Search in sources :

Example 6 with BiomeNMSImpl

use of com.denizenscript.denizen.nms.v1_17.impl.BiomeNMSImpl in project Denizen-For-Bukkit by DenizenScript.

the class Handler method getBiomes.

@Override
public List<BiomeNMS> getBiomes(World world) {
    ServerLevel level = ((CraftWorld) world).getHandle();
    ArrayList<BiomeNMS> output = new ArrayList<>();
    for (Map.Entry<ResourceKey<Biome>, Biome> pair : level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY).entrySet()) {
        output.add(new BiomeNMSImpl(level, pair.getKey().location().toString()));
    }
    return output;
}
Also used : ServerLevel(net.minecraft.server.level.ServerLevel) Biome(net.minecraft.world.level.biome.Biome) ArrayList(java.util.ArrayList) CraftWorld(org.bukkit.craftbukkit.v1_18_R1.CraftWorld) Map(java.util.Map) ResourceKey(net.minecraft.resources.ResourceKey) BiomeNMSImpl(com.denizenscript.denizen.nms.v1_18.impl.BiomeNMSImpl)

Aggregations

Biome (net.minecraft.world.level.biome.Biome)6 ServerLevel (net.minecraft.server.level.ServerLevel)4 BiomeNMSImpl (com.denizenscript.denizen.nms.v1_17.impl.BiomeNMSImpl)3 BiomeNMSImpl (com.denizenscript.denizen.nms.v1_18.impl.BiomeNMSImpl)3 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 ResourceKey (net.minecraft.resources.ResourceKey)2 ResourceLocation (net.minecraft.resources.ResourceLocation)2 LevelChunk (net.minecraft.world.level.chunk.LevelChunk)2 CraftWorld (org.bukkit.craftbukkit.v1_17_R1.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_18_R1.CraftWorld)2 ChunkPos (net.minecraft.world.level.ChunkPos)1 LevelHeightAccessor (net.minecraft.world.level.LevelHeightAccessor)1 ChunkBiomeContainer (net.minecraft.world.level.chunk.ChunkBiomeContainer)1 LevelChunkSection (net.minecraft.world.level.chunk.LevelChunkSection)1 CraftChunk (org.bukkit.craftbukkit.v1_17_R1.CraftChunk)1 CraftChunk (org.bukkit.craftbukkit.v1_18_R1.CraftChunk)1