From c60d4a38367ea38192dda5f5b688e46603e8205e Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Sat, 25 Nov 2023 23:09:26 +0100 Subject: [PATCH] Fix yaw being ignored for first spawn pos (#9959) --- .../server/Fix-a-bunch-of-vanilla-bugs.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/patches/server/Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch index 84f8c380d3..2fe35717ca 100644 --- a/patches/server/Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch @@ -69,6 +69,9 @@ https://bugs.mojang.com/browse/MC-153086 https://bugs.mojang.com/browse/MC-259321 Fix spawners checking max nearby entities with correct type +https://bugs.mojang.com/browse/MC-200092 + Fix yaw being ignored for a player's first spawn pos + == AT == public net/minecraft/world/entity/Mob leashInfoTag @@ -139,6 +142,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 }); if (!list.isEmpty()) { +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { + BlockPos blockposition1 = PlayerRespawnLogic.getOverworldRespawnPos(world, blockposition.getX() + j2 - i, blockposition.getZ() + k2 - i); + + if (blockposition1 != null) { +- this.moveTo(blockposition1, 0.0F, 0.0F); ++ this.moveTo(blockposition1, world.getSharedSpawnAngle(), 0.0F); // Paper - MC-200092 - fix first spawn pos yaw being ignored + if (world.noCollision(this, this.getBoundingBox(), true)) { // Paper - make sure this loads chunks, we default to NOT loading now + break; + } + } + } + } else { +- this.moveTo(blockposition, 0.0F, 0.0F); ++ this.moveTo(blockposition, world.getSharedSpawnAngle(), 0.0F); // Paper - MC-200092 - fix first spawn pos yaw being ignored + + while (!world.noCollision(this, this.getBoundingBox(), true) && this.getY() < (double) (world.getMaxBuildHeight() - 1)) { // Paper - make sure this loads chunks, we default to NOT loading now + this.setPos(this.getX(), this.getY() + 1.0D, this.getZ()); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java