mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 12:42:26 +00:00
Fix up persistent substitution. Should close #2259
This commit is contained in:
1 parent
d8ca68b280
commit
5562c14c45
3 files changed
+6
-2
No files matched your search
+3
-1
@@ -160,6 +160,8 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
|
||||
this.minId = otherRegistry.minId;
|
||||
this.aliases.clear();
|
||||
this.aliases.putAll(otherRegistry.aliases);
|
||||
this.persistentSubstitutions.clear();
|
||||
this.persistentSubstitutions.putAll(otherRegistry.getPersistentSubstitutions());
|
||||
this.activeSubstitutions.clear();
|
||||
|
||||
underlyingIntegerMap = new ObjectIntIdentityMap<I>();
|
||||
@@ -599,7 +601,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
|
||||
getPersistentSubstitutions().put(nameToReplace, replacement);
|
||||
}
|
||||
|
||||
private BiMap<ResourceLocation, I> getPersistentSubstitutions()
|
||||
BiMap<ResourceLocation, I> getPersistentSubstitutions()
|
||||
{
|
||||
return persistentSubstitutions;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ public class GameData
|
||||
|
||||
void registerSubstitutionAlias(String name, GameRegistry.Type type, Object toReplace) throws ExistingSubstitutionException
|
||||
{
|
||||
ResourceLocation nameToSubstitute = new ResourceLocation(Loader.instance().activeModContainer().getModId(), name);
|
||||
ResourceLocation nameToSubstitute = new ResourceLocation(name);
|
||||
if (type == GameRegistry.Type.BLOCK)
|
||||
{
|
||||
iBlockRegistry.addSubstitutionAlias(Loader.instance().activeModContainer().getModId(), nameToSubstitute, (Block)toReplace);
|
||||
|
||||
@@ -269,6 +269,8 @@ public class PersistentRegistryManager
|
||||
StartupQuery.abort();
|
||||
}
|
||||
FMLControlledNamespacedRegistry<T> newRegistry = PersistentRegistry.STAGING.getOrShallowCopyRegistry(registryName, regType, currentRegistry);
|
||||
// Copy the persistent substitution set from the currently active one into the new registry
|
||||
newRegistry.getPersistentSubstitutions().putAll(currentRegistry.getPersistentSubstitutions());
|
||||
GameDataSnapshot.Entry snapshotEntry = snapEntry.getValue();
|
||||
Set<ResourceLocation> substitutions = snapshotEntry.substitutions;
|
||||
if (injectFrozenData)
|
||||
|
||||
Reference in new issue
Block a user