Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lowercasebtw committed Dec 20, 2024
1 parent f39c2b5 commit 394ea8f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.entity.model.BipedEntityModel;
import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.client.render.entity.state.ArmedEntityRenderState;
import net.minecraft.client.render.entity.state.BipedEntityRenderState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.*;
import net.minecraft.util.Arm;
import net.minecraft.util.Hand;
import net.minecraft.util.math.RotationAxis;
import org.joml.Quaternionf;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -71,7 +70,7 @@ public MixinHeldItemFeatureRenderer(FeatureRendererContext<S, M> context) {
LivingEntity livingEntity = (LivingEntity) optionalLivingEntity.get();
ItemStack stack = livingEntity.getStackInArm(arm);
Item item = stack.getItem();
if (!stack.isEmpty() && !ItemUtils.isItemBlacklisted(stack) && !(stack.getItem() instanceof ShieldItem)) {
if (!stack.isEmpty() && !ItemUtils.isItemBlacklisted(stack)) {
float scale;
if (item instanceof BlockItem) {
scale = 0.375F;
Expand All @@ -94,12 +93,14 @@ public MixinHeldItemFeatureRenderer(FeatureRendererContext<S, M> context) {
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(direction * 180.0F));
matrices.translate(0.0F, -0.125F, 0.0F);
}

if (livingEntity instanceof PlayerEntity && livingEntity.getItemUseTime() > 0 && livingEntity.isBlocking()) {
matrices.translate(direction * 0.05F, 0.0F, -0.1F);
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(direction * -50.0F));
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-10.0F));
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(direction * -60.0F));
}

matrices.translate(direction * -0.0625F, 0.1875F, 0.0F);
matrices.scale(scale, scale, scale);
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(180));
Expand All @@ -122,7 +123,6 @@ public MixinHeldItemFeatureRenderer(FeatureRendererContext<S, M> context) {

matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(direction * 180.0F));
matrices.translate(direction * -0.5F, 0.5F, 0.03125F);

if (item instanceof BlockItem) {
matrices.scale(1 / 0.375F, 1 / 0.375F, 1 / 0.375F);
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(direction * -45.0F));
Expand All @@ -142,6 +142,7 @@ public MixinHeldItemFeatureRenderer(FeatureRendererContext<S, M> context) {
if (isRod) {
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(direction * -180.0F));
}

matrices.translate(0.0F, -4.0F * 0.0625F, -0.5F * 0.0625F);
if (isRod) {
matrices.translate(0.0F, 0.0F, -2.0F * 0.0625F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public abstract class MixinHeldItemRenderer {
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(direction * 45.0F));
matrices.scale(0.4F, 0.4F, 0.4F);

matrices.translate( direction * -0.5F, 0.2F, 0.0F);
matrices.translate(direction * -0.5F, 0.2F, 0.0F);
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(direction * 30.0F));
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-80.0F));
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(direction * 60.0F));
Expand Down

0 comments on commit 394ea8f

Please sign in to comment.