Interface DataMapValueRemover<R,T>

Type Parameters:
R - the type of the registry this remover is for
T - the data type
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.

@FunctionalInterface public interface DataMapValueRemover<R,T>
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

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    A remover that completely removes the value.
  • Method Summary

    Modifier and Type
    Method
    Description
    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 the value.
  • 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 the value.
      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.