Search in sources :

Example 1 with NullMovementInput

use of com.teamwizardry.wizardry.api.NullMovementInput in project Wizardry by TeamWizardry.

the class PotionNullMovement method onTick.

@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)) {
        if (!(player.movementInput instanceof NullMovementInput))
            player.movementInput = new NullMovementInput(player.movementInput);
    } else if (!(player.movementInput instanceof MovementInputFromOptions))
        player.movementInput = new MovementInputFromOptions(mc.gameSettings);
}
Also used : NullMovementInput(com.teamwizardry.wizardry.api.NullMovementInput) MovementInputFromOptions(net.minecraft.util.MovementInputFromOptions) EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP) Minecraft(net.minecraft.client.Minecraft) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

NullMovementInput (com.teamwizardry.wizardry.api.NullMovementInput)1 Minecraft (net.minecraft.client.Minecraft)1 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)1 MovementInputFromOptions (net.minecraft.util.MovementInputFromOptions)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1