Search in sources :

Example 1 with ItemRailgun

use of blusunrize.immersiveengineering.common.items.ItemRailgun in project ImmersiveEngineering by BluSunrize.

the class ClientUtils method handleBipedRotations.

public static void handleBipedRotations(ModelBiped model, Entity entity) {
    if (!Config.IEConfig.fancyItemHolding)
        return;
    if (entity instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) entity;
        for (EnumHand hand : EnumHand.values()) {
            ItemStack heldItem = player.getHeldItem(hand);
            if (!heldItem.isEmpty()) {
                boolean right = (hand == EnumHand.MAIN_HAND) == (player.getPrimaryHand() == EnumHandSide.RIGHT);
                if (heldItem.getItem() instanceof ItemRevolver) {
                    if (right) {
                        model.bipedRightArm.rotateAngleX = -1.39626f + model.bipedHead.rotateAngleX;
                        model.bipedRightArm.rotateAngleY = -.08726f + model.bipedHead.rotateAngleY;
                    } else {
                        model.bipedLeftArm.rotateAngleX = -1.39626f + model.bipedHead.rotateAngleX;
                        model.bipedLeftArm.rotateAngleY = .08726f + model.bipedHead.rotateAngleY;
                    }
                } else if (heldItem.getItem() instanceof ItemDrill || heldItem.getItem() instanceof ItemChemthrower) {
                    if (right) {
                        model.bipedLeftArm.rotateAngleX = -.87266f;
                        model.bipedLeftArm.rotateAngleY = .52360f;
                    } else {
                        model.bipedRightArm.rotateAngleX = -.87266f;
                        model.bipedRightArm.rotateAngleY = -0.52360f;
                    }
                } else if (heldItem.getItem() instanceof ItemRailgun) {
                    if (right)
                        model.bipedRightArm.rotateAngleX = -.87266f;
                    else
                        model.bipedLeftArm.rotateAngleX = -.87266f;
                }
            }
        }
    }
}
Also used : ItemRevolver(blusunrize.immersiveengineering.common.items.ItemRevolver) ItemRailgun(blusunrize.immersiveengineering.common.items.ItemRailgun) ItemChemthrower(blusunrize.immersiveengineering.common.items.ItemChemthrower) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack) ItemDrill(blusunrize.immersiveengineering.common.items.ItemDrill)

Aggregations

ItemChemthrower (blusunrize.immersiveengineering.common.items.ItemChemthrower)1 ItemDrill (blusunrize.immersiveengineering.common.items.ItemDrill)1 ItemRailgun (blusunrize.immersiveengineering.common.items.ItemRailgun)1 ItemRevolver (blusunrize.immersiveengineering.common.items.ItemRevolver)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ItemStack (net.minecraft.item.ItemStack)1