13
0
geforkt von Mirrors/Paper

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.
Dieser Commit ist enthalten in:
Alex 2023-04-07 01:21:33 +02:00
Ursprung cec73ac951
Commit f8be86a50e

Datei anzeigen

@ -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);