@Override public PacketBlockBreakAnimation setEntityId(Player player) { Object nmsPlayer = ReflectionAPI.invokeMethod(player, ReflectionAPI.getMethod(player, "getHandle")); return this.setEntityId( (int) ReflectionAPI.invokeMethod(nmsPlayer, ReflectionAPI.getMethod(nmsPlayer, "getId"))); }
public CraftPacketBlockBreakAnimation(Player player, Location blockLocation, byte destroyStage) { Object nmsPlayer = ReflectionAPI.invokeMethod(player, ReflectionAPI.getMethod(player, "getHandle")); this.entityId = (int) ReflectionAPI.invokeMethod(nmsPlayer, ReflectionAPI.getMethod(nmsPlayer, "getId")); this.blockLocation = blockLocation; this.destroyStage = destroyStage; }