Record Class NeoForgeUnifiedRegistries.Items

java.lang.Object
java.lang.Record
net.rebel459.unified.neoforge.core.NeoForgeUnifiedRegistries.Items
All Implemented Interfaces:
UnifiedRegistries.Items
Enclosing class:
NeoForgeUnifiedRegistries

public static record NeoForgeUnifiedRegistries.Items(String modId) extends Record implements UnifiedRegistries.Items
  • Constructor Summary

    Constructors
    Constructor
    Description
    Items(String modId)
    Creates an instance of a Items record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAlias(net.minecraft.resources.Identifier convertedFrom, net.minecraft.resources.Identifier convertedTo)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the modId record component.
    register(String path, Function<net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item> function, Supplier<net.minecraft.world.item.Item.Properties> properties)
     
    <T extends net.minecraft.world.level.block.Block>
    SuppliedItem
    registerBlockItem(net.minecraft.references.BlockItemId id, Supplier<T> block, BiFunction<net.minecraft.world.level.block.Block, net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item> function, Supplier<net.minecraft.world.item.Item.Properties> properties)
     
    registerBlockItem(SuppliedBlock block, BiFunction<net.minecraft.world.level.block.Block, net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item> function, Supplier<net.minecraft.world.item.Item.Properties> properties)
     
    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

    • Items

      public Items(String modId)
      Creates an instance of a Items record class.
      Parameters:
      modId - the value for the modId record component
  • Method Details

    • register

      public SuppliedItem register(String path, Function<net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item> function, Supplier<net.minecraft.world.item.Item.Properties> properties)
      Specified by:
      register in interface UnifiedRegistries.Items
    • registerBlockItem

      public SuppliedItem registerBlockItem(SuppliedBlock block, BiFunction<net.minecraft.world.level.block.Block, net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item> function, Supplier<net.minecraft.world.item.Item.Properties> properties)
      Specified by:
      registerBlockItem in interface UnifiedRegistries.Items
    • registerBlockItem

      public <T extends net.minecraft.world.level.block.Block> SuppliedItem registerBlockItem(net.minecraft.references.BlockItemId id, Supplier<T> block, BiFunction<net.minecraft.world.level.block.Block, net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item> function, Supplier<net.minecraft.world.item.Item.Properties> properties)
      Specified by:
      registerBlockItem in interface UnifiedRegistries.Items
    • addAlias

      public void addAlias(net.minecraft.resources.Identifier convertedFrom, net.minecraft.resources.Identifier convertedTo)
      Specified by:
      addAlias in interface UnifiedRegistries.Items
    • 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.
    • modId

      public String modId()
      Returns the value of the modId record component.
      Specified by:
      modId in interface UnifiedRegistries.Items
      Returns:
      the value of the modId record component