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.
  • Field Details

    • POT_SPRITES

      public static final Map<net.minecraft.world.item.Item, net.minecraft.client.resources.model.sprite.SpriteId> POT_SPRITES
  • 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)
    • addPotPatternItem

      public void addPotPatternItem(net.minecraft.world.item.Item item, net.minecraft.resources.ResourceKey<net.minecraft.world.level.block.entity.DecoratedPotPattern> pattern)
      Associates an item with a decorated pot pattern. Replacing existing associations is not a supported use case.
      Parameters:
      item - The item to associate with the pattern.
      pattern - The pattern displayed by the item.