some fixes

This commit is contained in:
boy0001 2014-11-10 21:54:36 +11:00
parent 7d304d3eb2
commit c9204b3590
8 changed files with 18 additions and 7 deletions

View File

@ -418,6 +418,11 @@ public enum C {
if (manager == null) { if (manager == null) {
manager = new TranslationManager(); 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) { if (defaultFile == null) {
defaultFile = new YamlTranslationFile(BukkitTranslation.getParent(PlotMain.getPlugin(PlotMain.class)), TranslationLanguage.englishAmerican, "PlotSquared", manager) defaultFile = new YamlTranslationFile(BukkitTranslation.getParent(PlotMain.getPlugin(PlotMain.class)), TranslationLanguage.englishAmerican, "PlotSquared", manager)
.read(); .read();

View File

@ -301,8 +301,12 @@ public class PlayerFunctions {
else { else {
String msg = c.s(); String msg = c.s();
if ((args != null) && (args.length > 0)) { if ((args != null) && (args.length > 0)) {
for (final String str : args) for (final String str : args) {
msg = msg.replaceFirst("%s", str); System.out.print(str);
if (msg.contains("%s")) {
msg = msg.replaceFirst("%s", str);
}
}
} }
sendMessage(plr, msg); sendMessage(plr, msg);
} }

View File

@ -37,6 +37,8 @@ public class StringComparsion {
public StringComparsion(final String input, final Object[] objects) { public StringComparsion(final String input, final Object[] objects) {
double c = 0; double c = 0;
this.bestMatch = objects[0].toString();
this.bestMatchObject = objects[0];
for (final Object o : objects) { for (final Object o : objects) {
if ((c = compare(input, o.toString())) > this.match) { if ((c = compare(input, o.toString())) > this.match) {
this.match = c; this.match = c;

View File

@ -126,7 +126,7 @@ public class UUIDHandler {
final Player player = Bukkit.getPlayer(name); final Player player = Bukkit.getPlayer(name);
if (player != null) { if (player != null) {
final UUID uuid = player.getUniqueId(); final UUID uuid = player.getUniqueId();
uuidMap.put(nameWrap, uuid); add(nameWrap, uuid);
return uuid; return uuid;
} }
UUID uuid; UUID uuid;

View File

@ -42,7 +42,7 @@ import java.util.UUID;
public class DebugClaimTest extends SubCommand { public class DebugClaimTest extends SubCommand {
public DebugClaimTest() { 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 @Override

View File

@ -34,7 +34,7 @@ import java.lang.reflect.Field;
public class DebugLoadTest extends SubCommand { public class DebugLoadTest extends SubCommand {
public DebugLoadTest() { 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 @Override

View File

@ -35,7 +35,7 @@ import java.util.ArrayList;
public class DebugSaveTest extends SubCommand { public class DebugSaveTest extends SubCommand {
public DebugSaveTest() { 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 @Override

View File

@ -243,7 +243,7 @@ public class DefaultPlotManager extends PlotManager {
final PlotBlock[] filling = dpw.MAIN_BLOCK; final PlotBlock[] filling = dpw.MAIN_BLOCK;
// PlotBlock wall = dpw.WALL_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; final PlotBlock wall_filling = dpw.WALL_FILLING;