Change method name to what it really does

This commit is contained in:
MineTheCube 2016-08-18 14:43:36 +02:00
parent 55a3bb87d3
commit 1c079b5abe

View File

@ -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;