mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-22 10:22:29 +00:00
parent
00323510bb
commit
e29da1279b
@ -233,7 +233,16 @@ public class ShopUtils {
|
|||||||
if (plugin.getShopChestConfig().only_show_shops_in_sight) {
|
if (plugin.getShopChestConfig().only_show_shops_in_sight) {
|
||||||
HashSet<Material> transparent = new HashSet<>();
|
HashSet<Material> transparent = new HashSet<>();
|
||||||
transparent.add(Material.AIR);
|
transparent.add(Material.AIR);
|
||||||
List<Block> sight = player.getLineOfSight(transparent, (int) plugin.getShopChestConfig().maximal_distance);
|
|
||||||
|
List<Block> 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<Shop> shopsInSight = new ArrayList<>();
|
ArrayList<Shop> shopsInSight = new ArrayList<>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user