public static void revertToFrozen()
{
if (!PersistentRegistry.FROZEN.isPopulated())
{
FMLLog.warning("Can't revert to frozen GameData state without freezing first.");
return;
}
else
{
FMLLog.fine("Reverting to frozen data state.");
}
for (Map.Entry<ResourceLocation, FMLControlledNamespacedRegistry<?>> r : PersistentRegistry.ACTIVE.registries.entrySet())
{
final Class<? extends IForgeRegistryEntry> registrySuperType = PersistentRegistry.ACTIVE.getRegistrySuperType(r.getKey());
loadRegistry(r.getKey(), PersistentRegistry.FROZEN, PersistentRegistry.ACTIVE, registrySuperType);
}
// the id mapping has reverted, fire remap events for those that care about id changes
Loader.instance().fireRemapEvent(ImmutableMap.<ResourceLocation, Integer[]>of(), ImmutableMap.<ResourceLocation, Integer[]>of(), true);
// the id mapping has reverted, ensure we sync up the object holders
ObjectHolderRegistry.INSTANCE.applyObjectHolders();
FMLLog.fine("Frozen state restored.");
}
PersistentRegistryManager.java 文件源码
java
阅读 40
收藏 0
点赞 0
评论 0
项目:CustomWorldGen
作者:
评论列表
文章目录