Skip to content

Instantly share code, notes, and snippets.

@amadornes
Created May 21, 2015 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amadornes/572bda434b7dd15ce910 to your computer and use it in GitHub Desktop.
Save amadornes/572bda434b7dd15ce910 to your computer and use it in GitHub Desktop.
private boolean avoidLoops = false;
@Override
public String getUnlocalizedName() {
if (avoidLoops)
return "tile." + ModInfo.MODID + ":" + id;
avoidLoops = true;
boolean same = getLocalizedName().equals(getUnlocalizedName() + ".name");
avoidLoops = false;
if (same) {
IFrameModifierMaterial m = FramezUtils.getMaterial(tile.getModifiers());
if (m != null)
return "tile." + ModInfo.MODID + ":frame_" + m.getType();
return "tile." + ModInfo.MODID + ":frame";
}
return "tile." + ModInfo.MODID + ":" + id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment