From d696bf9b03d330268d322dfd6420dbab3dcaa915 Mon Sep 17 00:00:00 2001 From: sk89q Date: Thu, 3 Apr 2014 18:41:36 -0700 Subject: [PATCH] Renamed ExtentDelegate -> AbstractDelegateExtent. --- .../{ExtentDelegate.java => AbstractDelegateExtent.java} | 4 ++-- .../java/com/sk89q/worldedit/extent/ChangeSetExtent.java | 2 +- .../java/com/sk89q/worldedit/extent/MaskingExtent.java | 2 +- .../worldedit/extent/buffer/ForgetfulExtentBuffer.java | 4 ++-- .../worldedit/extent/cache/LastAccessExtentCache.java | 4 ++-- .../sk89q/worldedit/extent/inventory/BlockBagExtent.java | 7 ++----- .../worldedit/extent/logging/AbstractLoggingExtent.java | 4 ++-- .../sk89q/worldedit/extent/reorder/MultiStageReorder.java | 4 ++-- .../worldedit/extent/validation/BlockChangeLimiter.java | 4 ++-- .../worldedit/extent/validation/DataValidatorExtent.java | 4 ++-- .../com/sk89q/worldedit/extent/world/BlockQuirkExtent.java | 4 ++-- .../sk89q/worldedit/extent/world/ChunkLoadingExtent.java | 4 ++-- .../com/sk89q/worldedit/extent/world/FastModeExtent.java | 4 ++-- 13 files changed, 24 insertions(+), 27 deletions(-) rename src/main/java/com/sk89q/worldedit/extent/{ExtentDelegate.java => AbstractDelegateExtent.java} (95%) diff --git a/src/main/java/com/sk89q/worldedit/extent/ExtentDelegate.java b/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java similarity index 95% rename from src/main/java/com/sk89q/worldedit/extent/ExtentDelegate.java rename to src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java index cfc88b6c2..1d6535f0c 100644 --- a/src/main/java/com/sk89q/worldedit/extent/ExtentDelegate.java +++ b/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java @@ -32,7 +32,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * A base class for {@link Extent}s that merely passes extents onto another. */ -public class ExtentDelegate implements Extent { +public abstract class AbstractDelegateExtent implements Extent { private final Extent extent; @@ -41,7 +41,7 @@ public class ExtentDelegate implements Extent { * * @param extent the extent */ - public ExtentDelegate(Extent extent) { + protected AbstractDelegateExtent(Extent extent) { checkNotNull(extent); this.extent = extent; } diff --git a/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java b/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java index 189c93207..11d399490 100644 --- a/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java @@ -30,7 +30,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Stores changes to a {@link ChangeSet}. */ -public class ChangeSetExtent extends ExtentDelegate { +public class ChangeSetExtent extends AbstractDelegateExtent { private final ChangeSet changeSet; diff --git a/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java b/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java index 359c41759..e96a62907 100644 --- a/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java @@ -29,7 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Requires that all mutating methods pass a given {@link Mask}. */ -public class MaskingExtent extends ExtentDelegate { +public class MaskingExtent extends AbstractDelegateExtent { private Mask mask; diff --git a/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java b/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java index 102e7a33a..193da9fc2 100644 --- a/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java +++ b/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java @@ -24,8 +24,8 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.ExtentDelegate; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.Masks; import com.sk89q.worldedit.function.pattern.Pattern; @@ -46,7 +46,7 @@ import static com.google.common.base.Preconditions.checkNotNull; * This buffer will not attempt to return results from the buffer when * accessor methods (such as {@link #getBlock(Vector)}) are called. */ -public class ForgetfulExtentBuffer extends ExtentDelegate implements Pattern { +public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pattern { private static final BaseBlock AIR = new BaseBlock(BlockID.AIR); diff --git a/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java b/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java index 218362710..812d17674 100644 --- a/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java +++ b/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java @@ -22,14 +22,14 @@ package com.sk89q.worldedit.extent.cache; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.ExtentDelegate; /** * Returns the same cached {@link BaseBlock} for repeated calls to * {@link #getLazyBlock(Vector)} with the same position. */ -public class LastAccessExtentCache extends ExtentDelegate { +public class LastAccessExtentCache extends AbstractDelegateExtent { private CachedBlock lastBlock; diff --git a/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java b/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java index c67997531..91fc2e1f6 100644 --- a/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java @@ -22,11 +22,8 @@ package com.sk89q.worldedit.extent.inventory; import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.ExtentDelegate; -import com.sk89q.worldedit.extent.inventory.BlockBag; -import com.sk89q.worldedit.extent.inventory.BlockBagException; -import com.sk89q.worldedit.extent.inventory.UnplaceableBlockException; import com.sk89q.worldedit.blocks.BaseBlock; import javax.annotation.Nullable; @@ -38,7 +35,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Applies a {@link BlockBag} to operations. */ -public class BlockBagExtent extends ExtentDelegate { +public class BlockBagExtent extends AbstractDelegateExtent { private final LocalWorld world; private Map missingBlocks = new HashMap(); diff --git a/src/main/java/com/sk89q/worldedit/extent/logging/AbstractLoggingExtent.java b/src/main/java/com/sk89q/worldedit/extent/logging/AbstractLoggingExtent.java index dea92b817..5d9ad031b 100644 --- a/src/main/java/com/sk89q/worldedit/extent/logging/AbstractLoggingExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/logging/AbstractLoggingExtent.java @@ -22,13 +22,13 @@ package com.sk89q.worldedit.extent.logging; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.ExtentDelegate; /** * An abstract class to implement block loggers and so on with. */ -public abstract class AbstractLoggingExtent extends ExtentDelegate { +public abstract class AbstractLoggingExtent extends AbstractDelegateExtent { /** * Create a new instance. diff --git a/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java b/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java index 6d9a90a1f..dbd786be8 100644 --- a/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java +++ b/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java @@ -27,8 +27,8 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.ExtentDelegate; import com.sk89q.worldedit.function.operation.BlockMapEntryPlacer; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.OperationQueue; @@ -40,7 +40,7 @@ import java.util.*; /** * Re-orders blocks into several stages. */ -public class MultiStageReorder extends ExtentDelegate implements ReorderingExtent { +public class MultiStageReorder extends AbstractDelegateExtent implements ReorderingExtent { private TupleArrayList stage1 = new TupleArrayList(); private TupleArrayList stage2 = new TupleArrayList(); diff --git a/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java b/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java index 5f1fd1457..817b3e00b 100644 --- a/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java +++ b/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java @@ -23,8 +23,8 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.ExtentDelegate; import static com.google.common.base.Preconditions.checkArgument; @@ -32,7 +32,7 @@ import static com.google.common.base.Preconditions.checkArgument; * Limits the number of blocks that can be changed before a * {@link MaxChangedBlocksException} is thrown. */ -public class BlockChangeLimiter extends ExtentDelegate { +public class BlockChangeLimiter extends AbstractDelegateExtent { private int limit; private int count = 0; diff --git a/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java b/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java index 1066517dd..bc26f71b4 100644 --- a/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java @@ -23,15 +23,15 @@ import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.ExtentDelegate; import static com.google.common.base.Preconditions.checkNotNull; /** * Validates set data to prevent creating invalid blocks and such. */ -public class DataValidatorExtent extends ExtentDelegate { +public class DataValidatorExtent extends AbstractDelegateExtent { private final LocalWorld world; diff --git a/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index ff1221bcf..009115128 100644 --- a/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -25,8 +25,8 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.ExtentDelegate; import static com.google.common.base.Preconditions.checkNotNull; @@ -34,7 +34,7 @@ import static com.google.common.base.Preconditions.checkNotNull; * Handles various quirks when setting blocks, such as ice turning * into water or containers dropping their contents. */ -public class BlockQuirkExtent extends ExtentDelegate { +public class BlockQuirkExtent extends AbstractDelegateExtent { private final LocalWorld world; diff --git a/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java b/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java index ab31ff5f1..9902dec70 100644 --- a/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java @@ -23,15 +23,15 @@ import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.ExtentDelegate; import static com.google.common.base.Preconditions.checkNotNull; /** * Automatically loads chunks when blocks are accessed. */ -public class ChunkLoadingExtent extends ExtentDelegate { +public class ChunkLoadingExtent extends AbstractDelegateExtent { private final LocalWorld world; private boolean enabled; diff --git a/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java b/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java index 33f3a5596..194f5a85d 100644 --- a/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java @@ -24,7 +24,7 @@ import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.extent.ExtentDelegate; +import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.RunContext; @@ -36,7 +36,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Implements "fast mode" which may skip physics, lighting, etc. */ -public class FastModeExtent extends ExtentDelegate { +public class FastModeExtent extends AbstractDelegateExtent { private final LocalWorld world; private final Set dirtyChunks = new HashSet();