Some changes

Fixes #605
Possibly #604
Other minor tweaks
This commit is contained in:
boy0001
2015-09-03 15:45:25 +10:00
parent 3a29022d19
commit afef79ea66
31 changed files with 195 additions and 146 deletions

View File

@ -122,7 +122,7 @@ public class ExpireManager {
public void run() {
PlotAnalysis changed = this.value;
if (Settings.CLEAR_THRESHOLD != -1 && plotworld.TYPE == 0 && changed != null) {
if (changed.getComplexity() > Settings.CLEAR_THRESHOLD) {
if (changed.changes != 0 && changed.getComplexity() > Settings.CLEAR_THRESHOLD) {
PS.debug("$2[&5Expire&dManager$2] &bIgnoring modified plot: " + plot + " : " + changed.getComplexity() + " - " + changed.changes);
expiredPlots.get(world).remove(plot);
FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("analysis"), changed.asList()));

View File

@ -1261,7 +1261,7 @@ public class MainUtil {
Location loc = new Location(bot.getWorld(), bot.getX() + home.x, bot.getY() + home.y, bot.getZ() + home.z);
if (BlockManager.manager.getBlock(loc).id != 0) {
// sendConsoleMessage("ID was " + BukkitUtil.getBlock(loc).id);
loc.setY(Math.max(getHeighestBlock(w, bot.getX(), bot.getZ()), bot.getY()));
loc.setY(Math.max(getHeighestBlock(w, loc.getX(), loc.getZ()), bot.getY()));
}
return loc;
}

View File

@ -1,5 +1,7 @@
package com.intellectualcrafters.plot.util;
import org.bukkit.permissions.Permission;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.plotsquared.general.commands.CommandCaller;
@ -13,13 +15,24 @@ public class Permissions {
return hasPermission((CommandCaller) player, perm);
}
public static boolean hasPermission(final CommandCaller player, final String perm) {
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;
}
perm = perm.toLowerCase().replaceAll("^[^a-z|0-9|\\.|_|-]", "");
String[] nodes = perm.split("\\.");
final StringBuilder n = new StringBuilder();
for (int i = 0; i < (nodes.length - 1); i++) {
n.append(nodes[i] + ("."));
if (!perm.equals(n + C.PERMISSION_STAR.s())) {
if (player.hasPermission(n + C.PERMISSION_STAR.s())) {
return true;
}
}
}
return false;
}
@ -40,6 +53,7 @@ public class Permissions {
if (player.hasPermission(stub + ".*")) {
return Integer.MAX_VALUE;
}
System.out.print(range);
for (int i = range; i > 0; i--) {
if (player.hasPermission(stub + "." + i)) {
return i;