aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0535-Expose-world-spawn-angle.patch
blob: 691463a16a7a9ae171925de7992415cf15e9d5b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
index 0b4d5ab836e861ea87bb72185a513bdf341d5921..30f0b20924d6b778e49761a72b50263c96311bee 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -878,7 +878,7 @@ public abstract class PlayerList {
             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
             }
 
             Player respawnPlayer = entityplayer1.getBukkitEntity();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 3f0a35ccb0763b34f735a76b230e30e7840684d1..2c93624bda6919ce0a291d8855cb6e176b010e0c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -247,7 +247,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
     @Override
     public Location getSpawnLocation() {
         BlockPos spawn = this.world.getSharedSpawnPos();
-        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