From 2cab6963a7a085ce2de972bf9905e3d5ceab23a8 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 10 Aug 2022 15:01:39 +0100 Subject: [PATCH] Don't manually send ClientboundPlayerPositionPacket for refreshPlayer in 1.19, mojang made it so that teleporations validate that an awaiting pos was set in the server when teleporting, thus we need to ensure that this is set when sending the player pos, otherwise the player will be kicked when the client sends back the aknowledgement --- patches/server/0181-Player.setPlayerProfile-API.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0181-Player.setPlayerProfile-API.patch b/patches/server/0181-Player.setPlayerProfile-API.patch index d0f4ecc27..c09ca131c 100644 --- a/patches/server/0181-Player.setPlayerProfile-API.patch +++ b/patches/server/0181-Player.setPlayerProfile-API.patch @@ -24,7 +24,7 @@ index fa949d01da7b6c1a489d17955108f7082f959c66..c83395364edb4f2ba8515326b19c4f1a playerName = gameProfile.getName(); uniqueId = gameProfile.getId(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c5164abae83cf6b0535d72c78adff5b72bc6f22e..63327bb4a57dea10f421bff15664ffa57c56cf65 100644 +index 299f2a8c45462d8070312c98554dbcc05298c681..31bcabd4c6ac3aa261c439a154ba7eb0f8caa0b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -75,6 +75,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes; @@ -131,7 +131,7 @@ index c5164abae83cf6b0535d72c78adff5b72bc6f22e..63327bb4a57dea10f421bff15664ffa5 + ServerLevel worldserver = handle.getLevel(); + connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true, this.getHandle().getLastDeathLocation())); + handle.onUpdateAbilities(); -+ connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), 0, false)); ++ connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), false); + net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle); + + if (this.isOp()) {