类net.minecraft.util.MovementInputFromOptions源码实例Demo

下面列出了怎么用net.minecraft.util.MovementInputFromOptions的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Wizardry   文件: PotionNullMovement.java
@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);
}
 
 类所在包
 类方法
 同包方法