mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
Expose world spawn angle (#4803)
This commit is contained in:
parent
41cba04006
commit
8996aa88cd
1 changed files with 44 additions and 0 deletions
44
Spigot-Server-Patches/Expose-world-spawn-angle.patch
Normal file
44
Spigot-Server-Patches/Expose-world-spawn-angle.patch
Normal file
|
@ -0,0 +1,44 @@
|
|||
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/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
if (location == null) {
|
||||
worldserver1 = this.server.getWorldServer(World.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.worldData.getSpawnAngle(), 0.0F); // Paper - use world spawn angle
|
||||
}
|
||||
|
||||
Player respawnPlayer = cserver.getPlayer(entityplayer1);
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldData.java b/src/main/java/net/minecraft/server/WorldData.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldData.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldData.java
|
||||
@@ -0,0 +0,0 @@ public interface WorldData {
|
||||
|
||||
int c();
|
||||
|
||||
+ default float getSpawnAngle() { return d(); } // Paper - OBFHELPER
|
||||
float d();
|
||||
|
||||
long getTime();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
@Override
|
||||
public Location getSpawnLocation() {
|
||||
BlockPosition spawn = world.getSpawn();
|
||||
- return new Location(this, spawn.getX(), spawn.getY(), spawn.getZ());
|
||||
+ return new Location(this, spawn.getX(), spawn.getY(), spawn.getZ(), world.worldData.getSpawnAngle(), 0.0F); // Paper - expose world spawn angle
|
||||
}
|
||||
|
||||
@Override
|
Loading…
Reference in a new issue