close #659
close #662
close #665
close #638
This commit is contained in:
Jesse Boyd
2015-10-10 18:07:26 +11:00
parent 8e874ddeb0
commit 50c6753bf4
13 changed files with 90 additions and 114 deletions

View File

@ -122,11 +122,6 @@ public interface IPlotMain {
*/
boolean initWorldEdit();
/**
* Register TNT related events (if TNT protection is enabled)
*/
void registerTNTListener();
/**
* Get the economy provider
* @return

View File

@ -191,9 +191,6 @@ public class PS {
log("&dUsing metrics will allow us to improve the plugin, please consider it :)");
}
IMP.startMetrics();
if (Settings.TNT_LISTENER) {
IMP.registerTNTListener();
}
if (Settings.CHUNK_PROCESSOR) {
IMP.registerChunkProcessor();
}
@ -1754,7 +1751,6 @@ public class PS {
// Protection
options.put("protection.redstone.disable-offline", Settings.REDSTONE_DISABLER);
options.put("protection.redstone.disable-unoccupied", Settings.REDSTONE_DISABLER_UNOCCUPIED);
options.put("protection.tnt-listener.enabled", Settings.TNT_LISTENER);
options.put("protection.piston.falling-blocks", Settings.PISTON_FALLING_BLOCK_CHECK);
// Clusters
@ -1885,7 +1881,6 @@ public class PS {
Settings.REDSTONE_DISABLER = config.getBoolean("protection.redstone.disable-offline");
Settings.REDSTONE_DISABLER_UNOCCUPIED = config.getBoolean("protection.redstone.disable-unoccupied");
Settings.TNT_LISTENER = config.getBoolean("protection.tnt-listener.enabled");
Settings.PISTON_FALLING_BLOCK_CHECK = config.getBoolean("protection.piston.falling-blocks");
// Clusters

View File

@ -50,7 +50,7 @@ public class Alias extends SetCommand {
MainUtil.sendMessage(plr, C.ALIAS_TOO_LONG);
return false;
}
if (!StringMan.isAlphanumericUnd(alias)) {
if (alias.contains(" ") || !StringMan.isAsciiPrintable(alias)) {
C.NOT_VALID_VALUE.send(plr);
return false;
}

View File

@ -164,28 +164,12 @@ public class list extends SubCommand {
return false;
}
plots = new ArrayList<>();
String match;
if (args.length == 2) {
match = args[1];
} else {
match = null;
}
for (final Plot plot : PS.get().getPlots()) {
final Flag flag = plot.getFlags().get("done");
if (flag == null) {
continue;
}
if (match != null) {
try {
if (flag.getValueString().matches(match)) {
plots.add(plot);
}
} catch (final Exception e) {
break;
}
} else {
plots.add(plot);
}
plots.add(plot);
}
Collections.sort(plots, new Comparator<Plot>() {
@Override

View File

@ -78,10 +78,6 @@ public class Settings {
public static boolean CHUNK_PROCESSOR_TRIM_ON_SAVE = false;
public static boolean CHUNK_PROCESSOR_GC = false;
public static int CHUNK_PROCESSOR_MAX_BLOCKSTATES = 4096;
public static int CHUNK_PROCESSOR_MAX_ENTITIES = 512;
public static boolean CHUNK_PROCESSOR_DISABLE_PHYSICS = false;
/**
* TNT listener
public static int CHUNK_PROCESSOR_MAX_ENTITIES = 512;
public static boolean CHUNK_PROCESSOR_DISABLE_PHYSICS = false;
/**

View File

@ -14,9 +14,6 @@ public class Permissions {
}
public static boolean hasPermission(final CommandCaller player, String perm) {
if ((player == null) || player.hasPermission(C.PERMISSION_ADMIN.s()) || player.hasPermission(C.PERMISSION_STAR.s())) {
return true;
}
if (player.hasPermission(perm)) {
return true;
}
@ -45,8 +42,15 @@ public class Permissions {
}
public static int hasPermissionRange(final PlotPlayer player, final String stub, final int range) {
if ((player == null) || player.hasPermission(C.PERMISSION_ADMIN.s()) || player.hasPermission(C.PERMISSION_STAR.s())) {
return Integer.MAX_VALUE;
final String[] nodes = stub.split("\\.");
final StringBuilder n = new StringBuilder();
for (int i = 0; i < (nodes.length - 1); i++) {
n.append(nodes[i] + ("."));
if (!stub.equals(n + C.PERMISSION_STAR.s())) {
if (player.hasPermission(n + C.PERMISSION_STAR.s())) {
return Integer.MAX_VALUE;
}
}
}
if (player.hasPermission(stub + ".*")) {
return Integer.MAX_VALUE;