mirror of
https://github.com/xSquishyLiam/mc-GeyserModelEnginePackGenerator-extension.git
synced 2025-12-19 14:59:16 +00:00
Some quick geometry fixes, and converted animation controller to custom properties.
This commit is contained in:
@@ -51,6 +51,11 @@ public class ExtensionMain implements Extension {
|
||||
GeyserUtils.addProperty(id, entity + ":" + bone, Boolean.class);
|
||||
});
|
||||
|
||||
GeyserUtils.addProperty(id, "modelengine:anim_idle", Boolean.class);
|
||||
GeyserUtils.addProperty(id, "modelengine:anim_spawn", Boolean.class);
|
||||
GeyserUtils.addProperty(id, "modelengine:anim_walk", Boolean.class);
|
||||
GeyserUtils.addProperty(id, "modelengine:anim_stop", Boolean.class);
|
||||
|
||||
GeyserUtils.registerProperties(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class AnimationController {
|
||||
],
|
||||
"transitions": [
|
||||
{
|
||||
"idle": "q.is_item_name_any('slot.armor.head', 0, 'minecraft:stone')"
|
||||
"idle": "query.property('modelengine:anim_idle')"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -25,13 +25,13 @@ public class AnimationController {
|
||||
],
|
||||
"transitions": [
|
||||
{
|
||||
"spawn": "q.is_item_name_any('slot.armor.head', 0, 'minecraft:iron_block')"
|
||||
"spawn": "query.property('modelengine:anim_spawn')"
|
||||
},
|
||||
{
|
||||
"walk": "q.is_item_name_any('slot.armor.head', 0, 'minecraft:redstone')"
|
||||
"walk": "query.property('modelengine:anim_walk')"
|
||||
},
|
||||
{
|
||||
"stop": "q.is_item_name_any('slot.armor.head', 0, 'minecraft:air')"
|
||||
"stop": "query.property('modelengine:anim_stop')"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -41,26 +41,26 @@ public class AnimationController {
|
||||
],
|
||||
"transitions": [
|
||||
{
|
||||
"spawn": "q.is_item_name_any('slot.armor.head', 0, 'minecraft:iron_block')"
|
||||
"spawn": "query.property('modelengine:anim_spawn')"
|
||||
},
|
||||
{
|
||||
"stop": "q.is_item_name_any('slot.armor.head', 0, 'minecraft:air')"
|
||||
"stop": "query.property('modelengine:anim_stop')"
|
||||
},
|
||||
{
|
||||
"idle": "q.is_item_name_any('slot.armor.head', 0, 'minecraft:stone')"
|
||||
"idle": "query.property('modelengine:anim_idle')"
|
||||
}
|
||||
]
|
||||
},
|
||||
"stop": {
|
||||
"transitions": [
|
||||
{
|
||||
"idle": "q.is_item_name_any('slot.armor.head', 0, 'minecraft:stone')"
|
||||
"idle": "query.property('modelengine:anim_idle')"
|
||||
},
|
||||
{
|
||||
"spawn": "q.is_item_name_any('slot.armor.head', 0, 'minecraft:iron_block')"
|
||||
"spawn": "query.property('modelengine:anim_spawn')"
|
||||
},
|
||||
{
|
||||
"walk": "q.is_item_name_any('slot.armor.head', 0, 'minecraft:redstone')"
|
||||
"walk": "query.property('modelengine:anim_walk')"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package re.imc.geysermodelenginepackgenerator.generator;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -12,6 +9,7 @@ import lombok.Setter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -43,8 +41,13 @@ public class Geometry {
|
||||
while (iterator.hasNext()) {
|
||||
JsonElement element = iterator.next();
|
||||
if (element.isJsonObject()) {
|
||||
String name = element.getAsJsonObject().get("name").getAsString();
|
||||
String name = element.getAsJsonObject().get("name").getAsString().toLowerCase(Locale.ROOT);
|
||||
|
||||
element.getAsJsonObject().remove("name");
|
||||
element.getAsJsonObject().addProperty("name", name);
|
||||
|
||||
if (name.equals("hitbox") ||
|
||||
name.equals("mount") ||
|
||||
name.startsWith("p_") ||
|
||||
name.startsWith("b_") ||
|
||||
name.startsWith("ob_")) {
|
||||
@@ -54,4 +57,5 @@ public class Geometry {
|
||||
}
|
||||
setId("geometry.modelengine_" + modelId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user