diff --git a/src/main/java/thut/core/client/render/animation/AnimationLoader.java b/src/main/java/thut/core/client/render/animation/AnimationLoader.java index 2fbc5c0f7c..a3fcaceef7 100644 --- a/src/main/java/thut/core/client/render/animation/AnimationLoader.java +++ b/src/main/java/thut/core/client/render/animation/AnimationLoader.java @@ -266,8 +266,7 @@ else if (phase.type != null) // Handle customTextures texturer.init(texs); - if (texs.defaults != null) holder.texture = new ResourceLocation( - holder.texture.toString().replace(holder.name, texs.defaults)); + if (texs.defaults != null) holder.texture = new ResourceLocation(texs.defaults); texturer.init(texs); // Apply texture phases (ie texture animations) diff --git a/src/main/java/thut/core/client/render/bbmodel/BBModelPart.java b/src/main/java/thut/core/client/render/bbmodel/BBModelPart.java index ebac2eeea1..b026f9542b 100644 --- a/src/main/java/thut/core/client/render/bbmodel/BBModelPart.java +++ b/src/main/java/thut/core/client/render/bbmodel/BBModelPart.java @@ -126,10 +126,11 @@ private static List makeShapes(BBModelTemplate t, Element b, float[] origi m.name = ThutCore.trim(key); Material mat = new Material(m.name); mats.put(m.name, mat); + if (b.box_uv) mat.cull = true; m.setMaterial(mat); shapes.add(m); }); - + tris_materials.forEach((key, lists) -> { List order = lists.get(0); List verts = lists.get(1); @@ -138,6 +139,7 @@ private static List makeShapes(BBModelTemplate t, Element b, float[] origi tex.toArray(new TextureCoordinate[0])); m.name = ThutCore.trim(key); Material mat = mats.getOrDefault(m.name, new Material(m.name)); + if (b.box_uv) mat.cull = true; m.setMaterial(mat); shapes.add(m); }); diff --git a/src/main/java/thut/core/client/render/bbmodel/BBModelTemplate.java b/src/main/java/thut/core/client/render/bbmodel/BBModelTemplate.java index 55101a41fa..f2f9ee4ccc 100644 --- a/src/main/java/thut/core/client/render/bbmodel/BBModelTemplate.java +++ b/src/main/java/thut/core/client/render/bbmodel/BBModelTemplate.java @@ -399,6 +399,7 @@ public static class Element implements IBBPart public float[] origin; public float[] rotation; public int color; + public boolean box_uv = false; public float inflate = 0.0f; public Map faces; public Map vertices; diff --git a/src/main/java/thut/core/client/render/model/parts/Material.java b/src/main/java/thut/core/client/render/model/parts/Material.java index d60cfdecae..835d027298 100644 --- a/src/main/java/thut/core/client/render/model/parts/Material.java +++ b/src/main/java/thut/core/client/render/model/parts/Material.java @@ -63,7 +63,7 @@ public class Material public float shininess; public float alpha = 1; public boolean transluscent = false; - public boolean cull = true; + public boolean cull = false; public boolean flat = true; public int[] rgbabro = new int[6]; diff --git a/src/main/java/thut/core/client/render/model/parts/RenderTypeProvider.java b/src/main/java/thut/core/client/render/model/parts/RenderTypeProvider.java index 15f05d931f..219b9f5a5e 100644 --- a/src/main/java/thut/core/client/render/model/parts/RenderTypeProvider.java +++ b/src/main/java/thut/core/client/render/model/parts/RenderTypeProvider.java @@ -60,7 +60,7 @@ public RenderType makeRenderType(Material material, ResourceLocation tex, Mode m final boolean transp = material.alpha < 1 || material.transluscent; // disable culling entirely - if (material.alpha >= 1) + if (!material.cull) { builder.setCullState(RenderStateShard.NO_CULL); }