Skip to content

Commit

Permalink
Add Hide hearts bouncing due to regen effect (NotEnoughUpdates#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
NopoTheGamer authored May 8, 2024
1 parent 12f2a74 commit 46bcdaf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@

package io.github.moulberry.notenoughupdates.mixins;

import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.miscfeatures.ItemCustomizeManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraftforge.client.GuiIngameForge;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -34,4 +37,12 @@ public class MixinGuiIngameForge {
public Item renderHelmet(ItemStack stack) {
return ItemCustomizeManager.useCustomItem(stack).getItem();
}

@Redirect(method = "renderHealth", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;isPotionActive(Lnet/minecraft/potion/Potion;)Z", ordinal = 0))
public boolean renderHealth(EntityPlayer player, Potion potion) {
if (!NotEnoughUpdates.INSTANCE.config.misc.hideRegenBounce || !NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) {
return player.isPotionActive(potion);
}
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,12 @@ public class Misc {
values = {"Off", "AM/PM [1PM]", "24hr [13:00]"}
)
public int showWhenCountdownEnds = 1;

@Expose
@ConfigOption(
name = "Stop Hearts Bouncing",
desc = "Stops the hearts bouncing with regeneration effect"
)
@ConfigEditorBoolean
public boolean hideRegenBounce = false;
}

0 comments on commit 46bcdaf

Please sign in to comment.