Skip to content

Commit

Permalink
Fixed some issues that I created :D
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixces committed Dec 25, 2023
1 parent 57295a0 commit 8baa6b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public void modifySwingSpeed(CallbackInfoReturnable<Integer> cir) {
ItemPositionAdvancedSettings advanced = OldAnimationsSettings.advancedSettings;
if (OldAnimationsSettings.globalPositions && settings.enabled) {
if (isPotionActive(Potion.digSpeed) && !ItemPositionAdvancedSettings.ignoreHaste) {
cir.setReturnValue(Math.max((int) (6 - (1 + getActivePotionEffect(Potion.digSpeed).getAmplifier()) * Math.exp(-advanced.itemSwingSpeedHaste)), 1));
cir.setReturnValue(Math.max((6 - (1 + getActivePotionEffect(Potion.digSpeed).getAmplifier())) * (int) Math.exp(-advanced.itemSwingSpeedHaste), 1));
} else if (isPotionActive(Potion.digSlowdown)) {
cir.setReturnValue(Math.max((int) (6 + (1 + getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 * Math.exp(-advanced.itemSwingSpeedFatigue)), 1));
cir.setReturnValue(Math.max((6 + (1 + getActivePotionEffect(Potion.digSlowdown).getAmplifier())) * 2 * (int) Math.exp(-advanced.itemSwingSpeedFatigue), 1));
} else {
cir.setReturnValue(Math.max((int) (6 * Math.exp(-advanced.itemSwingSpeed)), 1));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ private void modifyNormalValue(WorldRenderer instance, float x, float y, float z
}
}

@Redirect(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;hasEffect()Z"))
private boolean disableGlintOnSprite(ItemStack instance, ItemStack stack, IBakedModel model) {
@Inject(method = "renderEffect", at = @At(value = "HEAD"), cancellable = true)
public void disableGlintOnSprite(IBakedModel model, CallbackInfo ci) {
if (OldAnimationsSettings.itemSprites && OldAnimationsSettings.spritesGlint && OldAnimationsSettings.INSTANCE.enabled && TransformTypeHook.shouldNotHaveGlint()) {
return false;
ci.cancel();
}
return instance.hasEffect();
}

@Inject(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderModel(Lnet/minecraft/client/resources/model/IBakedModel;Lnet/minecraft/item/ItemStack;)V"))
Expand Down

0 comments on commit 8baa6b1

Please sign in to comment.