From c8f4e8980e151d0f0b7c52eb651172f43d667ec6 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 18 Aug 2016 22:59:12 +0200 Subject: [PATCH] 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() --- .../java/de/epiceric/shopchest/listeners/ShopItemListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java b/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java index a0069e9..bb0748a 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java @@ -64,7 +64,7 @@ public class ShopItemListener implements Listener { double itemDistanceSquared = plugin.getShopChestConfig().maximal_item_distance; itemDistanceSquared *= itemDistanceSquared; - World w = p.getWorld(); + World w = playerLocation.getWorld(); for (Shop shop : shopUtils.getShops()) { Location shopLocation = shop.getLocation();