Class ObjectRegistries<T>
java.lang.Object
net.tearpelato.craftcorelib.api.registry.ObjectRegistries<T>
- All Implemented Interfaces:
Supplier<T>
- Direct Known Subclasses:
BlockRegistries, StatRegistry
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionObjectRegistries(net.minecraft.core.Registry<? super T> registry, net.minecraft.resources.Identifier id, Supplier<T> supplier) -
Method Summary
Modifier and TypeMethodDescriptionprotected Tcreate()static voidstatic voidget()net.minecraft.resources.IdentifiergetId()net.minecraft.resources.ResourceKey<? super T> getKey()protected voidregister()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 Propertiesstatic <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 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 Propertiesstatic <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)
-
Field Details
-
id
protected final net.minecraft.resources.Identifier id -
supplier
-
registry
-
instance
-
-
Constructor Details
-
ObjectRegistries
-
-
Method Details
-
get
-
create
-
getKey
-
getId
public net.minecraft.resources.Identifier getId() -
register
protected void register() -
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) -
createAll
-
createAll
-