From bbd0046ed1d5dddd85016aef85fe1bfe97f5cb96 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 27 Jun 2017 21:42:41 +0200 Subject: [PATCH] Fixed crashes and errors ("Asynchronous entity track") Fixes #109 (Hopefully) Fixes #110 (Hopefully) --- src/main/java/de/epiceric/shopchest/utils/ShopUtils.java | 7 +++++-- 1 file changed, 5 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 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; } /**