3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00

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.
Dieser Commit ist enthalten in:
Aikar 2020-06-01 23:51:37 -04:00
Ursprung 70ad51a80c
Commit a4fe910f57
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 401ADFC9891FAAFE
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -4399,7 +4399,7 @@ index 143be566c683ae035997f9a4058381a109f3de23..0e30d8c9933dc6595b9715ef6dc99cc8
return VoxelShapes.b;
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 2e1eabba14a3757d03fd90741651001e78c6322f..d9ff52eda71fcdf88d4c9114450237bcba2ccb08 100644
index 2e1eabba14a3757d03fd90741651001e78c6322f..45ded8cd3aee69083f6196765208d8c2430f0a02 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -22,6 +22,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot
@ -4414,7 +4414,7 @@ index 2e1eabba14a3757d03fd90741651001e78c6322f..d9ff52eda71fcdf88d4c9114450237bc
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

Datei anzeigen

@ -1392,7 +1392,7 @@ index 01bf28dc34dd69dbcee5f470cc71ec2fbb2fcc12..caa18b046cd4231b1caa9c70e766ab60
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 74709dff3f87e929f1583be524d4e53ad3be6728..7faaef50a5430c8bdf85ca0e37a4ad24ad56b1ef 100644
index 69db339c29c8f06026f05b0b5bb8019099af3fdf..4608d5f50d3c572f56bcc20dae2d537a07d05202 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -2,6 +2,8 @@ package net.minecraft.server;
@ -1418,7 +1418,7 @@ index 74709dff3f87e929f1583be524d4e53ad3be6728..7faaef50a5430c8bdf85ca0e37a4ad24
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);
@@ -343,6 +347,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
// CraftBukkit end