diff --git a/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java b/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java index dc9abc1..7c49132 100644 --- a/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java +++ b/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java @@ -233,7 +233,16 @@ public class ShopUtils { if (plugin.getShopChestConfig().only_show_shops_in_sight) { HashSet transparent = new HashSet<>(); transparent.add(Material.AIR); - List sight = player.getLineOfSight(transparent, (int) plugin.getShopChestConfig().maximal_distance); + + List sight; + + try { + sight = player.getLineOfSight(transparent, (int) plugin.getShopChestConfig().maximal_distance); + } catch (IllegalStateException e) { + // This method is occasionally throwing this exception but the exact reason is unknown... + plugin.debug("Failed to get line of sight: " + e.getMessage()); + return; + } ArrayList shopsInSight = new ArrayList<>();