Package net.minecraftforge.registries
Class GameData
java.lang.Object
net.minecraftforge.registries.GameData
INTERNAL ONLY
MODDERS SHOULD HAVE NO REASON TO USE THIS CLASS
Use the public IForgeRegistry and ForgeRegistries APIs to get the data
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ResourceLocationprivate static final ResourceLocationprivate static final ResourceLocationprivate static final booleanprivate static booleanprivate static final BiConsumer<ResourceLocation,ForgeRegistry<?>> private static final org.apache.logging.log4j.Loggerprivate static final intprivate static final org.apache.logging.log4j.Marker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceLocationcheckPrefix(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 voidfireRemapEvent(Map<ResourceLocation, Map<ResourceLocation, IdMappingEvent.IdRemapping>> remaps, boolean isFreezing) static voidstatic 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<ItemDisplayContext>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 voidinit()static com.google.common.collect.Multimap<ResourceLocation,ResourceLocation> injectSnapshot(Map<ResourceLocation, ForgeRegistry.Snapshot> snapshot, boolean injectFrozenData, boolean isLocalWorld) private static <T> voidloadFrozenDataToStagingRegistry(RegistryManager STAGING, ResourceLocation name, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps) private static <T> voidloadPersistentDataToStagingRegistry(RegistryManager pool, RegistryManager to, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> missing, ResourceLocation name, ForgeRegistry.Snapshot snap) private static <T> voidloadRegistry(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) (package private) static <T> RegistryBuilder<T>static voidprivate static <T> voidprocessMissing(ResourceLocation name, RegistryManager STAGING, MissingMappingsEvent e, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> missing, Map<ResourceLocation, IdMappingEvent.IdRemapping> remaps, Collection<ResourceLocation> defaulted, Collection<ResourceLocation> failed, boolean injectNetworkDummies) static voidrevert(RegistryManager state, ResourceLocation registry, boolean lock) static voidrevertTo(RegistryManager target, boolean fireEvents) static voidstatic voidstatic void
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
REGISTRIES
private static final 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() -
getFluidTypeRegistryBuilder
-
makeUnsavedAndUnsynced
-
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, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> missing, ResourceLocation name, ForgeRegistry.Snapshot snap) -
processMissing
private static <T> void processMissing(ResourceLocation name, RegistryManager STAGING, MissingMappingsEvent e, it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceLocation> 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
ResourceLocationwith given or inferred domain
-