From c9204b3590c1aa48657d66a99616f66045e3ebed Mon Sep 17 00:00:00 2001 From: boy0001 Date: Mon, 10 Nov 2014 21:54:36 +1100 Subject: [PATCH] some fixes --- .../src/main/java/com/intellectualcrafters/plot/C.java | 5 +++++ .../com/intellectualcrafters/plot/PlayerFunctions.java | 8 ++++++-- .../com/intellectualcrafters/plot/StringComparsion.java | 2 ++ .../java/com/intellectualcrafters/plot/UUIDHandler.java | 2 +- .../plot/commands/DebugClaimTest.java | 2 +- .../intellectualcrafters/plot/commands/DebugLoadTest.java | 2 +- .../intellectualcrafters/plot/commands/DebugSaveTest.java | 2 +- .../plot/generator/DefaultPlotManager.java | 2 +- 8 files changed, 18 insertions(+), 7 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/C.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/C.java index 43e4d17cf..012f83cdc 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/C.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/C.java @@ -418,6 +418,11 @@ public enum C { if (manager == null) { manager = new TranslationManager(); } + + // FIXME: generating a blank file + // FIXME: translations aren't customizable + // FIXME: Some messages still have the %arg stuff in them + if (defaultFile == null) { defaultFile = new YamlTranslationFile(BukkitTranslation.getParent(PlotMain.getPlugin(PlotMain.class)), TranslationLanguage.englishAmerican, "PlotSquared", manager) .read(); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlayerFunctions.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlayerFunctions.java index b695bcc62..e6176868e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlayerFunctions.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlayerFunctions.java @@ -301,8 +301,12 @@ public class PlayerFunctions { else { String msg = c.s(); if ((args != null) && (args.length > 0)) { - for (final String str : args) - msg = msg.replaceFirst("%s", str); + for (final String str : args) { + System.out.print(str); + if (msg.contains("%s")) { + msg = msg.replaceFirst("%s", str); + } + } } sendMessage(plr, msg); } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/StringComparsion.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/StringComparsion.java index 1e2844372..3c81680a3 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/StringComparsion.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/StringComparsion.java @@ -37,6 +37,8 @@ public class StringComparsion { public StringComparsion(final String input, final Object[] objects) { double c = 0; + this.bestMatch = objects[0].toString(); + this.bestMatchObject = objects[0]; for (final Object o : objects) { if ((c = compare(input, o.toString())) > this.match) { this.match = c; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/UUIDHandler.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/UUIDHandler.java index 329fb9660..4ce241d6c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/UUIDHandler.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/UUIDHandler.java @@ -126,7 +126,7 @@ public class UUIDHandler { final Player player = Bukkit.getPlayer(name); if (player != null) { final UUID uuid = player.getUniqueId(); - uuidMap.put(nameWrap, uuid); + add(nameWrap, uuid); return uuid; } UUID uuid; 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 ee6f017ab..8c2b3ede1 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java @@ -42,7 +42,7 @@ import java.util.UUID; public class DebugClaimTest extends SubCommand { public DebugClaimTest() { - super(Command.DEBUGCLAIMTEST, "If you accidentally delete your database, this command will attempt to restore all plots based on the data from the plot signs. Execution time may vary", "claim", CommandCategory.DEBUG, false); + super(Command.DEBUGCLAIMTEST, "If you accidentally delete your database, this command will attempt to restore all plots based on the data from the plot signs. Execution time may vary", "debugclaimtest", CommandCategory.DEBUG, false); } @Override 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 747de576b..fb0b0c659 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugLoadTest.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugLoadTest.java @@ -34,7 +34,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", "claim", CommandCategory.DEBUG, false); + super(Command.DEBUGCLAIMTEST, "This debug command will force the reload of all plots in the DB", "debugloadtest", CommandCategory.DEBUG, false); } @Override 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 f51a9957b..cf0e23068 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugSaveTest.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugSaveTest.java @@ -35,7 +35,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", "claim", CommandCategory.DEBUG, false); + super(Command.DEBUGCLAIMTEST, "This debug command will force the recreation of all plots in the DB", "debugsavetest", CommandCategory.DEBUG, false); } @Override diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/DefaultPlotManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/DefaultPlotManager.java index da9fc429a..22a72e2bb 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/DefaultPlotManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/DefaultPlotManager.java @@ -243,7 +243,7 @@ public class DefaultPlotManager extends PlotManager { final PlotBlock[] filling = dpw.MAIN_BLOCK; // PlotBlock wall = dpw.WALL_BLOCK; - final PlotBlock wall = plot.hasOwner() ? dpw.CLAIMED_WALL_BLOCK : dpw.WALL_BLOCK; + final PlotBlock wall = dpw.WALL_BLOCK; final PlotBlock wall_filling = dpw.WALL_FILLING;