From e532e9c095d0e72c55f0b107277c11c360aa7119 Mon Sep 17 00:00:00 2001 From: ken_kentan Date: Tue, 15 Jan 2019 00:24:57 +0900 Subject: [PATCH] Fix shop updater (#236) --- src/main/java/de/epiceric/shopchest/utils/ShopUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java b/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java index 2e59859..325a724 100644 --- a/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java +++ b/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java @@ -380,9 +380,11 @@ public class ShopUtils { double holoDistSqr = Math.pow(Config.maximalDistance, 2); double itemDistSqr = Math.pow(Config.maximalItemDistance, 2); + Location playerLocation = p.getLocation(); + for (Shop shop : getShops()) { - if (p.getLocation().getWorld().getName().equals(shop.getLocation().getWorld().getName())) { - double distSqr = shop.getLocation().distanceSquared(p.getLocation()); + if (playerLocation.getWorld().getName().equals(shop.getLocation().getWorld().getName())) { + double distSqr = shop.getLocation().distanceSquared(playerLocation); if (shop.hasHologram()) { if (distSqr <= holoDistSqr) {