Package net.minecraftforge.registries
Class GameData
java.lang.Object
net.minecraftforge.registries.GameData
INTERNAL ONLY
MODDERS SHOULD HAVE NO REASON TO USE THIS CLASS
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
private static class
private static class
private static class
private static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final ResourceLocation
private static final ResourceLocation
private static final ResourceLocation
private static final boolean
private static boolean
private static final BiConsumer<ResourceLocation,
ForgeRegistry<?>> private static final org.apache.logging.log4j.Logger
private static final int
private static org.apache.logging.log4j.Marker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceLocation
checkPrefix
(String name, boolean warnOverrides) Check a name for a domain prefix, and if not present infer it from the current active mod container.private static void
fireRemapEvent
(Map<ResourceLocation, Map<ResourceLocation, IdMappingEvent.IdRemapping>> remaps, boolean isFreezing) static void
(package private) static RegistryBuilder<com.mojang.serialization.Codec<? extends BiomeModifier>>
static IdMapper<BlockState>
static Map<BlockState,
PoiType> (package private) static RegistryBuilder<EntityDataSerializer<?>>
(package private) static RegistryBuilder<FluidType>
(package private) static RegistryBuilder<com.mojang.serialization.Codec<? extends IGlobalLootModifier>>
(package private) static RegistryBuilder<HolderSetType>
(package private) static RegistryBuilder<ItemDisplayContext>
(package private) static RegistryBuilder<com.mojang.serialization.Codec<? extends StructureModifier>>
static <T> MappedRegistry<T>
getWrapper
(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle) static <T> MappedRegistry<T>
getWrapper
(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, String defKey) static void
init()
static com.google.common.collect.Multimap<ResourceLocation,
ResourceLocation> injectSnapshot
(Map<ResourceLocation, ForgeRegistry.Snapshot> snapshot, boolean injectFrozenData, boolean isLocalWorld) private static <T> void
loadFrozenDataToStagingRegistry
(RegistryManager STAGING, ResourceLocation name, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps) private static <T> void
loadPersistentDataToStagingRegistry
(RegistryManager pool, RegistryManager to, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps, Map<ResourceLocation, Integer> missing, ResourceLocation name, ForgeRegistry.Snapshot snap) private static <T> void
loadRegistry
(ResourceLocation registryName, RegistryManager from, RegistryManager to, boolean freeze) private static <T> RegistryBuilder<T>
makeRegistry
(ResourceKey<? extends Registry<T>> key) private static <T> RegistryBuilder<T>
makeRegistry
(ResourceKey<? extends Registry<T>> key, int min, int max) private static <T> RegistryBuilder<T>
makeRegistry
(ResourceKey<? extends Registry<T>> key, String _default) static void
private static <T> void
processMissing
(ResourceLocation name, RegistryManager STAGING, MissingMappingsEvent e, Map<ResourceLocation, Integer> missing, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps, Collection<ResourceLocation> defaulted, Collection<ResourceLocation> failed, boolean injectNetworkDummies) static void
revert
(RegistryManager state, ResourceLocation registry, boolean lock) static void
revertTo
(RegistryManager target, boolean fireEvents) static void
static void
static void
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
REGISTRIES
private static org.apache.logging.log4j.Marker REGISTRIES -
MAX_VARINT
private static final int MAX_VARINT- See Also:
-
BLOCK_TO_ITEM
-
BLOCKSTATE_TO_ID
-
BLOCKSTATE_TO_POINT_OF_INTEREST_TYPE
-
hasInit
private static boolean hasInit -
DISABLE_VANILLA_REGISTRIES
private static final boolean DISABLE_VANILLA_REGISTRIES -
LOCK_VANILLA
-
-
Constructor Details
-
GameData
public GameData()
-
-
Method Details
-
init
public static void init() -
getDataSerializersRegistryBuilder
-
getGLMSerializersRegistryBuilder
static RegistryBuilder<com.mojang.serialization.Codec<? extends IGlobalLootModifier>> getGLMSerializersRegistryBuilder() -
getBiomeModifierSerializersRegistryBuilder
static RegistryBuilder<com.mojang.serialization.Codec<? extends BiomeModifier>> getBiomeModifierSerializersRegistryBuilder() -
getStructureModifierSerializersRegistryBuilder
static RegistryBuilder<com.mojang.serialization.Codec<? extends StructureModifier>> getStructureModifierSerializersRegistryBuilder() -
getFluidTypeRegistryBuilder
-
getHolderSetTypeRegistryBuilder
-
getItemDisplayContextRegistryBuilder
-
makeRegistry
-
makeRegistry
private static <T> RegistryBuilder<T> makeRegistry(ResourceKey<? extends Registry<T>> key, int min, int max) -
makeRegistry
private static <T> RegistryBuilder<T> makeRegistry(ResourceKey<? extends Registry<T>> key, String _default) -
getWrapper
public static <T> MappedRegistry<T> getWrapper(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle) -
getWrapper
public static <T> MappedRegistry<T> getWrapper(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, String defKey) -
getBlockItemMap
-
getBlockStateIDMap
-
getBlockStatePointOfInterestTypeMap
-
vanillaSnapshot
public static void vanillaSnapshot() -
unfreezeData
public static void unfreezeData() -
freezeData
public static void freezeData() -
revertToFrozen
public static void revertToFrozen() -
revertTo
-
revert
-
postRegisterEvents
public static void postRegisterEvents() -
loadRegistry
private static <T> void loadRegistry(ResourceLocation registryName, RegistryManager from, RegistryManager to, boolean freeze) -
injectSnapshot
public static com.google.common.collect.Multimap<ResourceLocation,ResourceLocation> injectSnapshot(Map<ResourceLocation, ForgeRegistry.Snapshot> snapshot, boolean injectFrozenData, boolean isLocalWorld) -
fireRemapEvent
private static void fireRemapEvent(Map<ResourceLocation, Map<ResourceLocation, IdMappingEvent.IdRemapping>> remaps, boolean isFreezing) -
loadPersistentDataToStagingRegistry
private static <T> void loadPersistentDataToStagingRegistry(RegistryManager pool, RegistryManager to, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps, Map<ResourceLocation, Integer> missing, ResourceLocation name, ForgeRegistry.Snapshot snap) -
processMissing
private static <T> void processMissing(ResourceLocation name, RegistryManager STAGING, MissingMappingsEvent e, Map<ResourceLocation, Integer> missing, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps, Collection<ResourceLocation> defaulted, Collection<ResourceLocation> failed, boolean injectNetworkDummies) -
loadFrozenDataToStagingRegistry
private static <T> void loadFrozenDataToStagingRegistry(RegistryManager STAGING, ResourceLocation name, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps) -
checkPrefix
Check a name for a domain prefix, and if not present infer it from the current active mod container.- Parameters:
name
- The name or resource locationwarnOverrides
- If true, logs a warning if domain differs from that of the currently currently active mod container- Returns:
- The
ResourceLocation
with given or inferred domain
-