Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 11:00:04 +01:00
Fix Forge regen, by retaining the world reference. Also close the world.
Dieser Commit ist enthalten in:
Ursprung
1d413cde76
Commit
8975347703
@ -96,6 +96,7 @@ import net.minecraft.world.storage.WorldInfo;
|
|||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -329,8 +330,8 @@ public class ForgeWorld extends AbstractWorld {
|
|||||||
|
|
||||||
MinecraftServer server = originalWorld.getServer();
|
MinecraftServer server = originalWorld.getServer();
|
||||||
SaveHandler saveHandler = new SaveHandler(saveFolder, originalWorld.getSaveHandler().getWorldDirectory().getName(), server, server.getDataFixer());
|
SaveHandler saveHandler = new SaveHandler(saveFolder, originalWorld.getSaveHandler().getWorldDirectory().getName(), server, server.getDataFixer());
|
||||||
World freshWorld = new ServerWorld(server, server.getBackgroundExecutor(), saveHandler, originalWorld.getWorldInfo(),
|
try (World freshWorld = new ServerWorld(server, server.getBackgroundExecutor(), saveHandler, originalWorld.getWorldInfo(),
|
||||||
originalWorld.dimension.getType(), originalWorld.getProfiler(), new NoOpChunkStatusListener());
|
originalWorld.dimension.getType(), originalWorld.getProfiler(), new NoOpChunkStatusListener())) {
|
||||||
|
|
||||||
// Pre-gen all the chunks
|
// Pre-gen all the chunks
|
||||||
// We need to also pull one more chunk in every direction
|
// We need to also pull one more chunk in every direction
|
||||||
@ -343,6 +344,9 @@ public class ForgeWorld extends AbstractWorld {
|
|||||||
for (BlockVector3 vec : region) {
|
for (BlockVector3 vec : region) {
|
||||||
editSession.setBlock(vec, from.getFullBlock(vec));
|
editSession.setBlock(vec, from.getFullBlock(vec));
|
||||||
}
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
} catch (MaxChangedBlocksException e) {
|
} catch (MaxChangedBlocksException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} finally {
|
} finally {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren