Class RegistryBuilder<T>
java.lang.Object
net.neoforged.neoforge.registries.RegistryBuilder<T>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final List<RegistryCallback<T>>private @Nullable ResourceLocationprivate intprivate booleanprivate final ResourceKey<? extends Registry<T>>private boolean
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncallback(RegistryCallback<T> callback) create()Creates a new registry from this builder.defaultKey(ResourceKey<T> key) Disables the safeguard that ensures this registry is registered toNewRegistryEventin due time.maxId(int maxId) Sets the highest numerical id that an entry in this registry is allowed to use.onAdd(AddCallback<T> callback) onBake(BakeCallback<T> callback) onClear(ClearCallback<T> callback) sync(boolean sync) Sets whether this registry should have its numerical IDs synced to clients.
- 
Field Details- 
registryKey
- 
callbacks
- 
defaultKey
- 
maxIdprivate int maxId
- 
syncprivate boolean sync
- 
registrationCheckprivate boolean registrationCheck
 
- 
- 
Constructor Details- 
RegistryBuilder
 
- 
- 
Method Details- 
defaultKey
- 
defaultKey
- 
callback
- 
onAdd
- 
onBake
- 
onClear
- 
maxIdSets the highest numerical id that an entry in this registry is allowed to use. Must be greater than or equal to zero.- Parameters:
- maxId- the highest numerical id
 
- 
syncSets whether this registry should have its numerical IDs synced to clients. Default:false.
- 
disableRegistrationCheckDisables the safeguard that ensures this registry is registered toNewRegistryEventin due time. DO NOT CALL THIS METHOD UNLESS YOU KNOW WHAT YOU ARE DOING.
- 
createCreates a new registry from this builder. UseNewRegistryEvent.create(RegistryBuilder)orDeferredRegister.makeRegistry(Consumer)to not have to call this manually. All created registries must be registered, seeNewRegistryEvent.register(Registry).- Returns:
- the created registry
- See Also:
 
 
-