mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: ab74bb45 Speed up processing of chunk loads and generation f5dd491f Increase Light Queue Size 9ab69348 Don't load chunks when attempting to unload a chunk 38c62622 Improve Optimize Memory use logic to make iterator safer and fix bad plugins like P2
55 lines
2.4 KiB
Diff
55 lines
2.4 KiB
Diff
From 0c3f0203c4cf6d999a7fa8e09f0bf70c351398f0 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 cc35f322a8..87ede14251 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
|
|
|