/** * Appends an animation update. * * @param block The update block. * @param otherPlayer The player. */ private void appendAnimationUpdate(PacketBuilder block, Player otherPlayer) { // TODO: CHEAP FIX!! Caused errors if you attacked someone and clicked away Animation anim = otherPlayer.getCurrentAnimation() != null ? otherPlayer.getCurrentAnimation() : Animation.create(-1, 0); block.putShort(anim.getId()); block.putByteS((byte) anim.getDelay()); }