/** * Called to update the entity's position/logic. */ public void onUpdate() { if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) { super.onUpdate(); if (this.isRiding()) { this.connection.sendPacket(new CPacketPlayer.Rotation(this.rotationYaw, this.rotationPitch, this.onGround)); this.connection.sendPacket(new CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); Entity entity = this.getLowestRidingEntity(); if (entity != this && entity.canPassengerSteer()) { this.connection.sendPacket(new CPacketVehicleMove(entity)); } } else { this.onUpdateWalkingPlayer(); } } }
/** * Called to update the entity's position/logic. */ public void onUpdate() { if (this.world.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) { //-ZMod----------------------------------------------------------- ZHandle.handle("onClientUpdate",this); //---------------------------------------------------------------- super.onUpdate(); if (this.isRiding()) { this.connection.sendPacket(new CPacketPlayer.Rotation(this.rotationYaw, this.rotationPitch, this.onGround)); this.connection.sendPacket(new CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); Entity entity = this.getLowestRidingEntity(); if (entity != this && entity.canPassengerSteer()) { this.connection.sendPacket(new CPacketVehicleMove(entity)); } } else { //-ZMod------------------------------------------------------- ZHandle.handle("beforeSendMotion", this); this.onUpdateWalkingPlayer(); ZHandle.handle("afterSendMotion", this); //------------------------------------------------------------ } } }
@SubscribeEvent public void onPacketSend(PacketEvent.Outgoing.Pre event) { if(event.getPacket() instanceof CPacketPlayer || event.getPacket() instanceof CPacketInput) { event.setCanceled(true); } }
/** * Processes player movement input. Includes walking, strafing, jumping, sneaking; excludes riding and toggling * flying/sprinting */ public void processInput(CPacketInput packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld()); this.playerEntity.setEntityActionState(packetIn.getStrafeSpeed(), packetIn.getForwardSpeed(), packetIn.isJumping(), packetIn.isSneaking()); }
@Override public void processInput(CPacketInput p_147358_1_) { }
@Override public void processInput(@Nonnull CPacketInput p_147358_1_) { }
@Override public void processInput(CPacketInput packetIn) { }
/** * Processes player movement input. Includes walking, strafing, jumping, sneaking; excludes riding and toggling * flying/sprinting */ void processInput(CPacketInput packetIn);