Send all attributes on respawn (#12274)
This commit is contained in:
@@ -931,13 +931,18 @@
|
||||
}
|
||||
|
||||
player.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.LEVEL_CHUNKS_LOAD_START, 0.0F));
|
||||
@@ -671,8 +_,16 @@
|
||||
@@ -671,8 +_,21 @@
|
||||
|
||||
public void sendAllPlayerInfo(ServerPlayer player) {
|
||||
player.inventoryMenu.sendAllDataToRemote();
|
||||
- player.resetSentInfo();
|
||||
+ // entityplayer.resetSentInfo();
|
||||
+ player.getBukkitEntity().updateScaledHealth(); // CraftBukkit - Update scaled health on respawn and worldchange
|
||||
+ // Paper start - send all attributes
|
||||
+ // needs to be done because the ServerPlayer instance is being reused on respawn instead of getting replaced like on vanilla
|
||||
+ java.util.Collection<net.minecraft.world.entity.ai.attributes.AttributeInstance> syncableAttributes = player.getAttributes().getSyncableAttributes();
|
||||
+ player.getBukkitEntity().injectScaledMaxHealth(syncableAttributes, true);
|
||||
+ player.connection.send(new net.minecraft.network.protocol.game.ClientboundUpdateAttributesPacket(player.getId(), syncableAttributes));
|
||||
+ // Paper end - send all attributes
|
||||
+ player.refreshEntityData(player); // CraftBukkit - SPIGOT-7218: sync metadata
|
||||
player.connection.send(new ClientboundSetHeldSlotPacket(player.getInventory().selected));
|
||||
+ // CraftBukkit start - from GameRules
|
||||
|
||||
Reference in New Issue
Block a user