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
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 Field
private static final ResourceLocation
private static final ResourceLocation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> Class<T>
static CompletableFuture<List<Throwable>>
checkForRevertToVanilla
(Executor executor, CompletableFuture<List<Throwable>> listCompletableFuture) static 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, Integer[]>> remaps, boolean isFreezing) private static void
forceRegistryName
(IForgeRegistryEntry<?> entry, ResourceLocation name) static void
static Stream<ModLoadingStage.EventGenerator<?>>
static ObjectIntIdentityMap<BlockState>
static Map<BlockState,
PointOfInterestType> static Map<IDataSerializer<?>,
DataSerializerEntry> static <T extends IForgeRegistryEntry<T>>
SimpleRegistry<T>getWrapper
(RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle) static <T extends IForgeRegistryEntry<T>>
DefaultedRegistry<T>getWrapper
(RegistryKey<? 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 extends IForgeRegistryEntry<T>>
voidloadFrozenDataToStagingRegistry
(RegistryManager STAGING, ResourceLocation name, Map<ResourceLocation, Integer[]> remaps, Class<T> clazz) private static <T extends IForgeRegistryEntry<T>>
voidloadPersistentDataToStagingRegistry
(RegistryManager pool, RegistryManager to, Map<ResourceLocation, Integer[]> remaps, Map<ResourceLocation, Integer> missing, ResourceLocation name, ForgeRegistry.Snapshot snap, Class<T> regType) private static <T extends IForgeRegistryEntry<T>>
voidloadRegistry
(ResourceLocation registryName, RegistryManager from, RegistryManager to, Class<T> regType, boolean freeze) private static <T extends IForgeRegistryEntry<T>>
RegistryBuilder<T>makeRegistry
(RegistryKey<? extends Registry<T>> key, Class<T> type) private static <T extends IForgeRegistryEntry<T>>
RegistryBuilder<T>makeRegistry
(RegistryKey<? extends Registry<T>> key, Class<T> type, int min, int max) private static <T extends IForgeRegistryEntry<T>>
RegistryBuilder<T>makeRegistry
(RegistryKey<? extends Registry<T>> key, Class<T> type, String _default) static CompletableFuture<List<Throwable>>
postRegistryEventDispatch
(Executor executor, ModLoadingStage.EventGenerator<? extends RegistryEvent.Register<?>> eventGenerator) static CompletableFuture<List<Throwable>>
preRegistryEventDispatch
(Executor executor, ModLoadingStage.EventGenerator<? extends RegistryEvent.Register<?>> eventGenerator) private static <T extends IForgeRegistryEntry<T>>
voidprocessMissing
(Class<T> clazz, ResourceLocation name, RegistryManager STAGING, RegistryEvent.MissingMappings<?> e, Map<ResourceLocation, Integer> missing, Map<ResourceLocation, Integer[]> remaps, Collection<ResourceLocation> defaulted, Collection<ResourceLocation> failed, boolean injectNetworkDummies) static <K extends IForgeRegistryEntry<K>>
Kregister_impl
(K value) 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 -
MAX_VARINT
private static final int MAX_VARINT- See Also:
-
BLOCK_TO_ITEM
-
BLOCKSTATE_TO_ID
-
BLOCKSTATE_TO_POINT_OF_INTEREST_TYPE
-
SERIALIZER_TO_ENTRY
-
STRUCTURES
-
hasInit
private static boolean hasInit -
DISABLE_VANILLA_REGISTRIES
private static final boolean DISABLE_VANILLA_REGISTRIES -
LOCK_VANILLA
-
regName
-
-
Constructor Details
-
GameData
public GameData()
-
-
Method Details
-
init
public static void init() -
c
-
makeRegistry
private static <T extends IForgeRegistryEntry<T>> RegistryBuilder<T> makeRegistry(RegistryKey<? extends Registry<T>> key, Class<T> type) -
makeRegistry
private static <T extends IForgeRegistryEntry<T>> RegistryBuilder<T> makeRegistry(RegistryKey<? extends Registry<T>> key, Class<T> type, int min, int max) -
makeRegistry
private static <T extends IForgeRegistryEntry<T>> RegistryBuilder<T> makeRegistry(RegistryKey<? extends Registry<T>> key, Class<T> type, String _default) -
getWrapper
public static <T extends IForgeRegistryEntry<T>> SimpleRegistry<T> getWrapper(RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle) -
getWrapper
public static <T extends IForgeRegistryEntry<T>> DefaultedRegistry<T> getWrapper(RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, String defKey) -
getBlockItemMap
-
getBlockStateIDMap
-
getBlockStatePointOfInterestTypeMap
-
getSerializerMap
-
getStructureMap
-
register_impl
-
vanillaSnapshot
public static void vanillaSnapshot() -
freezeData
public static void freezeData() -
revertToFrozen
public static void revertToFrozen() -
revertTo
-
revert
-
generateRegistryEvents
-
preRegistryEventDispatch
public static CompletableFuture<List<Throwable>> preRegistryEventDispatch(Executor executor, ModLoadingStage.EventGenerator<? extends RegistryEvent.Register<?>> eventGenerator) -
postRegistryEventDispatch
public static CompletableFuture<List<Throwable>> postRegistryEventDispatch(Executor executor, ModLoadingStage.EventGenerator<? extends RegistryEvent.Register<?>> eventGenerator) -
checkForRevertToVanilla
public static CompletableFuture<List<Throwable>> checkForRevertToVanilla(Executor executor, CompletableFuture<List<Throwable>> listCompletableFuture) -
setCustomTagTypesFromRegistries
public static void setCustomTagTypesFromRegistries() -
loadRegistry
private static <T extends IForgeRegistryEntry<T>> void loadRegistry(ResourceLocation registryName, RegistryManager from, RegistryManager to, Class<T> regType, 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, Integer[]>> remaps, boolean isFreezing) -
loadPersistentDataToStagingRegistry
private static <T extends IForgeRegistryEntry<T>> void loadPersistentDataToStagingRegistry(RegistryManager pool, RegistryManager to, Map<ResourceLocation, Integer[]> remaps, Map<ResourceLocation, Integer> missing, ResourceLocation name, ForgeRegistry.Snapshot snap, Class<T> regType) -
processMissing
private static <T extends IForgeRegistryEntry<T>> void processMissing(Class<T> clazz, ResourceLocation name, RegistryManager STAGING, RegistryEvent.MissingMappings<?> e, Map<ResourceLocation, Integer> missing, Map<ResourceLocation, Integer[]> remaps, Collection<ResourceLocation> defaulted, Collection<ResourceLocation> failed, boolean injectNetworkDummies) -
loadFrozenDataToStagingRegistry
private static <T extends IForgeRegistryEntry<T>> void loadFrozenDataToStagingRegistry(RegistryManager STAGING, ResourceLocation name, Map<ResourceLocation, Integer[]> remaps, Class<T> clazz) -
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
-
forceRegistryName
-