|
1 | 1 | --- a/jp/ngt/rtm/render/ModelObject.java |
2 | 2 | +++ b/jp/ngt/rtm/render/ModelObject.java |
3 | | -@@ -92,10 +92,19 @@ |
| 3 | +@@ -42,11 +42,12 @@ |
| 4 | + private int program; |
| 5 | + |
| 6 | + public ModelObject(ModelConfig.ModelSource par1, ModelSetBase par2, PartsRenderer par3, Object... args) { |
| 7 | + String s = par1.modelFile; |
| 8 | + this.model = ModelPackManager.INSTANCE.loadModel(s, 4, true, par2.getConfig(), par2.md5); |
| 9 | +- Material[] amaterial = this.getMaterials(this.getTextureMap(par1.textures)); |
| 10 | ++ boolean objMtlCompatibilityMode = FileType.OBJ.match(s) && !s.equals(s.toLowerCase(java.util.Locale.ROOT)); |
| 11 | ++ Material[] amaterial = this.getMaterials(this.getTextureMap(par1.textures), objMtlCompatibilityMode); |
| 12 | + this.textures = new TextureSet[amaterial.length]; |
| 13 | + boolean flag = false; |
| 14 | + boolean flag1 = false; |
| 15 | + int i = amaterial.length != par1.textures.length ? 1 : amaterial.length; |
| 16 | + |
| 17 | +@@ -92,10 +93,19 @@ |
4 | 18 | this.alphaBlend = false; |
5 | 19 | this.useTexture = true; |
6 | 20 | this.renderer = this.getPartsRenderer((String)null, par1); |
|
20 | 34 | DUMMY = new ModelObject(ModelLoader.loadModel(new ResourceLocationCustom("models/ModelContainer_19g.obj"), VecAccuracy.LOW, new Object[0]), new TextureSet[]{new TextureSet(new Material((byte)0, ModelPackManager.INSTANCE.getResource("textures/container/19g_JRF_0.png")), 0, false, false, new String[0])}); |
21 | 35 | } |
22 | 36 |
|
23 | | -@@ -241,17 +250,17 @@ |
| 37 | +@@ -240,18 +250,22 @@ |
| 38 | + this.renderer.render(entity, pass, partialTick); |
24 | 39 | } |
25 | 40 |
|
26 | 41 | } |
27 | 42 |
|
28 | | - public Material[] getMaterials(Map<String, String> map) { |
| 43 | +- public Material[] getMaterials(Map<String, String> map) { |
29 | 44 | - Map<String, Material> map = this.model.getMaterials(); |
| 45 | ++ public Material[] getMaterials(Map<String, String> map, boolean objMtlCompatibilityMode) { |
30 | 46 | + Map<String, Material> map1 = this.model.getMaterials(); |
31 | 47 | Material[] amaterial; |
32 | 48 | - if (map.isEmpty()) { |
| 49 | +- amaterial = new Material[]{new Material((byte)0, ModelPackManager.INSTANCE.getResource(map.get("default")))}; |
| 50 | ++ |
33 | 51 | + if (map1.isEmpty()) { |
34 | | - amaterial = new Material[]{new Material((byte)0, ModelPackManager.INSTANCE.getResource(map.get("default")))}; |
| 52 | ++ amaterial = new Material[]{new Material((byte) 0, ModelPackManager.INSTANCE.getResource(map.get("default")))}; |
| 53 | ++ } else if (objMtlCompatibilityMode && map.size() == 1 && map.containsKey("default")) { |
| 54 | ++ // For compatibility, for default-only material, we think map1 is empty |
| 55 | ++ amaterial = new Material[]{new Material((byte) 0, ModelPackManager.INSTANCE.getResource(map.get("default")))}; |
35 | 56 | } else { |
36 | 57 | - amaterial = new Material[map.size()]; |
37 | 58 | - Iterator<Entry<String, Material>> iterator = map.entrySet().iterator(); |
|
0 commit comments