use of net.minecraft.client.entity.player.AbstractClientPlayerEntity in project AgriCraft by AgriCraft.
the class MagnifyingGlassViewHandler method onPlayerRender.
@SuppressWarnings("unused")
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPlayerRender(RenderPlayerEvent.Pre event) {
if (this.isActive()) {
PlayerRenderer renderer = event.getRenderer();
PlayerModel<AbstractClientPlayerEntity> model = renderer.getEntityModel();
Hand hand = this.getActiveHand();
HandSide side = Minecraft.getInstance().gameSettings.mainHand;
if ((hand == Hand.MAIN_HAND && side == HandSide.RIGHT) || (hand == Hand.OFF_HAND && side == HandSide.LEFT)) {
model.rightArmPose = BipedModel.ArmPose.BLOCK;
model.leftArmPose = BipedModel.ArmPose.EMPTY;
} else if ((hand == Hand.MAIN_HAND && side == HandSide.LEFT) || (hand == Hand.OFF_HAND && side == HandSide.RIGHT)) {
model.leftArmPose = BipedModel.ArmPose.BLOCK;
model.rightArmPose = BipedModel.ArmPose.EMPTY;
}
}
}
Aggregations