Package net.minecraftforge.common.world
Interface BiomeModifier
- All Known Implementing Classes:
ForgeBiomeModifiers.AddFeaturesBiomeModifier
,ForgeBiomeModifiers.AddSpawnsBiomeModifier
,ForgeBiomeModifiers.RemoveFeaturesBiomeModifier
,ForgeBiomeModifiers.RemoveSpawnsBiomeModifier
,NoneBiomeModifier
public interface BiomeModifier
JSON-serializable biome modifier.
Requires a
Codec
to deserialize biome modifiers from biome modifier jsons.
Biome modifier jsons have the following json format:
{ "type": "yourmod:yourserializer", // Indicates a registered biome modifier serializer // Additional fields can be specified here according to the codec }
Datapacks can also disable a biome modifier by overriding the json and using "type": "forge:none"
.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<BiomeModifier> Codec for (de)serializing biome modifiers inline.static final com.mojang.serialization.Codec
<HolderSet<BiomeModifier>> Codec for referring to biome modifiers by id, list of id, or tags.static final com.mojang.serialization.Codec
<Holder<BiomeModifier>> Codec for referring to biome modifiers by id in other datapack registry files. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<? extends BiomeModifier> codec()
void
modify
(Holder<Biome> biome, BiomeModifier.Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder) Modifies the information via the provided biome builder.
-
Field Details
-
DIRECT_CODEC
Codec for (de)serializing biome modifiers inline. Mods can use this for data generation. -
REFERENCE_CODEC
Codec for referring to biome modifiers by id in other datapack registry files. Can only be used withRegistryOps
. -
LIST_CODEC
Codec for referring to biome modifiers by id, list of id, or tags. Can only be used withRegistryOps
.
-
-
Method Details
-
modify
void modify(Holder<Biome> biome, BiomeModifier.Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder) Modifies the information via the provided biome builder. Allows mob spawns and world-gen features to be added or removed, and climate and client effects to be modified.- Parameters:
biome
- the named biome being modified (with original data readable).phase
- biome modification phase. Biome modifiers apply in each phase in order of the enum constants.builder
- mutable biome info builder. Apply changes to this.
-
codec
com.mojang.serialization.MapCodec<? extends BiomeModifier> codec()- Returns:
- the codec which serializes and deserializes this biome modifier
-