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: ffecc4e2 Revert "Optimize entity list iteration requiring entities be in" 0a4286cc Prevent Fire from loading chunks 07915ea1 Add Player Client Options API (#2883) bc48a317 Optimize entity list iteration requiring entities be in loaded chunks 88092fef Optimize ChunkProviderServer's chunk level checking helper methods 01e8ce8d Forced Watchdog Crash support and Improve Async Shutdown fdb8fe78 Be less strict with vanilla teleport command limits
55 lines
2.4 KiB
Diff
55 lines
2.4 KiB
Diff
From 609f674f3c194a3670547f1f589427812e72f504 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 ba08855b1c..f7f584f981 100644
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
|
@@ -1419,8 +1419,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
|
|
|