mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-13 22:21:06 +00:00
Change method name to what it really does
This commit is contained in:
parent
55a3bb87d3
commit
1c079b5abe
@ -36,17 +36,17 @@ public class ShopItemListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateShopVisibility(e.getPlayer(), true);
|
updateShopItemVisibility(e.getPlayer(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void onPlayerTeleport(PlayerTeleportEvent e) {
|
public void onPlayerTeleport(PlayerTeleportEvent e) {
|
||||||
updateShopVisibility(e.getPlayer(), true, e.getTo());
|
updateShopItemVisibility(e.getPlayer(), true, e.getTo());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent e) {
|
public void onPlayerJoin(PlayerJoinEvent e) {
|
||||||
updateShopVisibility(e.getPlayer(), false);
|
updateShopItemVisibility(e.getPlayer(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -56,11 +56,11 @@ public class ShopItemListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateShopVisibility(Player p, boolean hideIfAway) {
|
private void updateShopItemVisibility(Player p, boolean hideIfAway) {
|
||||||
updateShopVisibility(p, hideIfAway, p.getLocation());
|
updateShopItemVisibility(p, hideIfAway, p.getLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateShopVisibility(Player p, boolean hideIfAway, Location playerLocation) {
|
private void updateShopItemVisibility(Player p, boolean hideIfAway, Location playerLocation) {
|
||||||
|
|
||||||
double itemDistanceSquared = plugin.getShopChestConfig().maximal_item_distance;
|
double itemDistanceSquared = plugin.getShopChestConfig().maximal_item_distance;
|
||||||
itemDistanceSquared *= itemDistanceSquared;
|
itemDistanceSquared *= itemDistanceSquared;
|
||||||
|
Loading…
Reference in New Issue
Block a user