From 7c20de10362c03abcb6744e064616c4c9385dbe0 Mon Sep 17 00:00:00 2001 From: Sven65 Date: Wed, 7 Feb 2024 12:24:28 +0100 Subject: [PATCH] Fix issue with virtual shops crashing in wg regions --- modules/1_10_R1/pom.xml | 2 +- modules/1_11_R1/pom.xml | 2 +- modules/1_12_R1/pom.xml | 2 +- modules/1_13_R1/pom.xml | 2 +- modules/1_13_R2/pom.xml | 2 +- modules/1_14_R1/pom.xml | 2 +- modules/1_15_R1/pom.xml | 2 +- modules/1_16_R1/pom.xml | 2 +- modules/1_16_R2/pom.xml | 2 +- modules/1_16_R3/pom.xml | 2 +- modules/1_17_R1/pom.xml | 2 +- modules/1_18_R1/pom.xml | 2 +- modules/1_18_R2/pom.xml | 2 +- modules/1_19_R1/pom.xml | 2 +- modules/1_19_R2/pom.xml | 2 +- modules/1_19_R3/pom.xml | 2 +- modules/1_20_R1/pom.xml | 2 +- modules/1_20_R2/pom.xml | 2 +- modules/1_20_R3/pom.xml | 2 +- modules/1_8_R1/pom.xml | 2 +- modules/1_8_R2/pom.xml | 2 +- modules/1_8_R3/pom.xml | 2 +- modules/1_9_R1/pom.xml | 2 +- modules/1_9_R2/pom.xml | 2 +- modules/Dist/pom.xml | 2 +- modules/Plugin/pom.xml | 4 ++-- .../xyz/mackan/Slabbo/pluginsupport/WorldguardSupport.java | 6 ++++++ pom.xml | 2 +- 28 files changed, 34 insertions(+), 28 deletions(-) diff --git a/modules/1_10_R1/pom.xml b/modules/1_10_R1/pom.xml index d15926c..c61d473 100644 --- a/modules/1_10_R1/pom.xml +++ b/modules/1_10_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_11_R1/pom.xml b/modules/1_11_R1/pom.xml index 2092256..caac430 100644 --- a/modules/1_11_R1/pom.xml +++ b/modules/1_11_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_12_R1/pom.xml b/modules/1_12_R1/pom.xml index 3827ade..e3e3559 100644 --- a/modules/1_12_R1/pom.xml +++ b/modules/1_12_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_13_R1/pom.xml b/modules/1_13_R1/pom.xml index 1473895..ffd3339 100644 --- a/modules/1_13_R1/pom.xml +++ b/modules/1_13_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_13_R2/pom.xml b/modules/1_13_R2/pom.xml index 222db8d..a24427b 100644 --- a/modules/1_13_R2/pom.xml +++ b/modules/1_13_R2/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_14_R1/pom.xml b/modules/1_14_R1/pom.xml index 7e1e102..92d5aca 100644 --- a/modules/1_14_R1/pom.xml +++ b/modules/1_14_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_15_R1/pom.xml b/modules/1_15_R1/pom.xml index 58d6691..2326665 100644 --- a/modules/1_15_R1/pom.xml +++ b/modules/1_15_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_16_R1/pom.xml b/modules/1_16_R1/pom.xml index b025ff8..0b91e3d 100644 --- a/modules/1_16_R1/pom.xml +++ b/modules/1_16_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_16_R2/pom.xml b/modules/1_16_R2/pom.xml index dfdc097..fb4186b 100644 --- a/modules/1_16_R2/pom.xml +++ b/modules/1_16_R2/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_16_R3/pom.xml b/modules/1_16_R3/pom.xml index b884e79..f48b3c8 100644 --- a/modules/1_16_R3/pom.xml +++ b/modules/1_16_R3/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_17_R1/pom.xml b/modules/1_17_R1/pom.xml index dca3d1d..1d39326 100644 --- a/modules/1_17_R1/pom.xml +++ b/modules/1_17_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_18_R1/pom.xml b/modules/1_18_R1/pom.xml index 669c325..8aa302a 100644 --- a/modules/1_18_R1/pom.xml +++ b/modules/1_18_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_18_R2/pom.xml b/modules/1_18_R2/pom.xml index 82c5fbe..1e7dad0 100644 --- a/modules/1_18_R2/pom.xml +++ b/modules/1_18_R2/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_19_R1/pom.xml b/modules/1_19_R1/pom.xml index 862872c..781dc1e 100644 --- a/modules/1_19_R1/pom.xml +++ b/modules/1_19_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../pom.xml diff --git a/modules/1_19_R2/pom.xml b/modules/1_19_R2/pom.xml index f85dc30..c4979da 100644 --- a/modules/1_19_R2/pom.xml +++ b/modules/1_19_R2/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../pom.xml diff --git a/modules/1_19_R3/pom.xml b/modules/1_19_R3/pom.xml index aa8fc79..0b909c6 100644 --- a/modules/1_19_R3/pom.xml +++ b/modules/1_19_R3/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../pom.xml diff --git a/modules/1_20_R1/pom.xml b/modules/1_20_R1/pom.xml index fc577d5..27c7dde 100644 --- a/modules/1_20_R1/pom.xml +++ b/modules/1_20_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../pom.xml diff --git a/modules/1_20_R2/pom.xml b/modules/1_20_R2/pom.xml index b7bea81..c49eeb9 100644 --- a/modules/1_20_R2/pom.xml +++ b/modules/1_20_R2/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../pom.xml diff --git a/modules/1_20_R3/pom.xml b/modules/1_20_R3/pom.xml index 703b19a..7402fc0 100644 --- a/modules/1_20_R3/pom.xml +++ b/modules/1_20_R3/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../pom.xml diff --git a/modules/1_8_R1/pom.xml b/modules/1_8_R1/pom.xml index 85662a0..e2f4ab8 100644 --- a/modules/1_8_R1/pom.xml +++ b/modules/1_8_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_8_R2/pom.xml b/modules/1_8_R2/pom.xml index 6297d66..eb92274 100644 --- a/modules/1_8_R2/pom.xml +++ b/modules/1_8_R2/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_8_R3/pom.xml b/modules/1_8_R3/pom.xml index 897990b..dfefaee 100644 --- a/modules/1_8_R3/pom.xml +++ b/modules/1_8_R3/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_9_R1/pom.xml b/modules/1_9_R1/pom.xml index 3ae5b68..23b8ac9 100644 --- a/modules/1_9_R1/pom.xml +++ b/modules/1_9_R1/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/1_9_R2/pom.xml b/modules/1_9_R2/pom.xml index ab44816..06cce0d 100644 --- a/modules/1_9_R2/pom.xml +++ b/modules/1_9_R2/pom.xml @@ -13,7 +13,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../ diff --git a/modules/Dist/pom.xml b/modules/Dist/pom.xml index 01e5c07..95f1ff8 100644 --- a/modules/Dist/pom.xml +++ b/modules/Dist/pom.xml @@ -12,7 +12,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 ../../pom.xml diff --git a/modules/Plugin/pom.xml b/modules/Plugin/pom.xml index b3b5ef1..f44d004 100644 --- a/modules/Plugin/pom.xml +++ b/modules/Plugin/pom.xml @@ -12,13 +12,13 @@ Slabbo-parent xyz.mackan - 1.0.51 + 1.0.52 ../../pom.xml xyz.mackan Slabbo-plugin - 1.0.51 + 1.0.52 jar Slab shops for spigot diff --git a/modules/Plugin/src/main/java/xyz/mackan/Slabbo/pluginsupport/WorldguardSupport.java b/modules/Plugin/src/main/java/xyz/mackan/Slabbo/pluginsupport/WorldguardSupport.java index e1c8da9..5c0f97d 100644 --- a/modules/Plugin/src/main/java/xyz/mackan/Slabbo/pluginsupport/WorldguardSupport.java +++ b/modules/Plugin/src/main/java/xyz/mackan/Slabbo/pluginsupport/WorldguardSupport.java @@ -82,6 +82,12 @@ public static ArrayList getShopsInRegion(ProtectedRegion region) { ArrayList shopsInRegion = new ArrayList<>(); for(Shop shop : ShopManager.shops.values()) { + /** + * Todo: This might be a dumb way to handle virtual shops, + * but since they're NEVER going to be in a WG region, it's probably fine. + */ + if (shop.location == null) continue; + if (region.contains(shop.location.getBlockX(), shop.location.getBlockY(), shop.location.getBlockZ())) { shopsInRegion.add(shop); } diff --git a/pom.xml b/pom.xml index 8e98a63..dd77013 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ xyz.mackan Slabbo-parent - 1.0.51 + 1.0.52 pom Slabbo