T
- The type stored in the RegistryR
- The registry typepublic final class FabricRegistryBuilder<T,R extends net.minecraft.util.registry.MutableRegistry<T>> extends Object
SimpleRegistry<String> registry = FabricRegistryBuilder.createSimple(String.class, new Identifier("registry_sync", "fabric_registry"))
.attribute(RegistryAttribute.SYNCED)
.buildAndRegister();
Modifier and Type | Method and Description |
---|---|
FabricRegistryBuilder<T,R> |
attribute(RegistryAttribute attribute)
Add a
RegistryAttribute to the registry. |
R |
buildAndRegister()
Applies the attributes to the registry and registers it.
|
static <T> FabricRegistryBuilder<T,net.minecraft.util.registry.DefaultedRegistry<T>> |
createDefaulted(Class<T> type,
net.minecraft.util.Identifier registryId,
net.minecraft.util.Identifier defaultId)
Create a new
FabricRegistryBuilder using a DefaultedRegistry , the registry has the RegistryAttribute.MODDED attribute by default. |
static <T> FabricRegistryBuilder<T,net.minecraft.util.registry.SimpleRegistry<T>> |
createSimple(Class<T> type,
net.minecraft.util.Identifier registryId)
Create a new
FabricRegistryBuilder using a SimpleRegistry , the registry has the RegistryAttribute.MODDED attribute by default. |
static <T,R extends net.minecraft.util.registry.MutableRegistry<T>> |
from(R registry)
Create a new
FabricRegistryBuilder , the registry has the RegistryAttribute.MODDED attribute by default. |
public static <T,R extends net.minecraft.util.registry.MutableRegistry<T>> FabricRegistryBuilder<T,R> from(R registry)
FabricRegistryBuilder
, the registry has the RegistryAttribute.MODDED
attribute by default.T
- The type stored in the RegistryR
- The registry typeregistry
- The base registry type such as SimpleRegistry
or DefaultedRegistry
public static <T> FabricRegistryBuilder<T,net.minecraft.util.registry.SimpleRegistry<T>> createSimple(Class<T> type, net.minecraft.util.Identifier registryId)
FabricRegistryBuilder
using a SimpleRegistry
, the registry has the RegistryAttribute.MODDED
attribute by default.T
- The type stored in the RegistryregistryId
- The registry Identifier
used as the registry idpublic static <T> FabricRegistryBuilder<T,net.minecraft.util.registry.DefaultedRegistry<T>> createDefaulted(Class<T> type, net.minecraft.util.Identifier registryId, net.minecraft.util.Identifier defaultId)
FabricRegistryBuilder
using a DefaultedRegistry
, the registry has the RegistryAttribute.MODDED
attribute by default.T
- The type stored in the RegistryregistryId
- The registry Identifier
used as the registry iddefaultId
- The default registry idpublic FabricRegistryBuilder<T,R> attribute(RegistryAttribute attribute)
RegistryAttribute
to the registry.attribute
- the RegistryAttribute
to add to the registryFabricRegistryBuilder
public R buildAndRegister()