Fix overrides typo in saving registry data. Closes #4894

This commit is contained in:
LexManos 2018-04-21 21:40:40 -07:00
parent 34f4381e0c
commit a99fe41667
1 changed files with 17 additions and 2 deletions

View File

@ -156,7 +156,7 @@ public final class FMLContainer extends DummyModContainer implements WorldAccess
NBTTagCompound tag = new NBTTagCompound();
tag.setString("K", entry.getKey().toString());
tag.setString("V", entry.getValue().toString());
aliases.appendTag(tag);
overrides.appendTag(tag);
}
data.setTag("overrides", overrides);
@ -231,7 +231,22 @@ public final class FMLContainer extends DummyModContainer implements WorldAccess
for (int x = 0; x < list.tagCount(); x++)
{
NBTTagCompound e = list.getCompoundTagAt(x);
entry.aliases.put(new ResourceLocation(e.getString("K")), new ResourceLocation(e.getString("V")));
String v = e.getString("V");
if (v.indexOf(':') == -1) //Forge Bug: https://github.com/MinecraftForge/MinecraftForge/issues/4894 TODO: Remove in 1.13
{
entry.overrides.put(new ResourceLocation(e.getString("K")), v);
}
else
{
entry.aliases.put(new ResourceLocation(e.getString("K")), new ResourceLocation(v));
}
}
list = ent.getTagList("overrides", 10);
for (int x = 0; x < list.tagCount(); x++)
{
NBTTagCompound e = list.getCompoundTagAt(x);
entry.overrides.put(new ResourceLocation(e.getString("K")), e.getString("V"));
}
int[] blocked = regs.getCompoundTag(key).getIntArray("blocked");