mirror of
https://github.com/xSquishyLiam/mc-GeyserModelEnginePackGenerator-extension.git
synced 2025-12-19 14:59:16 +00:00
I think i replaced all the hardcoded namespaces
This commit is contained in:
@@ -30,7 +30,7 @@ public class Entity {
|
||||
"format_version": "1.10.0",
|
||||
"minecraft:client_entity": {
|
||||
"description": {
|
||||
"identifier": "modelengine:%entity_id%",
|
||||
"identifier": "%namespace%:%entity_id%",
|
||||
"materials": {
|
||||
"default": "%material%",
|
||||
"anim": "entity_alphatest_anim_change_color_one_sided"
|
||||
@@ -59,8 +59,9 @@ public class Entity {
|
||||
this.modelId = modelId;
|
||||
}
|
||||
|
||||
public void modify() {
|
||||
this.json = JsonParser.parseString(TEMPLATE.replace("%entity_id%", modelId)
|
||||
public void modify(String namespace) {
|
||||
this.json = JsonParser.parseString(TEMPLATE.replace("%namespace%", namespace)
|
||||
.replace("%entity_id%", modelId)
|
||||
.replace("%geometry%", "geometry.meg_" + modelId)
|
||||
.replace("%texture%", "textures/entity/" + path + modelId)
|
||||
.replace("%look_at_target%", modelConfig.isEnableHeadRotation() ? "animation." + modelId + ".look_at_target" : "animation.none")
|
||||
|
||||
@@ -13,7 +13,7 @@ public class Geometry {
|
||||
private String modelId;
|
||||
private String geometryId;
|
||||
private JsonObject json;
|
||||
private Map<String, Bone> bones = new HashMap<>();
|
||||
private final Map<String, Bone> bones = new HashMap<>();
|
||||
|
||||
private String path;
|
||||
|
||||
|
||||
@@ -8,9 +8,10 @@ import java.util.*;
|
||||
public class RenderController {
|
||||
|
||||
public static final Set<String> NEED_REMOVE_WHEN_SORT = Set.of("pbody_", "plarm_", "prarm_", "plleg_", "prleg_", "phead_", "p_");
|
||||
String modelId;
|
||||
Map<String, Bone> bones;
|
||||
Entity entity;
|
||||
|
||||
private final String modelId;
|
||||
private final Map<String, Bone> bones;
|
||||
private final Entity entity;
|
||||
|
||||
public RenderController(String modelId, Map<String, Bone> bones, Entity entity) {
|
||||
this.modelId = modelId;
|
||||
|
||||
@@ -180,7 +180,7 @@ public class ResourcePackManager {
|
||||
|
||||
for (Map.Entry<String, Entity> entry : entityCache.entrySet()) {
|
||||
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");
|
||||
entityPath.toFile().getParentFile().mkdirs();
|
||||
|
||||
Reference in New Issue
Block a user