Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/main/java/com/zenith/command/impl/AutoEatCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ public LiteralArgumentBuilder<CommandContext> register() {
CONFIG.client.extra.autoEat.allowUnsafeFood = getToggle(c, "toggle");
c.getSource().getEmbed()
.title("AutoEat Allow Unsafe Food " + toggleStrCaps(CONFIG.client.extra.autoEat.allowUnsafeFood));
return OK;
})))
.then(literal("ignoreEgapple").then(argument("toggle", toggle()).executes(c -> {
CONFIG.client.extra.autoEat.ignoreEgapple = getToggle(c, "toggle");
c.getSource().getEmbed()
.title("AutoEat Ignore EGapple " + toggleStrCaps(CONFIG.client.extra.autoEat.ignoreEgapple));
return OK;
})));
}

Expand All @@ -77,6 +84,7 @@ public void defaultEmbed(final Embed builder) {
.addField("Hunger Threshold", CONFIG.client.extra.autoEat.hungerThreshold)
.addField("Warning", toggleStr(CONFIG.client.extra.autoEat.warning))
.addField("Allow Unsafe Food", toggleStr(CONFIG.client.extra.autoEat.allowUnsafeFood))
.addField("Ignore EGapple", toggleStr(CONFIG.client.extra.autoEat.ignoreEgapple))
.primaryColor();
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/zenith/module/impl/AutoEat.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ public boolean itemPredicate(final ItemStack itemStack) {

boolean hasFood(boolean ignoreHunger, ItemStack itemStack) {
FoodData foodData = FoodRegistry.REGISTRY.get(itemStack.getId());
if (CONFIG.client.extra.autoEat.ignoreEgapple
&& FoodRegistry.ENCHANTED_GOLDEN_APPLE.id() == itemStack.getId()) {
return false;
}
boolean canEat = ignoreHunger || CACHE.getPlayerCache().getThePlayer().getFood() < 20;
return foodData != null
&& (CONFIG.client.extra.autoEat.allowUnsafeFood || foodData.isSafeFood())
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/zenith/util/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ public static final class AutoEat {
public boolean warning = true;
public boolean warningMention = false;
public boolean allowUnsafeFood = false;
public boolean ignoreEgapple = false;
}

public static final class AutoOmen {
Expand Down