Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void generateTranslationDefaults() {
- File dir = new File(ModLoader.getMinecraftInstance().getMinecraftDir(), "/resources/newsound/");
- for (String fileName : getFinalFile(dir)) {
- if (fileName.startsWith("."))
- fileName = fileName.replaceFirst(".", "");
- fileName = fileName.substring(fileName.indexOf("newsound") + 9, fileName.indexOf(".", fileName.indexOf("newsound") + 9));
- fileName = fileName.replace("/", ".");
- fileName = fileName.replace("\\", ".");
- fileName = fileName.replaceAll("[0-9]", "");
- if (!fileName.isEmpty())
- // add yo shizzle
- GenuineCaptionsContainer.instance.addTranslation(fileName, "default");
- }
- }
- private List<String> getFinalFile(File file) {
- List<String> list = new ArrayList<String>();
- if (file.isFile()) {
- list.add(file.getPath());
- return list;
- }
- for (File file1 : file.listFiles()) {
- if (file1.isFile())
- list.add(file1.getPath());
- else
- list.addAll(getFinalFile(file1));
- }
- return list;
- }
Advertisement