use of mekanism.client.render.armor.MekaSuitArmor in project Mekanism by mekanism.
the class RenderTickHandler method renderArm.
@SubscribeEvent
public void renderArm(RenderArmEvent event) {
AbstractClientPlayerEntity player = event.getPlayer();
ItemStack chestStack = player.getItemBySlot(EquipmentSlotType.CHEST);
if (chestStack.getItem() instanceof ItemMekaSuitArmor) {
MekaSuitArmor armor = (MekaSuitArmor) ((ItemMekaSuitArmor) chestStack.getItem()).getGearModel();
armor.setAllVisible(true);
// Note: We just want it to act as empty even if there is a map as it looks a lot better
boolean rightHand = event.getArm() == HandSide.RIGHT;
if (rightHand) {
armor.rightArmPose = ArmPose.EMPTY;
} else {
armor.leftArmPose = ArmPose.EMPTY;
}
armor.attackTime = 0.0F;
armor.crouching = false;
armor.swimAmount = 0.0F;
armor.setupAnim(player, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
armor.renderArm(event.getPoseStack(), event.getMultiBufferSource(), event.getPackedLight(), OverlayTexture.NO_OVERLAY, chestStack.hasFoil(), player, rightHand);
event.setCanceled(true);
}
}
Aggregations