From c931095736e6df8e65a969ee1167c90a480c13e4 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 27 Aug 2018 17:24:18 +1000 Subject: [PATCH] Little bit of formatting --- .../minecraft/util/commands/Injector.java | 2 +- .../minecraft/util/commands/Logging.java | 2 +- .../java/com/sk89q/util/yaml/YAMLNode.java | 2 +- .../java/com/sk89q/worldedit/WorldEdit.java | 8 ++--- .../worldedit/blocks/metadata/MobType.java | 2 +- .../worldedit/command/ClipboardCommands.java | 1 - .../worldedit/command/tool/BlockTool.java | 2 +- .../command/tool/DoubleActionBlockTool.java | 2 +- .../command/tool/DoubleActionTraceTool.java | 2 +- .../command/tool/LongRangeBuildTool.java | 1 - .../sk89q/worldedit/command/tool/Tool.java | 2 +- .../worldedit/command/tool/TraceTool.java | 2 +- .../worldedit/command/tool/brush/Brush.java | 2 +- .../clipboard/io/MCEditSchematicReader.java | 1 - .../clipboard/io/SpongeSchematicReader.java | 1 - .../worldedit/extent/inventory/BlockBag.java | 1 - .../extent/inventory/BlockBagExtent.java | 1 - .../extent/world/SurvivalModeExtent.java | 1 - .../worldedit/function/EntityFunction.java | 2 +- .../function/FlatRegionFunction.java | 2 +- .../worldedit/function/RegionFunction.java | 2 +- .../function/mask/ExistingBlockMask.java | 1 - .../internal/annotation/Direction.java | 2 +- .../worldedit/internal/cui/CUIEvent.java | 4 +-- .../worldedit/internal/cui/CUIRegion.java | 10 +++--- .../internal/expression/Identifiable.java | 4 +-- .../internal/expression/runtime/LValue.java | 6 ++-- .../internal/expression/runtime/RValue.java | 6 ++-- .../internal/util/DocumentationPrinter.java | 4 +-- .../math/interpolation/Interpolation.java | 6 ++-- .../sk89q/worldedit/regions/FlatRegion.java | 6 ++-- .../worldedit/regions/RegionSelector.java | 32 +++++++++---------- .../regions/selector/RegionSelectorType.java | 2 +- .../scripting/CraftScriptEngine.java | 6 ++-- .../worldedit/session/SessionManager.java | 2 +- .../com/sk89q/worldedit/util/TargetBlock.java | 1 - .../worldedit/util/YAMLConfiguration.java | 2 +- .../worldedit/util/command/Parameter.java | 2 +- .../worldedit/util/formatting/Style.java | 8 ++--- .../worldedit/world/block/BaseBlock.java | 1 - .../worldedit/world/snapshot/Snapshot.java | 2 +- .../world/snapshot/SnapshotDateParser.java | 2 +- .../storage/TrueZipLegacyChunkStore.java | 2 +- .../storage/TrueZipMcRegionChunkStore.java | 4 +-- .../world/storage/ZippedLegacyChunkStore.java | 2 +- .../storage/ZippedMcRegionChunkStore.java | 4 +-- 46 files changed, 76 insertions(+), 86 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/Injector.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/Injector.java index 4978e8eeb..0ac9fb166 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/Injector.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/Injector.java @@ -35,6 +35,6 @@ public interface Injector { * @throws InstantiationException thrown on injection fault * @throws InvocationTargetException thrown on injection fault */ - public Object getInstance(Class cls) throws InvocationTargetException, IllegalAccessException, InstantiationException; + Object getInstance(Class cls) throws InvocationTargetException, IllegalAccessException, InstantiationException; } diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/Logging.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/Logging.java index dc64b5e16..d8d87dcc0 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/Logging.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/Logging.java @@ -31,7 +31,7 @@ import java.lang.annotation.RetentionPolicy; @Retention(RetentionPolicy.RUNTIME) public @interface Logging { - public enum LogMode { + enum LogMode { /** * Player position */ diff --git a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java index 677ca5ecb..d0e5fc0c7 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java +++ b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java @@ -151,7 +151,7 @@ public class YAMLNode { return; } - if (o == null || !(o instanceof Map)) { + if (!(o instanceof Map)) { // This will override existing configuration data! o = new LinkedHashMap(); node.put(parts[i], o); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 0ac44dbff..5d6233f23 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -481,10 +481,10 @@ public class WorldEdit { int size = missingBlocks.size(); int i = 0; - for (BlockType id : missingBlocks.keySet()) { - str.append(id.getName()); + for (Map.Entry blockTypeIntegerEntry : missingBlocks.entrySet()) { + str.append((blockTypeIntegerEntry.getKey()).getName()); - str.append(" [Amt: ").append(missingBlocks.get(id)).append("]"); + str.append(" [Amt: ").append(blockTypeIntegerEntry.getValue()).append("]"); ++i; @@ -559,7 +559,7 @@ public class WorldEdit { Request.reset(); String filename = f.getPath(); - int index = filename.lastIndexOf("."); + int index = filename.lastIndexOf('.'); String ext = filename.substring(index + 1); if (!ext.equalsIgnoreCase("js")) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/metadata/MobType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/metadata/MobType.java index fbd28b32a..762f39715 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/metadata/MobType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/metadata/MobType.java @@ -55,7 +55,7 @@ public enum MobType { private final String name; - private MobType(String name) { + MobType(String name) { this.name = name; } 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 edc6282a7..c3c7b827f 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 @@ -32,7 +32,6 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.function.block.BlockReplace; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockTool.java index a4dd8e78f..139fbd640 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockTool.java @@ -27,5 +27,5 @@ import com.sk89q.worldedit.util.Location; public interface BlockTool extends Tool { - public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked); + boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionBlockTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionBlockTool.java index b44c82191..78f1a5f3e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionBlockTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionBlockTool.java @@ -30,6 +30,6 @@ import com.sk89q.worldedit.util.Location; */ public interface DoubleActionBlockTool extends BlockTool { - public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked); + boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionTraceTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionTraceTool.java index 708d3d9e9..dde9cca86 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionTraceTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DoubleActionTraceTool.java @@ -29,6 +29,6 @@ import com.sk89q.worldedit.extension.platform.Platform; */ public interface DoubleActionTraceTool extends TraceTool { - public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session); + boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java index 0522e8579..445c5e158 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java @@ -29,7 +29,6 @@ import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; /** * A tool that can place (or remove) blocks at a distance. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/Tool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/Tool.java index 85b8460fd..2ed73209f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/Tool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/Tool.java @@ -34,6 +34,6 @@ public interface Tool { * @param actor the actor * @return true if use is permitted */ - public boolean canUse(Actor actor); + boolean canUse(Actor actor); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TraceTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TraceTool.java index 3728cd862..f02801fa5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TraceTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TraceTool.java @@ -26,5 +26,5 @@ import com.sk89q.worldedit.extension.platform.Platform; public interface TraceTool extends Tool { - public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session); + boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/Brush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/Brush.java index 71e6ea608..0caf07dbe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/Brush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/Brush.java @@ -38,6 +38,6 @@ public interface Brush { * @param size the size of the brush * @throws MaxChangedBlocksException */ - public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException; + void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java index aaa4b387e..f3e653827 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java @@ -33,7 +33,6 @@ import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java index c66203025..f0e8f1f25 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java @@ -35,7 +35,6 @@ import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; 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 b48e8d509..b7f43f363 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.extent.inventory; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockTypes; /** * Represents a source to get blocks from and store removed ones. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBagExtent.java index b528c1c79..95af3d0c8 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 @@ -26,7 +26,6 @@ import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; import java.util.HashMap; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java index 52682bdca..52fe0af5e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/SurvivalModeExtent.java @@ -27,7 +27,6 @@ import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; /** * Makes changes to the world as if a player had done so during survival mode. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/EntityFunction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/EntityFunction.java index f7048cd1a..6bbb669f0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/EntityFunction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/EntityFunction.java @@ -34,6 +34,6 @@ public interface EntityFunction { * @return true if something was changed * @throws WorldEditException thrown on an error */ - public boolean apply(Entity entity) throws WorldEditException; + boolean apply(Entity entity) throws WorldEditException; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionFunction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionFunction.java index 9fb8284cc..41144fc8f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionFunction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionFunction.java @@ -36,6 +36,6 @@ public interface FlatRegionFunction { * @return true if something was changed * @throws WorldEditException thrown on an error */ - public boolean apply(Vector2D position) throws WorldEditException; + boolean apply(Vector2D position) throws WorldEditException; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionFunction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionFunction.java index 4f769dce4..91276d237 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionFunction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionFunction.java @@ -34,6 +34,6 @@ public interface RegionFunction { * @return true if something was changed * @throws WorldEditException thrown on an error */ - public boolean apply(Vector position) throws WorldEditException; + boolean apply(Vector position) throws WorldEditException; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java index 07c4545fc..911b4ce69 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java @@ -21,7 +21,6 @@ package com.sk89q.worldedit.function.mask; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.world.block.BlockTypes; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java index 45d495bbd..6a8d96ccf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java @@ -34,6 +34,6 @@ import java.lang.annotation.Target; @Target(ElementType.PARAMETER) public @interface Direction { - public static final String AIM = "me"; + String AIM = "me"; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/CUIEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/CUIEvent.java index 14f3f2c03..7d880f907 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/CUIEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/CUIEvent.java @@ -21,7 +21,7 @@ package com.sk89q.worldedit.internal.cui; public interface CUIEvent { - public String getTypeId(); + String getTypeId(); - public String[] getParameters(); + String[] getParameters(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/CUIRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/CUIRegion.java index 84b740e39..bd06908ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/CUIRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/CUIRegion.java @@ -30,7 +30,7 @@ public interface CUIRegion { * value supplied by getProtocolVersion(). * */ - public void describeCUI(LocalSession session, Actor player); + void describeCUI(LocalSession session, Actor player); /** * Sends CUI events describing the region for @@ -38,7 +38,7 @@ public interface CUIRegion { * supplied by getProtocolVersion(). * */ - public void describeLegacyCUI(LocalSession session, Actor player); + void describeLegacyCUI(LocalSession session, Actor player); /** * Returns the CUI version that is required to send @@ -47,14 +47,14 @@ public interface CUIRegion { * * @return the protocol version */ - public int getProtocolVersion(); + int getProtocolVersion(); /** * Returns the type ID to send to CUI in the selection event. * * @return the type ID */ - public String getTypeID(); + String getTypeID(); /** * Returns the type ID to send to CUI in the selection @@ -62,5 +62,5 @@ public interface CUIRegion { * * @return the legacy type ID */ - public String getLegacyTypeID(); + String getLegacyTypeID(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Identifiable.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Identifiable.java index b23ba38c4..3b82842ea 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Identifiable.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Identifiable.java @@ -54,8 +54,8 @@ public interface Identifiable { * C - Switch * */ - public abstract char id(); + char id(); - public int getPosition(); + int getPosition(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/LValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/LValue.java index a0f71cadf..338cc74b2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/LValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/LValue.java @@ -27,12 +27,12 @@ import com.sk89q.worldedit.internal.expression.parser.ParserException; */ public interface LValue extends RValue { - public double assign(double value) throws EvaluationException; + double assign(double value) throws EvaluationException; @Override - public LValue optimize() throws EvaluationException; + LValue optimize() throws EvaluationException; @Override - public LValue bindVariables(Expression expression, boolean preferLValue) throws ParserException; + LValue bindVariables(Expression expression, boolean preferLValue) throws ParserException; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/RValue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/RValue.java index c47c5c98f..45a654bcd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/RValue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/RValue.java @@ -28,10 +28,10 @@ import com.sk89q.worldedit.internal.expression.parser.ParserException; */ public interface RValue extends Identifiable { - public double getValue() throws EvaluationException; + double getValue() throws EvaluationException; - public RValue optimize() throws EvaluationException; + RValue optimize() throws EvaluationException; - public RValue bindVariables(Expression expression, boolean preferLValue) throws ParserException; + RValue bindVariables(Expression expression, boolean preferLValue) throws ParserException; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java index 4f9f130c9..4728bc9b8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/util/DocumentationPrinter.java @@ -160,13 +160,13 @@ public final class DocumentationPrinter { stream.print(" || "); - if (cmd.flags() != null && !cmd.flags().equals("")) { + if (cmd.flags() != null && !cmd.flags().isEmpty()) { stream.print(cmd.flags()); } stream.print(" || "); - if (cmd.desc() != null && !cmd.desc().equals("")) { + if (cmd.desc() != null && !cmd.desc().isEmpty()) { stream.print(cmd.desc()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/Interpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/Interpolation.java index 89f0a8012..68df24b0d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/Interpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/Interpolation.java @@ -36,7 +36,7 @@ public interface Interpolation { * * @param nodes the nodes */ - public void setNodes(List nodes); + void setNodes(List nodes); /** * Gets the result of f(position) @@ -44,7 +44,7 @@ public interface Interpolation { * @param position the position to interpolate * @return the result */ - public Vector getPosition(double position); + Vector getPosition(double position); /** * Gets the result of f'(position). @@ -52,7 +52,7 @@ public interface Interpolation { * @param position the position to interpolate * @return the result */ - public Vector get1stDerivative(double position); + Vector get1stDerivative(double position); /** * Gets the result of ∫ab|f'(t)| dt.
diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/FlatRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/FlatRegion.java index 39fc6dcf0..92cdf6e36 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/FlatRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/FlatRegion.java @@ -28,19 +28,19 @@ public interface FlatRegion extends Region { * * @return the Y value */ - public int getMinimumY(); + int getMinimumY(); /** * Gets the maximum Y value * * @return the Y value */ - public int getMaximumY(); + int getMaximumY(); /** * Get this region as an iterable flat region. * * @return a flat region iterable */ - public Iterable asFlatRegion(); + Iterable asFlatRegion(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java index 52329f86c..278ae4815 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionSelector.java @@ -44,14 +44,14 @@ public interface RegionSelector { * @return a world, which may be null */ @Nullable - public World getWorld(); + World getWorld(); /** * Set the world for the region selector. * * @param world the world, which may be null */ - public void setWorld(@Nullable World world); + void setWorld(@Nullable World world); /** * Called when the first point is selected. @@ -59,7 +59,7 @@ public interface RegionSelector { * @param position the position * @return true if something changed */ - public boolean selectPrimary(Vector position, SelectorLimits limits); + boolean selectPrimary(Vector position, SelectorLimits limits); /** * Called when the second point is selected. @@ -67,7 +67,7 @@ public interface RegionSelector { * @param position the position * @return true if something changed */ - public boolean selectSecondary(Vector position, SelectorLimits limits); + boolean selectSecondary(Vector position, SelectorLimits limits); /** * Tell the player information about his/her primary selection. @@ -76,7 +76,7 @@ public interface RegionSelector { * @param session the session * @param position position */ - public void explainPrimarySelection(Actor actor, LocalSession session, Vector position); + void explainPrimarySelection(Actor actor, LocalSession session, Vector position); /** * Tell the player information about his/her secondary selection. @@ -85,7 +85,7 @@ public interface RegionSelector { * @param session the session * @param position position */ - public void explainSecondarySelection(Actor actor, LocalSession session, Vector position); + void explainSecondarySelection(Actor actor, LocalSession session, Vector position); /** * The the player information about the region's changes. This may resend @@ -94,7 +94,7 @@ public interface RegionSelector { * @param actor the actor * @param session the session */ - public void explainRegionAdjust(Actor actor, LocalSession session); + void explainRegionAdjust(Actor actor, LocalSession session); /** * Get the primary position. @@ -102,7 +102,7 @@ public interface RegionSelector { * @return the primary position * @throws IncompleteRegionException thrown if a region has not been fully defined */ - public BlockVector getPrimaryPosition() throws IncompleteRegionException; + BlockVector getPrimaryPosition() throws IncompleteRegionException; /** * Get the selection. @@ -110,51 +110,51 @@ public interface RegionSelector { * @return the created region * @throws IncompleteRegionException thrown if a region has not been fully defined */ - public Region getRegion() throws IncompleteRegionException; + Region getRegion() throws IncompleteRegionException; /** * Get the region even if it's not fully defined. * * @return an incomplete region object that is incomplete */ - public Region getIncompleteRegion(); + Region getIncompleteRegion(); /** * Returns whether the region has been fully defined. * * @return true if a selection is available */ - public boolean isDefined(); + boolean isDefined(); /** * Get the number of blocks inside the region. * * @return number of blocks, or -1 if undefined */ - public int getArea(); + int getArea(); /** * Update the selector with changes to the region. */ - public void learnChanges(); + void learnChanges(); /** * Clear the selection. */ - public void clear(); + void clear(); /** * Get a lowercase name of this region selector type. * * @return a lower case name of the type */ - public String getTypeName(); + String getTypeName(); /** * Get lines of information about the selection. * * @return a list of lines describing the region */ - public List getInformationLines(); + List getInformationLines(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/RegionSelectorType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/RegionSelectorType.java index 9ce56af45..03cae96a0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/RegionSelectorType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/RegionSelectorType.java @@ -36,7 +36,7 @@ public enum RegionSelectorType { private final Class selectorClass; - private RegionSelectorType(Class selectorClass) { + RegionSelectorType(Class selectorClass) { this.selectorClass = selectorClass; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java index e86ae6efc..8f946800f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java @@ -24,10 +24,10 @@ import java.util.Map; import javax.script.ScriptException; public interface CraftScriptEngine { - public void setTimeLimit(int milliseconds); + void setTimeLimit(int milliseconds); - public int getTimeLimit(); + int getTimeLimit(); - public Object evaluate(String script, String filename, Map args) + Object evaluate(String script, String filename, Map args) throws ScriptException, Throwable; } 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 929085bd5..0f5166a81 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 @@ -104,7 +104,7 @@ public class SessionManager { checkNotNull(name); for (SessionHolder holder : sessions.values()) { String test = holder.key.getName(); - if (test != null && name.equals(test)) { + if (name.equals(test)) { return holder.session; } } 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 27fce4979..be654ec17 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 @@ -22,7 +22,6 @@ package com.sk89q.worldedit.util; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.world.World; -import com.sk89q.worldedit.world.block.BlockTypes; /** * This class uses an inefficient method to figure out what block a player diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java index 84e0fc34e..41745a0aa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java @@ -120,7 +120,7 @@ public class YAMLConfiguration extends LocalConfiguration { } String type = config.getString("shell-save-type", "").trim(); - shellSaveType = type.equals("") ? null : type; + shellSaveType = type.isEmpty() ? null : type; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Parameter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Parameter.java index 1952f6c56..a2ac4e343 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Parameter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Parameter.java @@ -61,6 +61,6 @@ public interface Parameter { * * @return a default value, or null if none is set */ - public String[] getDefaultValue(); + String[] getDefaultValue(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java index e46e6a7a4..f705bb99a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java @@ -136,11 +136,11 @@ public enum Style { private final static Map BY_ID = Maps.newHashMap(); private final static Map BY_CHAR = Maps.newHashMap(); - private Style(char code, int intCode) { + Style(char code, int intCode) { this(code, intCode, false); } - private Style(char code, int intCode, boolean isFormat) { + Style(char code, int intCode, boolean isFormat) { this.code = code; this.intCode = intCode; this.isFormat = isFormat; @@ -183,7 +183,7 @@ public enum Style { * Gets the color represented by the specified color code * * @param code Code to check - * @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist + * @return Associative Style with the given code, or null if it doesn't exist */ public static Style getByChar(char code) { return BY_CHAR.get(code); @@ -193,7 +193,7 @@ public enum Style { * Gets the color represented by the specified color code * * @param code Code to check - * @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist + * @return Associative Style with the given code, or null if it doesn't exist */ public static Style getByChar(String code) { checkNotNull(code); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BaseBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BaseBlock.java index ed9261e64..aa3100326 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BaseBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BaseBlock.java @@ -25,7 +25,6 @@ import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.blocks.TileEntityBlock; -import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.registry.state.Property; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java index 6b9cafcb5..d3ca0c251 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java @@ -200,7 +200,7 @@ public class Snapshot implements Comparable { public int compareTo(Snapshot o) { if (o.date == null || date == null) { // Remove the folder from the name - int i = name.indexOf("/"), j = o.name.indexOf("/"); + int i = name.indexOf('/'), j = o.name.indexOf('/'); return name.substring((i > 0 ? 0 : i)).compareTo(o.name.substring((j > 0 ? 0 : j))); } else { return date.compareTo(o.date); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java index 0c1887e37..323bef842 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java @@ -36,6 +36,6 @@ public interface SnapshotDateParser { * @return date or null */ @Nullable - public Calendar detectDate(File file); + Calendar detectDate(File file); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipLegacyChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipLegacyChunkStore.java index 33e59f590..ea5cf9f9c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipLegacyChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipLegacyChunkStore.java @@ -88,7 +88,7 @@ public class TrueZipLegacyChunkStore extends LegacyChunkStore { // Detect subfolder for the world's files if (folder != null) { - if (!folder.equals("")) { + if (!folder.isEmpty()) { file = folder + "/" + file; } } else { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipMcRegionChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipMcRegionChunkStore.java index cc5378a4e..a22818c77 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipMcRegionChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/TrueZipMcRegionChunkStore.java @@ -87,7 +87,7 @@ public class TrueZipMcRegionChunkStore extends McRegionChunkStore { protected InputStream getInputStream(String name, String worldName) throws IOException, DataException { // Detect subfolder for the world's files if (folder != null) { - if (!folder.equals("")) { + if (!folder.isEmpty()) { name = folder + "/" + name; } } else { @@ -100,7 +100,7 @@ public class TrueZipMcRegionChunkStore extends McRegionChunkStore { if (worldPattern.matcher(worldName).matches()) { // Check for file if (pattern.matcher(testEntry.getName()).matches()) { - folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf("/")); + folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf('/')); name = folder + "/" + name; break; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java index 967e456ac..19350d831 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java @@ -82,7 +82,7 @@ public class ZippedLegacyChunkStore extends LegacyChunkStore { // Detect subfolder for the world's files if (folder != null) { - if (!folder.equals("")) { + if (!folder.isEmpty()) { file = folder + "/" + file; } } else { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java index e8979d06c..581686ea4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java @@ -76,7 +76,7 @@ public class ZippedMcRegionChunkStore extends McRegionChunkStore { protected InputStream getInputStream(String name, String worldName) throws IOException, DataException { // Detect subfolder for the world's files if (folder != null) { - if (!folder.equals("")) { + if (!folder.isEmpty()) { name = folder + "/" + name; } } else { @@ -86,7 +86,7 @@ public class ZippedMcRegionChunkStore extends McRegionChunkStore { // Check for world if (testEntry.getName().startsWith(worldName + "/")) { if (pattern.matcher(testEntry.getName()).matches()) { // does entry end in .mca - folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf("/")); + folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf('/')); name = folder + "/" + name; break; }