use of blusunrize.immersiveengineering.common.items.ItemChemthrower 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;
}
}
}
}
}
Aggregations