Fixed error when extending shop in unowned ASkyBlock island

This commit is contained in:
Eric 2017-06-15 13:33:06 +02:00
parent 36ea51b593
commit 0e1fc781f5

View File

@ -202,9 +202,13 @@ public class ChestProtectListener implements Listener {
if (externalPluginsAllowed && plugin.hasASkyBlock() && config.enable_askyblock_integration) {
Island island = ASkyBlockAPI.getInstance().getIslandAt(b.getLocation());
if (island != null) {
if (island.getOwner() == null) {
externalPluginsAllowed = island.getMembers().contains(p.getUniqueId());
} else {
externalPluginsAllowed = island.getMembers().contains(p.getUniqueId()) || island.getOwner().equals(p.getUniqueId());
}
}
}
if (externalPluginsAllowed && plugin.hasIslandWorld() && config.enable_islandworld_integration && IslandWorldApi.isInitialized()) {
if (b.getWorld().getName().equals(IslandWorldApi.getIslandWorld().getName())) {