mirror of
https://github.com/GeyserExtensionists/GeyserModelEnginePackGenerator.git
synced 2025-12-19 15:09:18 +00:00
Revert "disable part visibility by default"
This reverts commit c5a739074b.
This commit is contained in:
@@ -8,7 +8,6 @@ import re.imc.geysermodelenginepackgenerator.generator.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
@@ -51,7 +50,13 @@ public class GeneratorMain {
|
||||
canAdd = true;
|
||||
textureMap.put(modelId, new Texture(modelId, currentPath, e.toPath()));
|
||||
}
|
||||
|
||||
if (e.getName().equals("config.properties")) {
|
||||
try {
|
||||
entity.getProperties().load(new FileReader(e));
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (e.getName().endsWith(".json")) {
|
||||
try {
|
||||
String json = Files.readString(e.toPath());
|
||||
@@ -76,17 +81,6 @@ public class GeneratorMain {
|
||||
}
|
||||
}
|
||||
if (canAdd) {
|
||||
File config = new File(folder, "config.properties");
|
||||
try {
|
||||
if (config.exists()) {
|
||||
entity.getProperties().load(new FileReader(config));
|
||||
} else {
|
||||
entity.getProperties().setProperty("enable-part-visibility", "false");
|
||||
entity.getProperties().store(new FileWriter(config), "For some reasons, the part visibility render controller may cause client crash");
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
entity.setPath(currentPath);
|
||||
entityMap.put(modelId, entity);
|
||||
}
|
||||
@@ -228,8 +222,6 @@ public class GeneratorMain {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
File controller = new File(animationControllersFolder, "modelengine.animation_controller.json");
|
||||
|
||||
@@ -2,7 +2,6 @@ package re.imc.geysermodelenginepackgenerator.generator;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import re.imc.geysermodelenginepackgenerator.GeneratorMain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,10 +37,7 @@ public class RenderController {
|
||||
JsonArray textures = new JsonArray();
|
||||
textures.add("Texture.default");
|
||||
controller.add("textures", textures);
|
||||
Entity entity = GeneratorMain.entityMap
|
||||
.get(modelId);
|
||||
boolean enable = Boolean.parseBoolean(entity.getProperties().getProperty("enable-part-visibility", "false"));
|
||||
if (enable) {
|
||||
|
||||
JsonArray partVisibility = new JsonArray();
|
||||
JsonObject visibilityDefault = new JsonObject();
|
||||
visibilityDefault.addProperty("*", true);
|
||||
@@ -53,7 +49,7 @@ public class RenderController {
|
||||
partVisibility.add(visibilityItem);
|
||||
}
|
||||
controller.add("part_visibility", partVisibility);
|
||||
}
|
||||
|
||||
return root.toString();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user