mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-28 13:36:01 +01:00
Fixed heal flag (for max. player health(20))
This commit is contained in:
parent
20f91b5258
commit
59a1726e8c
@ -88,7 +88,13 @@ public void run() {
|
|||||||
healDelay *= 1000;
|
healDelay *= 1000;
|
||||||
int healAmount = regions.getIntegerFlag(FlagType.HEAL_AMOUNT, true).getValue(1);
|
int healAmount = regions.getIntegerFlag(FlagType.HEAL_AMOUNT, true).getValue(1);
|
||||||
if (now - nfo.lastHealTick > healDelay) {
|
if (now - nfo.lastHealTick > healDelay) {
|
||||||
|
if (player.getHealth() < 20) {
|
||||||
|
if (player.getHealth() + healAmount > 20) {
|
||||||
|
player.setHealth(20);
|
||||||
|
} else {
|
||||||
player.setHealth(player.getHealth() + healAmount);
|
player.setHealth(player.getHealth() + healAmount);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
nfo.sheduledHealTick = now + healDelay;
|
nfo.sheduledHealTick = now + healDelay;
|
||||||
nfo.sheduledHealAmount = healAmount;
|
nfo.sheduledHealAmount = healAmount;
|
||||||
|
Loading…
Reference in New Issue
Block a user