Class DataMapValueRemover.Default<T,R>
java.lang.Object
net.neoforged.neoforge.registries.datamaps.DataMapValueRemover.Default<T,R>
- Type Parameters:
T
- the type of the dataR
- the registry type
- All Implemented Interfaces:
DataMapValueRemover<R,
T>
- Enclosing interface:
DataMapValueRemover<R,
T>
public static class DataMapValueRemover.Default<T,R>
extends Object
implements DataMapValueRemover<R,T>
A remover that completely removes the value.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.neoforged.neoforge.registries.datamaps.DataMapValueRemover
DataMapValueRemover.Default<T,
R> -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
R> com.mojang.serialization.Codec <DataMapValueRemover.Default<T, R>> codec()
static <T,
R> DataMapValueRemover.Default <T, R> remove
(T value, Registry<R> registry, com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>> source, R object) Remove the entry specified in this remover from thevalue
.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
Default
private Default()
-
-
Method Details
-
defaultRemover
-
codec
-
remove
public Optional<T> remove(T value, Registry<R> registry, com.mojang.datafixers.util.Either<TagKey<R>, ResourceKey<R>> source, R object) Description copied from interface:DataMapValueRemover
Remove the entry specified in this remover from thevalue
.- Specified by:
remove
in interfaceDataMapValueRemover<T,
R> - 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.
-