| 10 | private static final Color GRASS_COLOR = new Color(102, 255, 51); |
| 11 | |
| 12 | public static void main(String[] args) { |
| 13 | try { |
| 14 | File directory = new File("textures" + File.separator + "minecraft_original"); |
| 15 | for (File subFile : directory.listFiles()) { |
| 16 | if (!subFile.getName() |
| 17 | .endsWith(".vtf")) { |
| 18 | continue; |
| 19 | } |
| 20 | String vtfName = subFile.getName(); |
| 21 | String plainName = vtfName.substring(0, vtfName.lastIndexOf('.')); |
| 22 | ValveWriter writer = new ValveWriter(new File(directory, plainName + ".vmt")); |
| 23 | ValveTexture texture = new ValveTexture("minecraft_original" + "/" + plainName); |
| 24 | if (plainName.equals("mob_spawner")) { |
| 25 | texture.setTranslucent(true); |
| 26 | } else if (plainName.startsWith("leaves")) { |
| 27 | texture.setTranslucent(true); |
| 28 | texture.setColor(GRASS_COLOR); |
| 29 | } else if (plainName.equals("grass_top") || plainName.equals("grass_side_overlay")) { |
| 30 | texture.setColor(GRASS_COLOR); |
| 31 | } |
| 32 | texture.writeVmf(writer); |
| 33 | writer.finish(); |
| 34 | } |
| 35 | } catch (IOException e) { |
| 36 | e.printStackTrace(); |
| 37 | } |
| 38 | } |
| 39 | } |