类 RegistryBuilder<T>
java.lang.Object
net.neoforged.neoforge.registries.RegistryBuilder<T>
-
字段概要
字段修饰符和类型字段说明private final List
<RegistryCallback<T>> private @Nullable ResourceLocation
private boolean
private int
private boolean
private final ResourceKey
<? extends Registry<T>> private boolean
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明callback
(RegistryCallback<T> callback) create()
Creates a new registry from this builder.defaultKey
(ResourceKey<T> key) Disables the safeguard that ensures this registry is registered toNewRegistryEvent
in 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.已过时。Vanilla has deprecated intrusive holders and is in the process of moving away from them, you should not use this unless you have no better option.
-
字段详细资料
-
registryKey
-
callbacks
-
defaultKey
-
intrusiveHolders
private boolean intrusiveHolders -
maxId
private int maxId -
sync
private boolean sync -
registrationCheck
private boolean registrationCheck
-
-
构造器详细资料
-
RegistryBuilder
-
-
方法详细资料
-
defaultKey
-
defaultKey
-
withIntrusiveHolders
已过时。Vanilla has deprecated intrusive holders and is in the process of moving away from them, you should not use this unless you have no better option. -
callback
-
onAdd
-
onBake
-
onClear
-
maxId
Sets the highest numerical id that an entry in this registry is allowed to use. Must be greater than or equal to zero.- 参数:
maxId
- the highest numerical id
-
sync
Sets whether this registry should have its numerical IDs synced to clients. Default:false
. -
disableRegistrationCheck
Disables the safeguard that ensures this registry is registered toNewRegistryEvent
in due time. DO NOT CALL THIS METHOD UNLESS YOU KNOW WHAT YOU ARE DOING. -
create
Creates 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)
.- 返回:
- the created registry
- 另请参阅:
-