mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 23:45:44 +00:00
Capture a vanilla freeze - will be used when FML connects to vanilla servers, soon
This commit is contained in:
1 parent
efcb9ee570
commit
404995122a
4 files changed
+29
-1
No files matched your search
@@ -0,0 +1,10 @@
|
||||
--- ../src-base/minecraft/net/minecraft/init/Bootstrap.java
|
||||
+++ ../src-work/minecraft/net/minecraft/init/Bootstrap.java
|
||||
@@ -541,6 +541,7 @@
|
||||
StatList.func_151178_a();
|
||||
BiomeGenBase.func_185358_q();
|
||||
func_151353_a();
|
||||
+ net.minecraftforge.fml.common.registry.GameData.vanillaSnapshot();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,6 +244,11 @@ public class GameData
|
||||
return (ObjectIntIdentityMap<IBlockState>)getMain().iBlockRegistry.getSlaveMap(BLOCKSTATE_TO_ID, ObjectIntIdentityMap.class);
|
||||
}
|
||||
|
||||
public static void vanillaSnapshot()
|
||||
{
|
||||
PersistentRegistryManager.freezeVanilla();
|
||||
}
|
||||
|
||||
//Lets us clear the map so we can rebuild it.
|
||||
static class ClearableObjectIntIdentityMap<I> extends ObjectIntIdentityMap<I>
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
*
|
||||
* @param <V> The top level type for the registry
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@SuppressWarnings({"WeakerAccess", "unused"})
|
||||
public interface IForgeRegistry<V extends IForgeRegistryEntry<V>> extends Iterable<V>
|
||||
{
|
||||
public Class<V> getRegistrySuperType();
|
||||
|
||||
@@ -388,6 +388,19 @@ public class PersistentRegistryManager
|
||||
forAllRegistries(PersistentRegistry.FROZEN, ValidateRegistryFunction.OPERATION);
|
||||
}
|
||||
|
||||
public static void freezeVanilla()
|
||||
{
|
||||
FMLLog.fine("Creating vanilla freeze snapshot");
|
||||
for (Map.Entry<ResourceLocation, FMLControlledNamespacedRegistry<?>> r : PersistentRegistry.ACTIVE.registries.entrySet())
|
||||
{
|
||||
// This has to be performed prior to invoking the method so the compiler can precompute the type bounds for the method
|
||||
final Class<? extends IForgeRegistryEntry> registrySuperType = PersistentRegistry.ACTIVE.getRegistrySuperType(r.getKey());
|
||||
loadRegistry(r.getKey(), PersistentRegistry.ACTIVE, PersistentRegistry.VANILLA, registrySuperType);
|
||||
}
|
||||
forAllRegistries(PersistentRegistry.VANILLA, ValidateRegistryFunction.OPERATION);
|
||||
FMLLog.fine("Vanilla freeze snapshot created");
|
||||
}
|
||||
|
||||
public static List<String> processIdRematches(Iterable<FMLMissingMappingsEvent.MissingMapping> missedMappings, boolean isLocalWorld, Map<ResourceLocation, Integer> missingBlocks, Map<ResourceLocation, Integer> missingItems, Map<ResourceLocation, Integer[]> remapBlocks, Map<ResourceLocation, Integer[]> remapItems)
|
||||
{
|
||||
List<String> failed = Lists.newArrayList();
|
||||
|
||||
Reference in new issue
Block a user