MinecraftForge/FML — pull request #216 by agaricusb (2013-04-14 21:22:35+00:00)
Title: Add srgname to registerTileEntityWithAlternatives

> Map teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_70326_a", "a");

is replaced during MCP updatenames (in MinecraftForge/mcp/src_work/minecraftcpw/mods/fml/common/registry/GameRegistry.java) with:

> Map teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "nameToClassMap", "a");

At runtime, only the the obfuscated version-dependent "a" name is found. Works fine as long as the obfuscated name remains the same, but loses the version-independence benefit of srgnames.

This PR adds the srgname split up so it won't be replaced by updatenames (same technique used in cpw/mods/fml/relauncher/FMLRelauncher.java), for version-independence (and keeping the original name so all names are tried: srgname, csvname, obfuscated):

> Map teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "70326_a", "field_70326_a", "a");