Search in sources :

Example 1 with ItemBaykokBow

use of pokefenn.totemic.item.equipment.weapon.ItemBaykokBow in project Totemic by TeamTotemic.

the class GameOverlay method onFOVUpdate.

@SubscribeEvent
public void onFOVUpdate(FOVUpdateEvent event) {
    EntityPlayer player = Minecraft.getMinecraft().player;
    if (player.isHandActive() && player.getActiveItemStack().getItem() instanceof ItemBaykokBow) {
        int bowTicks = player.getItemInUseMaxCount();
        float modifier = bowTicks / 20.0F;
        if (modifier > 1.0F)
            modifier = 1.0F;
        else
            modifier = modifier * modifier;
        event.setNewfov(event.getFov() * (1.0F - 0.15F * modifier));
    }
}
Also used : ItemBaykokBow(pokefenn.totemic.item.equipment.weapon.ItemBaykokBow) EntityPlayer(net.minecraft.entity.player.EntityPlayer) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 ItemBaykokBow (pokefenn.totemic.item.equipment.weapon.ItemBaykokBow)1