Package de.rasmusantons.cubiomes
Enum Class BiomeID
- All Implemented Interfaces:
Serializable,Comparable<BiomeID>,Constable
All BiomeIDs that cubiomes knows.
A Biome can be translated to a BiomeID like this:
Note: Cubiomes defines some duplicate values for biomes with different names in some versions of Minecraft.
Here, those names are accessible with getAltNames().
If running inside a Minecraft mod, the BiomeID can be translated to a Biome like this (using Mojang Mappings):
public static Holder<Biome> biomeIDToBiome(RegistryAccess access, BiomeID biomeID) throws NoSuchElementException {
Registry<Biome> registry = access.lookup(Registries.BIOME).orElseThrow();
Optional<Holder.Reference<Biome>> biome = registry.get(ResourceLocation.withDefaultNamespace(biomeID.name()));
if (biome.isPresent()) {
return biome.get();
} else {
for (String altName : biomeID.getAltNames()) {
if (!ResourceLocation.isValidPath(altName))
continue;
biome = registry.get(ResourceLocation.withDefaultNamespace(altName));
if (biome.isPresent())
return biome.get();
}
}
throw new NoSuchElementException("No value present");
}
public static BiomeID biomeToBiomeID(Holder<Biome> biome) {
String path = biome.unwrapKey().orElseThrow().location().getPath();
try {
return BiomeID.valueOf(path);
} catch (IllegalArgumentException e) {
for (BiomeID biomeID : BiomeID.values()) {
if (Arrays.asList(biomeID.getAltNames()).contains(path))
return biomeID;
}
}
throw new NoSuchElementException("No value present");
}
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic BiomeIDfromValue(int value) Returns the BiomeID for a given internal id.String[]Returns alternative names for this biome.intgetValue()Returns cubiomes' internal id of this biome.static BiomeIDReturns the enum constant of this class with the specified name.static BiomeID[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
none
-
ocean
-
plains
-
desert
-
mountains
-
forest
-
taiga
-
swamp
-
river
-
nether_wastes
-
the_end
-
frozen_ocean
-
frozen_river
-
snowy_tundra
-
snowy_mountains
-
mushroom_fields
-
mushroom_field_shore
-
beach
-
desert_hills
-
wooded_hills
-
taiga_hills
-
mountain_edge
-
jungle
-
jungle_hills
-
jungle_edge
-
deep_ocean
-
stone_shore
-
snowy_beach
-
birch_forest
-
birch_forest_hills
-
dark_forest
-
snowy_taiga
-
snowy_taiga_hills
-
giant_tree_taiga
-
giant_tree_taiga_hills
-
wooded_mountains
-
savanna
-
savanna_plateau
-
badlands
-
wooded_badlands_plateau
-
badlands_plateau
-
small_end_islands
-
end_midlands
-
end_highlands
-
end_barrens
-
warm_ocean
-
lukewarm_ocean
-
cold_ocean
-
deep_warm_ocean
-
deep_lukewarm_ocean
-
deep_cold_ocean
-
deep_frozen_ocean
-
seasonal_forest
-
rainforest
-
shrubland
-
the_void
-
sunflower_plains
-
desert_lakes
-
gravelly_mountains
-
flower_forest
-
taiga_mountains
-
swamp_hills
-
ice_spikes
-
modified_jungle
-
modified_jungle_edge
-
tall_birch_forest
-
tall_birch_hills
-
dark_forest_hills
-
snowy_taiga_mountains
-
giant_spruce_taiga
-
giant_spruce_taiga_hills
-
modified_gravelly_mountains
-
shattered_savanna
-
shattered_savanna_plateau
-
eroded_badlands
-
modified_wooded_badlands_plateau
-
modified_badlands_plateau
-
bamboo_jungle
-
bamboo_jungle_hills
-
soul_sand_valley
-
crimson_forest
-
warped_forest
-
basalt_deltas
-
dripstone_caves
-
lush_caves
-
meadow
-
grove
-
snowy_slopes
-
jagged_peaks
-
frozen_peaks
-
stony_peaks
-
deep_dark
-
mangrove_swamp
-
cherry_grove
-
pale_garden
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
public int getValue()Returns cubiomes' internal id of this biome.- Returns:
- cubiomes' internal id of this biome
-
getAltNames
Returns alternative names for this biome.- Returns:
- alternative names for this biome
-
fromValue
Returns the BiomeID for a given internal id.- Returns:
- the BiomeID for a given internal id
-