Record Class StructureModifierTest.TestModifier

java.lang.Object
java.lang.Record
net.neoforged.neoforge.oldtest.world.StructureModifierTest.TestModifier
All Implemented Interfaces:
StructureModifier
Enclosing class:
StructureModifierTest

public static record StructureModifierTest.TestModifier(net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.structure.Structure> structures, net.minecraft.world.entity.MobCategory category, net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData spawn) extends Record implements StructureModifier
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.neoforged.neoforge.common.world.StructureModifier

    StructureModifier.Phase
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final net.minecraft.world.entity.MobCategory
    The field for the category record component.
    private static final DeferredHolder<com.mojang.serialization.MapCodec<? extends StructureModifier>,com.mojang.serialization.MapCodec<? extends StructureModifier>>
     
    private final net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData
    The field for the spawn record component.
    private final net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.structure.Structure>
    The field for the structures record component.

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

    DIRECT_CODEC, LIST_CODEC, REFERENCE_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
    TestModifier(net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.structure.Structure> structures, net.minecraft.world.entity.MobCategory category, net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData spawn)
    Creates an instance of a TestModifier record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.entity.MobCategory
    Returns the value of the category record component.
    com.mojang.serialization.MapCodec<? extends StructureModifier>
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    private static com.mojang.serialization.MapCodec<StructureModifierTest.TestModifier>
     
    void
    modify(net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.Structure> structure, StructureModifier.Phase phase, ModifiableStructureInfo.StructureInfo.Builder builder)
    Modifies the information via the provided structure builder.
    net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData
    Returns the value of the spawn record component.
    net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.structure.Structure>
    Returns the value of the structures 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

    • structures

      private final net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.structure.Structure> structures
      The field for the structures record component.
    • category

      private final net.minecraft.world.entity.MobCategory category
      The field for the category record component.
    • spawn

      private final net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData spawn
      The field for the spawn record component.
    • SERIALIZER

      private static final DeferredHolder<com.mojang.serialization.MapCodec<? extends StructureModifier>,com.mojang.serialization.MapCodec<? extends StructureModifier>> SERIALIZER
  • Constructor Details

    • TestModifier

      public TestModifier(net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.structure.Structure> structures, net.minecraft.world.entity.MobCategory category, net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData spawn)
      Creates an instance of a TestModifier record class.
      Parameters:
      structures - the value for the structures record component
      category - the value for the category record component
      spawn - the value for the spawn record component
  • Method Details

    • modify

      public void modify(net.minecraft.core.Holder<net.minecraft.world.level.levelgen.structure.Structure> structure, StructureModifier.Phase phase, ModifiableStructureInfo.StructureInfo.Builder builder)
      Description copied from interface: StructureModifier
      Modifies the information via the provided structure 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 StructureModifier
      Parameters:
      structure - the named structure being modified (with original data readable).
      phase - structure modification phase. Structure modifiers apply in each phase in order of the enum constants.
      builder - mutable structure info builder. Apply changes to this.
    • codec

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

      private static com.mojang.serialization.MapCodec<StructureModifierTest.TestModifier> makeCodec()
    • 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.
    • structures

      public net.minecraft.core.HolderSet<net.minecraft.world.level.levelgen.structure.Structure> structures()
      Returns the value of the structures record component.
      Returns:
      the value of the structures record component
    • category

      public net.minecraft.world.entity.MobCategory category()
      Returns the value of the category record component.
      Returns:
      the value of the category record component
    • spawn

      public net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData spawn()
      Returns the value of the spawn record component.
      Returns:
      the value of the spawn record component