Fixed health abuse bug

This commit is contained in:
Auxilor 2022-06-05 10:38:51 +01:00
parent 8e96b7d613
commit cc00f8b5b9
2 changed files with 2 additions and 6 deletions

View File

@ -41,9 +41,9 @@ public class Thrive extends EcoEnchant {
points = 0;
}
if (player.getHealth() >= inst.getValue()) {
if (player.getHealth() >= inst.getValue() && player.getHealth() >= 20) {
this.getPlugin().getScheduler().runLater(() -> {
player.setHealth(player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue());
player.setHealth(Math.min(player.getHealth(), player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()));
}, 1);
}

View File

@ -41,15 +41,11 @@ public class Prosperity extends EcoEnchant {
points = 0;
}
/*
Fixes health abuse bug
if (player.getHealth() >= inst.getValue() && player.getHealth() >= 20) {
this.getPlugin().getScheduler().runLater(() -> {
player.setHealth(Math.min(player.getHealth(), player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()));
}, 1);
}
*/
inst.setBaseValue(inst.getDefaultValue());