Class RegistrationContext

java.lang.Object
net.darkhax.bookshelf.common.api.registry.RegistrationContext

public final class RegistrationContext extends Object
Holds context that is shared between different registry adapters.
  • Constructor Details

    • RegistrationContext

      public RegistrationContext(String namespace)
  • Method Details

    • namespace

      public String namespace()
      Gets the namespace that all new content should be registered with.
      Returns:
      The namespace new content is registered with.
    • addPlaceableBlock

      public void addPlaceableBlock(RegistryReference<net.minecraft.resources.ResourceKey<net.minecraft.world.level.block.Block>, net.minecraft.world.level.block.Block> block, RegistrationContext.BlockItemGenerator itemBlock)
      Associates a block with a factory that provides its corresponding item form. The produced item will be automatically registered with the same ID as the block.
      Parameters:
      block - The block to associate the item with.
      itemBlock - A factory that creates the placer item.
    • registerPlacableBlocks

      public void registerPlacableBlocks(ItemRegistryAdapter itemRegistry)