aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2024-05-09 04:38:17 +1000
committerGitHub <noreply@github.com>2024-05-08 20:38:17 +0200
commit46bcdafb0f77f44a9d8592516a20acc0278f5bad (patch)
tree57061e1c037a07724ae9240aa33e9c431b93849d
parent12f2a7450871c14a3c846427ba5af7893a24a1f3 (diff)
downloadNotEnoughUpdates-46bcdafb0f77f44a9d8592516a20acc0278f5bad.tar.gz
NotEnoughUpdates-46bcdafb0f77f44a9d8592516a20acc0278f5bad.tar.bz2
NotEnoughUpdates-46bcdafb0f77f44a9d8592516a20acc0278f5bad.zip
Add Hide hearts bouncing due to regen effect (#1154)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiIngameForge.java11
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java8
2 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiIngameForge.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiIngameForge.java
index b263cf31..9ad3e921 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiIngameForge.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiIngameForge.java
@@ -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;
@@ -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;
+ }
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java
index f0e36d56..1f5c84ac 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java
@@ -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;
}