Class ObjectRegistries<T>

java.lang.Object
net.tearpelato.craftcorelib.api.registry.ObjectRegistries<T>
All Implemented Interfaces:
Supplier<T>
Direct Known Subclasses:
BlockRegistries, EntityDataSerializersRegistry, StatRegistry

public class ObjectRegistries<T> extends Object implements Supplier<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final net.minecraft.resources.Identifier
     
     
    protected final net.minecraft.core.Registry<? super T>
     
    protected final Supplier<T>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ObjectRegistries(net.minecraft.core.Registry<? super T> registry, net.minecraft.resources.Identifier id, Supplier<T> supplier)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected T
     
    static void
     
    static void
    createAll(String modId, net.minecraft.core.Registry<?> registry)
     
    get()
     
    net.minecraft.resources.Identifier
     
    net.minecraft.resources.ResourceKey<? super T>
     
    protected boolean
    matches(net.minecraft.core.Registry<?> r)
     
    protected void
     
    static <T extends net.minecraft.world.level.block.Block>
    ObjectRegistries<T>
    registerBlock(net.minecraft.resources.Identifier id, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function)
    Creating a custom block with proper Item, getting the Id, and the supplier function to define the Block Properties
    static <T extends net.minecraft.world.level.block.entity.BlockEntity>
    ObjectRegistries<net.minecraft.world.level.block.entity.BlockEntityType<T>>
    registerBlockEntity(net.minecraft.resources.Identifier id, BiFunction<net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState, T> factory, Supplier<net.minecraft.world.level.block.Block[]> blocks)
     
    static <T extends net.minecraft.world.level.block.Block>
    ObjectRegistries<net.minecraft.world.item.Item>
    registerBlockItem(net.minecraft.resources.Identifier id, Function<net.minecraft.world.item.Item.Properties, T> function, Supplier<T> block, net.minecraft.world.item.Item.Properties properties)
     
    static <T extends net.minecraft.world.level.block.Block>
    ObjectRegistries<T>
    registerBlockWithoutItem(net.minecraft.resources.Identifier id, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function)
     
    static ObjectRegistries<net.minecraft.world.item.CreativeModeTab>
    registerCreativeTab(net.minecraft.resources.Identifier id, Supplier<net.minecraft.world.item.CreativeModeTab> supplier)
     
    static <T> ObjectRegistries<T>
    registerCustom(net.minecraft.core.Registry<? super T> registry, net.minecraft.resources.Identifier id, Supplier<T> supplier)
     
    static <T extends net.minecraft.core.component.DataComponentType<?>>
    ObjectRegistries<T>
    registerEnchantmentComponentEffect(net.minecraft.resources.Identifier id, Supplier<T> supplier)
     
    static <T extends com.mojang.serialization.MapCodec<net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect>>
    ObjectRegistries<T>
    registerEnchantmentEffect(net.minecraft.resources.Identifier id, Supplier<T> supplier)
     
    static <T extends net.minecraft.world.entity.EntityType<?>>
    ObjectRegistries<T>
    registerEntity(net.minecraft.resources.Identifier id, Supplier<T> supplier)
     
    static <T> ObjectRegistries<net.minecraft.network.syncher.EntityDataSerializer<T>>
    registerEntityDataSerializer(net.minecraft.resources.Identifier id, Supplier<net.minecraft.network.syncher.EntityDataSerializer<T>> supplier)
     
    static <T extends net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacerType<?>>
    ObjectRegistries<T>
    registerFoliagePlacer(net.minecraft.resources.Identifier id, Supplier<T> supplier)
     
    static <T extends net.minecraft.world.item.Item>
    ObjectRegistries<T>
    registerItem(net.minecraft.resources.Identifier id, Function<net.minecraft.world.item.Item.Properties, T> function, Supplier<net.minecraft.world.item.Item.Properties> supplier)
    Creating a custom Item with the Id and the supplier for the Item Properties
    static <T extends net.minecraft.world.level.saveddata.maps.MapDecorationType>
    ObjectRegistries<T>
    registerMapDecoration(net.minecraft.resources.Identifier id, Supplier<T> supplier)
     
    static <T extends net.minecraft.world.inventory.AbstractContainerMenu>
    ObjectRegistries<net.minecraft.world.inventory.MenuType<T>>
    registerMenu(net.minecraft.resources.Identifier id, BiFunction<Integer, net.minecraft.world.entity.player.Inventory, T> function)
     
    static <T extends net.minecraft.world.inventory.AbstractContainerMenu>
    ObjectRegistries<net.minecraft.world.inventory.MenuType<T>>
    registerMenuData(net.minecraft.resources.Identifier id, org.apache.commons.lang3.function.TriFunction<Integer, net.minecraft.world.entity.player.Inventory, net.minecraft.network.FriendlyByteBuf, T> function)
     
    static <T extends net.minecraft.core.particles.ParticleType<?>>
    ObjectRegistries<T>
    registerParticleType(net.minecraft.resources.Identifier id, Supplier<T> supplier)
     
    static <T extends net.minecraft.world.item.crafting.RecipeSerializer<?>>
    ObjectRegistries<T>
    registerRecipeSerializer(net.minecraft.resources.Identifier id, Supplier<T> supplier)
     
    static <T extends net.minecraft.world.item.crafting.Recipe<?>>
    ObjectRegistries<net.minecraft.world.item.crafting.RecipeType<T>>
    registerRecipeType(net.minecraft.resources.Identifier id)
     
    static ObjectRegistries<net.minecraft.sounds.SoundEvent>
    registerSound(net.minecraft.resources.Identifier id, Function<net.minecraft.resources.Identifier, Supplier<net.minecraft.sounds.SoundEvent>> supplier)
     
    static ObjectRegistries<net.minecraft.resources.Identifier>
    registerStat(net.minecraft.resources.Identifier id, net.minecraft.stats.StatFormatter formatter)
     
    static <T extends net.minecraft.world.level.levelgen.feature.treedecorators.TreeDecoratorType<?>>
    ObjectRegistries<T>
    registerTreeDecoratorType(net.minecraft.resources.Identifier id, Supplier<T> supplier)
     
    static <T extends net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacerType<?>>
    ObjectRegistries<T>
    registerTrunkPlacer(net.minecraft.resources.Identifier id, Supplier<T> supplier)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • id

      protected final net.minecraft.resources.Identifier id
    • supplier

      protected final Supplier<T> supplier
    • registry

      protected final net.minecraft.core.Registry<? super T> registry
    • instance

      public T instance
  • Constructor Details

    • ObjectRegistries

      public ObjectRegistries(net.minecraft.core.Registry<? super T> registry, net.minecraft.resources.Identifier id, Supplier<T> supplier)
  • Method Details

    • get

      public T get()
      Specified by:
      get in interface Supplier<T>
    • create

      protected T create()
    • getKey

      public net.minecraft.resources.ResourceKey<? super T> getKey()
    • getId

      public net.minecraft.resources.Identifier getId()
    • register

      protected void register()
    • matches

      protected boolean matches(net.minecraft.core.Registry<?> r)
    • registerBlock

      public static <T extends net.minecraft.world.level.block.Block> ObjectRegistries<T> registerBlock(net.minecraft.resources.Identifier id, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function)
      Creating a custom block with proper Item, getting the Id, and the supplier function to define the Block Properties
    • registerBlockWithoutItem

      public static <T extends net.minecraft.world.level.block.Block> ObjectRegistries<T> registerBlockWithoutItem(net.minecraft.resources.Identifier id, Function<net.minecraft.world.level.block.state.BlockBehaviour.Properties, T> function)
    • registerItem

      public static <T extends net.minecraft.world.item.Item> ObjectRegistries<T> registerItem(net.minecraft.resources.Identifier id, Function<net.minecraft.world.item.Item.Properties, T> function, Supplier<net.minecraft.world.item.Item.Properties> supplier)
      Creating a custom Item with the Id and the supplier for the Item Properties
    • registerBlockItem

      public static <T extends net.minecraft.world.level.block.Block> ObjectRegistries<net.minecraft.world.item.Item> registerBlockItem(net.minecraft.resources.Identifier id, Function<net.minecraft.world.item.Item.Properties, T> function, Supplier<T> block, net.minecraft.world.item.Item.Properties properties)
    • registerCreativeTab

      public static ObjectRegistries<net.minecraft.world.item.CreativeModeTab> registerCreativeTab(net.minecraft.resources.Identifier id, Supplier<net.minecraft.world.item.CreativeModeTab> supplier)
    • registerBlockEntity

      public static <T extends net.minecraft.world.level.block.entity.BlockEntity> ObjectRegistries<net.minecraft.world.level.block.entity.BlockEntityType<T>> registerBlockEntity(net.minecraft.resources.Identifier id, BiFunction<net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState, T> factory, Supplier<net.minecraft.world.level.block.Block[]> blocks)
    • registerEntity

      public static <T extends net.minecraft.world.entity.EntityType<?>> ObjectRegistries<T> registerEntity(net.minecraft.resources.Identifier id, Supplier<T> supplier)
    • registerMenu

      public static <T extends net.minecraft.world.inventory.AbstractContainerMenu> ObjectRegistries<net.minecraft.world.inventory.MenuType<T>> registerMenu(net.minecraft.resources.Identifier id, BiFunction<Integer, net.minecraft.world.entity.player.Inventory, T> function)
    • registerMenuData

      public static <T extends net.minecraft.world.inventory.AbstractContainerMenu> ObjectRegistries<net.minecraft.world.inventory.MenuType<T>> registerMenuData(net.minecraft.resources.Identifier id, org.apache.commons.lang3.function.TriFunction<Integer, net.minecraft.world.entity.player.Inventory, net.minecraft.network.FriendlyByteBuf, T> function)
    • registerParticleType

      public static <T extends net.minecraft.core.particles.ParticleType<?>> ObjectRegistries<T> registerParticleType(net.minecraft.resources.Identifier id, Supplier<T> supplier)
    • registerRecipeType

      public static <T extends net.minecraft.world.item.crafting.Recipe<?>> ObjectRegistries<net.minecraft.world.item.crafting.RecipeType<T>> registerRecipeType(net.minecraft.resources.Identifier id)
    • registerRecipeSerializer

      public static <T extends net.minecraft.world.item.crafting.RecipeSerializer<?>> ObjectRegistries<T> registerRecipeSerializer(net.minecraft.resources.Identifier id, Supplier<T> supplier)
    • registerStat

      public static ObjectRegistries<net.minecraft.resources.Identifier> registerStat(net.minecraft.resources.Identifier id, net.minecraft.stats.StatFormatter formatter)
    • registerSound

      public static ObjectRegistries<net.minecraft.sounds.SoundEvent> registerSound(net.minecraft.resources.Identifier id, Function<net.minecraft.resources.Identifier, Supplier<net.minecraft.sounds.SoundEvent>> supplier)
    • registerCustom

      public static <T> ObjectRegistries<T> registerCustom(net.minecraft.core.Registry<? super T> registry, net.minecraft.resources.Identifier id, Supplier<T> supplier)
    • registerEnchantmentComponentEffect

      public static <T extends net.minecraft.core.component.DataComponentType<?>> ObjectRegistries<T> registerEnchantmentComponentEffect(net.minecraft.resources.Identifier id, Supplier<T> supplier)
    • registerEnchantmentEffect

      public static <T extends com.mojang.serialization.MapCodec<net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect>> ObjectRegistries<T> registerEnchantmentEffect(net.minecraft.resources.Identifier id, Supplier<T> supplier)
    • registerTreeDecoratorType

      public static <T extends net.minecraft.world.level.levelgen.feature.treedecorators.TreeDecoratorType<?>> ObjectRegistries<T> registerTreeDecoratorType(net.minecraft.resources.Identifier id, Supplier<T> supplier)
    • registerFoliagePlacer

      public static <T extends net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacerType<?>> ObjectRegistries<T> registerFoliagePlacer(net.minecraft.resources.Identifier id, Supplier<T> supplier)
    • registerTrunkPlacer

      public static <T extends net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacerType<?>> ObjectRegistries<T> registerTrunkPlacer(net.minecraft.resources.Identifier id, Supplier<T> supplier)
    • registerMapDecoration

      public static <T extends net.minecraft.world.level.saveddata.maps.MapDecorationType> ObjectRegistries<T> registerMapDecoration(net.minecraft.resources.Identifier id, Supplier<T> supplier)
    • registerEntityDataSerializer

      public static <T> ObjectRegistries<net.minecraft.network.syncher.EntityDataSerializer<T>> registerEntityDataSerializer(net.minecraft.resources.Identifier id, Supplier<net.minecraft.network.syncher.EntityDataSerializer<T>> supplier)
    • createAll

      public static void createAll(String modId)
    • createAll

      public static void createAll(String modId, net.minecraft.core.Registry<?> registry)