geforkt von Mirrors/Paper
d8c3fb7e47
Needs updating to hook into new entity storage system
33 Zeilen
2.1 KiB
Diff
33 Zeilen
2.1 KiB
Diff
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 b7e3ed5a6298774a315300daef771f278aa20af7..d8278190323d00c186d81f578f77fa335529baad 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -864,7 +864,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 = this.cserver.getPlayer(entityplayer1);
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
index d0b2de0f0a37554eb812aa8c7c20f1067807dc40..ed8c8b7ff07a58dfaf7bbb1e630a1e68cc0c29f3 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -377,7 +377,7 @@ public class CraftWorld 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
|