mirror of
https://github.com/GeyserExtensionists/GeyserModelEnginePackGenerator.git
synced 2025-12-19 15:09:18 +00:00
per texture material
This commit is contained in:
@@ -76,8 +76,13 @@ public class Entity {
|
||||
JsonObject description = json.get("minecraft:client_entity").getAsJsonObject().get("description").getAsJsonObject();
|
||||
JsonObject jsonAnimations = description.get("animations").getAsJsonObject();
|
||||
JsonObject jsonTextures = description.get("textures").getAsJsonObject();
|
||||
JsonObject jsonMaterials = description.get("materials").getAsJsonObject();
|
||||
|
||||
JsonArray jsonRenderControllers = description.get("render_controllers").getAsJsonArray();
|
||||
|
||||
Map<String, String> materials = getModelConfig().getTextureMaterials();
|
||||
materials.forEach(jsonMaterials::addProperty);
|
||||
|
||||
|
||||
for (String name : textureMap.keySet()) {
|
||||
jsonTextures.addProperty(name,"textures/entity/" + path + modelId + "/" + name);
|
||||
|
||||
@@ -26,6 +26,12 @@ public class ModelConfig {
|
||||
Map<String, Set<String>> bingingBones = new HashMap<>();
|
||||
@SerializedName("anim_textures")
|
||||
Map<String, AnimTextureOptions> animTextures = new HashMap<>();
|
||||
@SerializedName("texture_materials")
|
||||
Map<String, String> textureMaterials = new HashMap<>();
|
||||
|
||||
public Map<String, String> getTextureMaterials() {
|
||||
return textureMaterials != null ? textureMaterials : Map.of();
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -40,8 +40,11 @@ public class RenderController {
|
||||
controller.addProperty("geometry", "Geometry.default");
|
||||
|
||||
JsonArray materials = new JsonArray();
|
||||
String material = entity.getModelConfig().getTextureMaterials().get(key);
|
||||
JsonObject materialItem = new JsonObject();
|
||||
if (anim != null) {
|
||||
if (material != null) {
|
||||
materialItem.addProperty("*", "Material." + material);
|
||||
} else if (anim != null) {
|
||||
materialItem.addProperty("*", "Material.anim");
|
||||
JsonObject uvAnim = new JsonObject();
|
||||
controller.add("uv_anim", uvAnim);
|
||||
|
||||
Reference in New Issue
Block a user