From 9014baf6e519108aedc0e65174b943257fb0a90c Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 12 Sep 2021 11:48:32 +0100 Subject: [PATCH] Implement new method --- .../core/queue/implementation/blocks/BitSetBlocks.java | 9 ++++++++- .../core/queue/implementation/blocks/NullChunkGet.java | 6 ++++++ .../core/queue/implementation/chunk/ChunkHolder.java | 6 ++++++ .../core/queue/implementation/chunk/NullChunk.java | 6 ++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/blocks/BitSetBlocks.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/blocks/BitSetBlocks.java index 872317de3..efa635626 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/blocks/BitSetBlocks.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/blocks/BitSetBlocks.java @@ -10,6 +10,7 @@ import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; +import javax.annotation.Nullable; import java.util.Arrays; import java.util.Collections; import java.util.Map; @@ -38,7 +39,6 @@ public class BitSetBlocks implements IChunkSet { return row.rows[layer] != MemBlockSet.NULL_ROW_Y; } - @Override public boolean setBiome(int x, int y, int z, BiomeType biome) { return false; @@ -153,6 +153,13 @@ public class BitSetBlocks implements IChunkSet { return arr; } + // No need to do anything different + @Nullable + @Override + public char[] loadIfPresent(final int layer) { + return load(layer); + } + @Override public BiomeType[] getBiomes() { return null; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/blocks/NullChunkGet.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/blocks/NullChunkGet.java index 22f101a82..eea966ebc 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/blocks/NullChunkGet.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/blocks/NullChunkGet.java @@ -127,6 +127,12 @@ public final class NullChunkGet implements IChunkGet { return FaweCache.IMP.EMPTY_CHAR_4096; } + @Nullable + @Override + public char[] loadIfPresent(final int layer) { + return null; + } + public boolean hasSection(int layer) { return false; } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/ChunkHolder.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/ChunkHolder.java index 04f5e657e..4496a9aa0 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/ChunkHolder.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/ChunkHolder.java @@ -121,6 +121,12 @@ public class ChunkHolder> implements IQueueChunk { return getOrCreateGet().load(layer); } + @Nullable + @Override + public char[] loadIfPresent(final int layer) { + return getOrCreateGet().loadIfPresent(layer); + } + @Override public boolean isFastMode() { return fastmode; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/NullChunk.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/NullChunk.java index 4f1b826f3..9b6d72b95 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/NullChunk.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/NullChunk.java @@ -172,6 +172,12 @@ public final class NullChunk implements IQueueChunk { return null; } + @Nullable + @Override + public char[] loadIfPresent(final int layer) { + return null; + } + @Nullable public CompoundTag getEntity(@Nonnull UUID uuid) { return null;