Record Class NeoForgeUnifiedRegistries.Blocks

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

public static record NeoForgeUnifiedRegistries.Blocks(String modId) extends Record implements UnifiedRegistries.Blocks
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static List<com.mojang.datafixers.util.Pair<Supplier<? extends net.minecraft.world.level.block.entity.BlockEntityType<?>>, Supplier<? extends BlockLike>>>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Blocks(String modId)
    Creates an instance of a Blocks 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.
    static void
    modifyBlockEntities(net.neoforged.neoforge.event.BlockEntityTypeAddBlocksEvent event)
     
    <T extends net.minecraft.world.level.block.Block>
    SuppliedBlock
    register(String path, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> blockProperties)
     
    <T extends net.minecraft.world.level.block.Block, Y extends net.minecraft.world.level.block.entity.BlockEntity>
    SuppliedBlock
    register(String path, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> blockProperties, Supplier<net.minecraft.world.level.block.entity.BlockEntityType<Y>> type)
     
    <T extends net.minecraft.world.level.block.Block>
    SuppliedBlock
    registerWithoutItem(String blockPath, String itemPath, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> properties)
     
    <T extends net.minecraft.world.level.block.Block, Y extends net.minecraft.world.level.block.entity.BlockEntity>
    SuppliedBlock
    registerWithoutItem(String blockPath, String itemPath, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> properties, Supplier<net.minecraft.world.level.block.entity.BlockEntityType<Y>> type)
     
    <T extends net.minecraft.world.level.block.Block>
    SuppliedBlock
    registerWithoutItem(String path, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> properties)
     
    <T extends net.minecraft.world.level.block.Block, Y extends net.minecraft.world.level.block.entity.BlockEntity>
    SuppliedBlock
    registerWithoutItem(String path, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> properties, Supplier<net.minecraft.world.level.block.entity.BlockEntityType<Y>> type)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • BLOCK_ENTITIES

      public static List<com.mojang.datafixers.util.Pair<Supplier<? extends net.minecraft.world.level.block.entity.BlockEntityType<?>>, Supplier<? extends BlockLike>>> BLOCK_ENTITIES
  • Constructor Details

    • Blocks

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

    • register

      public <T extends net.minecraft.world.level.block.Block> SuppliedBlock register(String path, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> blockProperties)
      Specified by:
      register in interface UnifiedRegistries.Blocks
    • register

      public <T extends net.minecraft.world.level.block.Block, Y extends net.minecraft.world.level.block.entity.BlockEntity> SuppliedBlock register(String path, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> blockProperties, Supplier<net.minecraft.world.level.block.entity.BlockEntityType<Y>> type)
      Specified by:
      register in interface UnifiedRegistries.Blocks
    • registerWithoutItem

      public <T extends net.minecraft.world.level.block.Block> SuppliedBlock registerWithoutItem(String path, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> properties)
      Specified by:
      registerWithoutItem in interface UnifiedRegistries.Blocks
    • registerWithoutItem

      public <T extends net.minecraft.world.level.block.Block, Y extends net.minecraft.world.level.block.entity.BlockEntity> SuppliedBlock registerWithoutItem(String path, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> properties, Supplier<net.minecraft.world.level.block.entity.BlockEntityType<Y>> type)
      Specified by:
      registerWithoutItem in interface UnifiedRegistries.Blocks
    • registerWithoutItem

      public <T extends net.minecraft.world.level.block.Block> SuppliedBlock registerWithoutItem(String blockPath, String itemPath, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> properties)
      Specified by:
      registerWithoutItem in interface UnifiedRegistries.Blocks
    • registerWithoutItem

      public <T extends net.minecraft.world.level.block.Block, Y extends net.minecraft.world.level.block.entity.BlockEntity> SuppliedBlock registerWithoutItem(String blockPath, String itemPath, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function, Supplier<net.minecraft.world.level.block.state.BlockBehaviour.Properties> properties, Supplier<net.minecraft.world.level.block.entity.BlockEntityType<Y>> type)
      Specified by:
      registerWithoutItem in interface UnifiedRegistries.Blocks
    • addAlias

      public void addAlias(net.minecraft.resources.Identifier convertedFrom, net.minecraft.resources.Identifier convertedTo)
      Specified by:
      addAlias in interface UnifiedRegistries.Blocks
    • modifyBlockEntities

      public static void modifyBlockEntities(net.neoforged.neoforge.event.BlockEntityTypeAddBlocksEvent event)
    • 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.Blocks
      Returns:
      the value of the modId record component