From 2a08ad28a43a3e179c2b78178b27918ffd3c96a3 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sat, 20 May 2023 15:21:11 +0100 Subject: [PATCH] fix: correct issues with processor scopes (#2230) --- .../core/extent/DisallowedBlocksExtent.java | 6 +++--- .../fastasyncworldedit/core/extent/FaweRegionExtent.java | 2 +- .../core/extent/processor/MultiBatchProcessor.java | 2 +- .../core/extent/processor/ProcessorScope.java | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/DisallowedBlocksExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/DisallowedBlocksExtent.java index db270fa16..f1c523ce3 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/DisallowedBlocksExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/DisallowedBlocksExtent.java @@ -141,7 +141,7 @@ public class DisallowedBlocksExtent extends AbstractDelegateExtent implements IB BlockState state = BlockTypesCache.states[block]; if (blockedBlocks != null) { if (blockedBlocks.contains(state.getBlockType().getId())) { - blocks[i] = 0; + blocks[i] = BlockTypesCache.ReservedIDs.__RESERVED__; continue; } } @@ -150,7 +150,7 @@ public class DisallowedBlocksExtent extends AbstractDelegateExtent implements IB } for (FuzzyBlockState fuzzy : blockedStates) { if (fuzzy.equalsFuzzy(state)) { - blocks[i] = 0; + blocks[i] = BlockTypesCache.ReservedIDs.__RESERVED__; continue it; } } @@ -178,7 +178,7 @@ public class DisallowedBlocksExtent extends AbstractDelegateExtent implements IB @Override public ProcessorScope getScope() { - return ProcessorScope.CHANGING_BLOCKS; + return ProcessorScope.REMOVING_BLOCKS; } } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java index 6fa2767e0..84044f9b2 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java @@ -168,7 +168,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc @Override public ProcessorScope getScope() { - return ProcessorScope.READING_SET_BLOCKS; + return ProcessorScope.REMOVING_BLOCKS; } } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/MultiBatchProcessor.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/MultiBatchProcessor.java index 85fe20986..e57ccb490 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/MultiBatchProcessor.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/MultiBatchProcessor.java @@ -257,7 +257,7 @@ public class MultiBatchProcessor implements IBatchProcessor { for (IBatchProcessor processor : processors) { scope = Math.max(scope, processor.getScope().intValue()); } - return ProcessorScope.valueOf(0); + return ProcessorScope.valueOf(scope); } /** diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/ProcessorScope.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/ProcessorScope.java index 7fdd3e67a..e3f09e0a3 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/ProcessorScope.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/processor/ProcessorScope.java @@ -3,9 +3,9 @@ package com.fastasyncworldedit.core.extent.processor; /** * The scope of a processor. * Order in which processors are executed: - * - ADDING_BLOCKS (processors that strictly ADD blocks to an edit ONLY) - * - CHANGING_BLOCKS (processors that strictly ADD or CHANGE blocks being set) - * - REMOVING_BLOCKS (processors that string ADD, CHANGE or REMOVE blocks being set) + * - ADDING_BLOCKS (processors that may ADD blocks to an edit ONLY) + * - CHANGING_BLOCKS (processors that may ADD or CHANGE blocks being set) + * - REMOVING_BLOCKS (processors that may ADD, CHANGE or REMOVE blocks being set) * - CUSTOM (processors that do not specify a SCOPE) * - READING_SET_BLOCKS (processors that do not alter blocks at all, and read the blocks that are actually going to set, e.g. history processors) */