From 3fbf1cfbb3e34ea6ce907088a51539036cb023ce Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Sun, 30 Jun 2024 15:42:15 +0200 Subject: [PATCH] fix: fix paletteAlreadyInitialized + biome placement on linear clipboards --- .../core/extent/clipboard/io/FastSchematicReaderV3.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java index d58305fdf..db98d2203 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java @@ -296,7 +296,7 @@ public class FastSchematicReaderV3 implements ClipboardReader { readPalette( target != null, CACHE_IDENTIFIER_BLOCK, - () -> this.blockPalette.length == 0, + () -> this.blockPalette[0] != null, this.provideBlockPaletteInitializer(), this.getBlockWriter(target), (type, tag) -> { @@ -322,7 +322,7 @@ public class FastSchematicReaderV3 implements ClipboardReader { readPalette( target != null, CACHE_IDENTIFIER_BIOMES, - () -> this.biomePalette.length == 0, + () -> this.biomePalette[0] != null, this.provideBiomePaletteInitializer(), this.getBiomeWriter(target), (type, tag) -> { @@ -578,9 +578,6 @@ public class FastSchematicReaderV3 implements ClipboardReader { } private PaletteDataApplier getBiomeWriter(Clipboard target) { - if (target instanceof LinearClipboard linearClipboard) { - return (index, ordinal) -> linearClipboard.setBiome(index, this.biomePalette[ordinal]); - } return (index, ordinal) -> indexToPosition(index, (x, y, z) -> target.setBiome(x, y, z, this.biomePalette[ordinal])); }