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: cc477e6a Force Plugins that use delayed tasks for init back in their place 597263fd Don't skip full player connection tick when dead e2c23475 Revert loaded entity list (#3304) fa87db6b Move another NetworkManager util into the inner class (#3303) 841c7d18 Make loaded entity list logic more consistent (#3301) 36f34f01 Updated Upstream (Bukkit/CraftBukkit) 5ca5f131 Rebuild all patches using the new rebuild pattern 1ccff6fa Add villager reputation API 5c0bfffa Speed up rebuilding patches and reduce diff f37381ea Optimize Network Manager to not need synchronization 8f9df2ed Anti Xray cleanup 878c66f1 No-Tick view distance implementation - Closes #3196 b87743c1 Stop copy-on-write operations for updating light data 97a9c972 Optimize isOutsideRange to use distance maps b4e629a2 Use distance map to optimise entity tracker / Misc Utils d80d1517 Optimize Entity Ticking to Loaded Chunks only 31d7686d Add item slot helper methods for various inventories (#3221) 75e1e3b3 Mob Goal API c7bc393a Revert "Don't flush packet queue off main thread" 1abd2bd2 Don't flush packet queue off main thread a4ed58a9 Clean up Direct Memory Region Files Fix for different Java versions 55e35019 Set cap on JDK per-thread native byte buffer cache b5101f4f Cleanup Region Files Direct Memory on close 81e655d7 Optimize Voxel Shape Merging ed9fc11f Sync position on teleportation 9c326fce Nanothing to see here 3e9fc24b Attempt to fix FastLogin maybe
55 lines
2.4 KiB
Diff
55 lines
2.4 KiB
Diff
From 1d30eeeb7722d1dc6a30725d763f2724f7d8906a 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 4442f5cc0..71a47ca2a 100644
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
|
@@ -1432,8 +1432,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 acf854322..ba8b0e756 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
|
|
|