From ec51a60d8083bc20955474d70ace1588430d3099 Mon Sep 17 00:00:00 2001 From: SirYwell Date: Wed, 3 Aug 2022 20:07:19 +0200 Subject: [PATCH] replace usages of snow tag --- .../bukkit/listener/BlockEventListener.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 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 198710578..a5dd0feba 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java @@ -121,6 +121,11 @@ 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 final PlotAreaManager plotAreaManager; private final WorldEdit worldEdit; @@ -529,7 +534,7 @@ public class BlockEventListener implements Listener { event.setCancelled(true); return; } - if (Tag.SNOW.isTagged(event.getNewState().getType())) { + if (SNOW.contains(event.getNewState().getType())) { if (!plot.getFlag(SnowFormFlag.class)) { plot.debug("Snow could not form because snow-form = false"); event.setCancelled(true); @@ -561,7 +566,7 @@ public class BlockEventListener implements Listener { return; } Class> flag; - if (Tag.SNOW.isTagged(event.getNewState().getType())) { + if (SNOW.contains(event.getNewState().getType())) { flag = SnowFormFlag.class; } else if (Tag.ICE.isTagged(event.getNewState().getType())) { flag = IceFormFlag.class; @@ -678,7 +683,7 @@ public class BlockEventListener implements Listener { } return; } - if (Tag.SNOW.isTagged(blockType)) { + if (SNOW.contains(blockType)) { if (!plot.getFlag(SnowMeltFlag.class)) { plot.debug("Snow could not melt because snow-melt = false"); event.setCancelled(true);