Forge Mixin Naming

This commit is contained in:
Olof Larsson 2016-08-23 09:00:14 +02:00
parent 25f127e099
commit b847737de8
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474

View File

@ -187,6 +187,8 @@ public class Mixin extends Engine
// CREATE NAME // CREATE NAME
// -------------------------------------------- // // -------------------------------------------- //
private static final String FORGE = "Forge";
private static final Map<String, String> NAME_MAP = new MassiveMap<>( private static final Map<String, String> NAME_MAP = new MassiveMap<>(
"", "Default", "", "Default",
"Fallback", "Fallback (Generic and Weaker)", "Fallback", "Fallback (Generic and Weaker)",
@ -222,9 +224,17 @@ public class Mixin extends Engine
String baseName = this.getBaseName(); String baseName = this.getBaseName();
if (ret.startsWith(baseName)) ret = ret.substring(baseName.length()); if (ret.startsWith(baseName)) ret = ret.substring(baseName.length());
// Forge Pre
boolean forge = ret.endsWith(FORGE);
if (forge) ret = ret.substring(0, ret.length() - FORGE.length());
// Name Map
String name = NAME_MAP.get(ret); String name = NAME_MAP.get(ret);
if (name != null) ret = name; if (name != null) ret = name;
// Forge Post
if (forge) ret = FORGE + " " + ret;
// Return // Return
return ret; return ret;
} }