Fixed error message in console after teleporting

p.getWorld() does not return the right world when the process of teleporting has not yet finished. We need to use the world of the passed location object, which in the PlayerTeleportEvent is e.getTo()
This commit is contained in:
Eric 2016-08-18 22:59:12 +02:00 committed by GitHub
parent e94463ccbe
commit c8f4e8980e

View File

@ -64,7 +64,7 @@ public class ShopItemListener implements Listener {
double itemDistanceSquared = plugin.getShopChestConfig().maximal_item_distance; double itemDistanceSquared = plugin.getShopChestConfig().maximal_item_distance;
itemDistanceSquared *= itemDistanceSquared; itemDistanceSquared *= itemDistanceSquared;
World w = p.getWorld(); World w = playerLocation.getWorld();
for (Shop shop : shopUtils.getShops()) { for (Shop shop : shopUtils.getShops()) {
Location shopLocation = shop.getLocation(); Location shopLocation = shop.getLocation();