diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java index 7f84be430..dfb0f89f1 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/BlockTranslateExtent.java @@ -9,7 +9,7 @@ import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; -public class BlockTranslateExtent extends AbstractDelegateExtent { +public final class BlockTranslateExtent extends AbstractDelegateExtent { private final int dx; private final int dy; 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 11f15131f..2773f0b98 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 @@ -29,7 +29,7 @@ import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -public class DisallowedBlocksExtent extends AbstractDelegateExtent implements IBatchProcessor { +public final class DisallowedBlocksExtent extends AbstractDelegateExtent implements IBatchProcessor { private static final BlockState RESERVED = BlockTypes.__RESERVED__.getDefaultState(); private final Set> remaps; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ExtentHeightCacher.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ExtentHeightCacher.java index af008d1c9..36011e594 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ExtentHeightCacher.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ExtentHeightCacher.java @@ -4,7 +4,7 @@ import com.sk89q.worldedit.extent.Extent; import java.util.Arrays; -public class ExtentHeightCacher extends PassthroughExtent { +public final class ExtentHeightCacher extends PassthroughExtent { private transient int cacheBotX = Integer.MIN_VALUE; private transient int cacheBotZ = Integer.MIN_VALUE; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HeightBoundExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HeightBoundExtent.java index c22d9e6be..817d2c3bf 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HeightBoundExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HeightBoundExtent.java @@ -12,7 +12,7 @@ import com.sk89q.worldedit.regions.Region; import java.util.Collection; import java.util.Collections; -public class HeightBoundExtent extends FaweRegionExtent { +public final class HeightBoundExtent extends FaweRegionExtent { private final int min; private final int max; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HistoryExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HistoryExtent.java index 720b5e57b..00b8a4610 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HistoryExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/HistoryExtent.java @@ -26,7 +26,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Stores changes to a {@link ChangeSet}. */ -public class HistoryExtent extends AbstractDelegateExtent { +public final class HistoryExtent extends AbstractDelegateExtent { private final MutableBlockVector3 mutable = new MutableBlockVector3(); private AbstractChangeSet changeSet; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/LimitExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/LimitExtent.java index d43078354..983a280fa 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/LimitExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/LimitExtent.java @@ -40,7 +40,7 @@ import java.util.Set; import java.util.UUID; import java.util.function.Consumer; -public class LimitExtent extends AbstractDelegateExtent implements IBatchProcessor { +public final class LimitExtent extends AbstractDelegateExtent implements IBatchProcessor { private final FaweLimit limit; private final boolean[] faweExceptionReasonsUsed = new boolean[FaweException.Type.values().length]; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MemoryCheckingExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MemoryCheckingExtent.java index e2d215c56..d33291d1c 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MemoryCheckingExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MemoryCheckingExtent.java @@ -8,7 +8,7 @@ import com.fastasyncworldedit.core.util.WEManager; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; -public class MemoryCheckingExtent extends PassthroughExtent { +public final class MemoryCheckingExtent extends PassthroughExtent { private final Actor actor; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MultiRegionExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MultiRegionExtent.java index c13c5965b..9e02dba94 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MultiRegionExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/MultiRegionExtent.java @@ -15,7 +15,7 @@ import java.util.Collection; import java.util.List; import java.util.concurrent.Future; -public class MultiRegionExtent extends FaweRegionExtent { +public final class MultiRegionExtent extends FaweRegionExtent { @Nullable private final RegionIntersection intersection; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/NullExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/NullExtent.java index 4f0ad4960..d4c7dc6aa 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/NullExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/NullExtent.java @@ -40,7 +40,7 @@ import java.util.UUID; import java.util.concurrent.Future; //todo This should be removed in favor of com.sk89q.worldedit.extent.NullExtent -public class NullExtent extends FaweRegionExtent implements IBatchProcessor { +public final class NullExtent extends FaweRegionExtent implements IBatchProcessor { private final FaweException reason; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java index 5ac2f9d7b..23f0fa603 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java @@ -26,7 +26,7 @@ import javax.annotation.Nullable; import java.util.List; import java.util.Set; -public class PassthroughExtent extends AbstractDelegateExtent { +public abstract class PassthroughExtent extends AbstractDelegateExtent { /** * Create a new instance. diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PositionTransformExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PositionTransformExtent.java index d5e8e57e8..3be5901a5 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PositionTransformExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PositionTransformExtent.java @@ -11,7 +11,7 @@ import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; -public class PositionTransformExtent extends ResettableExtent { +public final class PositionTransformExtent extends ResettableExtent { private transient MutableBlockVector3 mutable = new MutableBlockVector3(); private transient BlockVector3 min; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ProcessedWEExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ProcessedWEExtent.java index e08e1535f..0521a7588 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ProcessedWEExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ProcessedWEExtent.java @@ -18,7 +18,7 @@ import com.sk89q.worldedit.world.block.BlockTypes; import java.util.UUID; -public class ProcessedWEExtent extends AbstractDelegateExtent { +public final class ProcessedWEExtent extends AbstractDelegateExtent { private final FaweLimit limit; private final Extent extent; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ResettableExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ResettableExtent.java index 0e3798415..469a27c03 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ResettableExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/ResettableExtent.java @@ -14,7 +14,7 @@ import java.lang.reflect.Field; import static com.google.common.base.Preconditions.checkNotNull; -public class ResettableExtent extends AbstractDelegateExtent implements Serializable { +public abstract class ResettableExtent extends AbstractDelegateExtent implements Serializable { public ResettableExtent(Extent parent) { super(parent); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SingleRegionExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SingleRegionExtent.java index 1caea9dbc..249b9e84c 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SingleRegionExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SingleRegionExtent.java @@ -11,7 +11,7 @@ import java.util.Collection; import java.util.Collections; import java.util.concurrent.Future; -public class SingleRegionExtent extends FaweRegionExtent { +public final class SingleRegionExtent extends FaweRegionExtent { private final Region region; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SlowExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SlowExtent.java index 6aa07b116..657322ce3 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SlowExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SlowExtent.java @@ -6,7 +6,7 @@ import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.block.BlockStateHolder; -public class SlowExtent extends AbstractDelegateExtent { +public final class SlowExtent extends AbstractDelegateExtent { private final long THRESHOLD = 50 * 1000000; // 1 tick private final long nanos; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java index 6da0a2ac6..dc6f54d56 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SourceMaskExtent.java @@ -9,7 +9,7 @@ import com.sk89q.worldedit.world.block.BlockStateHolder; import static com.google.common.base.Preconditions.checkNotNull; -public class SourceMaskExtent extends TemporalExtent { +public final class SourceMaskExtent extends TemporalExtent { private Mask mask; private final MutableBlockVector3 mutable = new MutableBlockVector3(); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/StripNBTExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/StripNBTExtent.java index c0b49c333..df6fb5355 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/StripNBTExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/StripNBTExtent.java @@ -32,7 +32,7 @@ import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; -public class StripNBTExtent extends AbstractDelegateExtent implements IBatchProcessor { +public final class StripNBTExtent extends AbstractDelegateExtent implements IBatchProcessor { private final Set strip; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SupplyingExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SupplyingExtent.java index 640243d5d..96952de4c 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SupplyingExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/SupplyingExtent.java @@ -7,7 +7,7 @@ import java.util.function.Supplier; /** * An extent that delegates actions to another extent that may change at any time. */ -public class SupplyingExtent extends PassthroughExtent { +public final class SupplyingExtent extends PassthroughExtent { private final Supplier extentSupplier; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TemporalExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TemporalExtent.java index ff0fa5106..f15883516 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TemporalExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TemporalExtent.java @@ -8,7 +8,7 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; -public class TemporalExtent extends PassthroughExtent { +public abstract class TemporalExtent extends PassthroughExtent { private int x; private int y; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TransformExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TransformExtent.java deleted file mode 100644 index daa731d3c..000000000 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TransformExtent.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.fastasyncworldedit.core.extent; - -import com.fastasyncworldedit.core.math.MutableBlockVector3; -import com.fastasyncworldedit.core.math.MutableVector3; -import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.transform.BlockTransformExtent; -import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.math.Vector3; -import com.sk89q.worldedit.world.biome.BiomeType; -import com.sk89q.worldedit.world.block.BaseBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; - -/** - * @deprecated Unused internal, will be removed in v3 - */ -@Deprecated(forRemoval = true, since = "2.9.2") -public class TransformExtent extends BlockTransformExtent { - - private final MutableVector3 mutable1 = new MutableVector3(); - private final MutableBlockVector3 mutable2 = new MutableBlockVector3(); - private BlockVector3 min; - - public TransformExtent(Extent parent) { - super(parent); - } - - @Override - public ResettableExtent setExtent(Extent extent) { - min = null; - return super.setExtent(extent); - } - - @Override - public BlockVector3 getMinimumPoint() { - BlockVector3 pos1 = getPos(super.getMinimumPoint()); - BlockVector3 pos2 = getPos(super.getMaximumPoint()); - return pos1.getMinimum(pos2); - } - - @Override - public BlockVector3 getMaximumPoint() { - BlockVector3 pos1 = getPos(super.getMinimumPoint()); - BlockVector3 pos2 = getPos(super.getMaximumPoint()); - return pos1.getMaximum(pos2); - } - - @Override - public void setOrigin(BlockVector3 pos) { - this.min = pos; - } - - public BlockVector3 getPos(BlockVector3 pos) { - if (min == null) { - min = pos; - } - mutable1.mutX(pos.x() - min.x()); - mutable1.mutY(pos.y() - min.y()); - mutable1.mutZ(pos.z() - min.z()); - Vector3 tmp = getTransform().apply(mutable1); - mutable2.mutX(tmp.x() + min.x()); - mutable2.mutY(tmp.y() + min.y()); - mutable2.mutZ(tmp.z() + min.z()); - return mutable2; - } - - public BlockVector3 getPos(int x, int y, int z) { - if (min == null) { - min = BlockVector3.at(x, y, z); - } - mutable1.mutX(x - min.x()); - mutable1.mutY(y - min.y()); - mutable1.mutZ(z - min.z()); - Vector3 tmp = getTransform().apply(mutable1); - mutable2.mutX(tmp.x() + min.x()); - mutable2.mutY(tmp.y() + min.y()); - mutable2.mutZ(tmp.z() + min.z()); - return tmp.toBlockPoint(); - } - - @Override - public BlockState getBlock(int x, int y, int z) { - BlockVector3 p = getPos(x, y, z); - return transform(super.getBlock(p.x(), p.y(), p.z())); - } - - @Override - public BaseBlock getFullBlock(BlockVector3 position) { - return transform(super.getFullBlock(getPos(position))); - } - - @Override - public BiomeType getBiomeType(int x, int y, int z) { - BlockVector3 p = getPos(x, y, z); - return super.getBiomeType(p.x(), p.y(), p.z()); - } - - @Override - @SuppressWarnings("unchecked") - public > boolean setBlock(int x, int y, int z, T block) - throws WorldEditException { - return super.setBlock(getPos(x, y, z), transformInverse(block)); - } - - - @Override - @SuppressWarnings("unchecked") - public > boolean setBlock(BlockVector3 location, B block) - throws WorldEditException { - return super.setBlock(getPos(location), transformInverse(block)); - } - - @Override - public boolean setBiome(int x, int y, int z, BiomeType biome) { - BlockVector3 p = getPos(x, y, z); - return super.setBiome(p.x(), p.y(), p.z(), biome); - } - -} diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/ParallelQueueExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/ParallelQueueExtent.java index 56a238166..33a1ec194 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/ParallelQueueExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/ParallelQueueExtent.java @@ -45,7 +45,7 @@ import java.util.Set; import java.util.concurrent.ForkJoinTask; import java.util.stream.IntStream; -public class ParallelQueueExtent extends PassthroughExtent { +public final class ParallelQueueExtent extends PassthroughExtent { private static final Logger LOGGER = LogManagerCompat.getLogger(); private static final ThreadLocal extents = new ThreadLocal<>(); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java index b0239a5a3..802561ce9 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java @@ -43,7 +43,7 @@ import java.util.concurrent.locks.ReentrantLock; * This queue is reusable {@link #init(Extent, IChunkCache, IChunkCache)} */ @SuppressWarnings({"unchecked", "rawtypes"}) -public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implements IQueueExtent { +public final class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implements IQueueExtent { private static final Logger LOGGER = LogManagerCompat.getLogger();