From 59a8fe5d6f3054866b754a27c12b874d82e71fd2 Mon Sep 17 00:00:00 2001 From: SirYwell Date: Thu, 4 Aug 2022 16:36:24 +0200 Subject: [PATCH] powder snow is 1.17+ --- .../bukkit/listener/BlockEventListener.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java index a5dd0feba..9248c078b 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java @@ -121,11 +121,23 @@ public class BlockEventListener implements Listener { Material.TURTLE_EGG, Material.TURTLE_SPAWN_EGG ); - private static final Set SNOW = Set.of( // needed as Tag.SNOW isn't present in 1.16.5 - Material.SNOW, - Material.SNOW_BLOCK, - Material.POWDER_SNOW - ); + private static final Set SNOW; // needed as Tag.SNOW isn't present in 1.16.5 + + static { + if (PlotSquared.platform().serverVersion()[1] < 17) { + SNOW = Set.of( + Material.SNOW, + Material.SNOW_BLOCK + ); + } else { + SNOW = Set.of( + Material.SNOW, + Material.SNOW_BLOCK, + Material.POWDER_SNOW // only since 1.17 + ); + } + } + private final PlotAreaManager plotAreaManager; private final WorldEdit worldEdit;