Interface DataMapValueRemover<R,T>
- Type Parameters:
T
- the data typeR
- the type of the registry this remover is for
- All Known Implementing Classes:
DataMapValueRemover.Default
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An interface used to remove values from registry data maps. This allows "decomposing" the data
and removing only a specific part of it (like a specific key in the case of map-based data).
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
A remover that completely removes the value. -
Method Summary
-
Method Details
-
remove
Optional<T> 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
.- 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.
-