From e7c27b08bfa379e14a2dec90b5d94607f18d334a Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 13 Aug 2018 02:36:39 +1000 Subject: [PATCH] Remove stub injector methods --- .../sk89q/worldedit/bukkit/BukkitAdapter.java | 4 +- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 5 +- .../java/com/boydti/fawe/config/Commands.java | 4 -- .../jnbt/anvil/HeightMapMCAGenerator.java | 2 +- .../fawe/object/extent/RandomTransform.java | 5 -- .../object/visitor/DFSRecursiveVisitor.java | 4 -- .../main/java/com/sk89q/jnbt/CompoundTag.java | 4 +- .../com/sk89q/jnbt/CompoundTagBuilder.java | 4 +- .../src/main/java/com/sk89q/jnbt/ListTag.java | 4 +- .../java/com/sk89q/jnbt/NBTInputStream.java | 4 +- .../java/com/sk89q/jnbt/NBTOutputStream.java | 4 +- .../src/main/java/com/sk89q/jnbt/Tag.java | 4 +- .../main/java/com/sk89q/util/StringUtil.java | 40 ++++++++++---- .../java/com/sk89q/worldedit/EditSession.java | 4 +- .../com/sk89q/worldedit/LocalSession.java | 4 +- .../main/java/com/sk89q/worldedit/Vector.java | 4 +- .../worldedit/command/BrushCommands.java | 4 +- .../command/BrushOptionsCommands.java | 4 +- .../worldedit/command/ClipboardCommands.java | 4 +- .../command/FlattenedClipboardTransform.java | 4 +- .../worldedit/command/HistoryCommands.java | 4 +- .../worldedit/command/NavigationCommands.java | 4 +- .../worldedit/command/OptionsCommands.java | 4 +- .../worldedit/command/RegionCommands.java | 4 +- .../worldedit/command/SchematicCommands.java | 4 +- .../worldedit/command/ScriptingCommands.java | 4 +- .../worldedit/command/SelectionCommands.java | 4 +- .../sk89q/worldedit/command/ToolCommands.java | 4 +- .../command/composition/SelectionCommand.java | 4 +- .../worldedit/command/tool/AreaPickaxe.java | 4 +- .../worldedit/command/tool/BrushTool.java | 4 +- .../command/tool/FloatingTreeRemover.java | 21 ++++---- .../worldedit/command/tool/FloodFillTool.java | 22 ++++---- .../command/tool/RecursivePickaxe.java | 4 +- .../worldedit/command/tool/SinglePickaxe.java | 4 +- .../command/tool/brush/GravityBrush.java | 4 +- .../tool/brush/HollowCylinderBrush.java | 2 +- .../command/tool/brush/HollowSphereBrush.java | 2 +- .../com/sk89q/worldedit/entity/Player.java | 2 +- .../event/extent/EditSessionEvent.java | 4 +- .../extension/factory/BlockFactory.java | 4 +- .../extension/factory/DefaultMaskParser.java | 4 +- .../factory/DefaultTransformParser.java | 4 +- .../factory/HashTagPatternParser.java | 4 +- .../extension/factory/PatternFactory.java | 1 - .../factory/RandomPatternParser.java | 4 +- .../platform/AbstractPlayerActor.java | 6 +-- .../extension/platform/CommandManager.java | 4 +- .../extension/platform/PlatformManager.java | 4 +- .../extent/AbstractDelegateExtent.java | 4 +- .../sk89q/worldedit/extent/MaskingExtent.java | 4 +- .../sk89q/worldedit/extent/NullExtent.java | 2 +- .../extent/buffer/ForgetfulExtentBuffer.java | 4 +- .../extent/cache/LastAccessExtentCache.java | 14 ++--- .../extent/clipboard/BlockArrayClipboard.java | 4 +- .../extent/clipboard/io/ClipboardFormat.java | 4 +- .../extent/clipboard/io/SchematicReader.java | 4 +- .../worldedit/extent/inventory/BlockBag.java | 28 ++-------- .../extent/inventory/BlockBagExtent.java | 4 +- .../transform/BlockTransformExtent.java | 4 +- .../function/CombinedRegionFunction.java | 4 +- .../function/block/BlockReplace.java | 4 +- .../function/block/ExtentBlockCopy.java | 4 +- .../worldedit/function/block/Naturalizer.java | 4 +- .../function/entity/ExtentEntityCopy.java | 4 +- .../function/generator/FloraGenerator.java | 4 +- .../function/generator/ForestGenerator.java | 2 +- .../generator/GardenPatchGenerator.java | 4 +- .../function/mask/AbstractExtentMask.java | 54 +++++++++++++++---- .../worldedit/function/mask/AbstractMask.java | 4 +- .../worldedit/function/mask/BlockMask.java | 4 +- .../sk89q/worldedit/function/mask/Masks.java | 4 +- .../worldedit/function/mask/OffsetMask.java | 4 +- .../function/mask/SolidBlockMask.java | 4 +- .../function/operation/ChangeSetExecutor.java | 4 +- .../function/operation/ForwardExtentCopy.java | 4 +- .../function/operation/Operations.java | 4 +- .../function/pattern/AbstractPattern.java | 4 +- .../function/pattern/ClipboardPattern.java | 4 +- .../function/pattern/RandomPattern.java | 4 +- .../function/visitor/BreadthFirstSearch.java | 4 +- .../function/visitor/DownwardVisitor.java | 4 +- .../function/visitor/EntityVisitor.java | 4 +- .../function/visitor/FlatRegionVisitor.java | 4 +- .../function/visitor/LayerVisitor.java | 4 +- .../function/visitor/NonRisingVisitor.java | 4 +- .../function/visitor/RecursiveVisitor.java | 4 +- .../function/visitor/RegionVisitor.java | 4 +- .../internal/command/WorldEditBinding.java | 4 +- .../internal/expression/Expression.java | 4 +- .../runtime/ExpressionEnvironment.java | 4 +- .../internal/expression/runtime/Function.java | 4 +- .../expression/runtime/Functions.java | 4 +- .../worldedit/math/convolution/HeightMap.java | 4 +- .../KochanekBartelsInterpolation.java | 4 +- .../math/transform/AffineTransform.java | 4 +- .../sk89q/worldedit/regions/CuboidRegion.java | 4 +- .../ConvexPolyhedralRegionSelector.java | 4 +- .../selector/CuboidRegionSelector.java | 4 +- .../selector/CylinderRegionSelector.java | 4 +- .../selector/EllipsoidRegionSelector.java | 4 +- .../ExtendingCuboidRegionSelector.java | 4 +- .../selector/SphereRegionSelector.java | 4 +- .../shape/WorldEditExpressionEnvironment.java | 4 +- .../worldedit/session/ClipboardHolder.java | 4 +- .../sk89q/worldedit/session/PasteBuilder.java | 4 +- .../worldedit/session/SessionManager.java | 4 +- .../worldedit/session/request/Request.java | 4 +- .../com/sk89q/worldedit/util/TargetBlock.java | 6 +-- .../util/command/SimpleCommandMapping.java | 4 +- .../util/command/fluent/DispatcherNode.java | 4 +- .../parametric/ContextArgumentStack.java | 4 +- .../command/parametric/ParameterData.java | 4 +- .../command/parametric/ParametricBuilder.java | 4 +- .../parametric/ParametricCallable.java | 4 +- .../parametric/StringArgumentStack.java | 4 +- .../worldedit/util/formatting/Fragment.java | 4 +- .../formatting/component/CommandListBox.java | 4 +- .../formatting/component/CommandUsageBox.java | 4 +- .../util/formatting/component/MessageBox.java | 4 +- .../com/sk89q/worldedit/world/NullWorld.java | 8 +-- .../worldedit/world/biome/BaseBiome.java | 4 +- .../sk89q/worldedit/world/chunk/Chunk.java | 2 +- .../sk89q/worldedit/world/chunk/OldChunk.java | 12 +++-- 124 files changed, 241 insertions(+), 411 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java index ed23a4ff4..6070ec87d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java @@ -221,8 +221,6 @@ public class BukkitAdapter { return Material.getMaterial(itemType.getId().replace("minecraft:", "").toUpperCase()); } - private static boolean test; - /** * Create a Bukkit Material form a WorldEdit BlockType * @@ -314,7 +312,7 @@ public class BukkitAdapter { * @param itemStack The Bukkit ItemStack * @return The WorldEdit BlockState */ - public static BlockStateHolder asBlockState(ItemStack itemStack) { + public static BlockState asBlockState(ItemStack itemStack) { checkNotNull(itemStack); if (itemStack.getType().isBlock()) { return adapt(itemStack.getType().createBlockData()); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index c4ee5348f..ef6e392e8 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -34,6 +34,7 @@ import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameModes; +import jdk.nashorn.internal.ir.Block; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -67,11 +68,11 @@ public class BukkitPlayer extends AbstractPlayerActor { } @Override - public BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException { + public BlockState getBlockInHand(HandSide handSide) throws WorldEditException { ItemStack itemStack = handSide == HandSide.MAIN_HAND ? player.getInventory().getItemInMainHand() : player.getInventory().getItemInOffHand(); - return new BaseBlock(BukkitAdapter.asBlockState(itemStack)); + return BukkitAdapter.asBlockState(itemStack); } @Override diff --git a/worldedit-core/src/main/java/com/boydti/fawe/config/Commands.java b/worldedit-core/src/main/java/com/boydti/fawe/config/Commands.java index 0f4879a5f..a7f039b09 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/config/Commands.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/config/Commands.java @@ -180,8 +180,4 @@ public class Commands { return command.anyFlags(); } } - - public static Class inject() { - return Commands.class; - } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/HeightMapMCAGenerator.java b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/HeightMapMCAGenerator.java index 99f1e2603..59d91ff4f 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/HeightMapMCAGenerator.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/HeightMapMCAGenerator.java @@ -216,7 +216,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr main = new DifferentialArray(new int[getArea()]); int stone = BlockTypes.STONE.getInternalId(); - int grass = BlockTypes.GRASS.getInternalId(); + int grass = BlockTypes.GRASS_BLOCK.getInternalId(); Arrays.fill(main.getIntArray(), stone); Arrays.fill(floor.getIntArray(), grass); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/RandomTransform.java b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/RandomTransform.java index 5a3af33a4..d50ca6c47 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/RandomTransform.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/RandomTransform.java @@ -80,9 +80,4 @@ public class RandomTransform extends SelectTransform { public RandomCollection getCollection() { return collection; } - - public static Class inject() { - return RandomPattern.class; - } - } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSRecursiveVisitor.java b/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSRecursiveVisitor.java index fe71fad5b..a9ec075a9 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSRecursiveVisitor.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSRecursiveVisitor.java @@ -36,8 +36,4 @@ public class DFSRecursiveVisitor extends DFSVisitor { public boolean isVisitable(final Vector from, final Vector to) { return this.mask.test(to); } - - public static Class inject() { - return RecursiveVisitor.class; - } } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java index 4f6ff928a..6faf8f326 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java @@ -425,7 +425,5 @@ public final class CompoundTag extends Tag { return bldr.toString(); } - public static Class inject() { - return CompoundTag.class; - } + } \ No newline at end of file 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 0e6de34d3..83b044eb0 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java @@ -201,7 +201,5 @@ public class CompoundTagBuilder { return new CompoundTagBuilder(); } - public static Class inject() { - return CompoundTagBuilder.class; - } + } \ No newline at end of file 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 fbd49710b..c708b21fa 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java @@ -419,8 +419,6 @@ public final class ListTag extends Tag { return bldr.toString(); } - public static Class inject() { - return ListTag.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java index fb06a31de..b8034efed 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java @@ -611,7 +611,5 @@ public final class NBTInputStream implements Closeable { } } - public static Class inject() { - return NBTInputStream.class; - } + } 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 77c78ac05..3ba992ac0 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java @@ -409,7 +409,5 @@ public final class NBTOutputStream implements Closeable { if (os instanceof Flushable) ((Flushable) os).flush(); } - public static Class inject() { - return NBTOutputStream.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/Tag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/Tag.java index 9c86b692b..f6eaa35ea 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/Tag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/Tag.java @@ -35,9 +35,7 @@ public abstract class Tag { return getValue(); } - public static Class inject() { - return Tag.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java b/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java index 90bb2f5b6..f7b54c369 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java @@ -19,7 +19,9 @@ package com.sk89q.util; +import java.util.ArrayList; import java.util.Collection; +import java.util.List; import java.util.Map; /** @@ -32,7 +34,7 @@ public final class StringUtil { /** * Trim a string if it is longer than a certain length. - * + * * @param str the stirng * @param len the length to trim to * @return a new string @@ -47,7 +49,7 @@ public final class StringUtil { /** * Join an array of strings into a string. - * + * * @param str the string array * @param delimiter the delimiter * @param initialIndex the initial index to start form @@ -66,7 +68,7 @@ public final class StringUtil { /** * Join an array of strings into a string. - * + * * @param str the string array * @param delimiter the delimiter * @param initialIndex the initial index to start form @@ -74,7 +76,7 @@ public final class StringUtil { * @return a new string */ public static String joinQuotedString(String[] str, String delimiter, - int initialIndex, String quote) { + int initialIndex, String quote) { if (str.length == 0) { return ""; } @@ -90,7 +92,7 @@ public final class StringUtil { /** * Join an array of strings into a string. - * + * * @param str the string array * @param delimiter the delimiter * @return a new string @@ -101,7 +103,7 @@ public final class StringUtil { /** * Join an array of strings into a string. - * + * * @param str an array of objects * @param delimiter the delimiter * @param initialIndex the initial index to start form @@ -120,7 +122,7 @@ public final class StringUtil { /** * Join an array of strings into a string. - * + * * @param str a list of integers * @param delimiter the delimiter * @param initialIndex the initial index to start form @@ -217,7 +219,7 @@ public final class StringUtil { * calculated). (Note that the arrays aren't really copied anymore, just * switched...this is clearly much better than cloning an array or doing * a System.arraycopy() each time through the outer loop.) - * + * * Effectively, the difference between the two implementations is this * one does not cause an out of memory condition when calculating the LD * over two very large strings. @@ -301,4 +303,24 @@ public final class StringUtil { return type; } -} + + public static List parseListInQuotes(String[] input, char delimiter, char quoteOpen, char quoteClose) { + List parsableBlocks = new ArrayList<>(); + StringBuilder buffer = new StringBuilder(); + for (String split : input) { + if (split.indexOf(quoteOpen) != -1 && split.indexOf(quoteClose) == -1) { + buffer.append(split).append(delimiter); + } else if (split.indexOf(quoteClose) != -1 && split.indexOf(quoteOpen) == -1) { + buffer.append(split); + parsableBlocks.add(buffer.toString()); + buffer = new StringBuilder(); + } else if (buffer.length() == 0) { + parsableBlocks.add(split); + } else { + buffer.append(split).append(delimiter); + } + } + + return parsableBlocks; + } +} \ No newline at end of file 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 45cf4e859..579f2c27d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -3320,7 +3320,5 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, world.setWeather(weatherType, duration); } - public static Class inject() { - return EditSession.class; - } + } 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 7a62e8ce4..a65ed5dcb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -1369,7 +1369,5 @@ public class LocalSession implements TextureHolder { this.transform = transform; } - public static Class inject() { - return LocalSession.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/Vector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/Vector.java index 91906e638..1d6346e91 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/Vector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/Vector.java @@ -910,7 +910,5 @@ public class Vector extends Vector2D implements Comparable, Serializable this.z = stream.readDouble(); } - public static Class inject() { - return Vector.class; - } + } 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 1c0db76ef..78b85fc7d 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 @@ -868,7 +868,5 @@ public class BrushCommands extends BrushProcessor { .setSize(radius); } - public static Class inject() { - return BrushCommands.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushOptionsCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushOptionsCommands.java index 20ec925d7..1076a0d6b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushOptionsCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushOptionsCommands.java @@ -508,7 +508,5 @@ public class BrushOptionsCommands extends MethodCommands { BBC.BRUSH_SIZE.send(player); } - public static Class inject() { - return BrushOptionsCommands.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index dfb7dad9f..6ed0097b4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -595,7 +595,5 @@ public class ClipboardCommands extends MethodCommands { BBC.CLIPBOARD_CLEARED.send(player); } - public static Class inject() { - return ClipboardCommands.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/FlattenedClipboardTransform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/FlattenedClipboardTransform.java index 009983c3e..c22b3d4c1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/FlattenedClipboardTransform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/FlattenedClipboardTransform.java @@ -134,7 +134,5 @@ public class FlattenedClipboardTransform { return new FlattenedClipboardTransform(original, transform); } - public static Class inject() { - return FlattenedClipboardTransform.class; - } + } 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 a54e85914..04dbcab4d 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 @@ -298,7 +298,5 @@ public class HistoryCommands extends MethodCommands { BBC.COMMAND_HISTORY_CLEAR.send(player); } - public static Class inject() { - return HistoryCommands.class; - } + } \ No newline at end of file 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 5f4e4d912..0492dd40a 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 @@ -231,7 +231,5 @@ public class NavigationCommands { return forceGlass || (config.navigationUseGlass && !forceFlight); } - public static Class inject() { - return NavigationCommands.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java index 94c032cd9..ee1db0b6b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java @@ -313,7 +313,5 @@ public class OptionsCommands { } } - public static Class inject() { - return OptionsCommands.class; - } + } \ No newline at end of file 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 8aa66e8eb..3924546ca 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 @@ -789,7 +789,5 @@ public class RegionCommands extends MethodCommands { BBC.COMMAND_FLORA.send(player, ground.getAffected()); } - public static Class inject() { - return RegionCommands.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index 617366314..6529b6363 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -636,7 +636,5 @@ public class SchematicCommands extends MethodCommands { }); } - public static Class inject() { - return SchematicCommands.class; - } + } 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 d7ccee00c..a4ad5779b 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 @@ -219,7 +219,5 @@ public class ScriptingCommands { } } - public static Class inject() { - return ScriptingCommands.class; - } + } 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 9c46b8dcd..f252e4ca4 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 @@ -821,7 +821,5 @@ public class SelectionCommands { session.dispatchCUISelection(player); } - public static Class inject() { - return SelectionCommands.class; - } + } \ No newline at end of file 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 7989cfe42..51f5c5a1e 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 @@ -183,7 +183,5 @@ public class ToolCommands { BBC.TOOL_LRBUILD_INFO.send(player, secondary, primary); } - public static Class inject() { - return ToolCommands.class; - } + } \ No newline at end of file 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 dd1722443..5d9c4b95e 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 @@ -189,8 +189,6 @@ public class SelectionCommand extends SimpleCommand { return locals.get(Actor.class).hasPermission(permission); } - public static Class inject() { - return SelectionCommand.class; - } + } \ No newline at end of file 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 28d028b2c..a93a6f62c 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 @@ -59,7 +59,5 @@ public class AreaPickaxe implements BlockTool { return true; } - public static Class inject() { - return AreaPickaxe.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java index 63430140d..71d46a795 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java @@ -499,9 +499,7 @@ public class BrushTool implements DoubleActionTraceTool, ScrollTool, MovableTool return act(BrushAction.SECONDARY, server, config, player, session); } - public static Class inject() { - return BrushTool.class; - } + public void setScrollAction(ScrollAction scrollAction) { this.getContext().setScrollAction(scrollAction); 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 03b460a73..90397323e 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.BlockStateHolder; -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 BlockStateHolder AIR = BlockTypes.AIR.getDefaultState(); private int rangeSq; public FloatingTreeRemover() { @@ -67,10 +66,10 @@ public class FloatingTreeRemover implements BlockTool { @Override public boolean actPrimary(Platform server, LocalConfiguration config, - Player player, LocalSession session, Location clicked) { + Player player, LocalSession session, Location clicked) { final World world = (World) clicked.getExtent(); - final BlockStateHolder state = world.getBlock(clicked.toVector()); + final BlockState state = world.getBlock(clicked.toVector()); if (!isTreeBlock(state.getBlockType())) { player.printError("That's not a tree."); @@ -87,9 +86,9 @@ public class FloatingTreeRemover implements BlockTool { } for (Vector blockVector : blockSet) { - final BlockStateHolder otherState = editSession.getBlock(blockVector); + final BlockState otherState = editSession.getBlock(blockVector); if (isTreeBlock(otherState.getBlockType())) { - editSession.setBlock(blockVector, AIR); + editSession.setBlock(blockVector, BlockTypes.AIR.getDefaultState()); } } } catch (MaxChangedBlocksException e) { @@ -134,7 +133,7 @@ public class FloatingTreeRemover implements BlockTool { } if (visited.add(next)) { - BlockStateHolder state = world.getBlock(next); + BlockState state = world.getBlock(next); if (state.getBlockType() == BlockTypes.AIR || state.getBlockType() == BlockTypes.SNOW) { continue; } @@ -154,4 +153,4 @@ public class FloatingTreeRemover implements BlockTool { return visited; } -} +} \ No newline at end of file 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 7a84bb028..bd7b4d341 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 @@ -54,7 +54,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.getBlockType(clicked.toVector()); if (initialType.getMaterial().isAir()) { return true; @@ -67,7 +67,7 @@ public class FloodFillTool implements BlockTool { EditSession editSession = session.createEditSession(player); try { - recurse(server, editSession, world, clicked.toVector().toBlockVector(), + recurse(editSession, world, clicked.toVector().toBlockVector(), clicked.toVector(), range, initialType, new HashSet()); } catch (WorldEditException e) { throw new RuntimeException(e); @@ -77,7 +77,7 @@ public class FloodFillTool implements BlockTool { return true; } - private void recurse(Platform server, EditSession editSession, World world, BlockVector pos, Vector origin, int size, BlockType initialType, + private void recurse(EditSession editSession, World world, BlockVector pos, Vector origin, int size, BlockType initialType, Set visited) throws WorldEditException { if (origin.distance(pos) > size || visited.contains(pos)) { @@ -92,21 +92,19 @@ public class FloodFillTool implements BlockTool { return; } - recurse(server, editSession, world, pos.add(1, 0, 0).toBlockVector(), + recurse(editSession, world, pos.add(1, 0, 0).toBlockVector(), origin, size, initialType, visited); - recurse(server, editSession, world, pos.add(-1, 0, 0).toBlockVector(), + recurse(editSession, world, pos.add(-1, 0, 0).toBlockVector(), origin, size, initialType, visited); - recurse(server, editSession, world, pos.add(0, 0, 1).toBlockVector(), + recurse(editSession, world, pos.add(0, 0, 1).toBlockVector(), origin, size, initialType, visited); - recurse(server, editSession, world, pos.add(0, 0, -1).toBlockVector(), + recurse(editSession, world, pos.add(0, 0, -1).toBlockVector(), origin, size, initialType, visited); - recurse(server, editSession, world, pos.add(0, 1, 0).toBlockVector(), + recurse(editSession, world, pos.add(0, 1, 0).toBlockVector(), origin, size, initialType, visited); - recurse(server, editSession, world, pos.add(0, -1, 0).toBlockVector(), + recurse(editSession, world, pos.add(0, -1, 0).toBlockVector(), origin, size, initialType, visited); } - public static Class inject() { - return FloodFillTool.class; - } + } \ No newline at end of file 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 309d316c2..edfefdd06 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 @@ -63,7 +63,5 @@ public class RecursivePickaxe implements BlockTool { return true; } - public static Class inject() { - return RecursivePickaxe.class; - } + } \ No newline at end of file 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 3306a9d93..21176deb7 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 @@ -63,7 +63,5 @@ public class SinglePickaxe implements BlockTool { return true; } - public static Class inject() { - return SinglePickaxe.class; - } + } 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 5677e3668..0e21d43e0 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 @@ -65,8 +65,6 @@ public class GravityBrush implements Brush { } } - public static Class inject() { - return GravityBrush.class; - } + } 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 77effa95d..5955531bf 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 @@ -39,7 +39,7 @@ public class HollowCylinderBrush implements Brush { @Override public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException { if (pattern == null) { - pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); + pattern = BlockTypes.COBBLESTONE.getDefaultState(); } editSession.makeCylinder(position, pattern, size, size, height, false); } 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 ce34c9d91..6c689652c 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 @@ -33,7 +33,7 @@ public class HollowSphereBrush implements Brush { @Override public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException { if (pattern == null) { - pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE)); + pattern = BlockTypes.COBBLESTONE.getDefaultState(); } editSession.makeSphere(position, pattern, size, size, size, false); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index 2f162db4a..4b0543043 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -71,7 +71,7 @@ public interface Player extends Entity, Actor { * * @return the item id of the item the player is holding */ - BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException; + BlockState getBlockInHand(HandSide handSide) throws WorldEditException; /** * Gives the player an item. 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 f96577fcb..07fdec002 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 @@ -176,7 +176,5 @@ public class EditSessionEvent extends Event implements Cancellable { return clone; } - public static Class inject() { - return EditSessionEvent.class; - } + } 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 8ca95785d..53d131de7 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 @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory; +import com.sk89q.util.StringUtil; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; @@ -62,7 +63,8 @@ public class BlockFactory extends AbstractFactory { */ public Set parseFromListInput(String input, ParserContext context) throws InputParseException { Set blocks = new HashSet<>(); - for (String token : input.split(",")) { + String[] splits = input.split(","); + for (String token : StringUtil.parseListInQuotes(splits, ',', '[', ']')) { blocks.add(parseFromInput(token, context)); } return blocks; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java index 29ed9660c..4c1e2f741 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java @@ -163,7 +163,5 @@ public class DefaultMaskParser extends FaweParser { } } - public static Class inject() { - return DefaultMaskParser.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultTransformParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultTransformParser.java index 7604f79ce..c3faa2e56 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultTransformParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultTransformParser.java @@ -146,7 +146,5 @@ public class DefaultTransformParser extends FaweParser { } } - public static Class inject() { - return HashTagPatternParser.class; - } + } 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 dc51d29a1..4242b4be0 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 @@ -135,7 +135,5 @@ public class HashTagPatternParser extends FaweParser { } } - public static Class inject() { - return HashTagPatternParser.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/PatternFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/PatternFactory.java index 71225e7d1..1bf1b4785 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/PatternFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/PatternFactory.java @@ -42,7 +42,6 @@ public final class PatternFactory extends AbstractFactory { parsers.add(new HashTagPatternParser(worldEdit)); parsers.add(new SingleBlockPatternParser(worldEdit)); - parsers.add(new RandomPatternParser(worldEdit)); } } 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 8c9cd344d..cf3383c3a 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 @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory; +import com.sk89q.util.StringUtil; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockState; @@ -40,7 +41,8 @@ class RandomPatternParser extends InputParser { BlockFactory blockRegistry = worldEdit.getBlockFactory(); RandomPattern randomPattern = new RandomPattern(); - for (String token : input.split(",")) { + String[] splits = input.split(","); + for (String token : StringUtil.parseListInQuotes(splits, ',', '[', ']')) { BlockStateHolder block; double chance; 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 b57ae9371..ab38922cd 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 @@ -368,12 +368,12 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { } @Override - public BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException { + public BlockState getBlockInHand(HandSide handSide) throws WorldEditException { final ItemType typeId = getItemInHand(handSide).getType(); if (typeId.hasBlockType()) { - return new BaseBlock(typeId.getBlockType()); + return typeId.getBlockType().getDefaultState(); } else { - return new BaseBlock(BlockTypes.AIR); + return BlockTypes.AIR.getDefaultState(); } } 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 1573377a8..1147d03cc 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 @@ -522,7 +522,5 @@ public final class CommandManager { return commandLog; } - public static Class inject() { - return CommandManager.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index 574fcb716..53bbe3bb3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -521,8 +521,6 @@ public class PlatformManager { } } - public static Class inject() { - return PlatformManager.class; - } + } \ No newline at end of file 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 8f66642e0..43ed8caed 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 @@ -285,7 +285,5 @@ public class AbstractDelegateExtent implements LightingExtent { } } - public static Class inject() { - return AbstractDelegateExtent.class; - } + } 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 38105f450..a3d745c47 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 @@ -86,8 +86,6 @@ public class MaskingExtent extends AbstractDelegateExtent { return mask.test(mutable.setComponents(x, y, z)) && super.setBiome(x, y, z, biome); } - public static Class inject() { - return MaskingExtent.class; - } + } 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 5a0c9e09c..538bde2a2 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 @@ -83,7 +83,7 @@ public class NullExtent implements Extent { @Override public BlockState getLazyBlock(Vector position) { - return new LazyBlock(BlockTypes.AIR, this, position); + return BlockTypes.AIR.getDefaultState(); } @Override 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 95b1f1db9..9ea2e1fd6 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 @@ -49,8 +49,6 @@ import java.util.Map; */ public class ForgetfulExtentBuffer extends AbstractDelegateExtent implements Pattern { - private static final BlockStateHolder AIR = BlockTypes.AIR.getDefaultState(); - private final Map buffer = new LinkedHashMap<>(); private final Mask mask; private Vector min = null; @@ -110,7 +108,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 b8eb0c305..851cb192b 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,17 +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.world.block.BlockState; -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; -import com.sk89q.worldedit.world.block.BlockStateHolder; /** - * 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 { @@ -47,13 +43,13 @@ public class LastAccessExtentCache extends AbstractDelegateExtent { } @Override - public BlockState 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 { - BlockState block = super.getLazyBlock(position); + BlockState block = super.getBlock(position); this.lastBlock = new CachedBlock(blockVector, block); return block; } @@ -69,4 +65,4 @@ public class LastAccessExtentCache extends AbstractDelegateExtent { } } -} +} \ No newline at end of file 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 03a59528e..4165ac3b5 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 @@ -252,9 +252,7 @@ public class BlockArrayClipboard implements Clipboard, LightingExtent, Closeable return null; } - public static Class inject() { - return BlockArrayClipboard.class; - } + @Override public int getLight(int x, int y, int z) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java index 6dab02ecb..a1f629cf5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java @@ -558,7 +558,5 @@ public enum ClipboardFormat { return newEnum; } - public static Class inject() { - return ClipboardFormat.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java index 72977affd..489ce802f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java @@ -103,9 +103,7 @@ public class SchematicReader implements ClipboardReader { return expected.cast(test); } - public static Class inject() { - return SchematicReader.class; - } + @Override public void close() throws IOException { 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 aca4cce61..62c5713f0 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 @@ -38,7 +38,7 @@ public abstract class BlockBag { public void storeDroppedBlock(BlockState blockState) throws BlockBagException { BlockState dropped = blockState; // TODO BlockType.getBlockBagItem(id, data); if (dropped == null) return; - if (dropped.getBlockType() == BlockTypes.AIR) return; + if (dropped.getBlockType().getMaterial().isAir()) return; storeBlock(dropped); } @@ -52,29 +52,9 @@ public abstract class BlockBag { public void fetchPlacedBlock(BlockState blockState) throws BlockBagException { try { // Blocks that can't be fetched... -// TODO switch (id) { -// case BlockTypesBEDROCK: -// case BlockTypesGOLD_ORE: -// case BlockTypesIRON_ORE: -// case BlockTypesCOAL_ORE: -// case BlockTypesDIAMOND_ORE: -// case BlockTypesTNT: -// case BlockTypesMOB_SPAWNER: -// case BlockTypesCROPS: -// case BlockTypesREDSTONE_ORE: -// case BlockTypesGLOWING_REDSTONE_ORE: -// case BlockTypesSNOW: -// case BlockTypesLIGHTSTONE: -// case BlockTypesPORTAL: -// throw new UnplaceableBlockException(); -// -// case BlockTypesWATER: -// case BlockTypesSTATIONARY_WATER: -// case BlockTypesLAVA: -// case BlockTypesSTATIONARY_LAVA: -// // Override liquids -// return; -// } + if (blockState.getBlockType().getMaterial().isReplacedDuringPlacement()) { + return; + } fetchBlock(blockState); } catch (OutOfBlocksException e) { BlockState placed = blockState;// TODO BlockType.getBlockBagItem(id, data); 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 99fbd1ee0..2f2c5d81e 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 @@ -117,7 +117,5 @@ public class BlockBagExtent extends AbstractDelegateExtent { return getExtent().setBlock(x, y, z, block); } - public static Class inject() { - return BlockBagExtent.class; - } + } \ No newline at end of file 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 80f1f543f..6ec3c459b 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 @@ -268,7 +268,5 @@ public class BlockTransformExtent extends ResettableExtent { return super.setBlock(location, transformFastInverse((BlockState) block)); } - public static Class inject() { - return BlockTransformExtent.class; - } + } \ No newline at end of file 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 4bd92c1a9..be8602416 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 @@ -106,7 +106,5 @@ public class CombinedRegionFunction implements RegionFunction { } - public static Class inject() { - return CombinedRegionFunction.class; - } + } 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 32a1f3dde..6a21edc94 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 @@ -54,8 +54,6 @@ public class BlockReplace implements RegionFunction { return pattern.apply(extent, position, position); } - public static Class inject() { - return BlockReplace.class; - } + } \ No newline at end of file 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 da9a552f6..2ec5af6be 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 @@ -119,8 +119,6 @@ public class ExtentBlockCopy implements RegionFunction { return state; } - public static Class inject() { - return ExtentBlockCopy.class; - } + } 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 17c9644d2..b673d57f7 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 @@ -52,7 +52,7 @@ public class Naturalizer implements LayerFunction { public Naturalizer(EditSession editSession) { checkNotNull(editSession); this.editSession = editSession; - this.mask = new BlockTypeMask(editSession, BlockTypes.GRASS, BlockTypes.DIRT, BlockTypes.STONE); + this.mask = new BlockTypeMask(editSession, BlockTypes.GRASS_BLOCK, BlockTypes.DIRT, BlockTypes.STONE); } /** @@ -75,7 +75,7 @@ public class Naturalizer implements LayerFunction { affected++; switch (depth) { case 0: - editSession.setBlock(position, BlockTypes.GRASS); + editSession.setBlock(position, BlockTypes.GRASS_BLOCK); break; case 1: case 2: 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 9d62d345b..e49c3c142 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 @@ -203,8 +203,6 @@ public class ExtentEntityCopy implements EntityFunction { return state; } - public static Class inject() { - return ExtentEntityCopy.class; - } + } 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..6f2092d69 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 @@ -96,7 +96,7 @@ public class FloraGenerator implements RegionFunction { */ public static Pattern getTemperatePattern() { RandomPattern pattern = new RandomPattern(); - pattern.add(new BlockPattern(BlockTypes.GRASS.getDefaultState()), 300); + pattern.add(new BlockPattern(BlockTypes.GRASS_BLOCK.getDefaultState()), 300); pattern.add(new BlockPattern(BlockTypes.POPPY.getDefaultState()), 5); pattern.add(new BlockPattern(BlockTypes.DANDELION.getDefaultState()), 5); return pattern; @@ -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..a043e156a 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 @@ -53,7 +53,7 @@ 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 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 7e05f86c2..2cea1f29d 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 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 6b1cd991c..1d6eab112 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 @@ -1,25 +1,61 @@ +/* + * 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.function.mask; -import com.google.common.base.Preconditions; +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}. + */ public abstract class AbstractExtentMask extends AbstractMask { - private transient Extent extent; + private Extent extent; + + /** + * Construct a new mask. + * + * @param extent the extent + */ protected AbstractExtentMask(Extent extent) { - this.setExtent(extent); + setExtent(extent); } + /** + * Get the extent. + * + * @return the extent + */ public Extent getExtent() { - return this.extent; + return extent; } + /** + * Set the extent. + * + * @param extent the extent + */ public void setExtent(Extent extent) { - Preconditions.checkNotNull(extent); + checkNotNull(extent); this.extent = extent; } - public static Class inject() { - return AbstractExtentMask.class; - } -} +} \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractMask.java index 073b4c888..216184562 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractMask.java @@ -25,7 +25,5 @@ import java.io.Serializable; * A base class of {@link Mask} that all masks should inherit from. */ public abstract class AbstractMask implements Mask, Serializable { - public static Class inject() { - return AbstractMask.class; - } + } 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 f1efd22ae..dc1ef5b03 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 @@ -196,7 +196,5 @@ public class BlockMask extends AbstractExtentMask { return null; } - public static Class inject() { - return BlockMask.class; - } + } \ No newline at end of file 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 b9957d726..c51da2073 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 @@ -153,7 +153,5 @@ public final class Masks { } } - public static Class inject() { - return Masks.class; - } + } \ No newline at end of file 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 65732927b..96d50a8a7 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 @@ -87,7 +87,5 @@ public class OffsetMask extends AbstractMask { } } - public static Class inject() { - return OffsetMask.class; - } + } 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 7f3d6b622..41c8bf051 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 @@ -28,7 +28,5 @@ public class SolidBlockMask extends BlockTypeMask { return null; } - public static Class inject() { - return SolidBlockMask.class; - } + } \ No newline at end of file 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 8057659ce..9b871a066 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 @@ -114,7 +114,5 @@ public class ChangeSetExecutor implements Operation { return new ChangeSetExecutor(changeSet, Type.REDO, context, null, 0); } - public static Class inject() { - return ChangeSetExecutor.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java index df652ddaf..1cc0be51a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java @@ -377,7 +377,5 @@ public class ForwardExtentCopy implements Operation { public void addStatusMessages(List messages) { } - public static Class inject() { - return ForwardExtentCopy.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/Operations.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/Operations.java index 9756a1475..cbbe6c759 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/Operations.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/Operations.java @@ -80,7 +80,5 @@ public final class Operations { return; } - public static Class inject() { - return Operations.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/AbstractPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/AbstractPattern.java index f5b7662d9..b22a7cf6d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/AbstractPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/AbstractPattern.java @@ -6,7 +6,5 @@ public abstract class AbstractPattern implements Pattern, Serializable { public AbstractPattern() { } - public static Class inject() { - return AbstractPattern.class; - } + } 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 f42aef610..632fe21c6 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 @@ -49,7 +49,5 @@ public class ClipboardPattern extends AbstractPattern { return clipboard.getBlock(mutable); } - public static Class inject() { - return ClipboardPattern.class; - } + } \ No newline at end of file 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 71881c3f5..edd624fa1 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 @@ -72,8 +72,6 @@ public class RandomPattern extends AbstractPattern { return collection.next(get.getBlockX(), get.getBlockY(), get.getBlockZ()).apply(extent, set, get); } - public static Class inject() { - return RandomPattern.class; - } + } \ No newline at end of file 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 64ab90825..e371e4ff5 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 @@ -215,7 +215,5 @@ public abstract class BreadthFirstSearch implements Operation { public void cancel() { } - public static Class inject() { - return BreadthFirstSearch.class; - } + } 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 cb4f0b81c..7d91069d7 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 @@ -69,7 +69,5 @@ public class DownwardVisitor extends RecursiveVisitor { return ((fromY == this.baseY) || (to.getBlockY() - from.getBlockY() < 0)) && super.isVisitable(from, to); } - public static Class inject() { - return DownwardVisitor.class; - } + } 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 5494e26b1..7ea203462 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 @@ -83,7 +83,5 @@ public class EntityVisitor implements Operation { messages.add(BBC.VISITOR_ENTITY.format(getAffected())); } - public static Class inject() { - return Operations.class; - } + } 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 f676b021c..6a36fcdac 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 @@ -100,8 +100,6 @@ public class FlatRegionVisitor implements Operation { messages.add(BBC.VISITOR_FLAT.format(getAffected())); } - public static Class inject() { - return Operations.class; - } + } 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 2442e44b6..ee0a1d67a 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 @@ -132,7 +132,5 @@ public class LayerVisitor implements Operation { public void addStatusMessages(final List messages) { } - public static Class inject() { - return Operations.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/NonRisingVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/NonRisingVisitor.java index c7e19956b..31eae2177 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/NonRisingVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/NonRisingVisitor.java @@ -52,8 +52,6 @@ public class NonRisingVisitor extends RecursiveVisitor { directions.add(new Vector(0, -1, 0)); } - public static Class inject() { - return NonRisingVisitor.class; - } + } 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 d57d2b97c..ba45fbf7c 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 @@ -60,7 +60,5 @@ public class RecursiveVisitor extends BreadthFirstSearch { return this.mask.test(to); } - public static Class inject() { - return RecursiveVisitor.class; - } + } \ No newline at end of file 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 c4c853af6..11895274f 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 @@ -198,7 +198,5 @@ public class RegionVisitor implements Operation { messages.add(BBC.VISITOR_BLOCK.format(getAffected())); } - public static Class inject() { - return Operations.class; - } + } 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 ff04710b6..d2578fcf5 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 @@ -385,8 +385,6 @@ public class WorldEditBinding extends BindingHelper { } } - public static Class inject() { - return WorldEditBinding.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java index d71011642..070f73296 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java @@ -165,8 +165,6 @@ public class Expression { this.environment = environment; } - public static Class inject() { - return Expression.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/ExpressionEnvironment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/ExpressionEnvironment.java index f5bfb306d..17afffd7d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/ExpressionEnvironment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/ExpressionEnvironment.java @@ -34,7 +34,5 @@ public interface ExpressionEnvironment { int getBlockTypeRel(double x, double y, double z); int getBlockDataRel(double x, double y, double z); - public static Class inject() { - return ExpressionEnvironment.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Function.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Function.java index 5b94e7d82..f2d9090e0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Function.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Function.java @@ -121,7 +121,5 @@ public class Function extends Node { return this; } - public static Class inject() { - return Function.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java index f74709b62..612709ff7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java @@ -489,7 +489,5 @@ public final class Functions { return queryInternal(type, data, typeId, dataValue); } - public static Class inject() { - return Functions.class; - } + } 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 36a1b25d2..bf9533de7 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 @@ -288,8 +288,6 @@ public class HeightMap { return blocksChanged; } - public static Class inject() { - return HeightMap.class; - } + } 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 b8e9e42e0..ac58612ca 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 @@ -256,7 +256,5 @@ public class KochanekBartelsInterpolation implements Interpolation { return (int) Math.floor(position); } - public static Class inject() { - return KochanekBartelsInterpolation.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/AffineTransform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/AffineTransform.java index 341770c80..2bb5a63f5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/AffineTransform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/AffineTransform.java @@ -324,7 +324,5 @@ public class AffineTransform implements Transform, Serializable { mutable = new MutableBlockVector(); } - public static Class inject() { - return AffineTransform.class; - } + } \ No newline at end of file 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 b9b080286..69b7de440 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 @@ -655,7 +655,5 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion { return new CuboidRegion(origin.subtract(size), origin.add(size)); } - public static Class inject() { - return CuboidRegion.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java index ca0c525c2..c60313581 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java @@ -278,7 +278,5 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion } } - public static Class inject() { - return ConvexPolyhedralRegionSelector.class; - } + } 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 fdfd65f10..c595bc335 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 @@ -312,7 +312,5 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion { return "cuboid"; } - public static Class inject() { - return CuboidRegionSelector.class; - } + } \ No newline at end of file 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 e3396ec47..8c4fef073 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 @@ -284,7 +284,5 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion { return "cuboid"; } - public static Class inject() { - return CylinderRegionSelector.class; - } + } 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 1c8829bcd..b15d3627d 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 @@ -249,7 +249,5 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion { return region.getCenter().toBlockVector(); } - public static Class inject() { - return EllipsoidRegionSelector.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java index d13d6f6f8..41ee319da 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java @@ -142,7 +142,5 @@ public class ExtendingCuboidRegionSelector extends CuboidRegionSelector { explainRegionAdjust(player, session); } - public static Class inject() { - return ExtendingCuboidRegionSelector.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java index 4e45612ca..14dace6bf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java @@ -96,7 +96,5 @@ public class SphereRegionSelector extends EllipsoidRegionSelector { return "sphere"; } - public static Class inject() { - return SphereRegionSelector.class; - } + } 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 67d1aee91..a889d8d88 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 @@ -85,7 +85,5 @@ public class WorldEditExpressionEnvironment implements ExpressionEnvironment { this.current = current; } - public static Class inject() { - return WorldEditExpressionEnvironment.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/ClipboardHolder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/ClipboardHolder.java index 9a53199f8..ec1aedefc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/ClipboardHolder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/ClipboardHolder.java @@ -120,8 +120,6 @@ public class ClipboardHolder { clipboard = null; } - public static Class inject() { - return ClipboardHolder.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java index f118dd383..3284b9a95 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java @@ -132,7 +132,5 @@ public class PasteBuilder { return copy; } - public static Class inject() { - return PasteBuilder.class; - } + } 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 c2928b236..72c28df4a 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 @@ -325,9 +325,7 @@ public class SessionManager { } } - public static Class inject() { - return SessionManager.class; - } + } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/Request.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/Request.java index 1175228f8..8bb5d7354 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/Request.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/Request.java @@ -137,7 +137,5 @@ public final class Request { threadLocal.remove(); } - public static Class inject() { - return Request.class; - } + } 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 4e082935b..2ac640d5d 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 @@ -101,7 +101,7 @@ public class TargetBlock { boolean searchForLastBlock = true; Location lastBlock = null; while (getNextBlock() != null) { - if (world.getLazyBlock(getCurrentBlock().toVector()).getBlockType().getMaterial().isAir()) { + if (world.getBlockType(getCurrentBlock().toVector()).getMaterial().isAir()) { if (searchForLastBlock) { lastBlock = getCurrentBlock(); if (lastBlock.getBlockY() <= 0 || lastBlock.getBlockY() >= world.getMaxY()) { @@ -123,7 +123,7 @@ public class TargetBlock { * @return Block */ public Location getTargetBlock() { - while (getNextBlock() != null && world.getLazyBlock(getCurrentBlock().toVector()).getBlockType().getMaterial().isAir()) ; + while (getNextBlock() != null && world.getBlockType(getCurrentBlock().toVector()).getMaterial().isAir()) ; return getCurrentBlock(); } @@ -134,7 +134,7 @@ public class TargetBlock { * @return Block */ public Location getSolidTargetBlock() { - while (getNextBlock() != null && !world.getBlock(getCurrentBlock().toVector()).getBlockType().getMaterial().isMovementBlocker()) ; + while (getNextBlock() != null && !world.getBlockType(getCurrentBlock().toVector()).getMaterial().isMovementBlocker()) ; return getCurrentBlock(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleCommandMapping.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleCommandMapping.java index 903b88deb..d3ca796a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleCommandMapping.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleCommandMapping.java @@ -95,8 +95,6 @@ public class SimpleCommandMapping implements CommandMapping { '}'; } - public static Class inject() { - return SimpleCommandMapping.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/fluent/DispatcherNode.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/fluent/DispatcherNode.java index c6dc28a18..96bc98865 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/fluent/DispatcherNode.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/fluent/DispatcherNode.java @@ -191,7 +191,5 @@ public class DispatcherNode { return dispatcher; } - public static Class inject() { - return DispatcherNode.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ContextArgumentStack.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ContextArgumentStack.java index 5c32ed029..d971d6056 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ContextArgumentStack.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ContextArgumentStack.java @@ -177,8 +177,6 @@ public class ContextArgumentStack implements ArgumentStack { return context; } - public static Class inject() { - return ContextArgumentStack.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParameterData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParameterData.java index 764f6f991..316b3ebcb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParameterData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParameterData.java @@ -198,7 +198,5 @@ public class ParameterData extends SimpleParameter { } } - public static Class inject() { - return ParameterData.class; - } + } 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 0f94495c8..7293fa715 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 @@ -293,8 +293,6 @@ public class ParametricBuilder { this.defaultCompleter = defaultCompleter; } - public static Class inject() { - return ParametricBuilder.class; - } + } 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 dea1734c0..daae175e1 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 @@ -352,7 +352,5 @@ public class ParametricCallable extends AParametricCallable { } } - public static Class inject() { - return ParametricCallable.class; - } + } \ No newline at end of file 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 52bb1d504..7ecaeaeb8 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 @@ -151,7 +151,5 @@ public class StringArgumentStack implements ArgumentStack { return value; } - public static Class inject() { - return StringArgumentStack.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java index 299d15de8..4720cb41c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java @@ -89,7 +89,5 @@ public class Fragment { return builder.toString(); } - public static Class inject() { - return Fragment.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java index 68d130c07..b2dbac493 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java @@ -47,7 +47,5 @@ public class CommandListBox extends MessageBox { return this; } - public static Class inject() { - return CommandListBox.class; - } + } 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 81f593053..80747ab15 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 @@ -109,8 +109,6 @@ public class CommandUsageBox extends StyledFragment { append(box); } - public static Class inject() { - return CommandUsageBox.class; - } + } 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 5e033ee4c..65bbde07a 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 @@ -50,7 +50,5 @@ public class MessageBox extends StyledFragment { return contents; } - public static Class inject() { - return MessageBox.class; - } + } 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 f7525d3e5..407e0ecd9 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 @@ -127,13 +127,13 @@ public class NullWorld extends AbstractWorld { } @Override - public LazyBlock getLazyBlock(Vector position) { - return new LazyBlock(getBlock(position), this, position); + public BlockState getLazyBlock(Vector position) { + return getBlock(position); } @Override - public BaseBlock getFullBlock(Vector position) { - return new BaseBlock(getBlock(position)); + public BlockState getFullBlock(Vector position) { + return getBlock(position); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BaseBiome.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BaseBiome.java index 72d39c714..8bb7d977c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BaseBiome.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BaseBiome.java @@ -86,7 +86,5 @@ public class BaseBiome { } - public static Class inject() { - return BaseBiome.class; - } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/Chunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/Chunk.java index da2d63699..5e6042901 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/Chunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/Chunk.java @@ -36,6 +36,6 @@ public interface Chunk { * @return block the block * @throws DataException thrown on data error */ - BaseBlock getBlock(Vector position) throws DataException; + BlockState getBlock(Vector position) throws DataException; } 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 9f8ce45d2..7f7b5d90c 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 @@ -155,8 +155,8 @@ public class OldChunk implements Chunk { } @Override - public BaseBlock getBlock(Vector position) throws DataException { - if(position.getBlockY() >= 128) new BaseBlock(BlockTypes.AIR); + public BlockState getBlock(Vector position) throws DataException { + if(position.getBlockY() >= 128) return BlockTypes.AIR.getDefaultState(); int id, dataVal; int x = position.getBlockX() - rootX * 16; @@ -183,9 +183,11 @@ public class OldChunk implements Chunk { } BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(id, dataVal); - CompoundTag tileEntity = getBlockTileEntity(position); - - return new BaseBlock(state, tileEntity); + if (state.getBlockType().getMaterial().hasContainer()) { + CompoundTag tileEntity = getBlockTileEntity(position); + if (tileEntity != null) return new BaseBlock(state, tileEntity); + } + return state; } }