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(net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome> biomes, net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.placement.PlacedFeature> features, Set<net.minecraft.world.level.levelgen.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

    Fields
    Modifier and Type
    Field
    Description
    private final net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>
    The field for the biomes record component.
    private final net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.placement.PlacedFeature>
    The field for the features record component.
    private final Set<net.minecraft.world.level.levelgen.GenerationStep.Decoration>
    The field for the steps record component.

    Fields inherited from interface net.neoforged.neoforge.common.world.BiomeModifier

    DIRECT_CODEC, LIST_CODEC, REFERENCE_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
    RemoveFeaturesBiomeModifier(net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome> biomes, net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.placement.PlacedFeature> features, Set<net.minecraft.world.level.levelgen.GenerationStep.Decoration> steps)
    Creates an instance of a RemoveFeaturesBiomeModifier record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    allSteps(net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome> biomes, net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.placement.PlacedFeature> features)
    Creates a modifier that removes the given features from all decoration steps in the given biomes.
    net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>
    Returns the value of the biomes record component.
    com.mojang.serialization.MapCodec<? extends BiomeModifier>
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.placement.PlacedFeature>
    Returns the value of the features record component.
    final int
    Returns a hash code value for this object.
    void
    modify(net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biome, BiomeModifier.Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder)
    Modifies the information via the provided biome builder.
    Set<net.minecraft.world.level.levelgen.GenerationStep.Decoration>
    Returns the value of the steps record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • biomes

      private final net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome> biomes
      The field for the biomes record component.
    • features

      private final net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.placement.PlacedFeature> features
      The field for the features record component.
    • steps

      private final Set<net.minecraft.world.level.levelgen.GenerationStep.Decoration> steps
      The field for the steps record component.
  • Constructor Details

    • RemoveFeaturesBiomeModifier

      public RemoveFeaturesBiomeModifier(net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome> biomes, net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.placement.PlacedFeature> features, Set<net.minecraft.world.level.levelgen.GenerationStep.Decoration> steps)
      Creates an instance of a RemoveFeaturesBiomeModifier record class.
      Parameters:
      biomes - the value for the biomes record component
      features - the value for the features record component
      steps - the value for the steps record component
  • Method Details

    • allSteps

      public static BiomeModifiers.RemoveFeaturesBiomeModifier allSteps(net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome> biomes, net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.placement.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(net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biome, BiomeModifier.Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder)
      Description copied from interface: BiomeModifier
      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.
      Specified by:
      modify in interface BiomeModifier
      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

      public com.mojang.serialization.MapCodec<? extends BiomeModifier> codec()
      Specified by:
      codec in interface BiomeModifier
      Returns:
      the codec which serializes and deserializes this biome modifier
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • biomes

      public net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome> biomes()
      Returns the value of the biomes record component.
      Returns:
      the value of the biomes record component
    • features

      public net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.placement.PlacedFeature> features()
      Returns the value of the features record component.
      Returns:
      the value of the features record component
    • steps

      public Set<net.minecraft.world.level.levelgen.GenerationStep.Decoration> steps()
      Returns the value of the steps record component.
      Returns:
      the value of the steps record component