mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 02:47:44 +01:00
Don't set health directly, will interfere with scoreboard system.
This commit is contained in:
parent
7466321212
commit
5903b9f5ca
@ -642,12 +642,12 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.world.getServer().getPluginManager().callEvent(event);
|
this.world.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
this.health += event.getAmount();
|
this.setHealth(this.getHealth() + event.getAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.getMaxHealth() -> this.maxHealth
|
// this.getMaxHealth() -> this.maxHealth
|
||||||
if (this.health > this.maxHealth) {
|
if (this.health > this.maxHealth) {
|
||||||
this.health = this.maxHealth;
|
this.setHealth(this.maxHealth);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user