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>
-
Nested Class Summary
Nested classes/interfaces inherited from interface DataMapValueRemover
DataMapValueRemover.Default<T,R> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Transformable.Remover> private final ResourceKey<BlockTransformer> The field for thetoRemoverecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRemover(ResourceKey<BlockTransformer> toRemove) Creates an instance of aRemoverrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.remove(Transformable value, Registry<Block> registry, com.mojang.datafixers.util.Either<TagKey<Block>, ResourceKey<Block>> source, Block object) Remove the entry specified in this remover from thevalue.toRemove()Returns the value of thetoRemoverecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
toRemove
The field for thetoRemoverecord component. -
CODEC
-
-
Constructor Details
-
Remover
Creates an instance of aRemoverrecord class.- Parameters:
toRemove- the value for thetoRemoverecord 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:DataMapValueRemoverRemove the entry specified in this remover from thevalue.- Specified by:
removein interfaceDataMapValueRemover<Block, Transformable>- Parameters:
value- the data to remove. Do NOT mutate this object. You should return copies instead, if you need toregistry- the registrysource- the source of the dataobject- 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
-
hashCode
-
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). -
toRemove
Returns the value of thetoRemoverecord component.- Returns:
- the value of the
toRemoverecord component
-