Created
August 30, 2019 16:22
-
-
Save Maxopoly/a6b1be7cb55282ea5671bb8b951227c1 to your computer and use it in GitHub Desktop.
Generates a csv with nice human readable names for each spigot material
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
StringBuilder sb = new StringBuilder(); | |
for (Material mat : Material.values()) { | |
if (mat.toString().contains("LEGACY")) { | |
continue; | |
} | |
sb.append(mat.toString()); | |
sb.append(","); | |
for (String part : mat.toString().split("_")) { | |
if (part.length() != 0) { | |
sb.append(part.substring(0, 1).toUpperCase()); | |
sb.append(part.substring(1).toLowerCase()); | |
} | |
sb.append(" "); | |
} | |
sb.append("\r\n"); | |
} | |
try (Writer writer = new BufferedWriter( | |
new OutputStreamWriter(new FileOutputStream("materials.csv"), "utf-8"))) { | |
writer.write(sb.toString()); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment