Package net.minecraftforge.registries
Class GameData
- java.lang.Object
-
- net.minecraftforge.registries.GameData
-
public class GameData extends java.lang.Object
INTERNAL ONLY MODDERS SHOULD HAVE NO REASON TO USE THIS CLASS
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
GameData.AttributeCallbacks
private static class
GameData.BlockCallbacks
private static class
GameData.ClearableObjectIntIdentityMap<I>
private static class
GameData.FeatureCallbacks
private static class
GameData.ItemCallbacks
private static class
GameData.PointOfInterestTypeCallbacks
private static class
GameData.SerializerCallbacks
-
Field Summary
Fields Modifier and Type Field Description private static ResourceLocation
BLOCK_TO_ITEM
private static ResourceLocation
BLOCKSTATE_TO_ID
private static ResourceLocation
BLOCKSTATE_TO_POINT_OF_INTEREST_TYPE
private static boolean
DISABLE_VANILLA_REGISTRIES
private static boolean
hasInit
private static java.util.function.BiConsumer<ResourceLocation,ForgeRegistry<?>>
LOCK_VANILLA
private static org.apache.logging.log4j.Logger
LOGGER
private static int
MAX_VARINT
private static java.lang.reflect.Field
regName
private static ResourceLocation
SERIALIZER_TO_ENTRY
private static ResourceLocation
STRUCTURES
-
Constructor Summary
Constructors Constructor Description GameData()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static <T> java.lang.Class<T>
c(java.lang.Class<?> cls)
static java.util.concurrent.CompletableFuture<java.util.List<java.lang.Throwable>>
checkForRevertToVanilla(java.util.concurrent.Executor executor, java.util.concurrent.CompletableFuture<java.util.List<java.lang.Throwable>> listCompletableFuture)
static ResourceLocation
checkPrefix(java.lang.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(java.util.Map<ResourceLocation,java.util.Map<ResourceLocation,java.lang.Integer[]>> remaps, boolean isFreezing)
private static void
forceRegistryName(IForgeRegistryEntry<?> entry, ResourceLocation name)
static void
freezeData()
static java.util.stream.Stream<ModLoadingStage.EventGenerator<?>>
generateRegistryEvents()
static java.util.Map<Block,Item>
getBlockItemMap()
static ObjectIntIdentityMap<BlockState>
getBlockStateIDMap()
static java.util.Map<BlockState,PointOfInterestType>
getBlockStatePointOfInterestTypeMap()
static java.util.Map<IDataSerializer<?>,DataSerializerEntry>
getSerializerMap()
static com.google.common.collect.BiMap<java.lang.String,Structure<?>>
getStructureMap()
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, java.lang.String defKey)
static void
init()
static com.google.common.collect.Multimap<ResourceLocation,ResourceLocation>
injectSnapshot(java.util.Map<ResourceLocation,ForgeRegistry.Snapshot> snapshot, boolean injectFrozenData, boolean isLocalWorld)
private static <T extends IForgeRegistryEntry<T>>
voidloadFrozenDataToStagingRegistry(RegistryManager STAGING, ResourceLocation name, java.util.Map<ResourceLocation,java.lang.Integer[]> remaps, java.lang.Class<T> clazz)
private static <T extends IForgeRegistryEntry<T>>
voidloadPersistentDataToStagingRegistry(RegistryManager pool, RegistryManager to, java.util.Map<ResourceLocation,java.lang.Integer[]> remaps, java.util.Map<ResourceLocation,java.lang.Integer> missing, ResourceLocation name, ForgeRegistry.Snapshot snap, java.lang.Class<T> regType)
private static <T extends IForgeRegistryEntry<T>>
voidloadRegistry(ResourceLocation registryName, RegistryManager from, RegistryManager to, java.lang.Class<T> regType, boolean freeze)
private static <T extends IForgeRegistryEntry<T>>
RegistryBuilder<T>makeRegistry(RegistryKey<? extends Registry<T>> key, java.lang.Class<T> type)
private static <T extends IForgeRegistryEntry<T>>
RegistryBuilder<T>makeRegistry(RegistryKey<? extends Registry<T>> key, java.lang.Class<T> type, int min, int max)
private static <T extends IForgeRegistryEntry<T>>
RegistryBuilder<T>makeRegistry(RegistryKey<? extends Registry<T>> key, java.lang.Class<T> type, java.lang.String _default)
static java.util.concurrent.CompletableFuture<java.util.List<java.lang.Throwable>>
postRegistryEventDispatch(java.util.concurrent.Executor executor, ModLoadingStage.EventGenerator<? extends RegistryEvent.Register<?>> eventGenerator)
static java.util.concurrent.CompletableFuture<java.util.List<java.lang.Throwable>>
preRegistryEventDispatch(java.util.concurrent.Executor executor, ModLoadingStage.EventGenerator<? extends RegistryEvent.Register<?>> eventGenerator)
private static <T extends IForgeRegistryEntry<T>>
voidprocessMissing(java.lang.Class<T> clazz, ResourceLocation name, RegistryManager STAGING, RegistryEvent.MissingMappings<?> e, java.util.Map<ResourceLocation,java.lang.Integer> missing, java.util.Map<ResourceLocation,java.lang.Integer[]> remaps, java.util.Collection<ResourceLocation> defaulted, java.util.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
revertToFrozen()
static void
setCustomTagTypesFromRegistries()
static void
vanillaSnapshot()
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
MAX_VARINT
private static final int MAX_VARINT
- See Also:
- Constant Field Values
-
BLOCK_TO_ITEM
private static final ResourceLocation BLOCK_TO_ITEM
-
BLOCKSTATE_TO_ID
private static final ResourceLocation BLOCKSTATE_TO_ID
-
BLOCKSTATE_TO_POINT_OF_INTEREST_TYPE
private static final ResourceLocation BLOCKSTATE_TO_POINT_OF_INTEREST_TYPE
-
SERIALIZER_TO_ENTRY
private static final ResourceLocation SERIALIZER_TO_ENTRY
-
STRUCTURES
private static final ResourceLocation STRUCTURES
-
hasInit
private static boolean hasInit
-
DISABLE_VANILLA_REGISTRIES
private static final boolean DISABLE_VANILLA_REGISTRIES
-
LOCK_VANILLA
private static final java.util.function.BiConsumer<ResourceLocation,ForgeRegistry<?>> LOCK_VANILLA
-
regName
private static java.lang.reflect.Field regName
-
-
Method Detail
-
init
public static void init()
-
c
private static <T> java.lang.Class<T> c(java.lang.Class<?> cls)
-
makeRegistry
private static <T extends IForgeRegistryEntry<T>> RegistryBuilder<T> makeRegistry(RegistryKey<? extends Registry<T>> key, java.lang.Class<T> type)
-
makeRegistry
private static <T extends IForgeRegistryEntry<T>> RegistryBuilder<T> makeRegistry(RegistryKey<? extends Registry<T>> key, java.lang.Class<T> type, int min, int max)
-
makeRegistry
private static <T extends IForgeRegistryEntry<T>> RegistryBuilder<T> makeRegistry(RegistryKey<? extends Registry<T>> key, java.lang.Class<T> type, java.lang.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, java.lang.String defKey)
-
getBlockStateIDMap
public static ObjectIntIdentityMap<BlockState> getBlockStateIDMap()
-
getBlockStatePointOfInterestTypeMap
public static java.util.Map<BlockState,PointOfInterestType> getBlockStatePointOfInterestTypeMap()
-
getSerializerMap
public static java.util.Map<IDataSerializer<?>,DataSerializerEntry> getSerializerMap()
-
getStructureMap
public static com.google.common.collect.BiMap<java.lang.String,Structure<?>> getStructureMap()
-
register_impl
public static <K extends IForgeRegistryEntry<K>> K register_impl(K value)
-
vanillaSnapshot
public static void vanillaSnapshot()
-
freezeData
public static void freezeData()
-
revertToFrozen
public static void revertToFrozen()
-
revertTo
public static void revertTo(RegistryManager target, boolean fireEvents)
-
revert
public static void revert(RegistryManager state, ResourceLocation registry, boolean lock)
-
generateRegistryEvents
public static java.util.stream.Stream<ModLoadingStage.EventGenerator<?>> generateRegistryEvents()
-
preRegistryEventDispatch
public static java.util.concurrent.CompletableFuture<java.util.List<java.lang.Throwable>> preRegistryEventDispatch(java.util.concurrent.Executor executor, ModLoadingStage.EventGenerator<? extends RegistryEvent.Register<?>> eventGenerator)
-
postRegistryEventDispatch
public static java.util.concurrent.CompletableFuture<java.util.List<java.lang.Throwable>> postRegistryEventDispatch(java.util.concurrent.Executor executor, ModLoadingStage.EventGenerator<? extends RegistryEvent.Register<?>> eventGenerator)
-
checkForRevertToVanilla
public static java.util.concurrent.CompletableFuture<java.util.List<java.lang.Throwable>> checkForRevertToVanilla(java.util.concurrent.Executor executor, java.util.concurrent.CompletableFuture<java.util.List<java.lang.Throwable>> listCompletableFuture)
-
setCustomTagTypesFromRegistries
public static void setCustomTagTypesFromRegistries()
-
loadRegistry
private static <T extends IForgeRegistryEntry<T>> void loadRegistry(ResourceLocation registryName, RegistryManager from, RegistryManager to, java.lang.Class<T> regType, boolean freeze)
-
injectSnapshot
public static com.google.common.collect.Multimap<ResourceLocation,ResourceLocation> injectSnapshot(java.util.Map<ResourceLocation,ForgeRegistry.Snapshot> snapshot, boolean injectFrozenData, boolean isLocalWorld)
-
fireRemapEvent
private static void fireRemapEvent(java.util.Map<ResourceLocation,java.util.Map<ResourceLocation,java.lang.Integer[]>> remaps, boolean isFreezing)
-
loadPersistentDataToStagingRegistry
private static <T extends IForgeRegistryEntry<T>> void loadPersistentDataToStagingRegistry(RegistryManager pool, RegistryManager to, java.util.Map<ResourceLocation,java.lang.Integer[]> remaps, java.util.Map<ResourceLocation,java.lang.Integer> missing, ResourceLocation name, ForgeRegistry.Snapshot snap, java.lang.Class<T> regType)
-
processMissing
private static <T extends IForgeRegistryEntry<T>> void processMissing(java.lang.Class<T> clazz, ResourceLocation name, RegistryManager STAGING, RegistryEvent.MissingMappings<?> e, java.util.Map<ResourceLocation,java.lang.Integer> missing, java.util.Map<ResourceLocation,java.lang.Integer[]> remaps, java.util.Collection<ResourceLocation> defaulted, java.util.Collection<ResourceLocation> failed, boolean injectNetworkDummies)
-
loadFrozenDataToStagingRegistry
private static <T extends IForgeRegistryEntry<T>> void loadFrozenDataToStagingRegistry(RegistryManager STAGING, ResourceLocation name, java.util.Map<ResourceLocation,java.lang.Integer[]> remaps, java.lang.Class<T> clazz)
-
checkPrefix
public static ResourceLocation checkPrefix(java.lang.String name, boolean warnOverrides)
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
private static void forceRegistryName(IForgeRegistryEntry<?> entry, ResourceLocation name)
-
-