From 55e3e3d0f89645a0073314a90d7337800cb934fa Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 1 Jun 2020 23:51:37 -0400 Subject: [PATCH] Fix sounds when using worldedit regen command Locks dimension manager to the first world its used with. WE is creating a temp world and the world ref on that manager is getting changed to the temp world. This would of also caused a memory leak of that temp world too. --- Spigot-Server-Patches/Anti-Xray.patch | 2 +- Spigot-Server-Patches/MC-Utils.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Anti-Xray.patch b/Spigot-Server-Patches/Anti-Xray.patch index 0dbc07153f..4d7eacafe6 100644 --- a/Spigot-Server-Patches/Anti-Xray.patch +++ b/Spigot-Server-Patches/Anti-Xray.patch @@ -1418,7 +1418,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper + this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray this.generator = gen; - dimensionmanager.world = (WorldServer) this; // Paper + if (dimensionmanager.world == null) dimensionmanager.world = (WorldServer) this; // Paper this.world = new CraftWorld((WorldServer) this, gen, env); @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // CraftBukkit end diff --git a/Spigot-Server-Patches/MC-Utils.patch b/Spigot-Server-Patches/MC-Utils.patch index fbf230afb7..0edb936d4f 100644 --- a/Spigot-Server-Patches/MC-Utils.patch +++ b/Spigot-Server-Patches/MC-Utils.patch @@ -4414,7 +4414,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper this.generator = gen; -+ dimensionmanager.world = (WorldServer) this; // Paper ++ if (dimensionmanager.world == null) dimensionmanager.world = (WorldServer) this; // Paper this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit this.ticksPerMonsterSpawns = this.getServer().getTicksPerMonsterSpawns(); // CraftBukkit