类 DataMapsUpdatedEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.registries.datamaps.DataMapsUpdatedEvent
public class DataMapsUpdatedEvent
extends net.neoforged.bus.api.Event
Event fired on the
game event bus
when the data maps of
a registry have either been synced to the client or reloaded on the server.
This event can be used to build caches (like weighed lists) or for post-processing the data map values.
Remember however that the data map values should not end up referencing their owner, as they're not copied when attached to tags.
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明private final DataMapsUpdatedEvent.UpdateCause
private final Registry
<?> private final RegistryAccess
-
构造器概要
构造器构造器说明DataMapsUpdatedEvent
(RegistryAccess registryAccess, Registry<?> registry, DataMapsUpdatedEvent.UpdateCause cause) -
方法概要
修饰符和类型方法说明getCause()
返回 the reason for the update。返回 a registry access。Registry
<?> 返回 the registry that had its data maps updated。ResourceKey
<? extends Registry<?>> 返回 the key of the registry that had its data maps updated。<T> void
ifRegistry
(ResourceKey<Registry<T>> type, Consumer<Registry<T>> consumer) Runs the givenconsumer
if the registry is of the giventype
.
-
字段详细资料
-
registryAccess
-
registry
-
cause
-
-
构造器详细资料
-
DataMapsUpdatedEvent
@Internal public DataMapsUpdatedEvent(RegistryAccess registryAccess, Registry<?> registry, DataMapsUpdatedEvent.UpdateCause cause)
-
-
方法详细资料
-
getRegistries
返回 a registry access。- 返回:
- a registry access
-
getRegistry
返回 the registry that had its data maps updated。- 返回:
- the registry that had its data maps updated
-
getRegistryKey
返回 the key of the registry that had its data maps updated。- 返回:
- the key of the registry that had its data maps updated
-
ifRegistry
Runs the givenconsumer
if the registry is of the giventype
.- 类型参数:
T
- the registry type- 参数:
type
- the registry keyconsumer
- the consumer
-
getCause
返回 the reason for the update。- 返回:
- the reason for the update
-