From 5f2856e0ea5dd02a22602fd752512b0a6a7c39b7 Mon Sep 17 00:00:00 2001 From: manuelgu Date: Tue, 29 Mar 2016 10:47:56 +0200 Subject: [PATCH 1/2] Cleanup Consistent use of String[] instead of String... Removed unused variables --- Core/src/main/java/com/intellectualcrafters/plot/PS.java | 1 - .../java/com/intellectualcrafters/plot/commands/Auto.java | 1 - .../java/com/intellectualcrafters/plot/commands/Buy.java | 3 +-- .../java/com/intellectualcrafters/plot/commands/Chat.java | 2 +- .../java/com/intellectualcrafters/plot/commands/Claim.java | 2 +- .../java/com/intellectualcrafters/plot/commands/Clear.java | 3 +-- .../java/com/intellectualcrafters/plot/commands/Cluster.java | 3 +-- .../com/intellectualcrafters/plot/commands/Condense.java | 3 +-- .../java/com/intellectualcrafters/plot/commands/Confirm.java | 2 +- .../plot/commands/CreateRoadSchematic.java | 5 +++-- .../intellectualcrafters/plot/commands/DebugAllowUnsafe.java | 3 +-- .../com/intellectualcrafters/plot/commands/DebugExec.java | 4 +--- .../intellectualcrafters/plot/commands/DebugRoadRegen.java | 2 +- .../java/com/intellectualcrafters/plot/commands/FlagCmd.java | 5 ++--- .../java/com/intellectualcrafters/plot/commands/Inbox.java | 1 - .../com/intellectualcrafters/plot/commands/SchematicCmd.java | 5 ++--- .../java/com/intellectualcrafters/plot/commands/Set.java | 3 +-- .../java/com/intellectualcrafters/plot/commands/SetHome.java | 1 - .../java/com/intellectualcrafters/plot/commands/Trim.java | 1 - .../java/com/intellectualcrafters/plot/commands/Undeny.java | 3 +-- 20 files changed, 19 insertions(+), 34 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/PS.java b/Core/src/main/java/com/intellectualcrafters/plot/PS.java index 99ce0c749..3f06189fc 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/PS.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/PS.java @@ -53,7 +53,6 @@ import com.intellectualcrafters.plot.util.WorldUtil; import com.intellectualcrafters.plot.util.area.QuadMap; import com.plotsquared.listener.WESubscriber; import com.sk89q.worldedit.WorldEdit; - import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Auto.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Auto.java index 9bce97b75..3fcd1d374 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Auto.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Auto.java @@ -180,7 +180,6 @@ public class Auto extends SubCommand { return false; } plotarea.setMeta("lastPlot", new PlotId(0, 0)); - boolean br = false; while (true) { PlotId start = getNextPlotId(getLastPlotId(plotarea), 1); PlotId end = new PlotId(start.x + size_x - 1, start.y + size_z - 1); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Buy.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Buy.java index 71ace6ccb..2845f5949 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Buy.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Buy.java @@ -31,7 +31,6 @@ import com.intellectualcrafters.plot.util.EconHandler; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.UUIDHandler; import com.plotsquared.general.commands.CommandDeclaration; - import java.util.Set; @CommandDeclaration( @@ -45,7 +44,7 @@ import java.util.Set; public class Buy extends SubCommand { @Override - public boolean onCommand(PlotPlayer plr, String... args) { + public boolean onCommand(PlotPlayer plr, String[] args) { if (EconHandler.manager == null) { return sendMessage(plr, C.ECON_DISABLED); } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Chat.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Chat.java index 381d9a8de..d99a54ebd 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Chat.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Chat.java @@ -13,7 +13,7 @@ import com.plotsquared.general.commands.CommandDeclaration; public class Chat extends SubCommand { @Override - public boolean onCommand(PlotPlayer player, String... args) { + public boolean onCommand(PlotPlayer player, String[] args) { MainCommand.getInstance().toggle.chat(this, player, new String[0], null, null); return true; } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Claim.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Claim.java index 497bdf240..13349b858 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Claim.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Claim.java @@ -40,7 +40,7 @@ import com.plotsquared.general.commands.CommandDeclaration; public class Claim extends SubCommand { @Override - public boolean onCommand(PlotPlayer plr, String... args) { + public boolean onCommand(PlotPlayer plr, String[] args) { String schematic = ""; if (args.length >= 1) { schematic = args[0]; diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Clear.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Clear.java index 5c7fb4957..034528e41 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Clear.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Clear.java @@ -32,7 +32,6 @@ import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.SetQueue; import com.intellectualcrafters.plot.util.TaskManager; import com.plotsquared.general.commands.CommandDeclaration; - import java.util.Set; @CommandDeclaration(command = "clear", @@ -45,7 +44,7 @@ import java.util.Set; public class Clear extends SubCommand { @Override - public boolean onCommand(final PlotPlayer plr, String... args) { + public boolean onCommand(final PlotPlayer plr, String[] args) { Location loc = plr.getLocation(); final Plot plot; if (args.length == 1) { diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java index da4489a49..eabee97a4 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java @@ -35,7 +35,6 @@ import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.UUIDHandler; import com.plotsquared.general.commands.CommandDeclaration; - import java.util.ArrayList; import java.util.HashSet; import java.util.Set; @@ -50,7 +49,7 @@ import java.util.UUID; public class Cluster extends SubCommand { @Override - public boolean onCommand(PlotPlayer plr, String... args) { + public boolean onCommand(PlotPlayer plr, String[] args) { // list, create, delete, resize, invite, kick, leave, helpers, tp, sethome if (args.length == 0) { diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Condense.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Condense.java index 796f3d864..e09e2ec96 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Condense.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Condense.java @@ -30,7 +30,6 @@ import com.intellectualcrafters.plot.util.MathMan; import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.WorldUtil; import com.plotsquared.general.commands.CommandDeclaration; - import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -49,7 +48,7 @@ public class Condense extends SubCommand { public static boolean TASK = false; @Override - public boolean onCommand(final PlotPlayer plr, String... args) { + public boolean onCommand(final PlotPlayer plr, String[] args) { if ((args.length != 2) && (args.length != 3)) { MainUtil.sendMessage(plr, "/plot condense [radius]"); return false; diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Confirm.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Confirm.java index a692d125c..acb8acc64 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Confirm.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Confirm.java @@ -35,7 +35,7 @@ import com.plotsquared.general.commands.CommandDeclaration; public class Confirm extends SubCommand { @Override - public boolean onCommand(PlotPlayer plr, String... args) { + public boolean onCommand(PlotPlayer plr, String[] args) { CmdInstance command = CmdConfirm.getPending(plr); if (command == null) { MainUtil.sendMessage(plr, C.FAILED_CONFIRM); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java index 032851219..8c40f75b9 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java @@ -28,6 +28,7 @@ import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.util.MainUtil; import com.plotsquared.general.commands.CommandDeclaration; +import org.bukkit.ChatColor; @CommandDeclaration( command = "createroadschematic", @@ -40,7 +41,7 @@ import com.plotsquared.general.commands.CommandDeclaration; public class CreateRoadSchematic extends SubCommand { @Override - public boolean onCommand(PlotPlayer player, String... args) { + public boolean onCommand(PlotPlayer player, String[] args) { Location loc = player.getLocation(); Plot plot = loc.getPlotAbs(); if (plot == null) { @@ -50,7 +51,7 @@ public class CreateRoadSchematic extends SubCommand { return sendMessage(player, C.NOT_IN_PLOT_WORLD); } HybridUtils.manager.setupRoadSchematic(plot); - MainUtil.sendMessage(player, "&6Saved new road schematic. To test the road, fly to a few other plots and use /plot debugroadregen"); + MainUtil.sendMessage(player, ChatColor.GOLD + "Saved new road schematic. To test the road, fly to a few other plots and use /plot debugroadregen"); return true; } } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugAllowUnsafe.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugAllowUnsafe.java index 0ad6e1a22..28f2b1d04 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugAllowUnsafe.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugAllowUnsafe.java @@ -3,7 +3,6 @@ package com.intellectualcrafters.plot.commands; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.PlotPlayer; import com.plotsquared.general.commands.CommandDeclaration; - import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -20,7 +19,7 @@ public class DebugAllowUnsafe extends SubCommand { public static final List unsafeAllowed = new ArrayList<>(); @Override - public boolean onCommand(PlotPlayer plr, String... args) { + public boolean onCommand(PlotPlayer plr, String[] args) { if (unsafeAllowed.contains(plr.getUUID())) { unsafeAllowed.remove(plr.getUUID()); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java index 7ba064d51..d315d31a9 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java @@ -56,7 +56,6 @@ import com.intellectualcrafters.plot.util.WorldUtil; import com.plotsquared.general.commands.Command; import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.listener.WEManager; - import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -65,7 +64,6 @@ import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.UUID; - import javax.script.Bindings; import javax.script.ScriptContext; import javax.script.ScriptEngine; @@ -165,7 +163,7 @@ public class DebugExec extends SubCommand { } @Override - public boolean onCommand(final PlotPlayer player, String... args) { + public boolean onCommand(final PlotPlayer player, String[] args) { java.util.List allowed_params = Arrays.asList("calibrate-analysis", "remove-flag", "stop-expire", "start-expire", "show-expired", "update-expired", "seen"); if (args.length > 0) { diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java index 345939f52..061ec8941 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java @@ -43,7 +43,7 @@ import com.plotsquared.general.commands.CommandDeclaration; public class DebugRoadRegen extends SubCommand { @Override - public boolean onCommand(PlotPlayer player, String... args) { + public boolean onCommand(PlotPlayer player, String[] args) { Location loc = player.getLocation(); PlotArea plotworld = loc.getPlotArea(); if (!(plotworld instanceof HybridPlotWorld)) { diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java index 2357499a4..c04261fe9 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java @@ -33,7 +33,6 @@ import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.StringMan; import com.plotsquared.general.commands.CommandDeclaration; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -55,8 +54,8 @@ public class FlagCmd extends SubCommand { } @Override - public boolean onCommand(PlotPlayer player, String... args) { - + public boolean onCommand(PlotPlayer player, String[] args) { + /* * plot flag set fly true * plot flag remove fly diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java index feeaeaf3b..e235b3da0 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java @@ -30,7 +30,6 @@ import com.intellectualcrafters.plot.util.CommentManager; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.StringMan; import com.plotsquared.general.commands.CommandDeclaration; - import java.util.ArrayList; import java.util.List; diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/SchematicCmd.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/SchematicCmd.java index 32c30e03b..1388bea91 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/SchematicCmd.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/SchematicCmd.java @@ -35,7 +35,6 @@ import com.intellectualcrafters.plot.util.SchematicHandler; import com.intellectualcrafters.plot.util.SchematicHandler.Schematic; import com.intellectualcrafters.plot.util.TaskManager; import com.plotsquared.general.commands.CommandDeclaration; - import java.net.URL; import java.util.ArrayList; import java.util.Collection; @@ -53,7 +52,7 @@ public class SchematicCmd extends SubCommand { private boolean running = false; @Override - public boolean onCommand(final PlotPlayer plr, String... args) { + public boolean onCommand(final PlotPlayer plr, String[] args) { if (args.length < 1) { sendMessage(plr, C.SCHEMATIC_MISSING_ARG); return true; @@ -166,7 +165,7 @@ public class SchematicCmd extends SubCommand { return false; } if (args.length != 2) { - MainUtil.sendMessage(plr, "&cNeed world arg. Use &7/plots sch exportall "); + MainUtil.sendMessage(plr, "&cNeed world argument. Use &7/plots sch exportall "); return false; } PlotArea area = PS.get().getPlotAreaByString(args[1]); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Set.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Set.java index 0bb43c328..daa55e263 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Set.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Set.java @@ -37,7 +37,6 @@ import com.intellectualcrafters.plot.util.StringMan; import com.intellectualcrafters.plot.util.WorldUtil; import com.plotsquared.general.commands.Command; import com.plotsquared.general.commands.CommandDeclaration; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; @@ -159,7 +158,7 @@ public class Set extends SubCommand { } @Override - public boolean onCommand(PlotPlayer plr, String... args) { + public boolean onCommand(PlotPlayer plr, String[] args) { if (args.length == 0) { return noArgs(plr); } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/SetHome.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/SetHome.java index ae27e1b5a..3938cf343 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/SetHome.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/SetHome.java @@ -45,7 +45,6 @@ public class SetHome extends SetCommand { case "remove": case "none": { Plot base = plot.getBasePlot(false); - Location bot = base.getBottomAbs(); base.setHome(null); return MainUtil.sendMessage(plr, C.POSITION_UNSET); } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Trim.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Trim.java index 0228b7a4a..6930c912f 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Trim.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Trim.java @@ -34,7 +34,6 @@ import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.WorldUtil; import com.plotsquared.general.commands.CommandDeclaration; - import java.io.File; import java.io.IOException; import java.nio.file.Files; diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Undeny.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Undeny.java index 7eff9fe87..1ad4fcda7 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Undeny.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Undeny.java @@ -29,7 +29,6 @@ import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.UUIDHandler; import com.plotsquared.general.commands.Argument; import com.plotsquared.general.commands.CommandDeclaration; - import java.util.ArrayList; import java.util.UUID; @@ -47,7 +46,7 @@ public class Undeny extends SubCommand { } @Override - public boolean onCommand(PlotPlayer plr, String... args) { + public boolean onCommand(PlotPlayer plr, String[] args) { Location loc = plr.getLocation(); Plot plot = loc.getPlotAbs(); From 22f56d4da614bbfba90fd209c9909e6b4df35a0e Mon Sep 17 00:00:00 2001 From: manuelgu Date: Tue, 29 Mar 2016 10:57:27 +0200 Subject: [PATCH 2/2] Remove ChatColor Sponge support --- .../plot/commands/CreateRoadSchematic.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java index 8c40f75b9..ca5bc305b 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java @@ -28,7 +28,6 @@ import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.util.MainUtil; import com.plotsquared.general.commands.CommandDeclaration; -import org.bukkit.ChatColor; @CommandDeclaration( command = "createroadschematic", @@ -51,7 +50,7 @@ public class CreateRoadSchematic extends SubCommand { return sendMessage(player, C.NOT_IN_PLOT_WORLD); } HybridUtils.manager.setupRoadSchematic(plot); - MainUtil.sendMessage(player, ChatColor.GOLD + "Saved new road schematic. To test the road, fly to a few other plots and use /plot debugroadregen"); + MainUtil.sendMessage(player, "$1Saved new road schematic. To test the road, fly to a few other plots and use /plot debugroadregen"); return true; } }