mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
55 lines
2.4 KiB
Diff
55 lines
2.4 KiB
Diff
From e1db66a264e8af597da193a69805291c90b56df5 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 d2fac7f296..838fc97843 100644
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
|
@@ -1437,8 +1437,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 414fc4baf9..e54cff571c 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -384,12 +384,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
|
|
|