mirror of
https://github.com/EpicEricEE/ShopChest.git
synced 2024-11-27 13:07:24 +01:00
Added null check for shop item when updating visibility
This commit is contained in:
parent
6a96e235a6
commit
f76ec6fe2d
@ -83,10 +83,12 @@ public class ShopItemListener implements Listener {
|
||||
for (Shop shop : shopUtils.getShops()) {
|
||||
Location shopLocation = shop.getLocation();
|
||||
if (w.equals(shopLocation.getWorld()) && shopLocation.distanceSquared(playerLocation) <= itemDistanceSquared) {
|
||||
if (shop.getItem() != null) {
|
||||
if (reset) shop.getItem().resetForPlayer(p);
|
||||
else shop.getItem().setVisible(p, true);
|
||||
}
|
||||
} else if (hideIfAway) {
|
||||
shop.getItem().setVisible(p, false);
|
||||
if (shop.getItem() != null) shop.getItem().setVisible(p, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user