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,7 +202,11 @@ public class ChestProtectListener implements Listener {
if (externalPluginsAllowed && plugin.hasASkyBlock() && config.enable_askyblock_integration) { if (externalPluginsAllowed && plugin.hasASkyBlock() && config.enable_askyblock_integration) {
Island island = ASkyBlockAPI.getInstance().getIslandAt(b.getLocation()); Island island = ASkyBlockAPI.getInstance().getIslandAt(b.getLocation());
if (island != null) { if (island != null) {
externalPluginsAllowed = island.getMembers().contains(p.getUniqueId()) || island.getOwner().equals(p.getUniqueId()); if (island.getOwner() == null) {
externalPluginsAllowed = island.getMembers().contains(p.getUniqueId());
} else {
externalPluginsAllowed = island.getMembers().contains(p.getUniqueId()) || island.getOwner().equals(p.getUniqueId());
}
} }
} }