From a99fe416673dd17577fa7711d2b67fa5f571ca1a Mon Sep 17 00:00:00 2001 From: LexManos Date: Sat, 21 Apr 2018 21:40:40 -0700 Subject: [PATCH] Fix overrides typo in saving registry data. Closes #4894 --- .../fml/common/FMLContainer.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/common/FMLContainer.java b/src/main/java/net/minecraftforge/fml/common/FMLContainer.java index 83a7da263..8f09c1c4e 100644 --- a/src/main/java/net/minecraftforge/fml/common/FMLContainer.java +++ b/src/main/java/net/minecraftforge/fml/common/FMLContainer.java @@ -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");