Paper/patches/server/0543-Expose-world-spawn-angle.patch

33 Zeilen
2.1 KiB
Diff

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Tue, 17 Nov 2020 19:13:09 +0200
Subject: [PATCH] Expose world spawn angle
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
2021-06-15 04:59:31 +02:00
index 1c61fd2c2c5cf5344f8c6dc14ae01353810de9eb..720fa2b74d3f9257a32e4bd5d21050626d136668 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
2021-06-15 04:59:31 +02:00
@@ -866,7 +866,7 @@ public abstract class PlayerList {
2021-06-11 14:02:28 +02:00
if (location == null) {
worldserver1 = this.server.getLevel(Level.OVERWORLD);
blockposition = entityplayer1.getSpawnPoint(worldserver1);
- location = new Location(worldserver1.getWorld(), (double) ((float) blockposition.getX() + 0.5F), (double) ((float) blockposition.getY() + 0.1F), (double) ((float) blockposition.getZ() + 0.5F));
+ location = new Location(worldserver1.getWorld(), (double) ((float) blockposition.getX() + 0.5F), (double) ((float) blockposition.getY() + 0.1F), (double) ((float) blockposition.getZ() + 0.5F), worldserver1.levelData.getSpawnAngle(), 0.0F); // Paper - use world spawn angle
}
2021-06-14 18:58:00 +02:00
Player respawnPlayer = this.cserver.getPlayer(entityplayer1);
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2021-06-15 04:59:31 +02:00
index b373e72237cc33a628648de515b163d8ce2980fb..8257e5a648eebf8ac9fa1a15656643a448cf07b6 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2021-06-14 18:58:00 +02:00
@@ -377,7 +377,7 @@ public class CraftWorld implements World {
2021-06-11 14:02:28 +02:00
@Override
public Location getSpawnLocation() {
2021-06-14 18:58:00 +02:00
BlockPos spawn = this.world.getSharedSpawnPos();
2021-06-11 14:02:28 +02:00
- return new Location(this, spawn.getX(), spawn.getY(), spawn.getZ());
+ return new Location(this, spawn.getX(), spawn.getY(), spawn.getZ(), world.levelData.getSpawnAngle(), 0.0F); // Paper - expose world spawn angle
}
@Override