geforkt von Mirrors/Paper
SPIGOT-3813: Player.setHealth not reliable in conjunction with attribute API
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
4eeeca56d9
Commit
4377f7fede
@ -257,7 +257,7 @@
|
||||
+ player.setRealHealth(f);
|
||||
+ }
|
||||
+
|
||||
+ this.datawatcher.set(EntityLiving.HEALTH, Float.valueOf(player.getScaledHealth()));
|
||||
+ player.updateScaledHealth();
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
@ -1382,9 +1382,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
injectScaledMaxHealth(set, true);
|
||||
|
||||
// SPIGOT-3813: Attributes before health
|
||||
if (getHandle().playerConnection != null) {
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateAttributes(getHandle().getId(), set));
|
||||
sendHealthUpdate();
|
||||
}
|
||||
getHandle().getDataWatcher().set(EntityLiving.HEALTH, (float) getScaledHealth());
|
||||
sendHealthUpdate();
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateAttributes(getHandle().getId(), set));
|
||||
|
||||
getHandle().maxHealthCache = getMaxHealth();
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren