MCPcopy Create free account
hub / github.com/Garten/sourcecraft / main

Method main

src/vmfWriter/texture/VmtGenerator.java:12–38  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 6

setTranslucentMethod · 0.95
setColorMethod · 0.95
writeVmfMethod · 0.95
finishMethod · 0.95
getNameMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected