Record Class DataMapWrapper<T,A>

java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.plugin.builtin.wrapper.DataMapWrapper<T,A>
All Implemented Interfaces:
Iterable<DataMapWrapper.Data<T,A>>

public record DataMapWrapper<T,A>(net.minecraft.core.Registry<T> registry, net.neoforged.neoforge.registries.datamaps.DataMapType<T,A> type) extends Record implements Iterable<DataMapWrapper.Data<T,A>>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DataMapWrapper(net.minecraft.core.Registry<T> registry, net.neoforged.neoforge.registries.datamaps.DataMapType<T,A> type)
    Creates an instance of a DataMapWrapper record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Map<net.minecraft.resources.ResourceKey<T>,A>
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    get(T item)
     
    final int
    Returns a hash code value for this object.
     
     
    static <T> DataMapWrapper<T,?>
    of(RegistryWrapper<T> registry, net.minecraft.resources.ResourceLocation id)
     
    static DataMapWrapper<?,?>
    of(dev.latvian.mods.rhino.Context cx, net.minecraft.resources.ResourceLocation registry, net.minecraft.resources.ResourceLocation id)
     
    net.minecraft.core.Registry<T>
    Returns the value of the registry record component.
    final String
    Returns a string representation of this record class.
    net.neoforged.neoforge.registries.datamaps.DataMapType<T,A>
    Returns the value of the type record component.
    static <T> net.neoforged.neoforge.registries.datamaps.DataMapType<T,?>
    typeOf(RegistryWrapper<T> registry, net.minecraft.resources.ResourceLocation id)
     
    static net.neoforged.neoforge.registries.datamaps.DataMapType<?,?>
    typeOf(dev.latvian.mods.rhino.Context cx, net.minecraft.resources.ResourceLocation registry, net.minecraft.resources.ResourceLocation id)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • DataMapWrapper

      public DataMapWrapper(net.minecraft.core.Registry<T> registry, net.neoforged.neoforge.registries.datamaps.DataMapType<T,A> type)
      Creates an instance of a DataMapWrapper record class.
      Parameters:
      registry - the value for the registry record component
      type - the value for the type record component
  • Method Details

    • of

      public static DataMapWrapper<?,?> of(dev.latvian.mods.rhino.Context cx, net.minecraft.resources.ResourceLocation registry, net.minecraft.resources.ResourceLocation id)
    • typeOf

      public static net.neoforged.neoforge.registries.datamaps.DataMapType<?,?> typeOf(dev.latvian.mods.rhino.Context cx, net.minecraft.resources.ResourceLocation registry, net.minecraft.resources.ResourceLocation id)
    • of

      public static <T> DataMapWrapper<T,?> of(RegistryWrapper<T> registry, net.minecraft.resources.ResourceLocation id)
    • typeOf

      public static <T> net.neoforged.neoforge.registries.datamaps.DataMapType<T,?> typeOf(RegistryWrapper<T> registry, net.minecraft.resources.ResourceLocation id)
    • get

      @Nullable public A get(T item)
    • keys

      public Stream<T> keys()
    • iterator

      @NotNull public @NotNull Iterator<DataMapWrapper.Data<T,A>> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • byKey

      @NotNull public @NotNull Map<net.minecraft.resources.ResourceKey<T>,A> byKey()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • registry

      public net.minecraft.core.Registry<T> registry()
      Returns the value of the registry record component.
      Returns:
      the value of the registry record component
    • type

      public net.neoforged.neoforge.registries.datamaps.DataMapType<T,A> type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component