Bugfixes / Auto-strip color codes from meta
This commit is contained in:
@@ -79,8 +79,6 @@ public class SectorInfo{
|
|||||||
|
|
||||||
//update sector's internal time spent counter1
|
//update sector's internal time spent counter1
|
||||||
state.rules.sector.setTimeSpent(internalTimeSpent);
|
state.rules.sector.setTimeSpent(internalTimeSpent);
|
||||||
|
|
||||||
Log.info(production);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Update averages of various stats, updates some special sector logic.
|
/** Update averages of various stats, updates some special sector logic.
|
||||||
|
|||||||
@@ -598,6 +598,7 @@ public class Mods implements Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
ModMeta meta = json.fromJson(ModMeta.class, Jval.read(metaf.readString()).toString(Jformat.plain));
|
ModMeta meta = json.fromJson(ModMeta.class, Jval.read(metaf.readString()).toString(Jformat.plain));
|
||||||
|
meta.cleanup();
|
||||||
String camelized = meta.name.replace(" ", "");
|
String camelized = meta.name.replace(" ", "");
|
||||||
String mainClass = meta.main == null ? camelized.toLowerCase() + "." + camelized + "Mod" : meta.main;
|
String mainClass = meta.main == null ? camelized.toLowerCase() + "." + camelized + "Mod" : meta.main;
|
||||||
String baseName = meta.name.toLowerCase().replace(" ", "-");
|
String baseName = meta.name.toLowerCase().replace(" ", "-");
|
||||||
@@ -783,6 +784,13 @@ public class Mods implements Loadable{
|
|||||||
public String displayName(){
|
public String displayName(){
|
||||||
return displayName == null ? name : displayName;
|
return displayName == null ? name : displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//removes all colors
|
||||||
|
public void cleanup(){
|
||||||
|
if(displayName != null) displayName = Strings.stripColors(displayName);
|
||||||
|
if(author != null) author = Strings.stripColors(author);
|
||||||
|
if(description != null) description = Strings.stripColors(description);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ModState{
|
public enum ModState{
|
||||||
|
|||||||
Reference in New Issue
Block a user