mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-09 20:21:07 +00:00
Fixed NPE while creating shop on an unowned ASkyBlock island
This commit is contained in:
parent
f6eb2948b5
commit
a92bd9292e
@ -240,11 +240,16 @@ public class ShopInteractListener implements Listener {
|
|||||||
if (loc != null) {
|
if (loc != null) {
|
||||||
Island island = ASkyBlockAPI.getInstance().getIslandAt(loc);
|
Island island = ASkyBlockAPI.getInstance().getIslandAt(loc);
|
||||||
if (island != null) {
|
if (island != null) {
|
||||||
|
if (island.getOwner() == null) {
|
||||||
|
plugin.debug("Chest is on an unowned island.");
|
||||||
|
externalPluginsAllowed &= island.getMembers().contains(p.getUniqueId());
|
||||||
|
} else {
|
||||||
plugin.debug("Chest is on island of " + Bukkit.getOfflinePlayer(island.getOwner()).getName());
|
plugin.debug("Chest is on island of " + Bukkit.getOfflinePlayer(island.getOwner()).getName());
|
||||||
externalPluginsAllowed &= island.getMembers().contains(p.getUniqueId()) || island.getOwner().equals(p.getUniqueId());
|
externalPluginsAllowed &= island.getMembers().contains(p.getUniqueId()) || island.getOwner().equals(p.getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!externalPluginsAllowed) denyReason = "ASkyBlock";
|
if (!externalPluginsAllowed) denyReason = "ASkyBlock";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user