Fix world caching + block interaction

Fixes #608
This commit is contained in:
boy0001
2015-09-05 11:35:43 +10:00
parent 4cc4196487
commit 8606319340
9 changed files with 13 additions and 14 deletions

View File

@ -126,6 +126,7 @@ public class DebugExec extends SubCommand {
scope.put("Settings", new Settings());
scope.put("StringMan", new StringMan());
scope.put("MathMan", new MathMan());
scope.put("FlagManager", new FlagManager());
// Classes
scope.put("Location", Location.class);

View File

@ -87,14 +87,13 @@ public abstract class EventUtil {
if (!plot.hasOwner()) {
return Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_UNOWNED.s(), notifyPerms);
}
Flag use = FlagManager.getPlotFlag(plot, "break");
Flag use = FlagManager.getPlotFlag(plot, "use");
if (use != null) {
HashSet<PlotBlock> value = (HashSet<PlotBlock>) use.getValue();
if (value.contains(PlotBlock.EVERYTHING) || value.contains(block.getPlotBlock())) {
return true;
}
}
Flag destroy = FlagManager.getPlotFlag(plot, "break");
if (destroy != null) {
HashSet<PlotBlock> value = (HashSet<PlotBlock>) destroy.getValue();

View File

@ -492,7 +492,6 @@ public class MainUtil {
public static boolean teleportPlayer(final PlotPlayer player, final Location from, final Plot plot) {
final Plot bot = MainUtil.getBottomPlot(plot);
boolean result = EventUtil.manager.callTeleport(player, from, plot);
if (result) {

View File

@ -242,11 +242,11 @@ public class StringMan {
}
public static boolean isEqual(String a, String b) {
return (a == b || (a.length() == b.length() && a.hashCode() == b.hashCode() && a.equals(b)));
return (a == b || (a != null && b != null && a.length() == b.length() && a.hashCode() == b.hashCode() && a.equals(b)));
}
public static boolean isEqualIgnoreCase(String a, String b) {
return (a == b || (a.length() == b.length() && a.equalsIgnoreCase(b)));
return (a == b || (a != null && b != null && a.length() == b.length() && a.equalsIgnoreCase(b)));
}
public static String repeat(String s, int n) {