Skip to content
Permalink
Browse files

Enforce Sentinel health value, relates to #240

  • Loading branch information...
mcmonkey4eva committed Mar 30, 2018
1 parent 3530dda commit 62b2d41a35ff9c433b4cf57d9345ff5f03078556
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/java/org/mcmonkey/sentinel/SentinelTrait.java
@@ -10,7 +10,6 @@
import net.citizensnpcs.api.trait.Trait;
import net.citizensnpcs.api.trait.trait.Inventory;
import net.citizensnpcs.api.trait.trait.Owner;
import net.citizensnpcs.api.trait.trait.Spawned;
import net.citizensnpcs.trait.waypoint.Waypoint;
import net.citizensnpcs.trait.waypoint.WaypointProvider;
import net.citizensnpcs.trait.waypoint.Waypoints;
@@ -1860,6 +1859,9 @@ public void runUpdate() {
return;
}
}
if (health != getLivingEntity().getMaxHealth()) {
getLivingEntity().setMaxHealth(health);
}
if (healRate > 0 && timeSinceHeal > healRate && getLivingEntity().getHealth() < health) {
getLivingEntity().setHealth(Math.min(getLivingEntity().getHealth() + 1.0, health));
timeSinceHeal = 0;

0 comments on commit 62b2d41

Please sign in to comment.
You can’t perform that action at this time.