mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
chore: make snow set more future-proof (#3768)
This commit is contained in:
parent
8d4333ad9d
commit
986812b9e4
@ -109,6 +109,8 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class BlockEventListener implements Listener {
|
public class BlockEventListener implements Listener {
|
||||||
@ -121,22 +123,10 @@ public class BlockEventListener implements Listener {
|
|||||||
Material.TURTLE_EGG,
|
Material.TURTLE_EGG,
|
||||||
Material.TURTLE_SPAWN_EGG
|
Material.TURTLE_SPAWN_EGG
|
||||||
);
|
);
|
||||||
private static final Set<Material> SNOW; // needed as Tag.SNOW isn't present in 1.16.5
|
private static final Set<Material> SNOW = Stream.of(Material.values()) // needed as Tag.SNOW isn't present in 1.16.5
|
||||||
|
.filter(material -> material.name().contains("SNOW"))
|
||||||
static {
|
.filter(Material::isBlock)
|
||||||
if (PlotSquared.platform().serverVersion()[1] < 17) {
|
.collect(Collectors.toUnmodifiableSet());
|
||||||
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 PlotAreaManager plotAreaManager;
|
||||||
private final WorldEdit worldEdit;
|
private final WorldEdit worldEdit;
|
||||||
|
Loading…
Reference in New Issue
Block a user