Record Class RegistryHelper

java.lang.Object
java.lang.Record
io.github.vampirestudios.vampirelib.utils.registry.RegistryHelper

public record RegistryHelper(String modId) extends Record
  • Nested Class Summary

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

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

    Modifier and Type
    Method
    Description
     
    static net.minecraft.world.level.block.Block[]
    collectBlocks(Class<?> blockClass)
     
     
    net.minecraft.sounds.SoundEvent
     
    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.
    <T extends net.minecraft.world.level.block.entity.BlockEntity>
    net.minecraft.world.level.block.entity.BlockEntityType<T>
    registerBlockEntity(net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder.Factory<T> blockEntityType, Class<? extends net.minecraft.world.level.block.Block> block, String name)
     
    <T extends net.minecraft.world.level.block.entity.BlockEntity>
    net.minecraft.world.level.block.entity.BlockEntityType<T>
    registerBlockEntity(net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder<T> builder, String name)
     
    <T extends net.minecraft.world.entity.Entity>
    net.minecraft.world.entity.EntityType<T>
    registerEntity(net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder<T> builder, String name)
     
    net.minecraft.sounds.SoundEvent
    registerSoundEvent(net.minecraft.sounds.SoundEvent soundEvent, String name)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • RegistryHelper

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

    • createRegistryHelper

      public static RegistryHelper createRegistryHelper(String modId)
    • blocks

      public RegistryHelper.Blocks blocks()
    • items

      public RegistryHelper.Items items()
    • registerBlockEntity

      public <T extends net.minecraft.world.level.block.entity.BlockEntity> net.minecraft.world.level.block.entity.BlockEntityType<T> registerBlockEntity(net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder.Factory<T> blockEntityType, Class<? extends net.minecraft.world.level.block.Block> block, String name)
    • registerBlockEntity

      public <T extends net.minecraft.world.level.block.entity.BlockEntity> net.minecraft.world.level.block.entity.BlockEntityType<T> registerBlockEntity(net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder<T> builder, String name)
    • collectBlocks

      public static net.minecraft.world.level.block.Block[] collectBlocks(Class<?> blockClass)
    • registerEntity

      public <T extends net.minecraft.world.entity.Entity> net.minecraft.world.entity.EntityType<T> registerEntity(net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder<T> builder, String name)
    • createSoundEvent

      public net.minecraft.sounds.SoundEvent createSoundEvent(String name)
    • registerSoundEvent

      public net.minecraft.sounds.SoundEvent registerSoundEvent(net.minecraft.sounds.SoundEvent soundEvent, String name)
    • 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.
      Returns:
      the value of the modId record component