Minor fixes

This commit is contained in:
boy0001
2015-08-23 22:04:17 +10:00
parent dbdd207390
commit d52e9b4c8c
8 changed files with 29 additions and 22 deletions

View File

@ -89,17 +89,17 @@ public class DebugExec extends SubCommand {
private Bindings scope;
public DebugExec() {
File file = new File(PS.get().IMP.getDirectory(), "scripts" + File.separator + "start.js");
if (file.exists()) {
init();
try {
String script = StringMan.join(Files.readLines(new File(new File(PS.get().IMP.getDirectory() + File.separator + "scripts"), "start.js"), StandardCharsets.UTF_8), System.getProperty("line.separator"));
scope.put("THIS", this);
scope.put("PlotPlayer", ConsolePlayer.getConsole());
engine.eval(script, scope);
} catch (Exception e) {
e.printStackTrace();
try {
File file = new File(PS.get().IMP.getDirectory(), "scripts" + File.separator + "start.js");
if (file.exists()) {
init();
String script = StringMan.join(Files.readLines(new File(new File(PS.get().IMP.getDirectory() + File.separator + "scripts"), "start.js"), StandardCharsets.UTF_8), System.getProperty("line.separator"));
scope.put("THIS", this);
scope.put("PlotPlayer", ConsolePlayer.getConsole());
engine.eval(script, scope);
}
} catch (Exception e) {
e.printStackTrace();
}
}

View File

@ -47,6 +47,9 @@ public class Unclaim extends SubCommand {
if (plot == null) {
return !sendMessage(plr, C.NOT_IN_PLOT);
}
if (!plot.hasOwner()) {
return !sendMessage(plr, C.PLOT_NOT_CLAIMED);
}
if (!MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) {
return !sendMessage(plr, C.UNLINK_REQUIRED);
}