Update Eat.java

This commit is contained in:
Danial
2021-10-07 12:51:38 +13:00
parent 7464f87e3a
commit 03582f6187
+1 -2
View File
@@ -14,7 +14,6 @@ public class Eat implements Strategy {
if (Variables.running if (Variables.running
&& hasRequiredItems() && hasRequiredItems()
&& currentHealth > 0 && currentHealth > 0
&& Players.getMyPlayer().isInCombat()
&& currentHealth <= (Skill.HITPOINTS.getRealLevel() - Variables.fighting_food_heals_amount) && currentHealth <= (Skill.HITPOINTS.getRealLevel() - Variables.fighting_food_heals_amount)
) { ) {
Variables.setStatus("eating food"); Variables.setStatus("eating food");
@@ -28,7 +27,7 @@ public class Eat implements Strategy {
public void execute() { public void execute() {
try { try {
Inventory.getItem(Variables.fighting_food_to_eat + 1).interact(Items.Option.CONSUME); Inventory.getItem(Variables.fighting_food_to_eat + 1).interact(Items.Option.CONSUME);
Time.sleep(() -> Players.getMyPlayer().getHealth() != currentHealth || !Players.getMyPlayer().isInCombat(), 8000); Time.sleep(() -> Players.getMyPlayer().getHealth() != currentHealth, 5000);
Variables.setStatus("none"); Variables.setStatus("none");
} catch (Exception ಠ_ಠ) { } catch (Exception ಠ_ಠ) {
System.out.println("Eating error: ¯\\_(ツ)_/¯"); System.out.println("Eating error: ¯\\_(ツ)_/¯");