Compare commits
2 Commits
811a56f3fa
...
f5fabde095
Author | SHA1 | Date |
---|---|---|
noil | f5fabde095 | |
noil | c89940160c |
|
@ -49,10 +49,16 @@ public class ModuleConfig extends Configurable {
|
|||
}
|
||||
|
||||
// Check if we are already enabled
|
||||
if (entry.getKey().equalsIgnoreCase("Enabled") && !module.isEnabled() && module.getType() != Module.ModuleType.HIDDEN) {
|
||||
if (entry.getValue().getAsBoolean()) {
|
||||
module.toggle();
|
||||
if (entry.getKey().equalsIgnoreCase("Enabled") && module.getType() != Module.ModuleType.HIDDEN) {
|
||||
if (entry.getValue().getAsBoolean() && !module.isEnabled()) {
|
||||
module.setEnabled(true);
|
||||
module.onEnable();
|
||||
}
|
||||
if (!entry.getValue().getAsBoolean() && module.isEnabled()) {
|
||||
module.setEnabled(false);
|
||||
module.onDisable();
|
||||
}
|
||||
module.onToggle();
|
||||
}
|
||||
|
||||
for (Value val : module.getValueList()) {
|
||||
|
|
|
@ -19,6 +19,7 @@ public final class AutoEatModule extends Module {
|
|||
|
||||
public final Value<Float> hunger = new Value<Float>("Hunger", new String[]{"food", "h"}, "The amount of hunger needed to acquire some food", 9.0f, 0.0f, 20.0f, 0.5f);
|
||||
public final Value<Integer> forcedSlot = new Value<Integer>("Slot", new String[]{"s"}, "The hot-bar slot to put the food into (45 for offhand)", 43, 0, 43, 1);
|
||||
public final Value<Boolean> gapples = new Value<Boolean>("Gapples", new String[]{"gap", "gapple", "goldenapple", "goldenapples"}, "Allow eating golden apples for food", false);
|
||||
|
||||
private int previousHeldItem = -1;
|
||||
private int foodSlot = -1;
|
||||
|
@ -120,6 +121,9 @@ public final class AutoEatModule extends Module {
|
|||
if (!(item instanceof ItemFood))
|
||||
return false; // is not of ItemFood class
|
||||
|
||||
if (this.gapples.getValue())
|
||||
return item == Items.GOLDEN_APPLE;
|
||||
|
||||
return item != Items.GOLDEN_APPLE && item != Items.CHORUS_FRUIT && item != Items.ROTTEN_FLESH && item != Items.POISONOUS_POTATO && item != Items.SPIDER_EYE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue