下面列出了怎么用net.minecraft.util.MovementInputFromOptions的API类实例代码及写法,或者点击链接到github查看源代码。
@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);
}