mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Fix scaling for player health. Fixes BUKKIT-4431
This commit is contained in:
1 parent
e1a3fb56b5
commit
adcb293a03
2 files changed
+15
-2
No files matched your search
@@ -233,8 +233,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
if (this.getHealth() != this.bP || this.bQ != this.foodData.a() || this.foodData.e() == 0.0F != this.bR) {
|
||||
// CraftBukkit - this.getHealth() -> this.getScaledHealth() - Magic number 20 -> original max health
|
||||
this.playerConnection.sendPacket(new Packet8UpdateHealth((float) (this.getHealth() * this.getMaxHealth() / 20.0D), this.foodData.a(), this.foodData.e()));
|
||||
// CraftBukkit - Optionally scale health
|
||||
this.playerConnection.sendPacket(new Packet8UpdateHealth(getBukkitEntity().getScaledHealth(), this.foodData.a(), this.foodData.e()));
|
||||
this.bP = this.getHealth();
|
||||
this.bQ = this.foodData.a();
|
||||
this.bR = this.foodData.e() == 0.0F;
|
||||
|
||||
Reference in new issue
Block a user