diff --git a/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java b/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java index b3e5e85..4fb4e8a 100644 --- a/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java +++ b/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java @@ -35,7 +35,10 @@ public class ShopUtils { * @return Shop at the given location or null if no shop is found there */ public Shop getShop(Location location) { - return shopLocation.get(location.getBlock().getLocation()); + Location newLocation = new Location(location.getWorld(), location.getBlockX(), + location.getBlockY(), location.getBlockZ()); + + return shopLocation.get(newLocation); } /** @@ -44,7 +47,7 @@ public class ShopUtils { * @return Whether there is a shop at the given location */ public boolean isShop(Location location) { - return shopLocation.containsKey(location.getBlock().getLocation()); + return getShop(location) != null; } /**