Class DataMapValueRemover.Default<T,R>

java.lang.Object
net.neoforged.neoforge.registries.datamaps.DataMapValueRemover.Default<T,R>
Type Parameters:
T - the type of the data
R - 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.
  • Field Details

  • Constructor Details

    • Default

      private Default()
  • Method Details

    • defaultRemover

      public static <T, R> DataMapValueRemover.Default<T,R> defaultRemover()
    • codec

      public static <T, R> com.mojang.serialization.Codec<DataMapValueRemover.Default<T,R>> 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 the value.
      Specified by:
      remove in interface DataMapValueRemover<T,R>
      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.