public void onPlayerJoin(PlayerJoinEvent e) {
updateShopItemVisibility(e.getPlayer(), false, false);
}
@EventHandler
public void onPlayerLeave(PlayerQuitEvent e) {
<BUG>for (Shop shop : plugin.getShopUtils().getShops()) {
shop.getItem().setVisible(e.getPlayer(), false);
}</BUG>
}
private void updateShopItemVisibility(Player p, boolean hideIfAway, boolean reset) {

public void onPlayerJoin(PlayerJoinEvent e) {
updateShopItemVisibility(e.getPlayer(), false, false);
}
@EventHandler
public void onPlayerLeave(PlayerQuitEvent e) {
for (Shop shop : plugin.getShopUtils().getShops()) {
if (shop.getItem() != null) {
shop.getItem().setVisible(e.getPlayer(), false);
}
}
}
private void updateShopItemVisibility(Player p, boolean hideIfAway, boolean reset) {
