Record Class DataRegistryAdapter

java.lang.Object
java.lang.Record
net.darkhax.bookshelf.common.impl.registry.adapter.DataRegistryAdapter

public record DataRegistryAdapter(RegistrationContext context, DataRegistryAdapter.Adapter adapter) extends Record
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a DataRegistryAdapter record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the adapter record component.
    <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>>
    add(String name, com.mojang.serialization.Codec<T> dataCodec, @Nullable com.mojang.serialization.Codec<T> syncCodec)
     
    <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>>
    add(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, com.mojang.serialization.Codec<T> dataCodec, @Nullable com.mojang.serialization.Codec<T> syncCodec)
     
    <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>>
    addSynced(String name, com.mojang.serialization.Codec<T> dataCodec)
     
    <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>>
    addSynced(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, com.mojang.serialization.Codec<T> dataCodec)
     
    <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>>
    addUnsynced(String name, com.mojang.serialization.Codec<T> dataCodec)
     
    <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>>
    addUnsynced(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, com.mojang.serialization.Codec<T> dataCodec)
     
    Returns the value of the context record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DataRegistryAdapter

      public DataRegistryAdapter(RegistrationContext context, DataRegistryAdapter.Adapter adapter)
      Creates an instance of a DataRegistryAdapter record class.
      Parameters:
      context - the value for the context record component
      adapter - the value for the adapter record component
  • Method Details

    • addSynced

      public <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> addSynced(String name, com.mojang.serialization.Codec<T> dataCodec)
    • addSynced

      public <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> addSynced(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, com.mojang.serialization.Codec<T> dataCodec)
    • addUnsynced

      public <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> addUnsynced(String name, com.mojang.serialization.Codec<T> dataCodec)
    • addUnsynced

      public <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> addUnsynced(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, com.mojang.serialization.Codec<T> dataCodec)
    • add

      public <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> add(String name, com.mojang.serialization.Codec<T> dataCodec, @Nullable com.mojang.serialization.Codec<T> syncCodec)
    • add

      public <T> net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> add(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, com.mojang.serialization.Codec<T> dataCodec, @Nullable com.mojang.serialization.Codec<T> syncCodec)
    • 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.
    • context

      public RegistrationContext context()
      Returns the value of the context record component.
      Returns:
      the value of the context record component
    • adapter

      public DataRegistryAdapter.Adapter adapter()
      Returns the value of the adapter record component.
      Returns:
      the value of the adapter record component