Record Class Transformable.Remover

java.lang.Object
java.lang.Record
net.neoforged.neoforge.registries.datamaps.builtin.Transformable.Remover
All Implemented Interfaces:
DataMapValueRemover<Block, Transformable>
Enclosing class:
Transformable

public static record Transformable.Remover(ResourceKey<BlockTransformer> toRemove) extends Record implements DataMapValueRemover<Block, Transformable>
  • Field Details

  • Constructor Details

    • Remover

      public Remover(ResourceKey<BlockTransformer> toRemove)
      Creates an instance of a Remover record class.
      Parameters:
      toRemove - the value for the toRemove record component
  • Method Details

    • remove

      public Optional<Transformable> remove(Transformable value, Registry<Block> registry, com.mojang.datafixers.util.Either<TagKey<Block>, ResourceKey<Block>> source, Block object)
      Description copied from interface: DataMapValueRemover
      Remove the entry specified in this remover from the value.
      Specified by:
      remove in interface DataMapValueRemover<Block, Transformable>
      Parameters:
      value - the data to remove. Do NOT mutate this object. You should return copies instead, if you need to
      registry - the registry
      source - the source of the data
      object - the object to remove the data from
      Returns:
      the remainder. If an empty optional, the value will be removed completely. Otherwise, this method returns the new value of the attached data.
    • 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.
    • toRemove

      public ResourceKey<BlockTransformer> toRemove()
      Returns the value of the toRemove record component.
      Returns:
      the value of the toRemove record component