类 RegistryManager
java.lang.Object
net.neoforged.neoforge.registries.RegistryManager
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static final io.netty.util.AttributeKey
<Map<ResourceKey<? extends Registry<?>>, Collection<ResourceLocation>>> private static Map
<ResourceKey<Registry<?>>, Map<ResourceLocation, DataMapType<?, ?>>> private static Map
<ResourceLocation, RegistrySnapshot> private static final org.slf4j.Logger
private static Set
<ResourceLocation> private static final org.slf4j.Marker
private static Set
<ResourceLocation> private static Map
<ResourceLocation, RegistrySnapshot> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static Set
<ResourceKey<?>> applySnapshot
(Map<ResourceLocation, RegistrySnapshot> snapshots, boolean allowMissing, boolean isLocalWorld) Applies the snapshot to the current state of theBuiltInRegistries
.private static <T> void
applySnapshot
(MappedRegistry<T> registry, RegistrySnapshot snapshot, Set<ResourceKey<?>> missing) static List
<FrozenRegistryPayload> generateRegistryPackets
(boolean isLocal) static <R> @Nullable DataMapType
<R, ?> getDataMap
(ResourceKey<? extends Registry<R>> registry, ResourceLocation key) static Map
<ResourceKey<Registry<?>>, Map<ResourceLocation, DataMapType<?, ?>>> 返回 a view of all registered data maps。static List
<ResourceLocation> static Set
<ResourceLocation> static void
handleKnownDataMapsReply
(KnownRegistryDataMapsReplyPayload payload, IPayloadContext context) static void
static boolean
isNonSyncedBuiltInRegistry
(Registry<?> registry) static void
static void
static void
(专用程序包) static void
static Map
<ResourceLocation, RegistrySnapshot> takeSnapshot
(RegistryManager.SnapshotType snapshotType) Takes a snapshot of the current registries registered toBuiltInRegistries.REGISTRY
.(专用程序包) static void
(专用程序包) static void
trackModdedRegistry
(ResourceLocation registry) Called byRegistryBuilder
to make sure that modders don't forget to register their registries.
-
字段详细资料
-
LOGGER
private static final org.slf4j.Logger LOGGER -
REGISTRIES
private static final org.slf4j.Marker REGISTRIES -
pendingModdedRegistries
-
vanillaRegistryKeys
-
vanillaSnapshot
-
frozenSnapshot
-
dataMaps
-
ATTRIBUTE_KNOWN_DATA_MAPS
public static final io.netty.util.AttributeKey<Map<ResourceKey<? extends Registry<?>>,Collection<ResourceLocation>>> ATTRIBUTE_KNOWN_DATA_MAPS
-
-
构造器详细资料
-
RegistryManager
public RegistryManager()
-
-
方法详细资料
-
trackModdedRegistry
Called byRegistryBuilder
to make sure that modders don't forget to register their registries. -
getDataMap
@Nullable public static <R> @Nullable DataMapType<R,?> getDataMap(ResourceKey<? extends Registry<R>> registry, ResourceLocation key) -
getDataMaps
返回 a view of all registered data maps。- 返回:
- a view of all registered data maps
-
postNewRegistryEvent
public static void postNewRegistryEvent() -
initDataMaps
public static void initDataMaps() -
takeVanillaSnapshot
static void takeVanillaSnapshot() -
takeFrozenSnapshot
static void takeFrozenSnapshot() -
revertToVanilla
public static void revertToVanilla() -
revertToFrozen
public static void revertToFrozen() -
applySnapshot
public static Set<ResourceKey<?>> applySnapshot(Map<ResourceLocation, RegistrySnapshot> snapshots, boolean allowMissing, boolean isLocalWorld) Applies the snapshot to the current state of theBuiltInRegistries
.- 参数:
snapshots
- the map of registry name to snapshotallowMissing
- iftrue
, missing registries will be skipped but will log a warning. Otherwise, an exception will be thrown if a registry name in the snapshot map is missing.isLocalWorld
- changes the logging depending on if the snapshot is coming from a local save or a remote connection- 返回:
- the set of unhandled missing registry entries after firing remapping events for mods
-
applySnapshot
private static <T> void applySnapshot(MappedRegistry<T> registry, RegistrySnapshot snapshot, Set<ResourceKey<?>> missing) -
takeSnapshot
public static Map<ResourceLocation,RegistrySnapshot> takeSnapshot(RegistryManager.SnapshotType snapshotType) Takes a snapshot of the current registries registered toBuiltInRegistries.REGISTRY
.- 参数:
snapshotType
- IfRegistryManager.SnapshotType.SYNC_TO_CLIENT
, only takes a snapshot of registries set to sync to the client. IfRegistryManager.SnapshotType.FULL
, takes a snapshot of all registries including entries.- 返回:
- the snapshot map of registry name to snapshot data
-
generateRegistryPackets
-
getRegistryNamesForSyncToClient
-
getVanillaRegistryKeys
-
handleKnownDataMapsReply
@Internal public static void handleKnownDataMapsReply(KnownRegistryDataMapsReplyPayload payload, IPayloadContext context) -
isNonSyncedBuiltInRegistry
-