I think i replaced all the hardcoded namespaces

This commit is contained in:
xSquishyLiam
2025-09-01 20:22:00 +01:00
parent ed95ddfbaf
commit 960c2750da
4 changed files with 10 additions and 8 deletions

View File

@@ -30,7 +30,7 @@ public class Entity {
"format_version": "1.10.0", "format_version": "1.10.0",
"minecraft:client_entity": { "minecraft:client_entity": {
"description": { "description": {
"identifier": "modelengine:%entity_id%", "identifier": "%namespace%:%entity_id%",
"materials": { "materials": {
"default": "%material%", "default": "%material%",
"anim": "entity_alphatest_anim_change_color_one_sided" "anim": "entity_alphatest_anim_change_color_one_sided"
@@ -59,8 +59,9 @@ public class Entity {
this.modelId = modelId; this.modelId = modelId;
} }
public void modify() { public void modify(String namespace) {
this.json = JsonParser.parseString(TEMPLATE.replace("%entity_id%", modelId) this.json = JsonParser.parseString(TEMPLATE.replace("%namespace%", namespace)
.replace("%entity_id%", modelId)
.replace("%geometry%", "geometry.meg_" + modelId) .replace("%geometry%", "geometry.meg_" + modelId)
.replace("%texture%", "textures/entity/" + path + modelId) .replace("%texture%", "textures/entity/" + path + modelId)
.replace("%look_at_target%", modelConfig.isEnableHeadRotation() ? "animation." + modelId + ".look_at_target" : "animation.none") .replace("%look_at_target%", modelConfig.isEnableHeadRotation() ? "animation." + modelId + ".look_at_target" : "animation.none")

View File

@@ -13,7 +13,7 @@ public class Geometry {
private String modelId; private String modelId;
private String geometryId; private String geometryId;
private JsonObject json; private JsonObject json;
private Map<String, Bone> bones = new HashMap<>(); private final Map<String, Bone> bones = new HashMap<>();
private String path; private String path;

View File

@@ -8,9 +8,10 @@ import java.util.*;
public class RenderController { public class RenderController {
public static final Set<String> NEED_REMOVE_WHEN_SORT = Set.of("pbody_", "plarm_", "prarm_", "plleg_", "prleg_", "phead_", "p_"); public static final Set<String> NEED_REMOVE_WHEN_SORT = Set.of("pbody_", "plarm_", "prarm_", "plleg_", "prleg_", "phead_", "p_");
String modelId;
Map<String, Bone> bones; private final String modelId;
Entity entity; private final Map<String, Bone> bones;
private final Entity entity;
public RenderController(String modelId, Map<String, Bone> bones, Entity entity) { public RenderController(String modelId, Map<String, Bone> bones, Entity entity) {
this.modelId = modelId; this.modelId = modelId;

View File

@@ -180,7 +180,7 @@ public class ResourcePackManager {
for (Map.Entry<String, Entity> entry : entityCache.entrySet()) { for (Map.Entry<String, Entity> entry : entityCache.entrySet()) {
Entity entity = entry.getValue(); Entity entity = entry.getValue();
entity.modify(); entity.modify(extension.getConfigManager().getConfig().getString("models.namespace"));
Path entityPath = entityFolder.toPath().resolve(entity.getPath() + entry.getKey() + ".entity.json"); Path entityPath = entityFolder.toPath().resolve(entity.getPath() + entry.getKey() + ".entity.json");
entityPath.toFile().getParentFile().mkdirs(); entityPath.toFile().getParentFile().mkdirs();