diff --git a/src/client/java/com/kckarnige/wham/mixin/client/ItemRendererMixin.java b/src/client/java/com/kckarnige/wham/mixin/client/ItemRendererMixin.java index bba92b6..f74170f 100644 --- a/src/client/java/com/kckarnige/wham/mixin/client/ItemRendererMixin.java +++ b/src/client/java/com/kckarnige/wham/mixin/client/ItemRendererMixin.java @@ -20,7 +20,7 @@ public abstract class ItemRendererMixin { @ModifyVariable(method = "renderItem", at = @At(value = "HEAD"), argsOnly = true) public BakedModel useMaceModel(BakedModel value, ItemStack stack, ModelTransformationMode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { if (stack.isOf(Items.MACE) && renderMode != ModelTransformationMode.GUI && renderMode != ModelTransformationMode.GROUND && renderMode != ModelTransformationMode.FIXED) { - if (stack.getMaxDamage() - 120 == stack.getMaxDamage() - stack.getDamage()) { + if (stack.getMaxDamage() * 0.80 >= stack.getMaxDamage() - stack.getDamage()) { return ((ItemRendererAccessor) this).macebut3d$getModels().getModelManager().getModel(ModelIdentifier.ofInventoryVariant(Identifier.of(MOD_ID, "mace_hand"))); } else { return ((ItemRendererAccessor) this).macebut3d$getModels().getModelManager().getModel(ModelIdentifier.ofInventoryVariant(Identifier.of(MOD_ID, "mace_hand_wind"))); diff --git a/src/main/java/com/kckarnige/wham/mixin/MaceMixin.java b/src/main/java/com/kckarnige/wham/mixin/MaceMixin.java index a4539f7..1e0f213 100644 --- a/src/main/java/com/kckarnige/wham/mixin/MaceMixin.java +++ b/src/main/java/com/kckarnige/wham/mixin/MaceMixin.java @@ -36,8 +36,7 @@ public TypedActionResult use(World world, PlayerEntity player, Hand h if (hit.getType() == HitResult.Type.BLOCK) { BlockHitResult blockHit = (BlockHitResult) hit; if (Objects.equals(String.valueOf(blockHit.getSide()), "up")) { - if (!(player.getStackInHand(hand).getMaxDamage() - 120 == player.getStackInHand(hand).getMaxDamage() - player.getStackInHand(hand).getDamage())) { - wham.LOGGER.info(String.valueOf(player.getStackInHand(hand).getMaxDamage() - player.getStackInHand(hand).getDamage()+" of "+player.getStackInHand(hand).getMaxDamage())); + if (!(player.getStackInHand(hand).getMaxDamage() * 0.80 >= player.getStackInHand(hand).getMaxDamage() - player.getStackInHand(hand).getDamage())) { world.playSound(null, player.getBlockPos(), SoundEvent.of(Identifier.of("minecraft:entity.wind_charge.wind_burst")), SoundCategory.PLAYERS); world.addParticle(ParticleTypes.HEART, player.getX(), player.getY() + 2.0, player.getZ(), 0.0, 0.0, 0.0); player.addStatusEffect(new StatusEffectInstance(StatusEffects.LEVITATION, 4, 20, false, false, false));