类 DataPackRegistryEvent.NewRegistry
- 所有已实现的接口:
net.neoforged.fml.event.IModBusEvent
Data JSONs will be loaded from data/<datapack_namespace>/modid/registryname/
, where modid
is the namespace of the registry key.
This event is not cancellable, and does not
引用无效
have a result
This event is fired on the mod-specific event bus, on both logical sides.
-
嵌套类概要
从类继承的嵌套类/接口 net.neoforged.neoforge.registries.DataPackRegistryEvent
DataPackRegistryEvent.DataPackRegistryData<T>, DataPackRegistryEvent.NewRegistry
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明<T> void
dataPackRegistry
(ResourceKey<Registry<T>> registryKey, com.mojang.serialization.Codec<T> codec) Registers the given registry key as an unsynced datapack registry, which will cause data to be loaded from a datapack folder based on the registry's name.<T> void
dataPackRegistry
(ResourceKey<Registry<T>> registryKey, com.mojang.serialization.Codec<T> codec, @Nullable com.mojang.serialization.Codec<T> networkCodec) Registers the registry key as a datapack registry, which will cause data to be loaded from a datapack folder based on the registry's name.<T> void
dataPackRegistry
(ResourceKey<Registry<T>> registryKey, com.mojang.serialization.Codec<T> codec, @Nullable com.mojang.serialization.Codec<T> networkCodec, Consumer<RegistryBuilder<T>> consumer) Registers the registry key as a datapack registry with aRegistryBuilder
configurator, which will cause data to be loaded from a datapack folder based on the registry's name.(专用程序包) void
process()
-
字段详细资料
-
registryDataList
-
-
构造器详细资料
-
NewRegistry
@Internal public NewRegistry()
-
-
方法详细资料
-
dataPackRegistry
public <T> void dataPackRegistry(ResourceKey<Registry<T>> registryKey, com.mojang.serialization.Codec<T> codec) Registers the given registry key as an unsynced datapack registry, which will cause data to be loaded from a datapack folder based on the registry's name. The datapack registry is not required to be present on clients when connecting to servers with the mod/registry.Data JSONs will be loaded from
data/<datapack_namespace>/modid/registryname/
, wheremodid
is the namespace of the registry key.- 参数:
registryKey
- the root registry key of the new datapack registrycodec
- the codec to be used for loading data from datapacks on servers- 另请参阅:
-
dataPackRegistry
public <T> void dataPackRegistry(ResourceKey<Registry<T>> registryKey, com.mojang.serialization.Codec<T> codec, @Nullable @Nullable com.mojang.serialization.Codec<T> networkCodec) Registers the registry key as a datapack registry, which will cause data to be loaded from a datapack folder based on the registry's name.Data JSONs will be loaded from
data/<datapack_namespace>/modid/registryname/
, wheremodid
is the namespace of the registry key.- 参数:
registryKey
- the root registry key of the new datapack registrycodec
- the codec to be used for loading data from datapacks on serversnetworkCodec
- the codec to be used for syncing loaded data to clients. IfnetworkCodec
is null, data will not be synced, and clients are not required to have this datapack registry to join a server.If
networkCodec
is not null, clients must have this datapack registry/mod when joining a server that has this datapack registry/mod. The data will be synced using the network codec and accessible via引用无效
ClientPacketListener#registryAccess()
- 另请参阅:
-
dataPackRegistry
public <T> void dataPackRegistry(ResourceKey<Registry<T>> registryKey, com.mojang.serialization.Codec<T> codec, @Nullable @Nullable com.mojang.serialization.Codec<T> networkCodec, Consumer<RegistryBuilder<T>> consumer) Registers the registry key as a datapack registry with aRegistryBuilder
configurator, which will cause data to be loaded from a datapack folder based on the registry's name.Data JSONs will be loaded from
data/<datapack_namespace>/modid/registryname/
, wheremodid
is the namespace of the registry key.- 参数:
registryKey
- the root registry key of the new datapack registrycodec
- the codec to be used for loading data from datapacks on serversnetworkCodec
- the codec to be used for syncing loaded data to clients. IfnetworkCodec
is null, data will not be synced, and clients are not required to have this datapack registry to join a server.If
networkCodec
is not null, clients must have this datapack registry/mod when joining a server that has this datapack registry/mod. The data will be synced using the network codec and accessible via引用无效
ClientPacketListener#registryAccess()
consumer
- A consumer that configures the provided RegistryBuilder- 另请参阅:
-
process
void process()
-