diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/ingame/AutoEat.java b/Client/src/main/java/de/com/baseband/client/feature/modules/ingame/AutoEat.java index 49b3cd7..8d37ca1 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/ingame/AutoEat.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/ingame/AutoEat.java @@ -6,6 +6,8 @@ import de.com.baseband.client.feature.Feature; import de.com.baseband.client.feature.category.Ingame; import de.com.baseband.client.mixin.mixins.IMinecraft; import de.com.baseband.client.registry.annotation.Config; +import de.com.baseband.client.registry.annotation.Description; +import de.com.baseband.client.registry.annotation.Range; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.settings.KeyBinding; import net.minecraft.init.MobEffects; @@ -27,6 +29,16 @@ public class AutoEat extends Feature { @Config("Close GUI On Eat") public boolean closeGui; + + @Config("GapUp Min health (no regen)") + @Description("Health to eat a golden apple at") + @Range("5..20") + public int hp = 18; + + @Config("GapUp Min health (always)") + @Description("Health to eat a golden apple at") + @Range("3..15") + public int deathHp = 10; @Override public String toString() { @@ -102,8 +114,8 @@ public class AutoEat extends Feature { stack.getItem() instanceof ItemFood //it has to be food bruh && !(stack.getItem() instanceof ItemChorusFruit) //not a chorus fruit you ret-.... dumbfuck && ((20 - currentHunger) >= ((ItemFood) stack.getItem()).getHealAmount(stack) //if hunger low and food wanted refills the amount left - || (stack.getItem() instanceof ItemAppleGold && mc.player.getHealth() < 18 && (mc.player.getActivePotionEffect(MobEffects.REGENERATION) == null || mc.player.getActivePotionEffect(MobEffects.ABSORPTION) == null)) //is golden apple and our health is less than 19 and we don't have regen - || (stack.getItem() instanceof ItemAppleGold && mc.player.getHealth() < 10) // we're in danger, eat! EAT EAT EAT EAT WE BOUTTA DIE + || (stack.getItem() instanceof ItemAppleGold && mc.player.getHealth() < hp && (mc.player.getActivePotionEffect(MobEffects.REGENERATION) == null || mc.player.getActivePotionEffect(MobEffects.ABSORPTION) == null)) //is golden apple and our health is less than 19 and we don't have regen + || (stack.getItem() instanceof ItemAppleGold && mc.player.getHealth() < deathHp) // we're in danger, eat! EAT EAT EAT EAT WE BOUTTA DIE || (stack.getItem() instanceof ItemAppleGold && mc.player.getActivePotionEffect(MobEffects.FIRE_RESISTANCE) == null) && mc.player.isBurning()); //is golden apple and we don't have fire res and we're burning } } diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/ingame/Fill.java b/Client/src/main/java/de/com/baseband/client/feature/modules/ingame/Fill.java index 93b53bd..0d3e6a3 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/ingame/Fill.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/ingame/Fill.java @@ -163,7 +163,7 @@ public class Fill extends Feature { } Lock value = new Lock(); - value.lock(Math.max(0, (int) (ServerDataManager.ping * 2))); + value.lock(Math.max(0, (int) (ServerDataManager.getRealPing() * 2))); placeCache.put(pos, value); lastPlacedItem = curItem.getItem(); diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java b/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java index 79d135d..918851b 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java @@ -225,7 +225,8 @@ public class HUD extends Feature { if (showTPS && showPing) infoString += " | "; if (showPing) - infoString += "Ping: " + (ServerDataManager.ping + (pingJitter ? (int) (Math.random() * pingJitterAmount) : 0)) + " | Players: " + ServerDataManager.players + "/" + ServerDataManager.maxPlayers + "\n"; + infoString += + "Ping: " + (ServerDataManager.getRealPing() + (pingJitter ? (int) (Math.random() * pingJitterAmount) : 0)) + (ServerDataManager.isPingAltered() ? " (" + ServerDataManager.ping + ")" : "") + " | Players: " + ServerDataManager.players + "/" + ServerDataManager.maxPlayers + "\n"; if (showSpotify && Features.isFeatureEnabled(Spotify.class)) { SpotifyAPI api = Features.getFeature(Spotify.class).api; diff --git a/Client/src/main/java/de/com/baseband/client/util/interact/ServerDataManager.java b/Client/src/main/java/de/com/baseband/client/util/interact/ServerDataManager.java index 2c4b677..728a18a 100644 --- a/Client/src/main/java/de/com/baseband/client/util/interact/ServerDataManager.java +++ b/Client/src/main/java/de/com/baseband/client/util/interact/ServerDataManager.java @@ -4,6 +4,7 @@ import de.com.baseband.client.BaseBand; import de.com.baseband.client.Setup; import de.com.baseband.client.feature.Features; import de.com.baseband.client.feature.modules.client.Client; +import de.com.baseband.client.feature.modules.ingame.Ping; import de.com.baseband.client.util.adapt.ServerPing; import de.tudbut.tools.Lock; import net.minecraft.client.network.NetworkPlayerInfo; @@ -86,7 +87,20 @@ public class ServerDataManager { } } + public static boolean isPingAltered() { + return ping != getRealPing(); + } + + public static long getRealPing() { + if(Features.isFeatureEnabled(Ping.class)) { + Ping p = Features.getFeature(Ping.class); + if(p.holdAll) + return ping + p.milliseconds; + } + return ping; + } + public static int timeToSurelyTicked() { - return (int) Math.ceil(((20f / tps) + (ping / 100f)) * (Features.getFeature(Client.class).tickTimeConservative ? 4f : 3f)); + return (int) Math.ceil(((20f / tps) + (getRealPing() / 100f)) * (Features.getFeature(Client.class).tickTimeConservative ? 4f : 3f)); } }