mirror of
https://github.com/GeyserExtensionists/GeyserModelEnginePackGenerator.git
synced 2025-12-20 07:29:29 +00:00
some improve
This commit is contained in:
@@ -25,11 +25,13 @@ public class ExtensionMain implements Extension {
|
||||
File[] files = source.listFiles();
|
||||
if (files != null) {
|
||||
for (File file : files) {
|
||||
String id = "modelengine:" + file.getName();
|
||||
String id = "modelengine:" + file.getName().toLowerCase();
|
||||
GeyserUtils.addCustomEntity(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void onPackLoad(GeyserLoadResourcePacksEvent event) {
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class GeneratorMain {
|
||||
if (file1.listFiles() == null) {
|
||||
continue;
|
||||
}
|
||||
String modelId = file1.getName();
|
||||
String modelId = file1.getName().toLowerCase();
|
||||
|
||||
entityMap.put(modelId, new Entity(modelId));
|
||||
for (File e : file1.listFiles()) {
|
||||
@@ -59,7 +59,6 @@ public class GeneratorMain {
|
||||
}
|
||||
|
||||
if (isGeometryFile(json)) {
|
||||
System.out.println("G");
|
||||
Geometry geometry = new Geometry();
|
||||
geometry.load(json);
|
||||
geometry.setModelId(modelId);
|
||||
|
||||
@@ -66,15 +66,16 @@ public class Animation {
|
||||
}
|
||||
if (name.startsWith("h_") || name.startsWith("hi_")) {
|
||||
bones.add(name, new JsonParser().parse(HEAD_TEMPLATE));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i == 0) {
|
||||
return;
|
||||
}
|
||||
GeneratorMain.entityMap
|
||||
.get(modelId).setHasHeadAnimation(true);
|
||||
|
||||
object.add("bones", bones);
|
||||
json.get("animations").getAsJsonObject().add("animation." + modelId + ".look_at_target", object);
|
||||
}
|
||||
|
||||
@@ -26,8 +26,9 @@ public class Entity {
|
||||
"default": "%geometry%"
|
||||
},
|
||||
"animations": {
|
||||
"default": "animation.%geometry%.idle",
|
||||
"default": "animation.%entity_id%.idle",
|
||||
"look_at_target": "%look_at_target%"
|
||||
|
||||
},
|
||||
"scripts": {
|
||||
"animate": [
|
||||
|
||||
Reference in New Issue
Block a user