mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 21:56:45 +01:00
Drop cherry_grove if present on pre 1.20 versions
This commit is contained in:
parent
ae63d0724f
commit
07c70f31d4
@ -37,6 +37,7 @@ import com.sk89q.worldedit.math.BlockVector2;
|
|||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.bukkit.HeightMap;
|
import org.bukkit.HeightMap;
|
||||||
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.Registry;
|
import org.bukkit.Registry;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
@ -50,10 +51,13 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static java.util.function.Predicate.not;
|
||||||
|
|
||||||
public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrapper<ChunkGenerator> {
|
public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrapper<ChunkGenerator> {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + BukkitPlotGenerator.class.getSimpleName());
|
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + BukkitPlotGenerator.class.getSimpleName());
|
||||||
@ -436,9 +440,15 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
|
|||||||
private static final List<Biome> BIOMES;
|
private static final List<Biome> BIOMES;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
Set<Biome> disabledBiomes = EnumSet.of(Biome.CUSTOM);
|
||||||
|
if (PlotSquared.platform().serverVersion()[1] <= 19) {
|
||||||
|
final Biome cherryGrove = Registry.BIOME.get(NamespacedKey.minecraft("cherry_grove"));
|
||||||
|
if (cherryGrove != null) {
|
||||||
|
disabledBiomes.add(cherryGrove);
|
||||||
|
}
|
||||||
|
}
|
||||||
BIOMES = Arrays.stream(Biome.values())
|
BIOMES = Arrays.stream(Biome.values())
|
||||||
.filter(b -> Registry.BIOME.get(b.getKey()) != null)
|
.filter(not(disabledBiomes::contains))
|
||||||
.filter(b -> b != Biome.CUSTOM)
|
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user