mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: a4f066cc Fix method profiler inbalance introduced in a2a9ffe (#3132) c65dcad3 Don't delay chunk unloads during entity ticking bc17ce69 Delay unsafe actions until after entity ticking is done - Fixes #3114 5553e6b3 Disable Sync Events firing Async errors during shutdown e12c51d9 Use better variable for isStopping() API 586ee2bb Remove patch for MC-111480, fixed in 1.14 09a94215 Remove streams from Mob AI System bb5c294e Fix Disabling Asynchronous Chunks 089d8356 Implement Chunk Priority / Urgency System for World Gen fce69af7 Use dedicated thread for main thread blocking chunk loads 588b62e4 Add tick times API and /mspt command (#3102) 11de41c7 Add API MinecraftServer#isStopping (#3129) 942ff3c2 My patches are under MIT (#3130)
55 lines
2.4 KiB
Diff
55 lines
2.4 KiB
Diff
From 2f457ddb8fff476a7b0fe42d81e33c811ad3360c Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Sat, 19 Oct 2019 01:42:50 -0500
|
|
Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/World.java | 3 +++
|
|
src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 12 ++++++++----
|
|
2 files changed, 11 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
|
index ae36518374..b2dd0c2073 100644
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
|
@@ -1391,8 +1391,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
|
return blockposition;
|
|
}
|
|
|
|
+ public void setSpawn(BlockPosition blockposition) { v(blockposition); } // Purpur - OBFHELPER
|
|
public void a_(BlockPosition blockposition) {
|
|
+ BlockPosition prevPos = getSpawn(); // Purpur
|
|
this.worldData.setSpawn(blockposition);
|
|
+ new org.bukkit.event.world.SpawnChangeEvent(world, MCUtil.toLocation(this, prevPos)).callEvent(); // Purpur
|
|
}
|
|
|
|
public boolean a(EntityHuman entityhuman, BlockPosition blockposition) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
index 0f5bd0a17a..b9b23c9803 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -383,12 +383,16 @@ public class CraftWorld implements World {
|
|
@Override
|
|
public boolean setSpawnLocation(int x, int y, int z) {
|
|
try {
|
|
- Location previousLocation = getSpawnLocation();
|
|
- world.worldData.setSpawn(new BlockPosition(x, y, z));
|
|
+ // Purpur start - move to World#setSpawn()
|
|
+ //Location previousLocation = getSpawnLocation();
|
|
+ //world.worldData.setSpawn(new BlockPosition(x, y, z));
|
|
|
|
// Notify anyone who's listening.
|
|
- SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation);
|
|
- server.getPluginManager().callEvent(event);
|
|
+ //SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation);
|
|
+ //server.getPluginManager().callEvent(event);
|
|
+
|
|
+ world.setSpawn(new BlockPosition(x, y, z));
|
|
+ // Purpur end
|
|
|
|
return true;
|
|
} catch (Exception e) {
|
|
--
|
|
2.24.0
|
|
|