Class MycelRegistry<T>
java.lang.Object
my.celium.org.registry.MycelRegistry<T>
Minimal deferred registration covering the repetitive cases (items, blocks,
entity types) without a universal registry framework.
MycelRegistry<Item> items = MycelRegistry.items(META);
DeferredEntry<Item> widget = items.registerWithKey("widget",
key -> new Item(new Item.Properties().setId(key)));
Minecraft 26.x refuses items and blocks whose properties carry no id, so
use registerWithKey(String, Function) (or key) for those.
Names must be lowercase [a-z0-9_/.-] paths. Registration timing is
owned by the loader bridge: call register during mod construction /
entrypoint execution. Resolving (DeferredEntry.get()) before the
loader creates the object throws - read entries lazily (in handlers, not in
static initialisers).
-
Method Summary
Modifier and TypeMethodDescriptionstatic MycelRegistry<net.minecraft.world.level.block.Block> blocks(ModMetadata mod) static MycelRegistry<net.minecraft.world.entity.EntityType<?>> entityTypes(ModMetadata mod) static MycelRegistry<net.minecraft.world.item.Item> items(ModMetadata mod) net.minecraft.resources.ResourceKey<T> The keymodid:namein this registry.Registersfactoryundermodid:name.registerWithKey(String name, Function<net.minecraft.resources.ResourceKey<T>, T> factory) Likeregister(String, Supplier), but hands the factory the entry's own key, whichItem.Properties.setIdandBlockBehaviour.Properties.setIdneed.
-
Method Details
-
items
-
blocks
-
entityTypes
-
register
Registersfactoryundermodid:name. The factory runs at the loader's registration time, never earlier. -
registerWithKey
public DeferredEntry<T> registerWithKey(String name, Function<net.minecraft.resources.ResourceKey<T>, T> factory) Likeregister(String, Supplier), but hands the factory the entry's own key, whichItem.Properties.setIdandBlockBehaviour.Properties.setIdneed. -
key
-