diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/dulkirfabric/mixin/render/HeldItemRendererMixin.java | 24 | ||||
-rw-r--r-- | src/main/java/com/dulkirfabric/mixin/render/InGameHudMixin.java | 7 |
2 files changed, 24 insertions, 7 deletions
diff --git a/src/main/java/com/dulkirfabric/mixin/render/HeldItemRendererMixin.java b/src/main/java/com/dulkirfabric/mixin/render/HeldItemRendererMixin.java index f0e6422..b785b59 100644 --- a/src/main/java/com/dulkirfabric/mixin/render/HeldItemRendererMixin.java +++ b/src/main/java/com/dulkirfabric/mixin/render/HeldItemRendererMixin.java @@ -8,6 +8,7 @@ import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.item.HeldItemRenderer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; +import net.minecraft.util.Arm; import net.minecraft.util.Hand; import net.minecraft.util.math.RotationAxis; import org.spongepowered.asm.mixin.Mixin; @@ -34,17 +35,17 @@ public abstract class HeldItemRendererMixin { float rotY = DulkirConfig.ConfigVars.getConfigOptions().getHeldItemRotY(); float rotZ = DulkirConfig.ConfigVars.getConfigOptions().getHeldItemRotZ(); - float posX = DulkirConfig.ConfigVars.getConfigOptions().getHeldItemPosX() / 1000f; - float posY = DulkirConfig.ConfigVars.getConfigOptions().getHeldItemPosY() / 1000f; - float posZ = DulkirConfig.ConfigVars.getConfigOptions().getHeldItemPosZ() / 1000f; + float posX = DulkirConfig.ConfigVars.getConfigOptions().getHeldItemPosX() / 100f; + float posY = DulkirConfig.ConfigVars.getConfigOptions().getHeldItemPosY() / 100f; + float posZ = DulkirConfig.ConfigVars.getConfigOptions().getHeldItemPosZ() / 100f; float scale = DulkirConfig.ConfigVars.getConfigOptions().getHeldItemScale(); + matrices.translate(posX, posY, posZ); - matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(rotX)); - matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(rotY)); - matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(rotZ)); + matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(rotX)); + matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(rotY)); + matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(rotZ)); matrices.scale(scale, scale, scale); - matrices.translate(posX, posY, posZ); } } @@ -57,4 +58,13 @@ public abstract class HeldItemRendererMixin { public float attackCooldown(float original) { return 1f; } + + @Inject(method = "applyEquipOffset", at = @At("HEAD"), cancellable = true) + public void onApplyEquipOffset(MatrixStack matrices, Arm arm, float equipProgress, CallbackInfo ci) { + if (DulkirConfig.ConfigVars.getConfigOptions().getCancelReEquip()) { + int i = arm == Arm.RIGHT ? 1 : -1; + matrices.translate((float)i * 0.56f, -0.52f, -0.72f); + ci.cancel(); + } + } } diff --git a/src/main/java/com/dulkirfabric/mixin/render/InGameHudMixin.java b/src/main/java/com/dulkirfabric/mixin/render/InGameHudMixin.java index c50f132..3a7c9ba 100644 --- a/src/main/java/com/dulkirfabric/mixin/render/InGameHudMixin.java +++ b/src/main/java/com/dulkirfabric/mixin/render/InGameHudMixin.java @@ -38,4 +38,11 @@ public class InGameHudMixin { } return original; } + + @ModifyExpressionValue(method = "renderStatusBars(Lnet/minecraft/client/gui/DrawContext;)V", + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/gui/hud/InGameHud;getHeartCount(Lnet/minecraft/entity/LivingEntity;)I")) + public int onCheckForRiding(int original) { + return 0; + } } |