From bcd113146b07d827a7ebf76a44a27e0d383146b4 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Mon, 29 Dec 2014 00:47:35 +1100 Subject: [PATCH] fixes --- .../plot/commands/Auto.java | 2 -- .../plot/commands/Command.java | 22 ++++++++++++++----- .../plot/commands/DebugClaimTest.java | 3 ++- .../plot/commands/DebugClear.java | 2 ++ .../plot/commands/DebugLoadTest.java | 5 +++-- .../plot/commands/DebugRoadRegen.java | 6 ----- .../plot/commands/DebugSaveTest.java | 5 +++-- .../plot/commands/MainCommand.java | 2 +- .../plot/commands/RegenAllRoads.java | 2 +- .../plot/generator/HybridPlotManager.java | 7 +++--- .../translation/YamlTranslationFile.java | 1 - 11 files changed, 32 insertions(+), 25 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Auto.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Auto.java index 7c43ffb1b..e0d59b0ec 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Auto.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Auto.java @@ -189,10 +189,8 @@ import org.bukkit.entity.Player; } else { lastPlot = false; } - System.out.print("UNOWNED: " + start); final PlotId end = new PlotId((start.x + size_x) - 1, (start.y + size_z) - 1); if (isUnowned(world, start, end)) { - System.out.print("LAST PLOT: " + start); for (int i = start.x; i <= end.x; i++) { for (int j = start.y; j <= end.y; j++) { final Plot plot = PlotHelper.getPlot(world, new PlotId(i, j)); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java index 30793769f..e700b8adc 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java @@ -43,15 +43,27 @@ public enum Command { /** * */ + DEBUGROADREGEN("debugroadregen"), + /** + * + */ + REGENALLROADS("regenallroads"), + /** + * + */ + DEBUGLOADTEST("debugloadtest"), + /** + * + */ + DEBUGSAVETEST("debugsavetest"), + /** + * + */ UNCLAIM("unclaim"), /** * */ - DEBUGROADREGEN("debugroadregen"), - /** - * - */ - DEBUGCLEAR("debugclear"), + DEBUGCLEAR("debugclear"), /** * */ diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java index 465b6aa6f..2a606d83c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java @@ -31,6 +31,7 @@ import com.intellectualcrafters.plot.object.*; import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlotHelper; import com.intellectualcrafters.plot.util.UUIDHandler; + import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.Location; @@ -172,7 +173,7 @@ public class DebugClaimTest extends SubCommand { } } else { - PlayerFunctions.sendMessage(plr, "This debug command can only be executed by console as it has been deemed unsafe if abused."); + PlayerFunctions.sendMessage(plr, "&6This command can only be executed by console as it has been deemed unsafe if abused."); } return true; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java index af7332fa8..132e03f77 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java @@ -63,6 +63,7 @@ public class DebugClear extends SubCommand { HybridPlotManager manager = (HybridPlotManager) PlotMain.getPlotManager(world); manager.clearPlotExperimental(Bukkit.getWorld(world), plot, false); PlotMain.sendConsoleSenderMessage("Plot " + plot.getId().toString() + " cleared."); + PlotMain.sendConsoleSenderMessage("&aDone!"); } } } @@ -83,6 +84,7 @@ public class DebugClear extends SubCommand { assert plot != null; HybridPlotManager manager = (HybridPlotManager) PlotMain.getPlotManager(plr.getWorld()); manager.clearPlotExperimental(plr.getWorld(), plot, false); + PlayerFunctions.sendMessage(plr, "&aDone!"); // sign diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugLoadTest.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugLoadTest.java index 66f81f8db..1aeea4257 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugLoadTest.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugLoadTest.java @@ -24,6 +24,7 @@ package com.intellectualcrafters.plot.commands; import com.intellectualcrafters.plot.PlotMain; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.util.PlayerFunctions; + import org.bukkit.entity.Player; import java.lang.reflect.Field; @@ -34,7 +35,7 @@ import java.lang.reflect.Field; public class DebugLoadTest extends SubCommand { public DebugLoadTest() { - super(Command.DEBUGCLAIMTEST, "This debug command will force the reload of all plots in the DB", "debugloadtest", CommandCategory.DEBUG, false); + super(Command.DEBUGLOADTEST, "This debug command will force the reload of all plots in the DB", "debugloadtest", CommandCategory.DEBUG, false); } @Override @@ -50,7 +51,7 @@ public class DebugLoadTest extends SubCommand { PlotMain.sendConsoleSenderMessage("&3===END OF STACKTRACE==="); } } else { - PlayerFunctions.sendMessage(plr, "This debug command can only be executed by console as it has been deemed unsafe if abused."); + PlayerFunctions.sendMessage(plr, "&6This command can only be executed by console as it has been deemed unsafe if abused.."); } return true; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java index e04f86d4d..27f6df2cf 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java @@ -25,14 +25,8 @@ import com.intellectualcrafters.plot.PlotMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.generator.HybridPlotManager; import com.intellectualcrafters.plot.generator.HybridPlotWorld; -import com.intellectualcrafters.plot.object.Plot; -import com.intellectualcrafters.plot.object.PlotId; -import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.util.PlayerFunctions; -import com.intellectualcrafters.plot.util.PlotHelper; -import com.intellectualcrafters.plot.util.UUIDHandler; -import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.entity.Player; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugSaveTest.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugSaveTest.java index c8af90319..e27261efc 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugSaveTest.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugSaveTest.java @@ -25,6 +25,7 @@ import com.intellectualcrafters.plot.PlotMain; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.util.PlayerFunctions; + import org.bukkit.entity.Player; import java.util.ArrayList; @@ -35,7 +36,7 @@ import java.util.ArrayList; public class DebugSaveTest extends SubCommand { public DebugSaveTest() { - super(Command.DEBUGCLAIMTEST, "This debug command will force the recreation of all plots in the DB", "debugsavetest", CommandCategory.DEBUG, false); + super(Command.DEBUGSAVETEST, "This debug command will force the recreation of all plots in the DB", "debugsavetest", CommandCategory.DEBUG, false); } @Override @@ -46,7 +47,7 @@ public class DebugSaveTest extends SubCommand { DBFunc.createPlots(plots); DBFunc.createAllSettingsAndHelpers(plots); } else { - PlayerFunctions.sendMessage(plr, "This debug command can only be executed by console as it has been deemed unsafe if abused."); + PlayerFunctions.sendMessage(plr, "This debug command can only be executed by console as it has been deemed unsafe if abused"); } return true; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java index cb2ca6446..9d068cd40 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java @@ -48,7 +48,7 @@ public class MainCommand implements CommandExecutor, TabCompleter { */ public static final String MAIN_PERMISSION = "plots.use"; - private final static SubCommand[] _subCommands = new SubCommand[]{new CreateRoadSchematic(), new RegenAllRoads(), new DebugRoadRegen(), new DebugClear(), new Ban(), new Unban(), new OP(), new DEOP(), new Claim(), new Paste(), new Copy(), new Clipboard(), new Auto(), new Home(), new Visit(), new TP(), new Set(), new Clear(), new Delete(), new SetOwner(), new Denied(), new Helpers(), new Trusted(), new Info(), new list(), new Help(), new Debug(), new Schematic(), new plugin(), new Inventory(), new Purge(), new Reload(), new Merge(), new Unlink(), new Kick(), new Setup(), new Rate(), new DebugClaimTest(), new Inbox(), new Comment(), new Database(), new Unclaim(), new Swap(), new MusicSubcommand()}; + private final static SubCommand[] _subCommands = new SubCommand[]{new DebugSaveTest(), new DebugLoadTest(), new CreateRoadSchematic(), new RegenAllRoads(), new DebugClear(), new Ban(), new Unban(), new OP(), new DEOP(), new Claim(), new Paste(), new Copy(), new Clipboard(), new Auto(), new Home(), new Visit(), new TP(), new Set(), new Clear(), new Delete(), new SetOwner(), new Denied(), new Helpers(), new Trusted(), new Info(), new list(), new Help(), new Debug(), new Schematic(), new plugin(), new Inventory(), new Purge(), new Reload(), new Merge(), new Unlink(), new Kick(), new Setup(), new Rate(), new DebugClaimTest(), new Inbox(), new Comment(), new Database(), new Unclaim(), new Swap(), new MusicSubcommand(), new DebugRoadRegen()}; public final static ArrayList subCommands = new ArrayList() { { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/RegenAllRoads.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/RegenAllRoads.java index e0b654bfa..aea4a10c9 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/RegenAllRoads.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/RegenAllRoads.java @@ -44,7 +44,7 @@ import org.bukkit.entity.Player; public class RegenAllRoads extends SubCommand { public RegenAllRoads() { - super(Command.DEBUGROADREGEN, "Regenerate all road schematic in your current chunk", "debugroadregen", CommandCategory.DEBUG, false); + super(Command.REGENALLROADS, "Regenerate all road schematic in your current chunk", "regenallroads", CommandCategory.DEBUG, false); } @Override diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java index 679b147c2..e1d4dca14 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java @@ -61,8 +61,8 @@ import java.util.HashSet; @SuppressWarnings("deprecation") public class HybridPlotManager extends PlotManager { public RegionWrapper CURRENT_PLOT_CLEAR; - public HashMap> GENERATE_BLOCKS; - public HashMap> GENERATE_DATA; + public HashMap> GENERATE_BLOCKS = new HashMap<>(); + public HashMap> GENERATE_DATA = new HashMap<>(); private int task; private static boolean UPDATE = false; @@ -164,7 +164,7 @@ import java.util.HashSet; else { ChunkLoc loc = chunks.get(0); - PlotMain.sendConsoleSenderMessage("Updating .mcr: " + loc.x + ", "+loc.z + "(aprrox 256 chunks)"); + PlotMain.sendConsoleSenderMessage("Updating .mcr: " + loc.x + ", "+loc.z + " (aprrox 256 chunks)"); PlotMain.sendConsoleSenderMessage("Remaining regions: "+chunks.size()); regenerateChunkChunk(world, loc); @@ -222,7 +222,6 @@ import java.util.HashSet; HybridPlotWorld plotworld = (HybridPlotWorld) PlotMain.getWorldSettings(world); if (!plotworld.ROAD_SCHEMATIC_ENABLED) { - System.out.print("REGEN ROAD DISABLED"); return false; } diff --git a/PlotSquared/src/main/java/com/intellectualsites/translation/YamlTranslationFile.java b/PlotSquared/src/main/java/com/intellectualsites/translation/YamlTranslationFile.java index 9176497dd..d1e2aa4bd 100644 --- a/PlotSquared/src/main/java/com/intellectualsites/translation/YamlTranslationFile.java +++ b/PlotSquared/src/main/java/com/intellectualsites/translation/YamlTranslationFile.java @@ -200,7 +200,6 @@ public class YamlTranslationFile extends TranslationFile { } if (this.map == null) { this.map = new HashMap(); - System.out.println("Was null..."); } for (final Map.Entry objects : this.map.entrySet()) { final String key = objects.getKey();