Record Class BiomeModifiers.RemoveFeaturesBiomeModifier
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.world.BiomeModifiers.RemoveFeaturesBiomeModifier
- Record Components:
biomes- Biomes to remove features from.features- PlacedFeatures to remove from biomes.steps- Decoration steps to remove features from.
- All Implemented Interfaces:
BiomeModifier
- Enclosing class:
BiomeModifiers
public static record BiomeModifiers.RemoveFeaturesBiomeModifier(HolderSet<Biome> biomes, HolderSet<PlacedFeature> features, Set<GenerationStep.Decoration> steps)
extends Record
implements BiomeModifier
Stock biome modifier that removes features from biomes. Has the following json format:
{
"type": "neoforge:remove_features", // required
"biomes": "#namespace:your_biome_tag", // accepts a biome id, [list of biome ids], or #namespace:biome_tag
"features": "namespace:your_feature", // accepts a placed feature id, [list of placed feature ids], or #namespace:feature_tag
"steps": "underground_ores" OR ["underground_ores", "vegetal_decoration"] // one or more decoration steps; optional field, defaults to all steps if not specified
}
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.neoforged.neoforge.common.world.BiomeModifier
BiomeModifier.Phase -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thebiomesrecord component.private final HolderSet<PlacedFeature> The field for thefeaturesrecord component.private final Set<GenerationStep.Decoration> The field for thestepsrecord component.Fields inherited from interface net.neoforged.neoforge.common.world.BiomeModifier
DIRECT_CODEC, LIST_CODEC, REFERENCE_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionRemoveFeaturesBiomeModifier(HolderSet<Biome> biomes, HolderSet<PlacedFeature> features, Set<GenerationStep.Decoration> steps) Creates an instance of aRemoveFeaturesBiomeModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionallSteps(HolderSet<Biome> biomes, HolderSet<PlacedFeature> features) Creates a modifier that removes the given features from all decoration steps in the given biomes.biomes()Returns the value of thebiomesrecord component.com.mojang.serialization.MapCodec<? extends BiomeModifier> codec()final booleanIndicates whether some other object is "equal to" this one.features()Returns the value of thefeaturesrecord component.final inthashCode()Returns a hash code value for this object.voidmodify(Holder<Biome> biome, BiomeModifier.Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder) Modifies the information via the provided biome builder.steps()Returns the value of thestepsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
Constructor Details
-
RemoveFeaturesBiomeModifier
public RemoveFeaturesBiomeModifier(HolderSet<Biome> biomes, HolderSet<PlacedFeature> features, Set<GenerationStep.Decoration> steps) Creates an instance of aRemoveFeaturesBiomeModifierrecord class.
-
-
Method Details
-
allSteps
public static BiomeModifiers.RemoveFeaturesBiomeModifier allSteps(HolderSet<Biome> biomes, HolderSet<PlacedFeature> features) Creates a modifier that removes the given features from all decoration steps in the given biomes.- Parameters:
biomes- Biomes to remove features from.features- PlacedFeatures to remove from biomes.
-
modify
public void modify(Holder<Biome> biome, BiomeModifier.Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder) Description copied from interface:BiomeModifierModifies 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.- Specified by:
modifyin interfaceBiomeModifier- 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
- Specified by:
codecin interfaceBiomeModifier- Returns:
- the codec which serializes and deserializes this biome modifier
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
biomes
Returns the value of thebiomesrecord component.- Returns:
- the value of the
biomesrecord component
-
features
Returns the value of thefeaturesrecord component.- Returns:
- the value of the
featuresrecord component
-
steps
Returns the value of thestepsrecord component.- Returns:
- the value of the
stepsrecord component
-