mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Properly resync player on Player#setPlayerProfile (#9080)
Currently breaking are potion effects and the XP bar, both are now being resent to make the client know about them again.
This commit is contained in:
parent
cec73ac951
commit
f8be86a50e
1 changed files with 6 additions and 0 deletions
|
@ -166,6 +166,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet());
|
||||
+ net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle);
|
||||
+
|
||||
+ // Resend their XP and effects because the respawn packet resets it
|
||||
+ connection.send(new net.minecraft.network.protocol.game.ClientboundSetExperiencePacket(handle.experienceProgress, handle.totalExperience, handle.experienceLevel));
|
||||
+ for (net.minecraft.world.effect.MobEffectInstance mobEffect : handle.getActiveEffects()) {
|
||||
+ connection.send(new net.minecraft.network.protocol.game.ClientboundUpdateMobEffectPacket(handle.getId(), mobEffect));
|
||||
+ }
|
||||
+
|
||||
+ if (this.isOp()) {
|
||||
+ this.setOp(false);
|
||||
+ this.setOp(true);
|
||||
|
|
Loading…
Reference in a new issue