net.minecraft.util.MovementInputFromOptions Java Examples

The following examples show how to use net.minecraft.util.MovementInputFromOptions. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PotionNullMovement.java    From Wizardry with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onTick(TickEvent.ClientTickEvent event) {
	Minecraft mc = Minecraft.getMinecraft();
	EntityPlayerSP player = mc.player;
	if (player == null) return;
	if (player.isPotionActive(ModPotions.NULL_MOVEMENT)) {
		//player.rotationYaw = player.getEntityData().getFloat("rot_yaw");
		//player.rotationPitch = player.getEntityData().getFloat("rot_pitch");
		//player.prevRotationYaw = player.getEntityData().getFloat("rot_yaw");
		//player.prevRotationPitch = player.getEntityData().getFloat("rot_pitch");

		if (!(player.movementInput instanceof NullMovementInput))
			player.movementInput = new NullMovementInput(player.movementInput);
	} else if (!(player.movementInput instanceof MovementInputFromOptions))
		player.movementInput = new MovementInputFromOptions(mc.gameSettings);
}