improve AutoPot.java (#353)
This commit is contained in:
@@ -6,10 +6,7 @@ import anticope.rejects.MeteorRejectsAddon;
|
|||||||
import baritone.api.BaritoneAPI;
|
import baritone.api.BaritoneAPI;
|
||||||
import meteordevelopment.meteorclient.events.entity.player.ItemUseCrosshairTargetEvent;
|
import meteordevelopment.meteorclient.events.entity.player.ItemUseCrosshairTargetEvent;
|
||||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
import meteordevelopment.meteorclient.settings.*;
|
||||||
import meteordevelopment.meteorclient.settings.IntSetting;
|
|
||||||
import meteordevelopment.meteorclient.settings.Setting;
|
|
||||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
|
||||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||||
import meteordevelopment.meteorclient.systems.modules.combat.AnchorAura;
|
import meteordevelopment.meteorclient.systems.modules.combat.AnchorAura;
|
||||||
@@ -20,51 +17,49 @@ import meteordevelopment.meteorclient.utils.Utils;
|
|||||||
import meteordevelopment.meteorclient.utils.player.Rotations;
|
import meteordevelopment.meteorclient.utils.player.Rotations;
|
||||||
import meteordevelopment.orbit.EventHandler;
|
import meteordevelopment.orbit.EventHandler;
|
||||||
import net.minecraft.component.DataComponentTypes;
|
import net.minecraft.component.DataComponentTypes;
|
||||||
|
import net.minecraft.component.type.PotionContentsComponent;
|
||||||
import net.minecraft.entity.effect.StatusEffect;
|
import net.minecraft.entity.effect.StatusEffect;
|
||||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||||
import net.minecraft.entity.effect.StatusEffects;
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.Items;
|
import net.minecraft.item.Items;
|
||||||
|
import net.minecraft.registry.Registries;
|
||||||
import net.minecraft.registry.entry.RegistryEntry;
|
import net.minecraft.registry.entry.RegistryEntry;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class AutoPot extends Module {
|
public class AutoPot extends Module {
|
||||||
private static final Class<? extends Module>[] AURAS = new Class[] { KillAura.class, CrystalAura.class, AnchorAura.class, BedAura.class };
|
private static final Class<? extends Module>[] AURAS = new Class[]{KillAura.class, CrystalAura.class, AnchorAura.class, BedAura.class};
|
||||||
|
|
||||||
|
|
||||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||||
|
|
||||||
private final Setting<Boolean> Healing = sgGeneral.add(new BoolSetting.Builder()
|
private final Setting<List<StatusEffect>> usablePotions = sgGeneral.add(new StatusEffectListSetting.Builder()
|
||||||
.name("Healing")
|
.name("potions-to-use")
|
||||||
.description("Enables healing potions.")
|
.description("The potions to use.")
|
||||||
.defaultValue(true)
|
.defaultValue(
|
||||||
.build()
|
StatusEffects.INSTANT_HEALTH.value(),
|
||||||
);
|
StatusEffects.STRENGTH.value()
|
||||||
private final Setting<Boolean> Strength = sgGeneral.add(new BoolSetting.Builder()
|
)
|
||||||
.name("Strength")
|
|
||||||
.description("Enables strength potions.")
|
|
||||||
.defaultValue(true)
|
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
private final Setting<Boolean> useSplashPots = sgGeneral.add(new BoolSetting.Builder()
|
private final Setting<Boolean> useSplashPots = sgGeneral.add(new BoolSetting.Builder()
|
||||||
.name("Splash-Pots")
|
.name("splash-potions")
|
||||||
.description("Allow the use of splash pots")
|
.description("Allow the use of splash potions")
|
||||||
.defaultValue(true)
|
.defaultValue(true)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
private final Setting<Integer> health = sgGeneral.add(new IntSetting.Builder()
|
private final Setting<Integer> health = sgGeneral.add(new IntSetting.Builder()
|
||||||
.name("health")
|
.name("health")
|
||||||
.description("If health goes below this point, Healing Pot will trigger.")
|
.description("If health goes below this point, Healing potions will trigger.")
|
||||||
.defaultValue(15)
|
.defaultValue(15)
|
||||||
.min(0)
|
.min(0)
|
||||||
.sliderMax(20)
|
.sliderMax(20)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
private final Setting<Boolean> pauseAuras = sgGeneral.add(new BoolSetting.Builder()
|
private final Setting<Boolean> pauseAuras = sgGeneral.add(new BoolSetting.Builder()
|
||||||
.name("pause-auras")
|
.name("pause-auras")
|
||||||
.description("Pauses all auras when eating.")
|
.description("Pauses all auras when eating.")
|
||||||
@@ -78,12 +73,14 @@ public class AutoPot extends Module {
|
|||||||
.defaultValue(true)
|
.defaultValue(true)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
private final Setting<Boolean> lookDown = sgGeneral.add(new BoolSetting.Builder()
|
private final Setting<Boolean> lookDown = sgGeneral.add(new BoolSetting.Builder()
|
||||||
.name("rotate")
|
.name("rotate")
|
||||||
.description("Forces you to rotate downwards when throwing bottles.")
|
.description("Forces you to rotate downwards when throwing splash potions.")
|
||||||
.defaultValue(true)
|
.defaultValue(true)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
private int slot, prevSlot;
|
private int slot, prevSlot;
|
||||||
private boolean drinking, splashing;
|
private boolean drinking, splashing;
|
||||||
private final List<Class<? extends Module>> wasAura = new ArrayList<>();
|
private final List<Class<? extends Module>> wasAura = new ArrayList<>();
|
||||||
@@ -92,168 +89,43 @@ public class AutoPot extends Module {
|
|||||||
public AutoPot() {
|
public AutoPot() {
|
||||||
super(MeteorRejectsAddon.CATEGORY, "auto-pot", "Automatically Drinks Potions");
|
super(MeteorRejectsAddon.CATEGORY, "auto-pot", "Automatically Drinks Potions");
|
||||||
}
|
}
|
||||||
//Gilded's first module, lets see how much i'll die making this
|
|
||||||
//TODO:Rework everything to accept all pots
|
// TODO : Add option to scan whole inv - then either swap item to hotbar if full or just place in first empty slot
|
||||||
//TODO: Does strength work better if you throw it up? will check.
|
// Note, Sometimes two or multiple splash pots are thrown - since the effect is not instant, the second pot is thrown before the effect of first is applied
|
||||||
@Override
|
@Override
|
||||||
public void onDeactivate() {
|
public void onDeactivate() {
|
||||||
if (drinking) stopDrinking();
|
stopPotionUsage();
|
||||||
if (splashing) stopSplashing();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onTick(TickEvent.Pre event) {
|
private void onTick(TickEvent.Pre event) {
|
||||||
if (Healing.get()) {
|
if (mc.player.isUsingItem()) return;
|
||||||
if (ShouldDrinkHealth()) {
|
for (StatusEffect statusEffect : usablePotions.get()) {
|
||||||
//Heal Pot Slot
|
RegistryEntry<StatusEffect> registryEntry = Registries.STATUS_EFFECT.getEntry(statusEffect);
|
||||||
int slot = HealingpotionSlot();
|
if (!mc.player.hasStatusEffect(registryEntry)) {
|
||||||
//Slot Not Invalid
|
slot = potionSlot(statusEffect);
|
||||||
if (slot != -1) {
|
if (slot != -1) {
|
||||||
startDrinking();
|
if (registryEntry == StatusEffects.INSTANT_HEALTH && ShouldDrinkHealth()) {
|
||||||
} else if (HealingpotionSlot() == -1 && useSplashPots.get()) {
|
startPotionUse();
|
||||||
slot = HealingSplashpotionSlot();
|
return;
|
||||||
if (slot != -1) {
|
} else if (registryEntry == StatusEffects.INSTANT_HEALTH) {
|
||||||
startSplashing();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (drinking) {
|
|
||||||
if (ShouldDrinkHealth()) {
|
|
||||||
if (isNotPotion(mc.player.getInventory().getStack(slot))) {
|
|
||||||
slot = HealingpotionSlot();
|
|
||||||
if (slot == -1) {
|
|
||||||
info("Ran out of Pots while drinking");
|
|
||||||
stopDrinking();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else changeSlot(slot);
|
|
||||||
}
|
|
||||||
drink();
|
|
||||||
if (ShouldNotDrinkHealth()) {
|
|
||||||
info("Health Full");
|
|
||||||
stopDrinking();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (splashing) {
|
|
||||||
if (ShouldDrinkHealth()) {
|
|
||||||
if (isNotSplashPotion(mc.player.getInventory().getStack(slot))) {
|
|
||||||
slot = HealingSplashpotionSlot();
|
|
||||||
if (slot == -1) {
|
|
||||||
info("Ran out of Pots while splashing");
|
|
||||||
stopSplashing();
|
|
||||||
return;
|
|
||||||
} else changeSlot(slot);
|
|
||||||
}
|
|
||||||
splash();
|
|
||||||
if (ShouldNotDrinkHealth()) {
|
|
||||||
info("Health Full");
|
|
||||||
stopSplashing();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
startPotionUse();
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Strength.get()) {
|
|
||||||
if (ShouldDrinkStrength()) {
|
|
||||||
//Strength Pot Slot
|
|
||||||
int slot = StrengthpotionSlot();
|
|
||||||
//Slot Not Invalid
|
|
||||||
if (slot != -1) {
|
|
||||||
startDrinking();
|
|
||||||
}
|
|
||||||
else if (StrengthpotionSlot() == -1 && useSplashPots.get()) {
|
|
||||||
slot = StrengthSplashpotionSlot();
|
|
||||||
if (slot != -1) {
|
|
||||||
startSplashing();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (drinking) {
|
|
||||||
if (ShouldDrinkStrength()) {
|
|
||||||
if (isNotPotion(mc.player.getInventory().getStack(slot))) {
|
|
||||||
slot = StrengthpotionSlot();
|
|
||||||
if (slot == -1) {
|
|
||||||
stopDrinking();
|
|
||||||
info("Out of Pots");
|
|
||||||
return;
|
|
||||||
} else changeSlot(slot);
|
|
||||||
}
|
|
||||||
drink();
|
|
||||||
} else {
|
|
||||||
stopDrinking();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (splashing) {
|
|
||||||
if (ShouldDrinkStrength()) {
|
|
||||||
if (isNotSplashPotion(mc.player.getInventory().getStack(slot))) {
|
|
||||||
slot = StrengthSplashpotionSlot();
|
|
||||||
if (slot == -1) {
|
|
||||||
info("Ran out of Pots while splashing");
|
|
||||||
stopSplashing();
|
|
||||||
return;
|
|
||||||
} else changeSlot(slot);
|
|
||||||
}
|
|
||||||
splash();
|
|
||||||
} else {
|
|
||||||
stopSplashing();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onItemUseCrosshairTarget(ItemUseCrosshairTargetEvent event) {
|
private void onItemUseCrosshairTarget(ItemUseCrosshairTargetEvent event) {
|
||||||
if (drinking) event.target = null;
|
if (drinking) event.target = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPressed(boolean pressed) {
|
private void setPressed(boolean pressed) {
|
||||||
mc.options.useKey.setPressed(pressed);
|
mc.options.useKey.setPressed(pressed);
|
||||||
}
|
}
|
||||||
private void startDrinking() {
|
|
||||||
prevSlot = mc.player.getInventory().selectedSlot;
|
|
||||||
drink();
|
|
||||||
// Pause auras
|
|
||||||
wasAura.clear();
|
|
||||||
if (pauseAuras.get()) {
|
|
||||||
for (Class<? extends Module> klass : AURAS) {
|
|
||||||
Module module = Modules.get().get(klass);
|
|
||||||
|
|
||||||
if (module.isActive()) {
|
|
||||||
wasAura.add(klass);
|
|
||||||
module.toggle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Pause baritone
|
|
||||||
wasBaritone = false;
|
|
||||||
if (pauseBaritone.get() && BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().isPathing()) {
|
|
||||||
wasBaritone = true;
|
|
||||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("pause");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void startSplashing() {
|
|
||||||
prevSlot = mc.player.getInventory().selectedSlot;
|
|
||||||
if (lookDown.get()){
|
|
||||||
Rotations.rotate(mc.player.getYaw(), 90); splash();
|
|
||||||
}
|
|
||||||
splash();
|
|
||||||
// Pause auras
|
|
||||||
wasAura.clear();
|
|
||||||
if (pauseAuras.get()) {
|
|
||||||
for (Class<? extends Module> klass : AURAS) {
|
|
||||||
Module module = Modules.get().get(klass);
|
|
||||||
|
|
||||||
if (module.isActive()) {
|
|
||||||
wasAura.add(klass);
|
|
||||||
module.toggle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Pause baritone
|
|
||||||
wasBaritone = false;
|
|
||||||
if (pauseBaritone.get() && BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().isPathing()) {
|
|
||||||
wasBaritone = true;
|
|
||||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("pause");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void drink() {
|
private void drink() {
|
||||||
changeSlot(slot);
|
changeSlot(slot);
|
||||||
setPressed(true);
|
setPressed(true);
|
||||||
@@ -261,38 +133,19 @@ public class AutoPot extends Module {
|
|||||||
|
|
||||||
drinking = true;
|
drinking = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void splash() {
|
private void splash() {
|
||||||
changeSlot(slot);
|
changeSlot(slot);
|
||||||
setPressed(true);
|
setPressed(true);
|
||||||
splashing = true;
|
splashing = true;
|
||||||
}
|
}
|
||||||
private void stopDrinking() {
|
|
||||||
|
private void stopPotionUsage() {
|
||||||
changeSlot(prevSlot);
|
changeSlot(prevSlot);
|
||||||
setPressed(false);
|
setPressed(false);
|
||||||
drinking = false;
|
drinking = false;
|
||||||
|
|
||||||
// Resume auras
|
|
||||||
if (pauseAuras.get()) {
|
|
||||||
for (Class<? extends Module> klass : AURAS) {
|
|
||||||
Module module = Modules.get().get(klass);
|
|
||||||
|
|
||||||
if (wasAura.contains(klass) && !module.isActive()) {
|
|
||||||
module.toggle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Resume baritone
|
|
||||||
if (pauseBaritone.get() && wasBaritone) {
|
|
||||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("resume");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void stopSplashing() {
|
|
||||||
changeSlot(prevSlot);
|
|
||||||
setPressed(false);
|
|
||||||
|
|
||||||
splashing = false;
|
splashing = false;
|
||||||
|
|
||||||
// Resume auras
|
|
||||||
if (pauseAuras.get()) {
|
if (pauseAuras.get()) {
|
||||||
for (Class<? extends Module> klass : AURAS) {
|
for (Class<? extends Module> klass : AURAS) {
|
||||||
Module module = Modules.get().get(klass);
|
Module module = Modules.get().get(klass);
|
||||||
@@ -302,114 +155,72 @@ public class AutoPot extends Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Resume baritone
|
|
||||||
if (pauseBaritone.get() && wasBaritone) {
|
if (pauseBaritone.get() && wasBaritone) {
|
||||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("resume");
|
BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("resume");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private double truehealth() {
|
|
||||||
|
private double trueHealth() {
|
||||||
assert mc.player != null;
|
assert mc.player != null;
|
||||||
return mc.player.getHealth();
|
return mc.player.getHealth();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeSlot(int slot) {
|
private void changeSlot(int slot) {
|
||||||
mc.player.getInventory().selectedSlot = slot;
|
mc.player.getInventory().selectedSlot = slot;
|
||||||
this.slot = slot;
|
this.slot = slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Sunk 7 hours into these checks, if i die blame checks
|
//Sunk 7 hours into these checks, if i die blame checks
|
||||||
//Heal pot checks
|
private int potionSlot(StatusEffect statusEffect) {
|
||||||
private int HealingpotionSlot() {
|
|
||||||
int slot = -1;
|
int slot = -1;
|
||||||
for (int i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
// Skip if item stack is empty
|
|
||||||
ItemStack stack = mc.player.getInventory().getStack(i);
|
ItemStack stack = mc.player.getInventory().getStack(i);
|
||||||
if (stack.isEmpty()) continue;
|
if (stack.isEmpty()) continue;
|
||||||
if (stack.getItem() != Items.POTION) continue;
|
if (stack.getItem() == Items.POTION || (stack.getItem() == Items.SPLASH_POTION && useSplashPots.get())) {
|
||||||
Iterator<StatusEffectInstance> effects = stack.getItem().getComponents().get(DataComponentTypes.POTION_CONTENTS).getEffects().iterator();
|
PotionContentsComponent effects = stack.getComponents().getOrDefault(DataComponentTypes.POTION_CONTENTS, PotionContentsComponent.DEFAULT);
|
||||||
if (effects.hasNext()) {
|
for (StatusEffectInstance effectInstance : effects.getEffects()) {
|
||||||
StatusEffectInstance effect = effects.next();
|
if (effectInstance.getTranslationKey().equals(statusEffect.getTranslationKey())) {
|
||||||
if (effect.getTranslationKey().equals("effect.minecraft.instant_health")) {
|
slot = i;
|
||||||
slot = i;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return slot;
|
return slot;
|
||||||
}
|
}
|
||||||
private int HealingSplashpotionSlot() {
|
|
||||||
int slot = -1;
|
|
||||||
for (int i = 0; i < 9; i++) {
|
|
||||||
// Skip if item stack is empty
|
|
||||||
ItemStack stack = mc.player.getInventory().getStack(i);
|
|
||||||
if (stack.isEmpty()) continue;
|
|
||||||
if (stack.getItem() != Items.SPLASH_POTION) continue;
|
|
||||||
Iterator<StatusEffectInstance> effects = stack.getItem().getComponents().get(DataComponentTypes.POTION_CONTENTS).getEffects().iterator();
|
|
||||||
if (effects.hasNext()) {
|
|
||||||
StatusEffectInstance effect = effects.next();
|
|
||||||
if (effect.getTranslationKey().equals("effect.minecraft.instant_health")) {
|
|
||||||
slot = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return slot;
|
|
||||||
}
|
|
||||||
//Strength Pot Checks
|
|
||||||
private int StrengthSplashpotionSlot () {
|
|
||||||
int slot = -1;
|
|
||||||
for (int i = 0; i < 9; i++) {
|
|
||||||
// Skip if item stack is empty
|
|
||||||
ItemStack stack = mc.player.getInventory().getStack(i);
|
|
||||||
if (stack.isEmpty()) continue;
|
|
||||||
if (stack.getItem() != Items.SPLASH_POTION) continue;
|
|
||||||
Iterator<StatusEffectInstance> effects = stack.getItem().getComponents().get(DataComponentTypes.POTION_CONTENTS).getEffects().iterator();
|
|
||||||
if (effects.hasNext()) {
|
|
||||||
StatusEffectInstance effect = effects.next();
|
|
||||||
if (effect.getTranslationKey().equals("effect.minecraft.strength")) {
|
|
||||||
slot = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
private void startPotionUse() {
|
||||||
|
prevSlot = mc.player.getInventory().selectedSlot;
|
||||||
|
|
||||||
|
if (useSplashPots.get()) {
|
||||||
|
if (lookDown.get()) {
|
||||||
|
Rotations.rotate(mc.player.getYaw(), 90);
|
||||||
|
splash();
|
||||||
|
} else {
|
||||||
|
splash();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
drink();
|
||||||
}
|
}
|
||||||
return slot;
|
wasAura.clear();
|
||||||
}
|
if (pauseAuras.get()) {
|
||||||
private int StrengthpotionSlot () {
|
for (Class<? extends Module> klass : AURAS) {
|
||||||
int slot = -1;
|
Module module = Modules.get().get(klass);
|
||||||
for (int i = 0; i < 9; i++) {
|
|
||||||
// Skip if item stack is empty
|
if (module.isActive()) {
|
||||||
ItemStack stack = mc.player.getInventory().getStack(i);
|
wasAura.add(klass);
|
||||||
if (stack.isEmpty()) continue;
|
module.toggle();
|
||||||
if (stack.getItem() != Items.POTION) continue;
|
|
||||||
Iterator<StatusEffectInstance> effects = stack.getItem().getComponents().get(DataComponentTypes.POTION_CONTENTS).getEffects().iterator();
|
|
||||||
if (effects.hasNext()) {
|
|
||||||
StatusEffectInstance effect = effects.next();
|
|
||||||
if (effect.getTranslationKey().equals("effect.minecraft.strength")) {
|
|
||||||
slot = i;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return slot;
|
wasBaritone = false;
|
||||||
|
if (pauseBaritone.get() && BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().isPathing()) {
|
||||||
|
wasBaritone = true;
|
||||||
|
BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("pause");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private boolean isNotPotion(ItemStack stack) {
|
|
||||||
Item item = stack.getItem();
|
private boolean ShouldDrinkHealth() {
|
||||||
return item != Items.POTION;
|
return trueHealth() < health.get();
|
||||||
}
|
|
||||||
private boolean isNotSplashPotion(ItemStack stack) {
|
|
||||||
Item item = stack.getItem();
|
|
||||||
return item != Items.SPLASH_POTION;
|
|
||||||
}
|
|
||||||
private boolean ShouldDrinkHealth(){
|
|
||||||
if (truehealth() < health.get()) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
private boolean ShouldNotDrinkHealth(){
|
|
||||||
if (truehealth() >= health.get()) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
private boolean ShouldDrinkStrength(){
|
|
||||||
Map<RegistryEntry<StatusEffect>, StatusEffectInstance> effects = mc.player.getActiveStatusEffects();
|
|
||||||
return !effects.containsKey(StatusEffects.STRENGTH);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user