From 1480606b52f5427e0b0bc35bb273234d27eb5d45 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 30 Jul 2018 23:26:06 +1000 Subject: [PATCH] Fixed a few more issues found looking over the changeset. --- .../ConfigurationPermissionsResolver.java | 8 +- .../sk89q/wepif/NijiPermissionsResolver.java | 2 +- .../worldedit/bukkit/BukkitBiomeRegistry.java | 3 +- .../bukkit/BukkitCommandInspector.java | 4 +- .../worldedit/bukkit/BukkitCommandSender.java | 11 ++- .../sk89q/worldedit/bukkit/BukkitEntity.java | 5 +- .../bukkit/BukkitEntityProperties.java | 4 +- .../bukkit/BukkitPlayerBlockBag.java | 4 +- .../sk89q/worldedit/bukkit/BukkitWorld.java | 6 -- .../bukkit/adapter/BukkitImplAdapter.java | 2 +- .../sk89q/wepif/DinnerPermsResolverTest.java | 8 +- .../sk89q/wepif/TestOfflinePermissible.java | 6 +- .../com/sk89q/worldedit/blocks/LazyBlock.java | 92 ------------------- .../com/sk89q/worldedit/blocks/SignBlock.java | 2 +- .../com/sk89q/jnbt/CompoundTagBuilder.java | 4 +- .../src/main/java/com/sk89q/jnbt/ListTag.java | 6 +- .../java/com/sk89q/jnbt/ListTagBuilder.java | 4 +- .../java/com/sk89q/jnbt/NBTOutputStream.java | 4 +- .../main/java/com/sk89q/jnbt/NBTUtils.java | 4 +- .../util/commands/CommandException.java | 5 +- .../java/com/sk89q/util/yaml/YAMLNode.java | 3 +- .../com/sk89q/util/yaml/YAMLProcessor.java | 15 ++- .../java/com/sk89q/worldedit/EditSession.java | 14 +-- .../sk89q/worldedit/EditSessionFactory.java | 4 +- .../sk89q/worldedit/LocalConfiguration.java | 2 +- .../com/sk89q/worldedit/LocalSession.java | 4 +- .../com/sk89q/worldedit/blocks/BaseBlock.java | 2 +- .../sk89q/worldedit/blocks/ClothColor.java | 7 +- .../worldedit/command/BiomeCommands.java | 6 +- .../worldedit/command/BrushCommands.java | 2 +- .../worldedit/command/ChunkCommands.java | 13 ++- .../worldedit/command/GeneralCommands.java | 14 ++- .../worldedit/command/GenerationCommands.java | 9 +- .../worldedit/command/HistoryCommands.java | 9 +- .../worldedit/command/NavigationCommands.java | 6 +- .../worldedit/command/RegionCommands.java | 19 ++-- .../worldedit/command/ScriptingCommands.java | 6 +- .../worldedit/command/SelectionCommands.java | 49 +++++++--- .../worldedit/command/SnapshotCommands.java | 6 +- .../command/SnapshotUtilCommands.java | 10 +- .../command/SuperPickaxeCommands.java | 6 +- .../sk89q/worldedit/command/ToolCommands.java | 17 +++- .../worldedit/command/ToolUtilCommands.java | 5 +- .../worldedit/command/UtilityCommands.java | 4 +- .../worldedit/command/WorldEditCommands.java | 5 +- .../command/argument/ItemParser.java | 2 +- .../command/argument/PatternParser.java | 3 +- .../command/argument/ReplaceParser.java | 4 +- .../command/composition/ApplyCommand.java | 4 +- .../command/composition/SelectionCommand.java | 4 +- .../composition/ShapedBrushCommand.java | 4 +- .../worldedit/command/tool/AreaPickaxe.java | 8 +- .../worldedit/command/tool/BlockReplacer.java | 9 +- .../worldedit/command/tool/DistanceWand.java | 3 +- .../command/tool/FloatingTreeRemover.java | 11 +-- .../worldedit/command/tool/FloodFillTool.java | 13 ++- .../command/tool/LongRangeBuildTool.java | 4 +- .../worldedit/command/tool/QueryTool.java | 2 +- .../command/tool/RecursivePickaxe.java | 15 +-- .../worldedit/command/tool/SinglePickaxe.java | 6 +- .../worldedit/command/tool/TreePlanter.java | 8 +- .../command/tool/brush/CylinderBrush.java | 2 +- .../command/tool/brush/GravityBrush.java | 6 +- .../tool/brush/HollowCylinderBrush.java | 2 +- .../command/tool/brush/HollowSphereBrush.java | 2 +- .../command/tool/brush/SmoothBrush.java | 4 +- .../command/tool/brush/SphereBrush.java | 2 +- .../sk89q/worldedit/entity/BaseEntity.java | 4 +- .../event/extent/EditSessionEvent.java | 8 +- .../event/platform/BlockInteractEvent.java | 4 +- .../event/platform/CommandEvent.java | 4 +- .../platform/CommandSuggestionEvent.java | 4 +- .../platform/ConfigurationLoadEvent.java | 4 +- .../event/platform/PlayerInputEvent.java | 4 +- .../extension/factory/BlockFactory.java | 4 +- .../factory/HashTagPatternParser.java | 2 +- .../factory/RandomPatternParser.java | 4 +- .../factory/SingleBlockPatternParser.java | 2 +- .../platform/AbstractPlayerActor.java | 20 ++-- .../extension/platform/CommandManager.java | 38 ++++++-- .../extension/platform/Platform.java | 3 +- .../extension/platform/PlayerProxy.java | 6 +- .../extent/AbstractDelegateExtent.java | 18 ++-- .../worldedit/extent/ChangeSetExtent.java | 8 +- .../com/sk89q/worldedit/extent/Extent.java | 5 +- .../sk89q/worldedit/extent/InputExtent.java | 26 +----- .../sk89q/worldedit/extent/MaskingExtent.java | 6 +- .../sk89q/worldedit/extent/NullExtent.java | 17 ++-- .../sk89q/worldedit/extent/OutputExtent.java | 2 +- .../extent/buffer/ForgetfulExtentBuffer.java | 9 +- .../extent/cache/LastAccessExtentCache.java | 15 ++- .../extent/clipboard/BlockArrayClipboard.java | 17 ++-- .../extent/clipboard/StoredEntity.java | 4 +- .../extent/clipboard/io/ClipboardReader.java | 1 - .../legacycompat/NBTCompatibilityHandler.java | 1 - .../SignCompatibilityHandler.java | 1 - .../worldedit/extent/inventory/BlockBag.java | 2 +- .../extent/inventory/BlockBagExtent.java | 4 +- .../transform/BlockTransformExtent.java | 6 -- .../extent/validation/BlockChangeLimiter.java | 6 +- .../validation/DataValidatorExtent.java | 8 +- .../extent/world/BlockQuirkExtent.java | 6 +- .../extent/world/ChunkLoadingExtent.java | 6 +- .../extent/world/FastModeExtent.java | 6 +- .../extent/world/SurvivalModeExtent.java | 4 +- .../function/CombinedRegionFunction.java | 9 +- .../sk89q/worldedit/function/EditContext.java | 4 +- .../function/FlatRegionMaskingFilter.java | 4 +- .../worldedit/function/GroundFunction.java | 4 +- .../function/RegionMaskingFilter.java | 4 +- .../function/biome/BiomeReplace.java | 4 +- .../function/block/BlockReplace.java | 6 +- .../function/block/ExtentBlockCopy.java | 4 +- .../worldedit/function/block/Naturalizer.java | 23 +++-- .../function/entity/ExtentEntityCopy.java | 4 +- .../worldedit/function/factory/Apply.java | 6 +- .../worldedit/function/factory/Deform.java | 6 +- .../worldedit/function/factory/Paint.java | 10 +- .../function/generator/FloraGenerator.java | 6 +- .../function/generator/ForestGenerator.java | 8 +- .../generator/GardenPatchGenerator.java | 4 +- .../function/mask/AbstractExtentMask.java | 4 +- .../worldedit/function/mask/BiomeMask2D.java | 4 +- .../worldedit/function/mask/BlockMask.java | 11 ++- .../function/mask/BoundedHeightMask.java | 4 +- .../function/mask/ExistingBlockMask.java | 4 +- .../function/mask/ExpressionMask.java | 4 +- .../function/mask/ExpressionMask2D.java | 4 +- .../function/mask/FuzzyBlockMask.java | 2 +- .../function/mask/MaskIntersection.java | 5 +- .../function/mask/MaskIntersection2D.java | 4 +- .../worldedit/function/mask/MaskUnion.java | 3 +- .../sk89q/worldedit/function/mask/Masks.java | 7 +- .../worldedit/function/mask/NoiseFilter.java | 6 +- .../function/mask/NoiseFilter2D.java | 6 +- .../worldedit/function/mask/OffsetMask.java | 4 +- .../worldedit/function/mask/OffsetMask2D.java | 4 +- .../worldedit/function/mask/RegionMask.java | 4 +- .../function/mask/SolidBlockMask.java | 2 +- .../operation/BlockMapEntryPlacer.java | 6 +- .../function/operation/ChangeSetExecutor.java | 6 +- .../function/operation/DelegateOperation.java | 4 +- .../function/operation/OperationQueue.java | 4 +- .../function/pattern/BlockPattern.java | 4 +- .../function/pattern/ClipboardPattern.java | 8 +- .../function/pattern/RandomPattern.java | 4 +- .../pattern/RepeatingExtentPattern.java | 8 +- .../function/util/FlatRegionOffset.java | 4 +- .../worldedit/function/util/RegionOffset.java | 4 +- .../function/visitor/BreadthFirstSearch.java | 14 ++- .../function/visitor/DownwardVisitor.java | 4 +- .../function/visitor/EntityVisitor.java | 4 +- .../function/visitor/FlatRegionVisitor.java | 4 +- .../function/visitor/LayerVisitor.java | 6 +- .../function/visitor/RecursiveVisitor.java | 4 +- .../function/visitor/RegionVisitor.java | 2 +- .../worldedit/history/change/BlockChange.java | 6 +- .../worldedit/history/change/Change.java | 2 +- .../history/change/EntityCreate.java | 4 +- .../history/change/EntityRemove.java | 4 +- .../history/changeset/ArrayListHistory.java | 4 +- .../changeset/BlockOptimizedHistory.java | 8 +- .../command/CommandLoggingHandler.java | 9 +- .../command/UserCommandCompleter.java | 4 +- .../internal/command/WorldEditBinding.java | 2 +- .../expression/parser/ParserProcessors.java | 6 +- .../internal/registry/AbstractFactory.java | 6 +- .../internal/registry/InputParser.java | 2 +- .../internal/util/DocumentationPrinter.java | 15 ++- .../worldedit/math/convolution/HeightMap.java | 2 +- .../KochanekBartelsInterpolation.java | 4 +- .../interpolation/LinearInterpolation.java | 4 +- .../ReparametrisingInterpolation.java | 4 +- .../math/transform/CombinedTransform.java | 4 +- .../worldedit/math/transform/Transforms.java | 4 +- .../worldedit/regions/AbstractRegion.java | 10 +- .../sk89q/worldedit/regions/CuboidRegion.java | 11 ++- .../sk89q/worldedit/regions/NullRegion.java | 10 +- .../com/sk89q/worldedit/regions/Region.java | 3 +- .../worldedit/regions/RegionSelector.java | 3 +- .../worldedit/regions/TransformRegion.java | 5 +- .../iterator/FlatRegion3DIterator.java | 4 +- .../regions/iterator/FlatRegionIterator.java | 4 +- .../regions/iterator/RegionIterator.java | 4 +- .../worldedit/regions/polyhedron/Edge.java | 4 +- .../regions/polyhedron/Triangle.java | 4 +- .../selector/CuboidRegionSelector.java | 10 +- .../selector/CylinderRegionSelector.java | 16 +++- .../selector/EllipsoidRegionSelector.java | 10 +- .../regions/shape/ArbitraryShape.java | 2 +- .../worldedit/regions/shape/RegionShape.java | 2 +- .../shape/WorldEditExpressionEnvironment.java | 6 +- .../registry/state/AbstractProperty.java | 3 - .../scripting/CraftScriptContext.java | 10 +- .../scripting/CraftScriptEngine.java | 1 + .../scripting/RhinoCraftScriptEngine.java | 7 +- .../scripting/java/RhinoScriptEngine.java | 16 ++-- .../java/RhinoScriptEngineFactory.java | 1 + .../worldedit/session/SessionManager.java | 5 +- .../session/request/RequestSelection.java | 7 +- .../session/storage/JsonFileSessionStore.java | 4 +- .../java/com/sk89q/worldedit/util/Enums.java | 4 +- .../sk89q/worldedit/util/FileDialogUtil.java | 5 +- .../com/sk89q/worldedit/util/GuavaUtil.java | 4 +- .../com/sk89q/worldedit/util/Location.java | 4 +- .../com/sk89q/worldedit/util/TargetBlock.java | 6 +- .../worldedit/util/YAMLConfiguration.java | 2 - .../util/collection/DoubleArrayList.java | 4 +- .../util/collection/FastListIterator.java | 6 +- .../worldedit/util/command/Dispatcher.java | 3 +- .../util/command/InvalidUsageException.java | 4 +- .../util/command/PrimaryAliasComparator.java | 3 +- .../command/binding/PrimitiveBindings.java | 3 +- .../util/command/composition/FlagParser.java | 5 +- .../command/parametric/ParametricBuilder.java | 4 +- .../parametric/ParametricCallable.java | 21 ++++- .../parametric/StringArgumentStack.java | 2 +- .../worldedit/util/eventbus/EventHandler.java | 4 +- .../util/eventbus/HierarchyCache.java | 6 +- .../util/eventbus/MethodEventHandler.java | 4 +- .../worldedit/util/eventbus/Subscribe.java | 6 +- .../worldedit/util/formatting/Style.java | 6 +- .../formatting/component/CommandUsageBox.java | 6 +- .../util/formatting/component/MessageBox.java | 4 +- .../util/function/LevenshteinDistance.java | 5 +- .../com/sk89q/worldedit/util/io/Closer.java | 4 +- .../util/logging/DynamicStreamHandler.java | 10 +- .../worldedit/util/logging/LogFormat.java | 4 +- .../sk89q/worldedit/world/AbstractWorld.java | 12 +-- .../com/sk89q/worldedit/world/NullWorld.java | 12 +-- .../java/com/sk89q/worldedit/world/World.java | 4 +- .../worldedit/world/biome/BiomeName.java | 4 +- .../worldedit/world/block/BlockState.java | 2 - .../sk89q/worldedit/world/chunk/OldChunk.java | 4 +- .../world/registry/BiomeRegistry.java | 3 +- .../world/registry/BlockRegistry.java | 1 - .../world/registry/LegacyMapper.java | 4 +- .../world/registry/NullBiomeRegistry.java | 3 +- .../worldedit/world/snapshot/Snapshot.java | 9 +- .../world/snapshot/SnapshotDateParser.java | 3 +- .../world/snapshot/SnapshotRepository.java | 3 +- .../world/snapshot/SnapshotRestore.java | 1 - .../world/storage/LegacyChunkStore.java | 2 +- .../world/storage/NBTConversions.java | 4 +- .../world/storage/ZippedLegacyChunkStore.java | 2 +- .../storage/ZippedMcRegionChunkStore.java | 2 +- .../util/commands/CommandContextTest.java | 8 +- .../java/com/sk89q/worldedit/VectorTest.java | 6 +- .../internal/expression/ExpressionTest.java | 10 +- .../sk89q/worldedit/util/LocationTest.java | 6 +- .../sk89q/worldedit/forge/CommandWrapper.java | 9 +- .../sk89q/worldedit/forge/CommonProxy.java | 3 +- .../worldedit/forge/ForgeBiomeRegistry.java | 2 +- .../sk89q/worldedit/forge/ForgeEntity.java | 5 +- .../forge/ForgeEntityProperties.java | 4 +- .../forge/ForgePermissionsProvider.java | 3 +- .../sk89q/worldedit/forge/ForgePlayer.java | 2 +- .../worldedit/forge/ForgeRegistries.java | 2 +- .../com/sk89q/worldedit/forge/ForgeWorld.java | 12 +-- .../forge/InternalPacketHandler.java | 5 +- .../com/sk89q/worldedit/forge/KeyHandler.java | 2 - .../sk89q/worldedit/forge/NBTConverter.java | 35 ++++++- .../worldedit/forge/TileEntityUtils.java | 9 +- .../worldedit/forge/WECUIPacketHandler.java | 4 +- .../forge/net/LeftClickAirEventMessage.java | 1 - .../worldedit/sponge/CUIChannelHandler.java | 6 +- .../worldedit/sponge/SpongeBiomeRegistry.java | 3 +- .../worldedit/sponge/SpongeCommandSender.java | 7 +- .../sk89q/worldedit/sponge/SpongeEntity.java | 5 +- .../sponge/SpongePermissionsProvider.java | 1 - .../sk89q/worldedit/sponge/SpongePlayer.java | 6 +- .../sponge/adapter/SpongeImplAdapter.java | 2 - 272 files changed, 922 insertions(+), 812 deletions(-) delete mode 100644 worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java index b309265d6..d61674c1e 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java @@ -19,16 +19,16 @@ package com.sk89q.wepif; +import com.sk89q.util.yaml.YAMLNode; +import com.sk89q.util.yaml.YAMLProcessor; +import org.bukkit.OfflinePlayer; + import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import com.sk89q.util.yaml.YAMLNode; -import com.sk89q.util.yaml.YAMLProcessor; -import org.bukkit.OfflinePlayer; - public class ConfigurationPermissionsResolver implements PermissionsResolver { private YAMLProcessor config; private Map> userPermissionsCache; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java index 182a29faf..fe23bfa46 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java @@ -19,6 +19,7 @@ package com.sk89q.wepif; +import com.nijikokun.bukkit.Permissions.Permissions; import com.sk89q.util.yaml.YAMLProcessor; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; @@ -27,7 +28,6 @@ import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; -import com.nijikokun.bukkit.Permissions.Permissions; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java index 8a69eaf31..cb0fea4de 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java @@ -25,11 +25,12 @@ import com.sk89q.worldedit.world.biome.BiomeData; import com.sk89q.worldedit.world.registry.BiomeRegistry; import org.bukkit.block.Biome; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * A biome registry for Bukkit. */ diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java index 8f4b8e5ae..b392c50ac 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.bukkit.util.CommandInspector; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extension.platform.Actor; @@ -30,8 +32,6 @@ import org.bukkit.command.CommandSender; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - class BukkitCommandInspector implements CommandInspector { private static final Logger logger = Logger.getLogger(BukkitCommandInspector.class.getCanonicalName()); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java index df7fdd520..55929af02 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandSender.java @@ -19,19 +19,20 @@ package com.sk89q.worldedit.bukkit; -import com.sk89q.worldedit.session.SessionKey; -import com.sk89q.worldedit.util.auth.AuthorizationException; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIEvent; +import com.sk89q.worldedit.session.SessionKey; +import com.sk89q.worldedit.util.auth.AuthorizationException; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import javax.annotation.Nullable; import java.io.File; import java.util.UUID; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; public class BukkitCommandSender implements Actor { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java index 085f6c8b8..418980ad7 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -28,10 +30,9 @@ import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.NullWorld; -import javax.annotation.Nullable; import java.lang.ref.WeakReference; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * An adapter to adapt a Bukkit entity into a WorldEdit one. diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java index 0e20172bd..86618f62f 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.util.Enums; import org.bukkit.entity.Ambient; @@ -42,8 +44,6 @@ import org.bukkit.entity.Tameable; import org.bukkit.entity.Villager; import org.bukkit.entity.minecart.ExplosiveMinecart; -import static com.google.common.base.Preconditions.checkNotNull; - class BukkitEntityProperties implements EntityProperties { private static final org.bukkit.entity.EntityType armorStandType = diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index cc0ce26df..7334a48c8 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -20,13 +20,13 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBagException; import com.sk89q.worldedit.extent.inventory.OutOfBlocksException; import com.sk89q.worldedit.extent.inventory.OutOfSpaceException; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockTypes; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 36dd574b9..81ef4af75 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -29,7 +29,6 @@ import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.history.change.BlockChange; @@ -418,11 +417,6 @@ public class BukkitWorld extends AbstractWorld { } } - @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(getBlock(position), this, position); - } - @Override public BaseBlock getFullBlock(Vector position) { BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 359ddd90d..f16a6716e 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -20,9 +20,9 @@ package com.sk89q.worldedit.bukkit.adapter; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.world.block.BlockType; import org.bukkit.Location; import org.bukkit.block.Biome; diff --git a/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java b/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java index 8e80a57bc..e207e7b8d 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java @@ -19,13 +19,15 @@ package com.sk89q.wepif; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + import org.bukkit.Server; import org.bukkit.plugin.PluginManager; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.*; - -import static org.mockito.Mockito.*; public class DinnerPermsResolverTest { private DinnerPermsResolver resolver; diff --git a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java index a67351cd5..21c83228f 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java @@ -28,7 +28,11 @@ import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.Plugin; -import java.util.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.UUID; public class TestOfflinePermissible implements OfflinePlayer, Permissible { private boolean op; diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java deleted file mode 100644 index a26d50026..000000000 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/LazyBlock.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.blocks; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.extent.Extent; - -/** - * A implementation of a lazy block for {@link Extent#getLazyBlock(Vector)} - * that takes the block's ID and metadata, but will defer loading of NBT - * data until time of access. - * - *

NBT data is later loaded using a call to {@link Extent#getBlock(Vector)} - * with a stored {@link Extent} and location.

- * - *

All mutators on this object will throw an - * {@link UnsupportedOperationException}.

- */ -public class LazyBlock extends BaseBlock { - - private final Extent extent; - private final Vector position; - private boolean loaded = false; - - /** - * Create a new lazy block. - * - * @param type the block type - * @param extent the extent to later load the full block data from - * @param position the position to later load the full block data from - */ - public LazyBlock(BlockType type, Extent extent, Vector position) { - super(type); - checkNotNull(extent); - checkNotNull(position); - this.extent = extent; - this.position = position; - } - - /** - * Create a new lazy block. - * - * @param state the block state - * @param extent the extent to later load the full block data from - * @param position the position to later load the full block data from - */ - public LazyBlock(BlockState state, Extent extent, Vector position) { - super(state); - checkNotNull(extent); - checkNotNull(position); - this.extent = extent; - this.position = position; - } - - @Override - public CompoundTag getNbtData() { - if (!loaded) { - BaseBlock loadedBlock = extent.getFullBlock(position); - this.nbtData = loadedBlock.getNbtData(); - loaded = true; - } - return super.getNbtData(); - } - - @Override - public void setNbtData(CompoundTag nbtData) { - throw new UnsupportedOperationException("This object is immutable"); - } - -} diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java index e4b7d28b8..d9d209a44 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java @@ -22,8 +22,8 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.util.gson.GsonUtil; +import com.sk89q.worldedit.world.block.BlockState; import java.util.HashMap; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java index 0bd661967..c6d8fe9e8 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java @@ -19,11 +19,11 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.HashMap; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Helps create compound tags. */ diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java index 1b8d1fa21..7a2482344 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java @@ -19,12 +19,12 @@ package com.sk89q.jnbt; -import javax.annotation.Nullable; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.Collections; import java.util.List; -import java.util.NoSuchElementException; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * The {@code TAG_List} tag. diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java index cd1f11e25..c410ec3ae 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java @@ -19,13 +19,13 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Helps create list tags. */ diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java index a54ea6e26..ddf1168be 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java @@ -19,6 +19,8 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import java.io.Closeable; import java.io.DataOutputStream; import java.io.IOException; @@ -26,8 +28,6 @@ import java.io.OutputStream; import java.util.List; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * This class writes NBT, or Named Binary Tag * {@code Tag} objects to an underlying {@code OutputStream}. diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java index 428ff4d86..440738c4e 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java @@ -19,13 +19,13 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.world.storage.InvalidFormatException; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A class which contains NBT-related utility methods. * diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java index 1dcbdde1e..4345793d1 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java @@ -19,12 +19,13 @@ package com.sk89q.minecraft.util.commands; -import javax.annotation.Nullable; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.ArrayList; import java.util.List; import java.util.ListIterator; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; public class CommandException extends Exception { diff --git a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java index 22b09cd48..677ca5ecb 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java +++ b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java @@ -23,12 +23,13 @@ import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; + /** * Represents a configuration node. */ diff --git a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java index 0d09fe64f..45ffd8776 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java +++ b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java @@ -24,15 +24,22 @@ import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.emitter.ScalarAnalysis; -import org.yaml.snakeyaml.nodes.Node; import org.yaml.snakeyaml.nodes.Tag; import org.yaml.snakeyaml.reader.UnicodeReader; -import org.yaml.snakeyaml.representer.Represent; import org.yaml.snakeyaml.representer.Representer; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.Map.Entry; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index b0f58edf0..687cc0be5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -26,7 +26,6 @@ import static com.sk89q.worldedit.regions.Regions.maximumBlockY; import static com.sk89q.worldedit.regions.Regions.minimumBlockY; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.event.extent.EditSessionEvent; @@ -399,11 +398,6 @@ public class EditSession implements Extent { return bypassNone.setBiome(position, biome); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return world.getLazyBlock(position); - } - @Override public BlockState getBlock(Vector position) { return world.getBlock(position); @@ -1146,7 +1140,7 @@ public class EditSession implements Extent { checkArgument(radius >= 0, "radius >= 0 required"); // Our origins can only be liquids - BlockMask liquidMask = new BlockMask(this, new BlockState(fluid, new HashMap<>())); + BlockMask liquidMask = new BlockMask(this, fluid.getDefaultState().toFuzzy()); // But we will also visit air blocks MaskIntersection blockMask = new MaskUnion(liquidMask, new BlockMask(this, BlockTypes.AIR.getDefaultState())); @@ -1508,7 +1502,7 @@ public class EditSession implements Extent { // Snow should not cover these blocks if (id.getMaterial().isTranslucent()) { // Add snow on leaves - if (BlockCategories.LEAVES.contains(id)) { + if (!BlockCategories.LEAVES.contains(id)) { break; } } @@ -1678,7 +1672,7 @@ public class EditSession implements Extent { for (int z = minZ; z <= maxZ; ++z) { Vector pt = new Vector(x, y, z); - BlockType type = getLazyBlock(pt).getBlockType(); + BlockType type = getBlock(pt).getBlockType(); if (map.containsKey(type)) { map.get(type).increment(); @@ -1692,7 +1686,7 @@ public class EditSession implements Extent { } } else { for (Vector pt : region) { - BlockType type = getLazyBlock(pt).getBlockType(); + BlockType type = getBlock(pt).getBlockType(); if (map.containsKey(type)) { map.get(type).increment(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java index 8af5071c6..094da742e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.world.World; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Creates new {@link EditSession}s. To get an instance of this factory, * use {@link WorldEdit#getEditSessionFactory()}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java index 6b5e54de4..2d931f91f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java @@ -19,9 +19,9 @@ package com.sk89q.worldedit; +import com.sk89q.worldedit.util.logging.LogFormat; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.item.ItemTypes; -import com.sk89q.worldedit.util.logging.LogFormat; import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index 6677c9579..c42be0914 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -25,8 +25,6 @@ import com.sk89q.jchronic.Chronic; import com.sk89q.jchronic.Options; import com.sk89q.jchronic.utils.Span; import com.sk89q.jchronic.utils.Time; -import com.sk89q.worldedit.world.item.ItemType; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.command.tool.BlockTool; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.InvalidToolBindException; @@ -46,6 +44,8 @@ import com.sk89q.worldedit.regions.selector.RegionSelectorType; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.snapshot.Snapshot; import java.util.Calendar; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index f29a2d5ef..9fd469057 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -22,12 +22,12 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; +import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.world.registry.LegacyMapper; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java index 23562fdf0..dd3ba1fc2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.blocks; -import javax.annotation.Nullable; -import java.util.Map; -import java.util.HashMap; import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; /** * The colors for wool. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java index 94cd303ea..70deb8133 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; @@ -53,9 +56,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; - /** * Implements biome-related commands such as "/biomelist". */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index f1ce2ba38..045dc6fbe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -30,7 +30,6 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.command.tool.brush.ButcherBrush; import com.sk89q.worldedit.command.tool.brush.ClipboardBrush; @@ -50,6 +49,7 @@ import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; +import com.sk89q.worldedit.world.block.BlockTypes; /** * Commands to set brush shape. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java index dfa646400..ae96027b0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java @@ -19,11 +19,19 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector2D; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.math.MathUtils; import com.sk89q.worldedit.util.Location; @@ -35,9 +43,6 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; - /** * Commands for working with chunks. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java index adf0ced28..3e1ecec7b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java @@ -19,19 +19,23 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Sets; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.world.item.ItemType; -import com.sk89q.worldedit.world.item.ItemTypes; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.util.command.parametric.Optional; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; /** * General WorldEdit commands. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java index aa6640ba2..381de7a8a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java @@ -19,6 +19,11 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.ALL; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.PLACEMENT; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; @@ -32,7 +37,6 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.internal.annotation.Selection; import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.util.command.binding.Range; import com.sk89q.worldedit.util.command.binding.Switch; @@ -40,9 +44,6 @@ import com.sk89q.worldedit.util.command.binding.Text; import com.sk89q.worldedit.util.command.parametric.Optional; import com.sk89q.worldedit.world.biome.BaseBiome; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.*; - /** * Commands for the generation of shapes and other objects. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java index a895e183f..8b76b68d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java @@ -19,14 +19,17 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Commands to undo, redo, and clear history. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java index 6a7e72f53..082b29c6e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; @@ -32,9 +35,6 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.command.parametric.Optional; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION; - /** * Commands for moving the player around. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index 61f2edb75..4bc7d084a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -19,10 +19,22 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.ALL; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.ORIENTATION_REGION; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; +import static com.sk89q.worldedit.regions.Regions.asFlatRegion; +import static com.sk89q.worldedit.regions.Regions.maximumBlockY; +import static com.sk89q.worldedit.regions.Regions.minimumBlockY; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.function.GroundFunction; @@ -45,7 +57,6 @@ import com.sk89q.worldedit.regions.ConvexPolyhedralRegion; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionOperationException; -import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.util.command.binding.Range; import com.sk89q.worldedit.util.command.binding.Switch; @@ -55,10 +66,6 @@ import com.sk89q.worldedit.util.command.parametric.Optional; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.*; -import static com.sk89q.worldedit.regions.Regions.*; - /** * Commands that operate on regions. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java index 3cb190e15..922dfcb69 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.ALL; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; @@ -31,9 +34,6 @@ import com.sk89q.worldedit.entity.Player; import java.io.File; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.ALL; - /** * Commands related to scripting. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 9d118681c..fb4d9824e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -34,8 +34,6 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits; @@ -59,6 +57,9 @@ import com.sk89q.worldedit.util.formatting.Style; import com.sk89q.worldedit.util.formatting.StyledFragment; import com.sk89q.worldedit.util.formatting.component.CommandListBox; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.storage.ChunkStore; import java.util.ArrayList; @@ -651,7 +652,7 @@ public class SelectionCommands { help = "Gets the distribution of blocks in the selection.\n" + "The -c flag gets the distribution of your clipboard.\n" + - "The -d flag separates blocks by data", + "The -d flag separates blocks by state", flags = "cd", min = 0, max = 0 @@ -660,32 +661,50 @@ public class SelectionCommands { public void distr(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException, CommandException { int size; - List> distributionData; + boolean useData = args.hasFlag('d'); + List> distribution = null; + List> distributionData = null; if (args.hasFlag('c')) { // TODO: Update for new clipboard throw new CommandException("Needs to be re-written again"); } else { - distributionData = editSession.getBlockDistributionWithData(session.getSelection(player.getWorld())); + if (useData) { + distributionData = editSession.getBlockDistributionWithData(session.getSelection(player.getWorld())); + } else { + distribution = editSession.getBlockDistribution(session.getSelection(player.getWorld())); + } size = session.getSelection(player.getWorld()).getArea(); } - if (distributionData.size() <= 0) { // *Should* always be false + if ((useData && distributionData.size() <= 0) || (!useData && distribution.size() <= 0)) { // *Should* always be false player.printError("No blocks counted."); return; } player.print("# total blocks: " + size); - for (Countable c : distributionData) { - String name = c.getID().getBlockType().getName(); - String str = String.format("%-7s (%.3f%%) %s #%s%s", - String.valueOf(c.getAmount()), - c.getAmount() / (double) size * 100, - name, - c.getID().getBlockType().getId(), - c.getID().getStates()); - player.print(str); + if (useData) { + for (Countable c : distributionData) { + String name = c.getID().getBlockType().getName(); + String str = String.format("%-7s (%.3f%%) %s #%s%s", + String.valueOf(c.getAmount()), + c.getAmount() / (double) size * 100, + name, + c.getID().getBlockType().getId(), + c.getID().getStates()); + player.print(str); + } + } else { + for (Countable c : distribution) { + String name = c.getID().getName(); + String str = String.format("%-7s (%.3f%%) %s #%s", + String.valueOf(c.getAmount()), + c.getAmount() / (double) size * 100, + name, + c.getID().getId()); + player.print(str); + } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java index 8c7676eee..4cd0e0079 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java @@ -24,7 +24,11 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.world.snapshot.InvalidSnapshotException; import com.sk89q.worldedit.world.snapshot.Snapshot; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java index 7dc61dba7..fcd5445a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java @@ -19,11 +19,17 @@ package com.sk89q.worldedit.command; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.world.DataException; @@ -37,8 +43,6 @@ import java.io.File; import java.io.IOException; import java.util.logging.Logger; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; - public class SnapshotUtilCommands { private static final Logger logger = Logger.getLogger("Minecraft.WorldEdit"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java index 116d71a81..5fa571265 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java @@ -22,7 +22,11 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.command.tool.AreaPickaxe; import com.sk89q.worldedit.command.tool.RecursivePickaxe; import com.sk89q.worldedit.command.tool.SinglePickaxe; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index 806b6258a..7b80fbd73 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -22,15 +22,26 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.command.tool.BlockDataCyler; +import com.sk89q.worldedit.command.tool.BlockReplacer; +import com.sk89q.worldedit.command.tool.DistanceWand; +import com.sk89q.worldedit.command.tool.FloatingTreeRemover; +import com.sk89q.worldedit.command.tool.FloodFillTool; +import com.sk89q.worldedit.command.tool.LongRangeBuildTool; +import com.sk89q.worldedit.command.tool.QueryTool; +import com.sk89q.worldedit.command.tool.TreePlanter; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; -import com.sk89q.worldedit.command.tool.*; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.TreeGenerator; +import com.sk89q.worldedit.world.block.BlockStateHolder; public class ToolCommands { private final WorldEdit we; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java index 3302c9981..e74dd129f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java @@ -22,7 +22,10 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.pattern.Pattern; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 4a428e0c2..f20b54d51 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -33,8 +33,6 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.command.util.CreatureButcher; import com.sk89q.worldedit.command.util.EntityRemover; import com.sk89q.worldedit.entity.Entity; @@ -66,6 +64,8 @@ import com.sk89q.worldedit.util.formatting.component.Code; import com.sk89q.worldedit.util.formatting.component.CommandListBox; import com.sk89q.worldedit.util.formatting.component.CommandUsageBox; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.ArrayList; import java.util.List; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java index 6cfa41059..c849d1469 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java @@ -22,7 +22,10 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandPermissions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.platform.ConfigurationLoadEvent; import com.sk89q.worldedit.extension.platform.Actor; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java index 878fc013c..880c17fb8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java @@ -24,13 +24,13 @@ import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseItem; -import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.command.argument.CommandArgs; +import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.world.World; public class ItemParser extends SimpleCommand { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java index 524da7792..e8d209e4c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/PatternParser.java @@ -23,15 +23,14 @@ import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extension.input.InputParseException; -import com.sk89q.worldedit.extension.input.NoMatchException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.command.argument.CommandArgs; +import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.world.World; public class PatternParser extends SimpleCommand { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java index eed6e383c..4d98103c3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command.argument; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extent.NullExtent; @@ -30,8 +32,6 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.composition.SimpleCommand; -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; - public class ReplaceParser extends SimpleCommand> { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java index 50c0710ea..a73748e4c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command.composition; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.command.argument.RegionFunctionParser; @@ -30,8 +32,6 @@ import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.composition.CommandExecutor; import com.sk89q.worldedit.util.command.composition.SimpleCommand; -import static com.google.common.base.Preconditions.checkNotNull; - public class ApplyCommand extends SimpleCommand> { private final CommandExecutor> functionParser; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java index 4206d6947..087963aed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command.composition; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Joiner; import com.google.common.collect.Lists; import com.sk89q.minecraft.util.commands.CommandException; @@ -41,8 +43,6 @@ import com.sk89q.worldedit.util.command.composition.SimpleCommand; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - public class SelectionCommand extends SimpleCommand { private final CommandExecutor> delegate; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java index 0bf486328..e2bc2f14f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command.composition; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.minecraft.util.commands.CommandPermissionsException; @@ -40,8 +42,6 @@ import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.composition.CommandExecutor; import com.sk89q.worldedit.util.command.composition.SimpleCommand; -import static com.google.common.base.Preconditions.checkNotNull; - public class ShapedBrushCommand extends SimpleCommand { private final CommandExecutor> delegate; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java index e5b638bd5..6401eb993 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java @@ -24,20 +24,18 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; /** * A super pickaxe mode that will remove blocks in an area. */ public class AreaPickaxe implements BlockTool { - private static final BlockState air = BlockTypes.AIR.getDefaultState(); private int range; public AreaPickaxe(int range) { @@ -78,7 +76,7 @@ public class AreaPickaxe implements BlockTool { ((World) clicked.getExtent()).queueBlockBreakEffect(server, pos, initialType, clicked.toVector().distanceSq(pos)); - editSession.setBlock(pos, air); + editSession.setBlock(pos, BlockTypes.AIR.getDefaultState()); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java index 21095b28b..9d0b9c9fc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java @@ -19,13 +19,16 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.inventory.BlockBag; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; /** * A mode that replaces one block. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java index a1b51e256..7488c14ad 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java @@ -19,7 +19,8 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java index 5487b63d0..5f2d822cc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java @@ -24,16 +24,16 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockCategories; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockCategories; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.HashSet; import java.util.LinkedList; @@ -44,7 +44,6 @@ import java.util.Set; * to anything else) */ public class FloatingTreeRemover implements BlockTool { - private static final BlockState AIR = BlockTypes.AIR.getDefaultState(); private int rangeSq; public FloatingTreeRemover() { @@ -89,7 +88,7 @@ public class FloatingTreeRemover implements BlockTool { for (Vector blockVector : blockSet) { final BlockState otherState = editSession.getBlock(blockVector); if (isTreeBlock(otherState.getBlockType())) { - editSession.setBlock(blockVector, AIR); + editSession.setBlock(blockVector, BlockTypes.AIR.getDefaultState()); } } } catch (MaxChangedBlocksException e) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java index 99a4d2857..3d178cb9c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java @@ -19,15 +19,20 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.HashSet; import java.util.Set; @@ -54,7 +59,7 @@ public class FloodFillTool implements BlockTool { public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { World world = (World) clicked.getExtent(); - BlockType initialType = world.getLazyBlock(clicked.toVector()).getBlockType(); + BlockType initialType = world.getBlock(clicked.toVector()).getBlockType(); if (initialType == BlockTypes.AIR) { return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java index e0ab56643..908ec5325 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java @@ -23,12 +23,12 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; /** * A tool that can place (or remove) blocks at a distance. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index 5a8f6165e..1ad0441a4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -23,11 +23,11 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.blocks.MobSpawnerBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Looks up information about a block. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java index c2f2b6bee..f513cb075 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/RecursivePickaxe.java @@ -19,14 +19,18 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.HashSet; import java.util.Set; @@ -37,7 +41,6 @@ import java.util.Set; */ public class RecursivePickaxe implements BlockTool { - private static final BlockState air = BlockTypes.AIR.getDefaultState(); private double range; public RecursivePickaxe(double range) { @@ -95,7 +98,7 @@ public class RecursivePickaxe implements BlockTool { world.queueBlockBreakEffect(server, pos, initialType, distanceSq); - editSession.setBlock(pos, air); + editSession.setBlock(pos, BlockTypes.AIR.getDefaultState()); recurse(server, editSession, world, pos.add(1, 0, 0).toBlockVector(), origin, size, initialType, visited); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java index 40274abcb..f3f4c9945 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java @@ -23,12 +23,12 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; /** * A super pickaxe mode that removes one block. @@ -43,7 +43,7 @@ public class SinglePickaxe implements BlockTool { @Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { World world = (World) clicked.getExtent(); - final BlockType blockType = world.getLazyBlock(clicked.toVector()).getBlockType(); + final BlockType blockType = world.getBlock(clicked.toVector()).getBlockType(); if (blockType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java index 998c87fd5..436d42104 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java @@ -19,11 +19,15 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; -import com.sk89q.worldedit.util.*; +import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.util.TreeGenerator; /** * Plants a tree. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java index 3aa52262c..10db344ca 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java @@ -22,9 +22,9 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.world.block.BlockTypes; public class CylinderBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java index 2dcce3bea..eae099ed4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/GravityBrush.java @@ -23,11 +23,13 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.function.pattern.Pattern; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class GravityBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java index dc6bd9459..7da259c33 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java @@ -23,9 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.world.block.BlockTypes; public class HollowCylinderBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java index 2fa5d3902..b5009221b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java @@ -23,9 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.world.block.BlockTypes; public class HollowSphereBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java index d52ebbd4b..df76950d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java @@ -20,11 +20,11 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.math.convolution.HeightMap; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.convolution.GaussianKernel; +import com.sk89q.worldedit.math.convolution.HeightMap; import com.sk89q.worldedit.math.convolution.HeightMapFilter; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java index 120539b82..781ee6d1f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java @@ -23,9 +23,9 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.world.block.BlockTypes; public class SphereBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java index 5c853a2a6..456acaa3d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.entity; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.world.NbtValued; import com.sk89q.worldedit.world.entity.EntityType; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Represents a mutable "snapshot" of an entity. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java index 81f1f131b..d1bf6a238 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/extent/EditSessionEvent.java @@ -19,19 +19,19 @@ package com.sk89q.worldedit.event.extent; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.EditSession.Stage; + import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.EditSession.Stage; - /** * Raised (several times) when a new {@link EditSession} is being instantiated. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java index 2fdb4e443..7549518ad 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.event.Cancellable; import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Called when a block is interacted with. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandEvent.java index 0790787f4..6d3791b86 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandEvent.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.event.AbstractCancellable; import com.sk89q.worldedit.extension.platform.Actor; -import static com.google.common.base.Preconditions.checkNotNull; - /** * This class is currently only for internal use. Do not post or catch this event. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java index 8fa39c0ff..75483745e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.extension.platform.Actor; import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Posted when suggestions for auto-completion are requested for command input. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java index 73d23131c..1bfc11724 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.event.Event; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Raised when the configuration has been loaded or re-loaded. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java index 2bc39ee97..67ef25268 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.Cancellable; import com.sk89q.worldedit.event.Event; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Raised whenever a player sends input. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java index 90ff8d365..f8c3a5e95 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java @@ -21,10 +21,10 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.internal.registry.AbstractFactory; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.HashSet; import java.util.Set; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java index 1c7a0d646..fe28aafe8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java @@ -22,12 +22,12 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.EmptyClipboardException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.function.pattern.ClipboardPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.internal.registry.InputParser; -import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.session.ClipboardHolder; class HashTagPatternParser extends InputParser { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java index 87b3862fc..45373ec26 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java @@ -20,13 +20,13 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.RandomPattern; import com.sk89q.worldedit.internal.registry.InputParser; +import com.sk89q.worldedit.world.block.BlockStateHolder; class RandomPatternParser extends InputParser { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java index 17833cf97..cd3adb5e7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java @@ -20,11 +20,11 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.internal.registry.InputParser; -import com.sk89q.worldedit.extension.input.InputParseException; class SingleBlockPatternParser extends InputParser { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index f30aeaa5b..41a495c40 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -24,13 +24,6 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockType; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.world.gamemode.GameMode; -import com.sk89q.worldedit.world.gamemode.GameModes; -import com.sk89q.worldedit.world.item.ItemType; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.internal.cui.CUIEvent; @@ -38,6 +31,13 @@ import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TargetBlock; import com.sk89q.worldedit.util.auth.AuthorizationException; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.gamemode.GameMode; +import com.sk89q.worldedit.world.gamemode.GameModes; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.item.ItemTypes; import java.io.File; @@ -103,7 +103,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { byte free = 0; - while (y <= world.getMinimumPoint().getBlockY() + 2) { + while (y <= world.getMaximumPoint().getBlockY() + 2) { if (!world.getBlock(new Vector(x, y, z)).getBlockType().getMaterial().isMovementBlocker()) { ++free; } else { @@ -310,12 +310,12 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public Location getBlockIn() { - return getLocation(); + return getLocation().setPosition(getLocation().toVector().toBlockVector()); } @Override public Location getBlockOn() { - return getLocation().setY(getLocation().getY() - 1); + return getLocation().setPosition(getLocation().setY(getLocation().getY() - 1).toVector().toBlockVector()); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java index 5c010c1f8..12f56a81a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.extension.platform; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.util.command.composition.LegacyCommandAdapter.adapt; + import com.google.common.base.Joiner; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; @@ -28,15 +31,41 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.command.*; +import com.sk89q.worldedit.command.BiomeCommands; +import com.sk89q.worldedit.command.BrushCommands; +import com.sk89q.worldedit.command.ChunkCommands; +import com.sk89q.worldedit.command.ClipboardCommands; +import com.sk89q.worldedit.command.GeneralCommands; +import com.sk89q.worldedit.command.GenerationCommands; +import com.sk89q.worldedit.command.HistoryCommands; +import com.sk89q.worldedit.command.NavigationCommands; +import com.sk89q.worldedit.command.RegionCommands; +import com.sk89q.worldedit.command.SchematicCommands; +import com.sk89q.worldedit.command.ScriptingCommands; +import com.sk89q.worldedit.command.SelectionCommands; +import com.sk89q.worldedit.command.SnapshotCommands; +import com.sk89q.worldedit.command.SnapshotUtilCommands; +import com.sk89q.worldedit.command.SuperPickaxeCommands; +import com.sk89q.worldedit.command.ToolCommands; +import com.sk89q.worldedit.command.ToolUtilCommands; +import com.sk89q.worldedit.command.UtilityCommands; +import com.sk89q.worldedit.command.WorldEditCommands; import com.sk89q.worldedit.command.argument.ReplaceParser; import com.sk89q.worldedit.command.argument.TreeGeneratorParser; -import com.sk89q.worldedit.command.composition.*; +import com.sk89q.worldedit.command.composition.ApplyCommand; +import com.sk89q.worldedit.command.composition.DeformCommand; +import com.sk89q.worldedit.command.composition.PaintCommand; +import com.sk89q.worldedit.command.composition.SelectionCommand; +import com.sk89q.worldedit.command.composition.ShapedBrushCommand; import com.sk89q.worldedit.event.platform.CommandEvent; import com.sk89q.worldedit.event.platform.CommandSuggestionEvent; import com.sk89q.worldedit.function.factory.Deform; import com.sk89q.worldedit.function.factory.Deform.Mode; -import com.sk89q.worldedit.internal.command.*; +import com.sk89q.worldedit.internal.command.ActorAuthorizer; +import com.sk89q.worldedit.internal.command.CommandLoggingHandler; +import com.sk89q.worldedit.internal.command.UserCommandCompleter; +import com.sk89q.worldedit.internal.command.WorldEditBinding; +import com.sk89q.worldedit.internal.command.WorldEditExceptionConverter; import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.InvalidUsageException; @@ -58,9 +87,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.util.command.composition.LegacyCommandAdapter.adapt; - /** * Handles the registration and invocation of commands. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java index 517c98e93..3b37a98b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java @@ -25,10 +25,11 @@ import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.registry.Registries; -import javax.annotation.Nullable; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; + /** * Represents a platform that WorldEdit has been implemented for. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index 8b6af45d8..27da6be8a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.extension.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.BaseEntity; @@ -31,11 +33,9 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.gamemode.GameMode; -import javax.annotation.Nullable; - import java.util.UUID; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; class PlayerProxy extends AbstractPlayerActor { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java index bb956d4ae..a33c56fd5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java @@ -19,26 +19,25 @@ package com.sk89q.worldedit.extent; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.OperationQueue; -import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.biome.BaseBiome; - -import javax.annotation.Nullable; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * A base class for {@link Extent}s that merely passes extents onto another. @@ -71,11 +70,6 @@ public abstract class AbstractDelegateExtent implements Extent { return extent.getBlock(position); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return extent.getLazyBlock(position); - } - @Override public BaseBlock getFullBlock(Vector position) { return extent.getFullBlock(position); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java index f57056f7a..590622a72 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/ChangeSetExtent.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.extent; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.history.change.BlockChange; @@ -31,13 +32,12 @@ import com.sk89q.worldedit.history.change.EntityRemove; import com.sk89q.worldedit.history.changeset.ChangeSet; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; - -import javax.annotation.Nullable; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Stores changes to a {@link ChangeSet}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java index 617dff41f..5ed584351 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java @@ -22,11 +22,12 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; -import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.util.Location; + +import java.util.List; import javax.annotation.Nullable; -import java.util.List; /** * A world, portion of a world, clipboard, or other object that can have blocks diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java index 39e4bd12f..fc7d70081 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/InputExtent.java @@ -22,10 +22,9 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockState; /** * Provides the current state of blocks, entities, and so on. @@ -48,29 +47,6 @@ public interface InputExtent { */ BlockState getBlock(Vector position); - /** - * Get a lazy, immutable snapshot of the block at the given location that only - * immediately contains information about the block's type (and metadata). - * - *

Further information (such as NBT data) will be available by the - * time of access. Therefore, it is not recommended that - * this method is used if the world is being simulated at the time of - * call. If the block needs to be stored for future use, then this method should - * definitely not be used. Moreover, the block that is returned is immutable (or - * should be), and therefore modifications should not be attempted on it. If a - * modifiable copy is required, then the block should be cloned.

- * - *

This method exists because it is sometimes important to inspect the block - * at a given location, but {@link #getBlock(Vector)} may be too expensive in - * the underlying implementation. It is also not possible to implement - * caching if the returned object is mutable, so this methods allows caching - * implementations to be used.

- * - * @param position position of the block - * @return the block - */ - LazyBlock getLazyBlock(Vector position); - /** * Get a immutable snapshot of the block at the given location. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java index ea8ca7c14..cbd21675c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/MaskingExtent.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.extent; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.function.mask.Mask; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Requires that all mutating methods pass a given {@link Mask}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java index f73152476..2753948cd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/NullExtent.java @@ -23,21 +23,21 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; -import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * An extent that returns air blocks for all blocks and does not * pass on any changes. @@ -77,11 +77,6 @@ public class NullExtent implements Extent { return BlockTypes.AIR.getDefaultState(); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(BlockTypes.AIR, this, position); - } - @Override public BaseBlock getFullBlock(Vector position) { return new BaseBlock(getBlock(position)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java index 424e84165..36747fd97 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java @@ -22,9 +22,9 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockStateHolder; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java index a8b5636ed..3905f4ccb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java @@ -24,9 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; @@ -35,6 +32,8 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.regions.AbstractRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionOperationException; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Iterator; import java.util.LinkedHashMap; @@ -49,8 +48,6 @@ import java.util.Map; */ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pattern { - private static final BlockState AIR = BlockTypes.AIR.getDefaultState(); - private final Map buffer = new LinkedHashMap<>(); private final Mask mask; private Vector min = null; @@ -110,7 +107,7 @@ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pat if (block != null) { return block; } else { - return AIR; + return BlockTypes.AIR.getDefaultState(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java index 2a61679c7..b4c4e267a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java @@ -21,14 +21,13 @@ 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.blocks.LazyBlock; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockState; /** - * Returns the same cached {@link BaseBlock} for repeated calls to - * {@link #getLazyBlock(Vector)} with the same position. + * Returns the same cached {@link BlockState} for repeated calls to + * {@link #getBlock(Vector)} with the same position. */ public class LastAccessExtentCache extends AbstractDelegateExtent { @@ -44,13 +43,13 @@ public class LastAccessExtentCache extends AbstractDelegateExtent { } @Override - public LazyBlock getLazyBlock(Vector position) { + public BlockState getBlock(Vector position) { BlockVector blockVector = position.toBlockVector(); CachedBlock lastBlock = this.lastBlock; if (lastBlock != null && lastBlock.position.equals(blockVector)) { return lastBlock.block; } else { - LazyBlock block = super.getLazyBlock(position); + BlockState block = super.getBlock(position); this.lastBlock = new CachedBlock(blockVector, block); return block; } @@ -58,9 +57,9 @@ public class LastAccessExtentCache extends AbstractDelegateExtent { private static class CachedBlock { private final BlockVector position; - private final LazyBlock block; + private final BlockState block; - private CachedBlock(BlockVector position, LazyBlock block) { + private CachedBlock(BlockVector position, BlockState block) { this.position = position; this.block = block; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index 0cc32149c..fc31c2886 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -19,27 +19,27 @@ package com.sk89q.worldedit.extent.clipboard; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Stores block data as a multi-dimensional array of {@link BaseBlock}s and @@ -135,11 +135,6 @@ public class BlockArrayClipboard implements Clipboard { return BlockTypes.AIR.getDefaultState(); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(getBlock(position), null, position); - } - @Override public BaseBlock getFullBlock(Vector position) { if (region.contains(position)) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java index 4311ada18..4b56e5e06 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.extent.clipboard; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An implementation of {@link Entity} that stores a {@link BaseEntity} with it. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java index 1448ca123..94f76fe5f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.extent.clipboard.io; import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.world.registry.Registries; import java.io.Closeable; import java.io.IOException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java index cfe6007c9..16a60c80d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.extent.clipboard.io.legacycompat; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java index 566f34812..ae2d5f055 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java @@ -26,7 +26,6 @@ import com.google.gson.JsonPrimitive; import com.google.gson.JsonSyntaxException; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java index aeee7a339..d55771266 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java @@ -19,9 +19,9 @@ package com.sk89q.worldedit.extent.inventory; +import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.util.Location; /** * Represents a source to get blocks from and store removed ones. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java index 894dda9d4..343181e25 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java @@ -21,12 +21,12 @@ package com.sk89q.worldedit.extent.inventory; 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.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.extent.AbstractDelegateExtent; -import com.sk89q.worldedit.extent.Extent; import java.util.HashMap; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java index 06f36079f..a4630bb8d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java @@ -24,7 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.transform.Transform; @@ -82,11 +81,6 @@ public class BlockTransformExtent extends AbstractDelegateExtent { return transformBlock(super.getBlock(position), false); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return transformBlock(super.getLazyBlock(position), false); - } - @Override public BaseBlock getFullBlock(Vector position) { return transformBlock(super.getFullBlock(position), false); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java index 04266af6d..c3332a250 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.extent.validation; +import static com.google.common.base.Preconditions.checkArgument; + import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; - -import static com.google.common.base.Preconditions.checkArgument; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Limits the number of blocks that can be changed before a diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java index 720a4d8a9..ffb2b175a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java @@ -19,15 +19,15 @@ package com.sk89q.worldedit.extent.validation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; /** * Validates set data to prevent creating invalid blocks and such. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index 5e33b6455..25591defb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -23,12 +23,12 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; /** * Handles various quirks when setting blocks, such as ice turning diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java index e98e9d8dc..845276a58 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.extent.world; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Automatically loads chunks when blocks are accessed. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java index b11210bdf..9ad839a32 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java @@ -19,21 +19,21 @@ package com.sk89q.worldedit.extent.world; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.RunContext; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.HashSet; import java.util.List; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Implements "fast mode" which may skip physics, lighting, etc. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java index c8f1b2741..97d8ee9c3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java @@ -23,11 +23,11 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; /** * Makes changes to the world as if a player had done so during survival mode. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java index 2a0a4f992..ba853eba9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/CombinedRegionFunction.java @@ -19,12 +19,15 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import java.util.*; - -import static com.google.common.base.Preconditions.checkNotNull; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; /** * Executes several region functions in order. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java index d9ee8c917..07c1515ba 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.regions.Region; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - public class EditContext { private Extent destination; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java index 35a9802e4..ff287632c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.mask.Mask2D; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Passes calls to {@link #apply(com.sk89q.worldedit.Vector2D)} to the * delegate {@link com.sk89q.worldedit.function.FlatRegionFunction} if they diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java index ae130d6c6..2b14b57b2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.mask.Mask; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Applies a {@link RegionFunction} to the first ground block. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java index 1f773a188..673d411d2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.mask.Mask; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Passes calls to {@link #apply(com.sk89q.worldedit.Vector)} to the * delegate {@link com.sk89q.worldedit.function.RegionFunction} if they diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java index f877adce5..ac5fdf98d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function.biome; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.FlatRegionFunction; import com.sk89q.worldedit.world.biome.BaseBiome; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Replaces the biome at the locations that this function is applied to. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java index a95c512e6..0013ade94 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/BlockReplace.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function.block; -import com.sk89q.worldedit.extent.Extent; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Replaces blocks with a given pattern. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java index be1e39ec9..70dbf6bb2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/ExtentBlockCopy.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.block; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTagBuilder; import com.sk89q.worldedit.Vector; @@ -31,8 +33,6 @@ import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Direction.Flag; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Copies blocks from one extent to another. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java index fd8cc5b7c..1c56d8a4f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/block/Naturalizer.java @@ -19,17 +19,16 @@ package com.sk89q.worldedit.function.block; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Sets; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.LayerFunction; import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.Mask; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockTypes; /** * Makes a layer of grass on top, three layers of dirt below, and smooth stone @@ -38,10 +37,6 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class Naturalizer implements LayerFunction { - private static final BlockState grass = BlockTypes.GRASS_BLOCK.getDefaultState(); - private static final BlockState dirt = BlockTypes.DIRT.getDefaultState(); - private static final BlockState stone = BlockTypes.STONE.getDefaultState(); - private final EditSession editSession; private final Mask mask; private int affected = 0; @@ -54,7 +49,11 @@ public class Naturalizer implements LayerFunction { public Naturalizer(EditSession editSession) { checkNotNull(editSession); this.editSession = editSession; - this.mask = new BlockMask(editSession, Sets.newHashSet(grass, dirt, stone)); + this.mask = new BlockMask(editSession, Sets.newHashSet( + BlockTypes.GRASS_BLOCK.getDefaultState(), + BlockTypes.DIRT.getDefaultState(), + BlockTypes.STONE.getDefaultState() + )); } /** @@ -77,15 +76,15 @@ public class Naturalizer implements LayerFunction { affected++; switch (depth) { case 0: - editSession.setBlock(position, grass); + editSession.setBlock(position, BlockTypes.GRASS_BLOCK.getDefaultState()); break; case 1: case 2: case 3: - editSession.setBlock(position, dirt); + editSession.setBlock(position, BlockTypes.DIRT.getDefaultState()); break; default: - editSession.setBlock(position, stone); + editSession.setBlock(position, BlockTypes.STONE.getDefaultState()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java index 5fbda8908..e157de444 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.entity; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTagBuilder; import com.sk89q.worldedit.Vector; @@ -33,8 +35,6 @@ import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Direction.Flag; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Copies entities provided to the function to the provided destination * {@code Extent}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java index 7ff183a37..324fe72f1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.function.factory; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.worldedit.function.Contextual; import com.sk89q.worldedit.function.EditContext; import com.sk89q.worldedit.function.RegionFunction; @@ -27,9 +30,6 @@ import com.sk89q.worldedit.function.visitor.RegionVisitor; import com.sk89q.worldedit.regions.NullRegion; import com.sk89q.worldedit.regions.Region; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; - public class Apply implements Contextual { private final Region region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java index f255050b7..d80ad4570 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.function.factory; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; @@ -34,9 +37,6 @@ import com.sk89q.worldedit.regions.Region; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; - public class Deform implements Contextual { private Extent destination; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Paint.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Paint.java index b88c09bbf..908608b81 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Paint.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Paint.java @@ -19,6 +19,12 @@ package com.sk89q.worldedit.function.factory; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.regions.Regions.asFlatRegion; +import static com.sk89q.worldedit.regions.Regions.maximumBlockY; +import static com.sk89q.worldedit.regions.Regions.minimumBlockY; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.NullExtent; import com.sk89q.worldedit.function.Contextual; @@ -33,10 +39,6 @@ import com.sk89q.worldedit.math.noise.RandomNoise; import com.sk89q.worldedit.regions.NullRegion; import com.sk89q.worldedit.regions.Region; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.regions.Regions.*; -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; - public class Paint implements Contextual { private final Extent destination; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java index 348e533d5..3f6265de7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java @@ -22,12 +22,12 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.RandomPattern; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; /** * Generates flora (which may include tall grass, flowers, etc.). @@ -106,7 +106,7 @@ public class FloraGenerator implements RegionFunction { public boolean apply(Vector position) throws WorldEditException { BlockStateHolder block = editSession.getBlock(position); - if (block.getBlockType() == BlockTypes.GRASS) { + if (block.getBlockType() == BlockTypes.GRASS_BLOCK) { editSession.setBlock(position.add(0, 1, 0), temperatePattern.apply(position)); return true; } else if (block.getBlockType() == BlockTypes.SAND) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index a76066adf..bf37a4d9c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -22,11 +22,11 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.function.RegionFunction; +import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.function.RegionFunction; -import com.sk89q.worldedit.util.TreeGenerator; /** * Generates forests by searching for the ground starting from the given upper Y @@ -53,10 +53,10 @@ public class ForestGenerator implements RegionFunction { BlockStateHolder block = editSession.getBlock(position); BlockType t = block.getBlockType(); - if (t == BlockTypes.GRASS || t == BlockTypes.DIRT) { + if (t == BlockTypes.GRASS_BLOCK || t == BlockTypes.DIRT) { treeType.generate(editSession, position.add(0, 1, 0)); return true; - } else if (t == BlockTypes.TALL_GRASS || t == BlockTypes.DEAD_BUSH || t == BlockTypes.POPPY || t == BlockTypes.DANDELION) { // TODO: This list needs to be moved + } else if (t == BlockTypes.GRASS || t == BlockTypes.DEAD_BUSH || t == BlockTypes.POPPY || t == BlockTypes.DANDELION) { // TODO: This list needs to be moved editSession.setBlock(position, BlockTypes.AIR.getDefaultState()); treeType.generate(editSession, position); return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index ad9d906fb..b23af44ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -163,7 +163,7 @@ public class GardenPatchGenerator implements RegionFunction { position = position.add(0, 1, 0); } - if (editSession.getBlock(position.add(0, -1, 0)).getBlockType() != BlockTypes.GRASS) { + if (editSession.getBlock(position.add(0, -1, 0)).getBlockType() != BlockTypes.GRASS_BLOCK) { return false; } @@ -187,7 +187,7 @@ public class GardenPatchGenerator implements RegionFunction { * @return a pumpkin pattern */ public static Pattern getPumpkinPattern() { - return new BlockPattern(BlockTypes.CARVED_PUMPKIN.getDefaultState()); + return new BlockPattern(BlockTypes.PUMPKIN.getDefaultState()); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java index 3a7d89aa2..dbb3f28cc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.extent.Extent; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.extent.Extent; + /** * An abstract implementation of {@link Mask} that takes uses an {@link Extent}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java index b1d8be833..d7bf33c8a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.biome.BaseBiome; @@ -28,8 +30,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Tests true if the biome at applied points is the same as the one given. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java index f44ce27e6..0eee90887 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMask.java @@ -19,17 +19,18 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.Vector; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockStateHolder; -import javax.annotation.Nullable; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * A mask that checks whether blocks at the given positions are matched by diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java index fe35ff1ef..3622926e3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkArgument; + import com.sk89q.worldedit.Vector; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkArgument; - /** * Has the criteria where the Y value of passed positions must be within * a certain range of Y values (inclusive). diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java index c942ddc5c..552197d10 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java @@ -19,9 +19,9 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockTypes; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java index d1d1e374b..d662e0fa3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.internal.expression.ExpressionException; @@ -27,8 +29,6 @@ import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A mask that evaluates an expression. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java index 52fc28c57..2b4031ca8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.internal.expression.runtime.EvaluationException; -import static com.google.common.base.Preconditions.checkNotNull; - public class ExpressionMask2D extends AbstractMask2D { private final Expression expression; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java index bf6d904b2..8b47e2c2c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/FuzzyBlockMask.java @@ -21,8 +21,8 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.Blocks; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.Collection; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java index 2d1fadaaa..5968b3b6c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection.java @@ -19,9 +19,10 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -29,7 +30,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Combines several masks and requires that all masks return true diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java index 75905f49f..07e43be38 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import java.util.Arrays; @@ -26,8 +28,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Tests true if all contained masks test true. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java index 941cf0c14..a54794255 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskUnion.java @@ -21,11 +21,12 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import javax.annotation.Nullable; + /** * Combines several masks and requires that one or more masks return true * when a certain position is tested. It serves as a logical OR operation diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java index 82b5a5176..007520485 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/Masks.java @@ -19,12 +19,13 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Various utility functions related to {@link Mask} and {@link Mask2D}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java index 61dd7b73a..04c793bde 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.math.noise.NoiseGenerator; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A mask that uses a noise generator and returns true whenever the noise * generator returns a value above the given density. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java index 6a2146c58..fdcbcd59b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.Vector2D; -import com.sk89q.worldedit.math.noise.NoiseGenerator; - import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector2D; +import com.sk89q.worldedit.math.noise.NoiseGenerator; + /** * A mask that uses a noise generator and returns true whenever the noise * generator returns a value above the given density. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java index b5358cb30..d8d3d455f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Checks whether another mask tests true for a position that is offset * a given vector. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java index 50d2835ba..74daead9d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.Vector2D; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector2D; + /** * Checks whether another mask tests true for a position that is offset * a given vector. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java index 1ddf891fe..7d2d78dfc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.function.mask; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.regions.Region; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A mask that tests whether given positions are contained within a region. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java index 7137ca221..917c22f36 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/SolidBlockMask.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockState; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java index 6db38a2d8..1f3bf2a22 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/BlockMapEntryPlacer.java @@ -19,18 +19,18 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.Iterator; import java.util.List; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Sets block from an iterator of {@link Map.Entry} containing a * {@link BlockVector} as the key and a {@link BaseBlock} as the value. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java index 93c0348e2..54ea500f0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ChangeSetExecutor.java @@ -19,16 +19,16 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.history.UndoContext; import com.sk89q.worldedit.history.change.Change; import com.sk89q.worldedit.history.changeset.ChangeSet; -import com.sk89q.worldedit.history.UndoContext; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Performs an undo or redo from a given {@link ChangeSet}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java index 509b103c1..69560ec56 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Executes a delegete operation, but returns to another operation upon * completing the delegate. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java index f4b2a95d7..53e79fa3d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Lists; import com.sk89q.worldedit.WorldEditException; @@ -27,8 +29,6 @@ import java.util.Collection; import java.util.Deque; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Executes multiple queues in order. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java index 66f112a61..ebab2aa5f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.pattern; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A pattern that returns the same {@link BaseBlock} each time. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java index 708f2bb4e..6f08d5b34 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/ClipboardPattern.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.pattern; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extent.clipboard.Clipboard; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.extent.clipboard.Clipboard; +import com.sk89q.worldedit.world.block.BlockStateHolder; + /** * A pattern that reads from {@link Clipboard}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java index e27d0d274..c28c147f9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.pattern; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.world.block.BlockStateHolder; @@ -26,8 +28,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Uses a random pattern of a weighted list of patterns. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java index 6a9581ff3..659fef612 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RepeatingExtentPattern.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.pattern; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.extent.Extent; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.extent.Extent; +import com.sk89q.worldedit.world.block.BlockStateHolder; + /** * Returns the blocks from {@link Extent}, repeating when out of bounds. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java index c01e9bc9d..6a21a50c3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.util; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.FlatRegionFunction; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Offsets the position parameter by adding a given offset vector. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java index 4d5338eaf..c1f395be6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.util; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.RegionFunction; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Offsets the position parameter by adding a given offset vector. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java index 84d8ab366..1601caf40 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java @@ -19,16 +19,22 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.RegionFunction; +import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.RunContext; -import java.util.*; - -import static com.google.common.base.Preconditions.checkNotNull; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Queue; +import java.util.Set; /** * Performs a breadth-first search starting from points added with diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java index ae57a4418..3788d547d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.mask.Mask; import java.util.Collection; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Visits adjacent points on the same X-Z plane as long as the points * pass the given mask, and then executes the provided region diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java index b4c301ae4..c3ce36567 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.function.EntityFunction; @@ -28,8 +30,6 @@ import com.sk89q.worldedit.function.operation.RunContext; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Visits entities as provided by an {@code Iterator}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java index 23dd74e4e..1f0d96e42 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.FlatRegionFunction; @@ -28,8 +30,6 @@ import com.sk89q.worldedit.regions.FlatRegion; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Applies region functions to columns in a {@link FlatRegion}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/LayerVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/LayerVisitor.java index f128b1301..b6dcf4882 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/LayerVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/LayerVisitor.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; @@ -31,9 +34,6 @@ import com.sk89q.worldedit.regions.FlatRegion; import java.util.List; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Visits the layers within a region. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java index 79bef13b4..ac89393a3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.visitor; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.mask.Mask; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An implementation of an {@link BreadthFirstSearch} that uses a mask to * determine where a block should be visited. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java index caec36d7d..d6fc7d45c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java @@ -21,8 +21,8 @@ package com.sk89q.worldedit.function.visitor; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.RegionFunction; +import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.RunContext; import com.sk89q.worldedit.regions.Region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java index a1761f833..4bb94aa09 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.history.change; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.history.UndoContext; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Represents a block change that may be undone or replayed. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java index f9f644fe1..006839291 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.history.change; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.history.changeset.ChangeSet; import com.sk89q.worldedit.history.UndoContext; +import com.sk89q.worldedit.history.changeset.ChangeSet; /** * Describes a change that can be undone or re-applied. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityCreate.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityCreate.java index 80d0bbcaa..e74f0cc84 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityCreate.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityCreate.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.history.change; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.history.UndoContext; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Logs the creation of an entity and removes the entity upon undo. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityRemove.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityRemove.java index eef480a91..79f79e31a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityRemove.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/EntityRemove.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.history.change; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.history.UndoContext; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Tracks the removal of an entity. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java index fb871a214..bc13a5755 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/ArrayListHistory.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.history.changeset; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Lists; import com.sk89q.worldedit.history.change.Change; @@ -26,8 +28,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Stores all {@link Change}s in an {@link ArrayList}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java index 982f8503d..3239789bc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/changeset/BlockOptimizedHistory.java @@ -19,20 +19,20 @@ package com.sk89q.worldedit.history.changeset; +import static com.google.common.base.Preconditions.checkNotNull; +import static java.util.Map.Entry; + import com.google.common.base.Function; import com.google.common.collect.Iterators; import com.sk89q.worldedit.BlockVector; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.history.change.BlockChange; import com.sk89q.worldedit.history.change.Change; import com.sk89q.worldedit.util.collection.TupleArrayList; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.ArrayList; import java.util.Iterator; -import static com.google.common.base.Preconditions.checkNotNull; -import static java.util.Map.Entry; - /** * An extension of {@link ArrayListHistory} that stores {@link BlockChange}s * separately in two {@link ArrayList}s. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java index 71c9751e7..a6371961f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java @@ -19,10 +19,15 @@ package com.sk89q.worldedit.internal.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.util.command.parametric.AbstractInvokeListener; @@ -35,8 +40,6 @@ import java.lang.reflect.Method; import java.util.logging.Handler; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Logs called commands to a logger. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java index 5e0bbdbb7..a93363295 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.internal.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extension.platform.Actor; @@ -33,8 +35,6 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Provides the names of connected users as suggestions. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java index 31e5f1a65..1d7d7d99b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/WorldEditBinding.java @@ -27,7 +27,6 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.NoMatchException; @@ -50,6 +49,7 @@ import com.sk89q.worldedit.util.command.parametric.ParameterException; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.Biomes; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.registry.BiomeRegistry; import java.util.Arrays; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java index d1810bc9f..b50997cc6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java @@ -26,7 +26,11 @@ import com.sk89q.worldedit.internal.expression.runtime.Conditional; import com.sk89q.worldedit.internal.expression.runtime.Operators; import com.sk89q.worldedit.internal.expression.runtime.RValue; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Map; /** * Helper classfor Parser. Contains processors for statements and operators. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java index 4f4f36ea6..506663a81 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java @@ -19,16 +19,16 @@ package com.sk89q.worldedit.internal.registry; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.NoMatchException; +import com.sk89q.worldedit.extension.input.ParserContext; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An abstract implementation of a factory for internal usage. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java index 059c95ba4..77c05c2e3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.internal.registry; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; /** * Input parser interface for {@link AbstractFactory}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java index c82570597..4f9f130c9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java @@ -22,7 +22,20 @@ package com.sk89q.worldedit.internal.util; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.NestedCommand; -import com.sk89q.worldedit.command.*; +import com.sk89q.worldedit.command.BiomeCommands; +import com.sk89q.worldedit.command.ChunkCommands; +import com.sk89q.worldedit.command.ClipboardCommands; +import com.sk89q.worldedit.command.GeneralCommands; +import com.sk89q.worldedit.command.GenerationCommands; +import com.sk89q.worldedit.command.HistoryCommands; +import com.sk89q.worldedit.command.NavigationCommands; +import com.sk89q.worldedit.command.RegionCommands; +import com.sk89q.worldedit.command.ScriptingCommands; +import com.sk89q.worldedit.command.SelectionCommands; +import com.sk89q.worldedit.command.SnapshotUtilCommands; +import com.sk89q.worldedit.command.ToolCommands; +import com.sk89q.worldedit.command.ToolUtilCommands; +import com.sk89q.worldedit.command.UtilityCommands; import java.io.File; import java.io.FileOutputStream; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java index a1bae435f..0cfd4c35f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/convolution/HeightMap.java @@ -24,9 +24,9 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.regions.Region; /** * Allows applications of Kernels onto the region's height map. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java index f953d3de6..f5f41313b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java @@ -21,13 +21,13 @@ package com.sk89q.worldedit.math.interpolation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A Kochanek-Bartels interpolation; continuous in the 2nd derivative. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java index 00fa7c12f..ea1962119 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java @@ -21,12 +21,12 @@ package com.sk89q.worldedit.math.interpolation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Simple linear interpolation. Mainly used for testing. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java index 7b67c6a86..d6920b829 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java @@ -21,6 +21,8 @@ package com.sk89q.worldedit.math.interpolation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import java.util.List; @@ -28,8 +30,6 @@ import java.util.Map.Entry; import java.util.TreeMap; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Reparametrises another interpolation function by arc length. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java index 46cd72177..646e2a209 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.math.transform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import java.util.ArrayList; @@ -26,8 +28,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Combines several transforms in order. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java index 71286507b..5d0412259 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.math.transform; -import com.sk89q.worldedit.util.Location; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.util.Location; + /** * Various utility methods related to {@link Transform}s. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java index 9bc7159f6..44f7070cb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java @@ -19,13 +19,19 @@ package com.sk89q.worldedit.regions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.regions.iterator.RegionIterator; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.storage.ChunkStore; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; public abstract class AbstractRegion implements Region { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java index 711d729d8..8269821c1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java @@ -19,7 +19,13 @@ package com.sk89q.worldedit.regions; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.storage.ChunkStore; @@ -27,9 +33,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An axis-aligned cuboid. It can be defined using two corners of the cuboid. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java index 7730b6756..5f1c9653e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java @@ -19,11 +19,17 @@ package com.sk89q.worldedit.regions; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.world.World; -import java.util.*; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Set; /** * A region that contains no points. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java index a84227075..ae72793a2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java @@ -25,10 +25,11 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.List; import java.util.Set; +import javax.annotation.Nullable; + /** * Represents a physical shape. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java index 1e7e723f6..52329f86c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java @@ -27,9 +27,10 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.List; +import javax.annotation.Nullable; + /** * Region selectors create {@link Region}s from a series of "selected points." * They are used, for example, to allow users to create a {@link CuboidRegion} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java index cff94d8cd..338d5f0e9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.regions; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; @@ -26,12 +28,11 @@ import com.sk89q.worldedit.math.transform.Identity; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Transforms another region according to a provided vector {@code Transform}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java index 7cfeff11e..8c6628616 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.regions.iterator; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.regions.FlatRegion; @@ -26,8 +28,6 @@ import com.sk89q.worldedit.regions.FlatRegion; import java.util.Iterator; import java.util.NoSuchElementException; -import static com.google.common.base.Preconditions.checkNotNull; - public class FlatRegion3DIterator implements Iterator { private Iterator flatIterator; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java index 6657613b2..60018afeb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.regions.iterator; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.regions.Region; import java.util.Iterator; -import static com.google.common.base.Preconditions.checkNotNull; - public class FlatRegionIterator implements Iterator { private Region region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java index 9d3b4542d..35700595c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.regions.iterator; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.regions.Region; import java.util.Iterator; -import static com.google.common.base.Preconditions.checkNotNull; - public class RegionIterator implements Iterator { private final Region region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java index 875af7659..3495fee83 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.regions.polyhedron; -import com.sk89q.worldedit.Vector; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector; + public class Edge { private final Vector start; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java index ed1ee46c8..01bd7f8ae 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.regions.polyhedron; -import com.sk89q.worldedit.Vector; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.Vector; + public class Triangle { private String tag = "Triangle"; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java index fdafcd41b..182c08f0f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java @@ -19,7 +19,12 @@ package com.sk89q.worldedit.regions.selector; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIRegion; import com.sk89q.worldedit.internal.cui.SelectionPointEvent; @@ -29,11 +34,10 @@ import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Creates a {@code CuboidRegion} from a user's selections. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java index 592d05f15..8e4ce873c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java @@ -19,21 +19,29 @@ package com.sk89q.worldedit.regions.selector; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.extension.platform.Actor; -import com.sk89q.worldedit.internal.cui.*; +import com.sk89q.worldedit.internal.cui.CUIRegion; +import com.sk89q.worldedit.internal.cui.SelectionCylinderEvent; +import com.sk89q.worldedit.internal.cui.SelectionMinMaxEvent; +import com.sk89q.worldedit.internal.cui.SelectionPointEvent; import com.sk89q.worldedit.regions.CylinderRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Creates a {@code CylinderRegionSelector} from a user's selections. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java index e01e667da..ca32ac3dc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java @@ -19,7 +19,12 @@ package com.sk89q.worldedit.regions.selector; -import com.sk89q.worldedit.*; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIRegion; import com.sk89q.worldedit.internal.cui.SelectionEllipsoidPointEvent; @@ -30,11 +35,10 @@ import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Creates a {@code EllipsoidRegionSelector} from a user's selections. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java index c1eb744d6..7629637d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java @@ -22,9 +22,9 @@ package com.sk89q.worldedit.regions.shape; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Generates solid and hollow shapes according to materials returned by the diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java index ba5d8d587..e8419cf00 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.regions.shape; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Generates solid and hollow shapes according to materials returned by the diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java index 6f5cb958a..8757235a3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/WorldEditExpressionEnvironment.java @@ -53,7 +53,7 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { @Override public int getBlockData(double x, double y, double z) { - return editSession.getLazyBlock(new Vector(x, y, z)).getData(); + return 0; } @Override @@ -63,7 +63,7 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { @Override public int getBlockDataAbs(double x, double y, double z) { - return editSession.getLazyBlock(new Vector(x, y, z)).getData(); + return 0; } @Override @@ -73,7 +73,7 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { @Override public int getBlockDataRel(double x, double y, double z) { - return editSession.getLazyBlock(new Vector(x, y, z)).getData(); + return 0; } public void setCurrentBlock(Vector current) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java index 8079bae0e..75e0765c4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java @@ -21,9 +21,6 @@ package com.sk89q.worldedit.registry.state; import static com.google.common.base.Preconditions.checkState; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - import java.util.List; public abstract class AbstractProperty implements Property { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java index 125220020..98c62ec59 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java @@ -19,14 +19,20 @@ package com.sk89q.worldedit.scripting; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.DisallowedItemException; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.UnknownItemException; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.command.InsufficientArgumentsException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.io.file.FilenameException; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.io.File; import java.util.ArrayList; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java index fbadc0fa1..e86ae6efc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.scripting; import java.util.Map; + import javax.script.ScriptException; public interface CraftScriptEngine { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java index 7f3354bbc..79d51cefb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java @@ -19,8 +19,7 @@ package com.sk89q.worldedit.scripting; -import java.util.Map; -import javax.script.ScriptException; +import com.sk89q.worldedit.WorldEditException; import org.mozilla.javascript.Context; import org.mozilla.javascript.ImporterTopLevel; import org.mozilla.javascript.JavaScriptException; @@ -29,7 +28,9 @@ import org.mozilla.javascript.Scriptable; import org.mozilla.javascript.ScriptableObject; import org.mozilla.javascript.WrappedException; -import com.sk89q.worldedit.WorldEditException; +import java.util.Map; + +import javax.script.ScriptException; public class RhinoCraftScriptEngine implements CraftScriptEngine { private int timeLimit; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java index bf64e4e12..afab20c3a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java @@ -19,6 +19,14 @@ package com.sk89q.worldedit.scripting.java; +import com.sk89q.worldedit.scripting.RhinoContextFactory; +import org.mozilla.javascript.Context; +import org.mozilla.javascript.ImporterTopLevel; +import org.mozilla.javascript.JavaScriptException; +import org.mozilla.javascript.RhinoException; +import org.mozilla.javascript.Scriptable; +import org.mozilla.javascript.ScriptableObject; + import java.io.IOException; import java.io.Reader; @@ -30,14 +38,6 @@ import javax.script.ScriptEngineFactory; import javax.script.ScriptException; import javax.script.SimpleBindings; -import org.mozilla.javascript.Context; -import org.mozilla.javascript.ImporterTopLevel; -import org.mozilla.javascript.JavaScriptException; -import org.mozilla.javascript.RhinoException; -import org.mozilla.javascript.Scriptable; -import org.mozilla.javascript.ScriptableObject; -import com.sk89q.worldedit.scripting.RhinoContextFactory; - public class RhinoScriptEngine extends AbstractScriptEngine { private ScriptEngineFactory factory; private Context cx; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java index 89cca721e..ee312229c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.scripting.java; import java.util.ArrayList; import java.util.Collections; import java.util.List; + import javax.script.ScriptEngine; import javax.script.ScriptEngineFactory; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java index d59dc5eb0..aa9b9e5df 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.session; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; @@ -35,7 +37,6 @@ import com.sk89q.worldedit.util.concurrency.EvenMoreExecutors; import com.sk89q.worldedit.util.eventbus.Subscribe; import com.sk89q.worldedit.world.gamemode.GameModes; -import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.util.HashMap; @@ -48,7 +49,7 @@ import java.util.concurrent.Callable; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Session manager for WorldEdit. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java index b6392f093..72ae6ef2b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java @@ -19,7 +19,12 @@ package com.sk89q.worldedit.session.request; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.regions.NullRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionOperationException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java index 962ae4426..d7b2a9893 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.session.storage; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonIOException; @@ -38,8 +40,6 @@ import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Stores sessions as JSON files in a directory. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java index 9f397c127..7e9160eb0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util; -import javax.annotation.Nullable; - import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; + /** * Helper methods for enums. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java index 927692140..b44850ca7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java @@ -21,13 +21,14 @@ package com.sk89q.worldedit.util; import com.sk89q.util.StringUtil; -import javax.swing.*; -import javax.swing.filechooser.FileFilter; import java.io.File; import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import javax.swing.JFileChooser; +import javax.swing.filechooser.FileFilter; + public final class FileDialogUtil { private FileDialogUtil() { } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java index 1e6fddbfa..861858aed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util; -import javax.annotation.Nullable; - import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; + public final class GuavaUtil { private GuavaUtil() {} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java index e48aa77c0..521545b37 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Location.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.util; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.extent.Extent; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Represents a location in a world with has a direction. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java index 03ba6f76c..a703e6baf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TargetBlock.java @@ -20,9 +20,9 @@ package com.sk89q.worldedit.util; import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockTypes; /** * This class uses an inefficient method to figure out what block a player @@ -102,7 +102,7 @@ public class TargetBlock { boolean searchForLastBlock = true; Location lastBlock = null; while (getNextBlock() != null) { - if (world.getLazyBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) { + if (world.getBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) { if (searchForLastBlock) { lastBlock = getCurrentBlock(); if (lastBlock.getBlockY() <= 0 || lastBlock.getBlockY() >= world.getMaxY()) { @@ -124,7 +124,7 @@ public class TargetBlock { * @return Block */ public Location getTargetBlock() { - while (getNextBlock() != null && world.getLazyBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) ; + while (getNextBlock() != null && world.getBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) ; return getCurrentBlock(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java index 2b7939363..c6ab2b7db 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java @@ -24,8 +24,6 @@ import com.sk89q.util.yaml.YAMLProcessor; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.session.SessionManager; -import com.sk89q.worldedit.world.registry.BundledItemData; -import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import java.io.IOException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java index d3bf38793..70c233704 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.util.collection; -import java.util.List; import java.util.ArrayList; -import java.util.Map; import java.util.Iterator; +import java.util.List; import java.util.ListIterator; +import java.util.Map; import java.util.NoSuchElementException; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java index 75aea6b29..3182502f6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.util.collection; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A fast iterator for lists that uses an internal index integer * and caches the size of the list. The size of the list cannot change diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java index 568db508e..a7f1405f8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.util.command; -import javax.annotation.Nullable; import java.util.Collection; import java.util.Set; +import javax.annotation.Nullable; + /** * Executes a command based on user input. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java index f121a2fe8..0ffbc4c1e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.util.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Thrown when a command is not used properly. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java index b7b980acf..bca779d4b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.util.command; -import javax.annotation.Nullable; import java.util.Comparator; import java.util.regex.Pattern; +import javax.annotation.Nullable; + /** * Compares the primary aliases of two {@link CommandMapping} using * {@link String#compareTo(String)}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java index 2a5ee0ccf..3a4d78edf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java @@ -28,9 +28,10 @@ import com.sk89q.worldedit.util.command.parametric.BindingHelper; import com.sk89q.worldedit.util.command.parametric.BindingMatch; import com.sk89q.worldedit.util.command.parametric.ParameterException; -import javax.annotation.Nullable; import java.lang.annotation.Annotation; +import javax.annotation.Nullable; + /** * Handles basic Java types such as {@link String}s, {@link Byte}s, etc. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java index 2309adb53..479a62d6f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java @@ -25,15 +25,16 @@ import com.google.common.collect.Maps; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.util.command.argument.CommandArgs; -import com.sk89q.worldedit.util.command.composition.FlagParser.FlagData; import com.sk89q.worldedit.util.command.argument.MissingArgumentException; +import com.sk89q.worldedit.util.command.composition.FlagParser.FlagData; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import javax.annotation.Nullable; + public class FlagParser implements CommandExecutor { private final Map> flags = Maps.newHashMap(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java index 6204422b4..422cd9982 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricBuilder.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.util.command.parametric; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.ImmutableBiMap.Builder; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; @@ -43,8 +45,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Creates commands using annotations placed on methods and individual parameters of * such methods. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java index d24ebbb8f..10932717d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java @@ -20,15 +20,30 @@ package com.sk89q.worldedit.util.command.parametric; import com.google.common.primitives.Chars; -import com.sk89q.minecraft.util.commands.*; -import com.sk89q.worldedit.util.command.*; +import com.sk89q.minecraft.util.commands.Command; +import com.sk89q.minecraft.util.commands.CommandContext; +import com.sk89q.minecraft.util.commands.CommandException; +import com.sk89q.minecraft.util.commands.CommandLocals; +import com.sk89q.minecraft.util.commands.CommandPermissions; +import com.sk89q.minecraft.util.commands.CommandPermissionsException; +import com.sk89q.minecraft.util.commands.WrappedCommandException; +import com.sk89q.worldedit.util.command.CommandCallable; +import com.sk89q.worldedit.util.command.InvalidUsageException; +import com.sk89q.worldedit.util.command.MissingParameterException; +import com.sk89q.worldedit.util.command.Parameter; +import com.sk89q.worldedit.util.command.SimpleDescription; +import com.sk89q.worldedit.util.command.UnconsumedParameterException; import com.sk89q.worldedit.util.command.binding.Switch; import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Type; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * The implementation of a {@link CommandCallable} for the {@link ParametricBuilder}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/StringArgumentStack.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/StringArgumentStack.java index 7d93070fa..9d4142adc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/StringArgumentStack.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/StringArgumentStack.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.util.command.parametric; import com.sk89q.minecraft.util.commands.CommandContext; -import com.sk89q.worldedit.util.command.MissingParameterException; import com.sk89q.util.StringUtil; +import com.sk89q.worldedit.util.command.MissingParameterException; /** * A virtual scope that does not actually read from the underlying diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java index 6488af945..aaafb4dc8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util.eventbus; -import java.lang.reflect.InvocationTargetException; - import static com.google.common.base.Preconditions.checkNotNull; +import java.lang.reflect.InvocationTargetException; + /** * Event handler object for {@link EventBus} that is able to dispatch * an event. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java index 5644e2aa3..92f1cb56b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java @@ -23,7 +23,11 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.sk89q.worldedit.internal.annotation.RequiresNewerGuava; -import java.util.*; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.WeakHashMap; /** * Holds a cache of class hierarchy. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java index a0575e83f..1d825927e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util.eventbus; -import java.lang.reflect.Method; - import static com.google.common.base.Preconditions.checkNotNull; +import java.lang.reflect.Method; + /** * Invokes a {@link Method} to dispatch an event. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java index 6616ea65e..88b3222ee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.util.eventbus; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + import java.lang.annotation.Retention; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.*; -import static java.lang.annotation.RetentionPolicy.*; - /** * Used to mark methods as event handlers. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java index c6fd71ddb..e46e6a7a4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.util.formatting; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Maps; import java.util.Map; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * All supported color values for chat. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java index adfbc1ec5..00a16c24e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandUsageBox.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.util.formatting.component; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extension.platform.CommandManager; import com.sk89q.worldedit.util.command.CommandCallable; @@ -28,12 +30,10 @@ import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.PrimaryAliasComparator; import com.sk89q.worldedit.util.formatting.StyledFragment; -import javax.annotation.Nullable; import java.util.ArrayList; -import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * A box to describe usage of a command. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java index 757006d7c..086ce05e9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.util.formatting.component; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.util.formatting.ColorCodeBuilder; import com.sk89q.worldedit.util.formatting.Style; import com.sk89q.worldedit.util.formatting.StyledFragment; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Makes for a box with a border above and below. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java index 723db8123..1020d92cd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java @@ -19,12 +19,13 @@ package com.sk89q.worldedit.util.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Function; -import javax.annotation.Nullable; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Provides a Levenshtein distance between a given string and each string diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java index ff1793082..2872aa48f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.util.io; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Throwables; @@ -31,8 +33,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.zip.ZipFile; -import static com.google.common.base.Preconditions.checkNotNull; - public final class Closer implements Closeable { private static final Logger logger = Logger.getLogger(Closer.class.getCanonicalName()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/DynamicStreamHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/DynamicStreamHandler.java index 500b77aef..0c9e89c8c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/DynamicStreamHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/DynamicStreamHandler.java @@ -19,9 +19,15 @@ package com.sk89q.worldedit.util.logging; -import javax.annotation.Nullable; import java.io.UnsupportedEncodingException; -import java.util.logging.*; +import java.util.logging.Filter; +import java.util.logging.Formatter; +import java.util.logging.Level; +import java.util.logging.LogRecord; +import java.util.logging.SimpleFormatter; +import java.util.logging.StreamHandler; + +import javax.annotation.Nullable; /** * A {@link StreamHandler} delegate that allows for the swap and disable of diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java index 05a4c8378..d48b3d89a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.util.logging; +import java.io.PrintWriter; +import java.io.StringWriter; import java.util.Date; import java.util.logging.Formatter; import java.util.logging.LogRecord; -import java.io.PrintWriter; -import java.io.StringWriter; /** * A standard logging format for WorldEdit. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index b506c20ce..d0c399c0d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -24,17 +24,15 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.util.Direction; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.BlockTypes; -import java.util.HashMap; import java.util.PriorityQueue; import javax.annotation.Nullable; @@ -65,8 +63,8 @@ public abstract class AbstractWorld implements World { @Override public Mask createLiquidMask() { return new BlockMask(this, - new BlockState(BlockTypes.LAVA, new HashMap<>()), - new BlockState(BlockTypes.WATER, new HashMap<>())); + BlockTypes.LAVA.getDefaultState().toFuzzy(), + BlockTypes.WATER.getDefaultState().toFuzzy()); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java index 4f7098f0e..328784589 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/NullWorld.java @@ -26,16 +26,15 @@ import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.weather.WeatherType; import java.util.Collections; @@ -125,11 +124,6 @@ public class NullWorld extends AbstractWorld { return BlockTypes.AIR.getDefaultState(); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(getBlock(position), this, position); - } - @Override public BaseBlock getFullBlock(Vector position) { return new BaseBlock(getBlock(position)); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index cf5ad39f7..ed0234e6c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -26,14 +26,14 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.TreeGenerator; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.weather.WeatherType; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java index 145d891cb..45018ed41 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.world.biome; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Function; import com.sk89q.worldedit.world.registry.BiomeRegistry; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Returns the name of a biome using a given {@code BiomeRegistry}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java index 8828d12f2..908a2ba67 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java @@ -27,7 +27,6 @@ import com.google.common.collect.Table; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.registry.state.Property; -import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -37,7 +36,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; -import java.util.stream.Collectors; /** * An immutable class that represents the state a block can be in. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java index a78ea896f..6094ac297 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java @@ -28,10 +28,10 @@ import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.storage.InvalidFormatException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java index ab3942463..8a581b7a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java @@ -22,9 +22,10 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BiomeData; -import javax.annotation.Nullable; import java.util.List; +import javax.annotation.Nullable; + /** * Provides information on biomes. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java index df22df349..a871a2812 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java @@ -23,7 +23,6 @@ import com.sk89q.worldedit.blocks.BlockMaterial; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockType; -import java.util.List; import java.util.Map; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index 6b1be416f..12d3ae2b1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -27,11 +27,11 @@ import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.input.ParserContext; +import com.sk89q.worldedit.util.gson.VectorAdapter; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; -import com.sk89q.worldedit.extension.input.ParserContext; -import com.sk89q.worldedit.util.gson.VectorAdapter; import java.io.IOException; import java.net.URL; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java index 8bbf7c1ff..551cbc039 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java @@ -22,10 +22,11 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BiomeData; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * A biome registry that knows nothing. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java index d087b5b28..6b9cafcb5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java @@ -22,7 +22,14 @@ package com.sk89q.worldedit.world.snapshot; import com.sk89q.worldedit.world.DataException; -import com.sk89q.worldedit.world.storage.*; +import com.sk89q.worldedit.world.storage.ChunkStore; +import com.sk89q.worldedit.world.storage.FileLegacyChunkStore; +import com.sk89q.worldedit.world.storage.FileMcRegionChunkStore; +import com.sk89q.worldedit.world.storage.TrueZipLegacyChunkStore; +import com.sk89q.worldedit.world.storage.TrueZipMcRegionChunkStore; +import com.sk89q.worldedit.world.storage.ZippedLegacyChunkStore; +import com.sk89q.worldedit.world.storage.ZippedMcRegionChunkStore; + import java.io.File; import java.io.IOException; import java.util.Calendar; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java index b3d499148..0c1887e37 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.world.snapshot; -import javax.annotation.Nullable; import java.io.File; import java.util.Calendar; +import javax.annotation.Nullable; + /** * A name parser attempts to make sense of a filename for a snapshot. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java index 2add97ec8..72650a408 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java @@ -23,7 +23,6 @@ package com.sk89q.worldedit.world.snapshot; import com.sk89q.worldedit.world.storage.MissingWorldException; -import javax.annotation.Nullable; import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; @@ -31,6 +30,8 @@ import java.util.Calendar; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * A repository contains zero or more snapshots. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java index 1ccfef753..d55e7815c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java @@ -31,7 +31,6 @@ import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.chunk.Chunk; import com.sk89q.worldedit.world.storage.ChunkStore; import com.sk89q.worldedit.world.storage.MissingChunkException; -import com.sk89q.worldedit.world.storage.MissingWorldException; import java.io.IOException; import java.util.ArrayList; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java index 12c8f6d63..568c4615e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java @@ -22,7 +22,7 @@ package com.sk89q.worldedit.world.storage; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.NBTInputStream; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.World; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java index ad10929ae..6b61bddf9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.world.storage; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.ListTag; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Utility methods for working with NBT data used in Minecraft. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java index 30c9fa41a..967e456ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java @@ -24,11 +24,11 @@ import com.sk89q.worldedit.world.DataException; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.util.Enumeration; import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; -import java.util.Enumeration; /** * Represents the chunk store used by Minecraft alpha but zipped. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java index b6c7ff569..e8979d06c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java @@ -26,11 +26,11 @@ import com.sk89q.worldedit.world.DataException; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.util.Enumeration; import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; -import java.util.Enumeration; /** * Represents the chunk store used by Minecraft alpha but zipped. diff --git a/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java b/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java index bcdf19dd2..2b9a50013 100644 --- a/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java +++ b/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java @@ -19,6 +19,12 @@ package com.sk89q.minecraft.util.commands; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import org.junit.Before; import org.junit.Test; @@ -27,8 +33,6 @@ import java.util.HashSet; import java.util.logging.Level; import java.util.logging.Logger; -import static org.junit.Assert.*; - public class CommandContextTest { private static final Logger log = Logger.getLogger(CommandContextTest.class.getCanonicalName()); diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java index fea68dbf0..51d50f93b 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java @@ -19,8 +19,10 @@ package com.sk89q.worldedit; -import org.junit.*; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; public class VectorTest { @Test diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java index d60ed68f9..1d0456d01 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/internal/expression/ExpressionTest.java @@ -19,17 +19,17 @@ package com.sk89q.worldedit.internal.expression; +import static java.lang.Math.atan2; +import static java.lang.Math.sin; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + import com.sk89q.worldedit.internal.expression.lexer.LexerException; import com.sk89q.worldedit.internal.expression.parser.ParserException; import com.sk89q.worldedit.internal.expression.runtime.EvaluationException; import com.sk89q.worldedit.internal.expression.runtime.ExpressionEnvironment; import org.junit.Test; -import static java.lang.Math.atan2; -import static java.lang.Math.sin; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - public class ExpressionTest { @Test public void testEvaluate() throws ExpressionException { diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java index 1acdbc892..b7944d476 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.util; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.world.World; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; - /** * Tests {@link Location}. */ diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java index 38cd3c8ca..1ad0f10ca 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java @@ -20,16 +20,17 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.util.command.CommandMapping; - -import java.util.Arrays; -import java.util.List; -import javax.annotation.Nullable; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Nullable; + public class CommandWrapper extends CommandBase { private CommandMapping command; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommonProxy.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommonProxy.java index fbb07b9d2..18a7de68f 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommonProxy.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommonProxy.java @@ -19,9 +19,8 @@ package com.sk89q.worldedit.forge; -import net.minecraftforge.fml.common.network.NetworkRegistry; - import com.sk89q.worldedit.forge.gui.GuiHandler; +import net.minecraftforge.fml.common.network.NetworkRegistry; public class CommonProxy { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java index e637138f9..96efd1fe8 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java @@ -22,10 +22,10 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BiomeData; import com.sk89q.worldedit.world.registry.BiomeRegistry; +import net.minecraft.world.biome.Biome; import java.util.ArrayList; import java.util.List; -import net.minecraft.world.biome.Biome; /** * Provides access to biome data in Forge. diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java index 5d93dc942..54e28c244 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntity.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.forge; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -30,10 +32,9 @@ import com.sk89q.worldedit.world.entity.EntityTypes; import net.minecraft.entity.EntityList; import net.minecraft.nbt.NBTTagCompound; -import javax.annotation.Nullable; import java.lang.ref.WeakReference; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; class ForgeEntity implements Entity { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java index d5e543ca9..bf6a16ae2 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityProperties.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.forge; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.metadata.EntityProperties; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; @@ -43,8 +45,6 @@ import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import static com.google.common.base.Preconditions.checkNotNull; - public class ForgeEntityProperties implements EntityProperties { private final Entity entity; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java index 15f4d6657..bc6820c0d 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePermissionsProvider.java @@ -19,12 +19,11 @@ package com.sk89q.worldedit.forge; -import org.spongepowered.api.entity.living.player.Player; - import net.minecraft.command.ICommand; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.GameType; import net.minecraftforge.fml.common.FMLCommonHandler; +import org.spongepowered.api.entity.living.player.Player; public interface ForgePermissionsProvider { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index 8de41de5d..d4b906fc4 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.forge; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; @@ -30,6 +29,7 @@ import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.item.ItemTypes; import io.netty.buffer.Unpooled; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java index bbdde9048..7b8737fd8 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.world.registry.BiomeRegistry; -import com.sk89q.worldedit.world.registry.ItemRegistry; import com.sk89q.worldedit.world.registry.BundledRegistries; +import com.sk89q.worldedit.world.registry.ItemRegistry; /** * World data for the Forge platform. diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 14d6bd107..5c717c3ff 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -32,10 +32,6 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.blocks.LazyBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.internal.Constants; @@ -46,6 +42,9 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.weather.WeatherType; import net.minecraft.block.Block; @@ -381,11 +380,6 @@ public class ForgeWorld extends AbstractWorld { return LegacyMapper.getInstance().getBlockFromLegacy(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state)); } - @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(getBlock(position), this, position); - } - @Override public BaseBlock getFullBlock(Vector position) { BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/InternalPacketHandler.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/InternalPacketHandler.java index 029ca2602..afac351ac 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/InternalPacketHandler.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/InternalPacketHandler.java @@ -19,14 +19,13 @@ package com.sk89q.worldedit.forge; -import java.nio.charset.Charset; - import com.sk89q.worldedit.forge.net.LeftClickAirEventMessage; - import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.relauncher.Side; +import java.nio.charset.Charset; + public class InternalPacketHandler { public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8"); public static SimpleNetworkWrapper CHANNEL; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java index a89d2edc2..76e726884 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/KeyHandler.java @@ -20,13 +20,11 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.forge.gui.GuiHandler; - import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent; - import org.lwjgl.input.Keyboard; public class KeyHandler { diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/NBTConverter.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/NBTConverter.java index 1b2eb4487..aef3956f4 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/NBTConverter.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/NBTConverter.java @@ -19,11 +19,40 @@ package com.sk89q.worldedit.forge; -import com.sk89q.jnbt.*; -import net.minecraft.nbt.*; +import com.sk89q.jnbt.ByteArrayTag; +import com.sk89q.jnbt.ByteTag; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.DoubleTag; +import com.sk89q.jnbt.EndTag; +import com.sk89q.jnbt.FloatTag; +import com.sk89q.jnbt.IntArrayTag; +import com.sk89q.jnbt.IntTag; +import com.sk89q.jnbt.ListTag; +import com.sk89q.jnbt.LongTag; +import com.sk89q.jnbt.ShortTag; +import com.sk89q.jnbt.StringTag; +import com.sk89q.jnbt.Tag; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagByte; +import net.minecraft.nbt.NBTTagByteArray; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.nbt.NBTTagEnd; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagInt; +import net.minecraft.nbt.NBTTagIntArray; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagLong; +import net.minecraft.nbt.NBTTagShort; +import net.minecraft.nbt.NBTTagString; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Set; /** * Converts between JNBT and Minecraft NBT classes. diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java index 77befeb4a..803407766 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java @@ -19,17 +19,18 @@ package com.sk89q.worldedit.forge; -import com.sk89q.worldedit.Vector; +import static com.google.common.base.Preconditions.checkNotNull; -import java.lang.reflect.Constructor; -import javax.annotation.Nullable; +import com.sk89q.worldedit.Vector; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagInt; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import static com.google.common.base.Preconditions.checkNotNull; +import java.lang.reflect.Constructor; + +import javax.annotation.Nullable; /** * Utility methods for setting tile entities in the world. diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java index 01f421c59..c6cf673e4 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/WECUIPacketHandler.java @@ -20,8 +20,6 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.LocalSession; - -import java.nio.charset.Charset; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.NetHandlerPlayServer; import net.minecraft.network.PacketBuffer; @@ -33,6 +31,8 @@ import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientCustomPacketE import net.minecraftforge.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; +import java.nio.charset.Charset; + public class WECUIPacketHandler { public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8"); public static FMLEventChannel WECUI_CHANNEL; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/LeftClickAirEventMessage.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/LeftClickAirEventMessage.java index 68deef4a2..7273439a3 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/LeftClickAirEventMessage.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/net/LeftClickAirEventMessage.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.forge.net; import com.sk89q.worldedit.forge.ForgeWorldEdit; - import io.netty.buffer.ByteBuf; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java index 863e48e9c..7be50e8d1 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/CUIChannelHandler.java @@ -23,7 +23,11 @@ import com.sk89q.worldedit.LocalSession; import org.spongepowered.api.Platform; import org.spongepowered.api.Sponge; import org.spongepowered.api.entity.living.player.Player; -import org.spongepowered.api.network.*; +import org.spongepowered.api.network.ChannelBinding; +import org.spongepowered.api.network.ChannelBuf; +import org.spongepowered.api.network.PlayerConnection; +import org.spongepowered.api.network.RawDataListener; +import org.spongepowered.api.network.RemoteConnection; import java.nio.charset.StandardCharsets; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeBiomeRegistry.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeBiomeRegistry.java index 606937b04..1b1955bdb 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeBiomeRegistry.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeBiomeRegistry.java @@ -25,10 +25,11 @@ import com.sk89q.worldedit.world.registry.BiomeRegistry; import org.spongepowered.api.Sponge; import org.spongepowered.api.world.biome.BiomeType; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nullable; + /** * Provides access to biome data in Sponge. */ diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java index a2a3fa138..bf1ceb7bd 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeCommandSender.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.sponge; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; @@ -30,12 +33,10 @@ import org.spongepowered.api.text.format.TextColor; import org.spongepowered.api.text.format.TextColors; import org.spongepowered.api.text.serializer.TextSerializers; -import javax.annotation.Nullable; import java.io.File; import java.util.UUID; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; public class SpongeCommandSender implements Actor { diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java index 1ec0f3a85..9aa728310 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeEntity.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.sponge; +import static com.google.common.base.Preconditions.checkNotNull; + import com.flowpowered.math.vector.Vector3d; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -28,10 +30,9 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.NullWorld; import org.spongepowered.api.world.World; -import javax.annotation.Nullable; import java.lang.ref.WeakReference; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; class SpongeEntity implements Entity { diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePermissionsProvider.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePermissionsProvider.java index 6b324ce80..d9970ecb1 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePermissionsProvider.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePermissionsProvider.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.sponge; import org.spongepowered.api.Sponge; import org.spongepowered.api.command.CommandCallable; import org.spongepowered.api.entity.living.player.Player; -import org.spongepowered.api.service.context.Contextual; import org.spongepowered.api.service.permission.PermissionDescription; import org.spongepowered.api.service.permission.PermissionService; import org.spongepowered.api.service.permission.SubjectReference; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index cc79d3e5e..37774dbc8 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -23,9 +23,6 @@ import com.flowpowered.math.vector.Vector3d; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.gamemode.GameMode; -import com.sk89q.worldedit.world.gamemode.GameModes; -import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extension.platform.AbstractPlayerActor; import com.sk89q.worldedit.extent.inventory.BlockBag; @@ -33,6 +30,9 @@ import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.gamemode.GameMode; +import com.sk89q.worldedit.world.gamemode.GameModes; +import com.sk89q.worldedit.world.item.ItemTypes; import org.spongepowered.api.Sponge; import org.spongepowered.api.data.type.HandTypes; import org.spongepowered.api.entity.living.player.Player; diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java index 5987a7335..a134e1ac3 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplAdapter.java @@ -25,9 +25,7 @@ import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.sponge.SpongeWorld; import com.sk89q.worldedit.util.Location; -import org.spongepowered.api.block.BlockType; import org.spongepowered.api.entity.Entity; -import org.spongepowered.api.item.ItemType; import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.world.World; import org.spongepowered.api.world.biome.BiomeType;