From 95a4cfc1d9e38529f2cf12907560f21943798c09 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 20 Dec 2023 16:13:29 -0600 Subject: [PATCH] model fixes - Fixed rotations on several models caused by the new render. - Fixed a utility method for changing rotations in model files. - Cleanup of some model render stuff. --- .../java/fexcraft/tmt/slim/ModelBase.java | 108 +++++++++--------- .../render/models/Model100TonHopper.java | 8 +- .../client/render/models/ModelClass85.java | 30 ++--- .../client/render/models/ModelEMDF3.java | 14 +-- .../client/render/models/ModelEMDF7.java | 14 +-- .../client/render/models/ModelEWSClass66.java | 30 ++--- .../train/client/render/models/ModelF7A.java | 16 +-- .../render/models/ModelFreightCarL.java | 9 +- .../client/render/models/ModelGS4Baggage.java | 8 +- .../client/render/models/ModelGS4Loco.java | 21 +--- .../client/render/models/ModelGS4Tail.java | 8 +- .../client/render/models/ModelMILWClassA.java | 21 +--- .../render/models/ModelMILWPassenger.java | 14 +-- .../models/ModelPassenger_DB_oriental.java | 4 +- .../ModelPassenger_DB_oriental_bogie.java | 3 + .../ModelRheingoldPassenger_Dining2.java | 8 +- .../models/ModelSouthern1102Tender.java | 14 +-- .../render/models/ModelSwitchStandOff.java | 13 +-- .../render/models/ModelSwitchStandOn.java | 14 +-- .../client/render/models/ModelVB040.java | 14 +-- .../client/render/models/ModelWLs40.java | 19 +-- 21 files changed, 132 insertions(+), 258 deletions(-) diff --git a/src/main/java/fexcraft/tmt/slim/ModelBase.java b/src/main/java/fexcraft/tmt/slim/ModelBase.java index 18678f4b2a..afb1705cb6 100644 --- a/src/main/java/fexcraft/tmt/slim/ModelBase.java +++ b/src/main/java/fexcraft/tmt/slim/ModelBase.java @@ -5,6 +5,7 @@ import net.minecraft.client.renderer.GLAllocation; import net.minecraft.entity.Entity; import org.lwjgl.opengl.GL11; +import train.common.core.handlers.ConfigHandler; import java.util.ArrayList; import java.util.HashMap; @@ -12,9 +13,9 @@ import java.util.Map; /** -* Similar to 'FlansMod'-type Models, for a fast convert. -* @Author Ferdinand Calo' (FEX___96) -*/ + * Similar to 'FlansMod'-type Models, for a fast convert. + * @Author Ferdinand Calo' (FEX___96) + */ public class ModelBase extends ArrayList { @Deprecated //box list for static parts should be completley unnecessary by making a displaylist of it as a whole. @@ -32,14 +33,14 @@ public class ModelBase extends ArrayList { public static Map staticPartMap = new HashMap<>(); public Integer localGLID = null; - public static boolean disableCache=false; - public static boolean EnableAnimations=false; public int textureWidth=512, textureHeight=512; + public boolean disableCache=false, EnableAnimations=true; + public void render(){ if(init){ - initAllParts(); + initAllParts(); } if(disableCache) { @@ -167,7 +168,7 @@ public void render(List model){ public void render(Object type, Entity ent){render(); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {render();} - + public void translateAll(float x, float y, float z){ translate(base, x, y, z); @@ -207,35 +208,34 @@ public void rotateAll(float x, float y, float z){ rotate(boxList,x,y,z); rotate(namedList,x,y,z); } - public void flipAll(){ - flip(base); - flip(open); - flip(closed); - flip(r0); - flip(r1); - flip(r2); - flip(r3); - flip(r4); - flip(r5); - flip(r6); - flip(r7); - flip(r8); - flip(r9); + public void flipAll(){ + flip(base); + flip(open); + flip(closed); + flip(r0); + flip(r1); + flip(r2); + flip(r3); + flip(r4); + flip(r5); + flip(r6); + flip(r7); + flip(r8); + flip(r9); flip(bodyModel); flip(boxList); flip(namedList); - } + } protected final void fixRotation(ModelRendererTurbo[] model, boolean flipX, boolean flipY, boolean flipZ){ - bodyModel=model.clone(); - model= new ModelRendererTurbo[]{}; - for(ModelRendererTurbo p : bodyModel){ - p.rotateAngleX*= CommonUtil.degreesF; - p.rotateAngleY*= CommonUtil.degreesF; - p.rotateAngleZ*= CommonUtil.degreesF; + if(!flipX && !flipY && !flipZ){return;} + for(ModelRendererTurbo mod : model){ + if(mod==null){continue;} + if(flipX){mod.rotateAngleX = -mod.rotateAngleX;} + if(flipY){mod.rotateAngleY = -mod.rotateAngleY;} + if(flipZ){mod.rotateAngleZ = -mod.rotateAngleZ;} } - } protected final void fixRotation(ModelRendererTurbo[] parts){ @@ -285,15 +285,15 @@ protected void rotate(List model, float x, float y, float z) } } - public void flip(ModelRendererTurbo[] model) { - if(model==null){return;} + public void flip(ModelRendererTurbo[] model) { + if(model==null){return;} for(ModelRendererTurbo mod : model){ if(mod==null){continue;} mod.rotateAngleY = -mod.rotateAngleY * 57.29578F; mod.rotateAngleZ = -mod.rotateAngleZ * 57.29578F; mod.rotateAngleX *= 57.29578F; } - } + } public void flip(List model) { if(model==null){return;} for(ModelRendererTurbo sub : model){ @@ -326,28 +326,28 @@ public void addToCreators(String s){ public void initAllParts(){ - base=initList(base); - open=initList(open); - closed=initList(closed); - bodyModel=initList(bodyModel); - r0=initList(r0); - r1=initList(r1); - r2=initList(r2); - r3=initList(r3); - r4=initList(r4); - r5=initList(r5); - r6=initList(r6); - r7=initList(r7); - r8=initList(r8); - r9=initList(r9); - init=false; - } + base=initList(base); + open=initList(open); + closed=initList(closed); + bodyModel=initList(bodyModel); + r0=initList(r0); + r1=initList(r1); + r2=initList(r2); + r3=initList(r3); + r4=initList(r4); + r5=initList(r5); + r6=initList(r6); + r7=initList(r7); + r8=initList(r8); + r9=initList(r9); + init=false; + } public ModelRendererTurbo[] initList(ModelRendererTurbo[] list){ - if(list==null){return null;} - for(ModelRendererTurbo model : list){ - addPart(model); - } - return null; - } + if(list==null){return null;} + for(ModelRendererTurbo model : list){ + addPart(model); + } + return null; + } } diff --git a/src/main/java/train/client/render/models/Model100TonHopper.java b/src/main/java/train/client/render/models/Model100TonHopper.java index 2cbfae52d0..285c5bc043 100644 --- a/src/main/java/train/client/render/models/Model100TonHopper.java +++ b/src/main/java/train/client/render/models/Model100TonHopper.java @@ -222,6 +222,9 @@ public Model100TonHopper() fixRotation(model100tonhopperModel, false, true, true); + fixRotation(model100tonhopperModel); + bodyModel=model100tonhopperModel; + } private ModelFreightTruckM fronttrucks = new ModelFreightTruckM(); private ModelFreightTruckM backtrucks = new ModelFreightTruckM(); @@ -229,10 +232,7 @@ public Model100TonHopper() @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - for(int i = 0; i < 48; i++) - { - model100tonhopperModel[i].render(f5); - } + super.render(entity, f, f1, f2, f3, f4, f5); Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/freighttruckm.png")); GL11.glPushMatrix(); diff --git a/src/main/java/train/client/render/models/ModelClass85.java b/src/main/java/train/client/render/models/ModelClass85.java index bc9212ef4b..9722ab461b 100644 --- a/src/main/java/train/client/render/models/ModelClass85.java +++ b/src/main/java/train/client/render/models/ModelClass85.java @@ -56,17 +56,17 @@ public ModelClass85() class85Model[27] = new ModelRendererTurbo(this, 81, 17, textureX, textureY); // 28 class85Model[28] = new ModelRendererTurbo(this, 481, 1, textureX, textureY); // 29 class85Model[29] = new ModelRendererTurbo(this, 49, 9, textureX, textureY); // 30 - class85Model[30] = new ModelRendererTurbo(this, 465, 1, textureX, textureY); // 31 - class85Model[31] = new ModelRendererTurbo(this, 505, 1, textureX, textureY); // 32 + class85Model[30] = new ModelRendererTurbo(this, 465, 1, textureX, textureY, "lamp"); // 31 + class85Model[31] = new ModelRendererTurbo(this, 505, 1, textureX, textureY, "lamp"); // 32 class85Model[32] = new ModelRendererTurbo(this, 177, 9, textureX, textureY); // 33 class85Model[33] = new ModelRendererTurbo(this, 345, 9, textureX, textureY); // 34 - class85Model[34] = new ModelRendererTurbo(this, 201, 9, textureX, textureY); // 35 - class85Model[35] = new ModelRendererTurbo(this, 209, 9, textureX, textureY); // 36 + class85Model[34] = new ModelRendererTurbo(this, 201, 9, textureX, textureY, "lamp"); // 35 + class85Model[35] = new ModelRendererTurbo(this, 209, 9, textureX, textureY, "lamp"); // 36 class85Model[36] = new ModelRendererTurbo(this, 3, 99, textureX, textureY); // 37 - class85Model[37] = new ModelRendererTurbo(this, 369, 9, textureX, textureY); // 38 - class85Model[38] = new ModelRendererTurbo(this, 465, 9, textureX, textureY); // 39 - class85Model[39] = new ModelRendererTurbo(this, 489, 9, textureX, textureY); // 42 - class85Model[40] = new ModelRendererTurbo(this, 497, 9, textureX, textureY); // 43 + class85Model[37] = new ModelRendererTurbo(this, 369, 9, textureX, textureY, "lamp"); // 38 + class85Model[38] = new ModelRendererTurbo(this, 465, 9, textureX, textureY, "lamp"); // 39 + class85Model[39] = new ModelRendererTurbo(this, 489, 9, textureX, textureY, "lamp"); // 42 + class85Model[40] = new ModelRendererTurbo(this, 497, 9, textureX, textureY, "lamp"); // 43 class85Model[41] = new ModelRendererTurbo(this, 225, 17, textureX, textureY); // 44 class85Model[42] = new ModelRendererTurbo(this, 505, 9, textureX, textureY); // 45 class85Model[43] = new ModelRendererTurbo(this, 49, 17, textureX, textureY); // 46 @@ -831,6 +831,9 @@ public ModelClass85() fixRotation(class85Model, false, true, true); + fixRotation(class85Model); + bodyModel=class85Model; + } private ModelDeiticBogie fronttrucks = new ModelDeiticBogie(); @@ -839,16 +842,7 @@ public ModelClass85() @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - for(int i = 0; i < 193; i++) - { - if (i==30 || i==31 || i==37 || i== 38 || i==39 || i==40 || i==35 || i ==34){ - Minecraft.getMinecraft().entityRenderer.disableLightmap(1D); - } - class85Model[i].render(f5); - if (i==30 || i==31 || i==37 || i== 38 || i==39 || i==40 || i==35 || i ==34){ - Minecraft.getMinecraft().entityRenderer.enableLightmap(1D); - } - } + super.render(entity, f, f1, f2, f3, f4, f5); Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/Class85_Bogie.png")); GL11.glPushMatrix(); diff --git a/src/main/java/train/client/render/models/ModelEMDF3.java b/src/main/java/train/client/render/models/ModelEMDF3.java index c027b8d6f0..6d7dbc0783 100644 --- a/src/main/java/train/client/render/models/ModelEMDF3.java +++ b/src/main/java/train/client/render/models/ModelEMDF3.java @@ -700,6 +700,9 @@ public ModelEMDF3() emdf3Model[163].setRotationPoint(-21.01F, -15.25F, 0F); fixRotation(emdf3Model, true, true, true); + + fixRotation(emdf3Model); + bodyModel=emdf3Model; } private ModelBloombergTrucks fronttrucks = new ModelBloombergTrucks(); @@ -707,16 +710,7 @@ public ModelEMDF3() @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - for (int i = 0; i < 164; i++) - { - if (emdf3Model[i].boxName != null && emdf3Model[i].boxName.equals("lamp")) { - Minecraft.getMinecraft().entityRenderer.disableLightmap(1D); - emdf3Model[i].render(f5); - Minecraft.getMinecraft().entityRenderer.enableLightmap(1D); - } else { - emdf3Model[i].render(f5); - } - } + super.render(entity, f, f1, f2, f3, f4, f5); Tessellator.bindTexture(new ResourceLocation(Info.modID, "textures/trains/Blomberg_b_trucks.png")); GL11.glPushMatrix(); diff --git a/src/main/java/train/client/render/models/ModelEMDF7.java b/src/main/java/train/client/render/models/ModelEMDF7.java index 79a46b90b0..ce10945256 100644 --- a/src/main/java/train/client/render/models/ModelEMDF7.java +++ b/src/main/java/train/client/render/models/ModelEMDF7.java @@ -747,6 +747,9 @@ public ModelEMDF7() emdf7Model[175].setRotationPoint(12F, -25.75F, -3F); fixRotation(emdf7Model, false, true, true); + fixRotation(emdf7Model); + bodyModel=emdf7Model; + } private ModelBloombergTrucks fronttrucks = new ModelBloombergTrucks(); @@ -754,16 +757,7 @@ public ModelEMDF7() @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - for (int i = 0; i < 176; i++) - { - if (emdf7Model[i].boxName != null && emdf7Model[i].boxName.equals("lamp")) { - Minecraft.getMinecraft().entityRenderer.disableLightmap(1D); - emdf7Model[i].render(f5); - Minecraft.getMinecraft().entityRenderer.enableLightmap(1D); - } else { - emdf7Model[i].render(f5); - } - } + super.render(entity, f, f1, f2, f3, f4, f5); Tessellator.bindTexture(new ResourceLocation(Info.modID, "textures/trains/Blomberg_b_trucks.png")); GL11.glPushMatrix(); diff --git a/src/main/java/train/client/render/models/ModelEWSClass66.java b/src/main/java/train/client/render/models/ModelEWSClass66.java index 7cec5ba9ec..2ac50ccb0c 100644 --- a/src/main/java/train/client/render/models/ModelEWSClass66.java +++ b/src/main/java/train/client/render/models/ModelEWSClass66.java @@ -33,8 +33,8 @@ public ModelEWSClass66() ewsclass66Model[4] = new ModelRendererTurbo(this, 49, 1, textureX, textureY); // 06 ewsclass66Model[5] = new ModelRendererTurbo(this, 245, 250, textureX, textureY); // 07 ewsclass66Model[6] = new ModelRendererTurbo(this, 57, 1, textureX, textureY); // 08 - ewsclass66Model[7] = new ModelRendererTurbo(this, 73, 1, textureX, textureY); // 09 - ewsclass66Model[8] = new ModelRendererTurbo(this, 145, 1, textureX, textureY); // 10 + ewsclass66Model[7] = new ModelRendererTurbo(this, 73, 1, textureX, textureY, "lamp"); // 09 + ewsclass66Model[8] = new ModelRendererTurbo(this, 145, 1, textureX, textureY, "lamp"); // 10 ewsclass66Model[9] = new ModelRendererTurbo(this, 233, 17, textureX, textureY); // 11 ewsclass66Model[10] = new ModelRendererTurbo(this, 169, 1, textureX, textureY); // 12 ewsclass66Model[11] = new ModelRendererTurbo(this, 33, 1, textureX, textureY); // 13 @@ -53,14 +53,14 @@ public ModelEWSClass66() ewsclass66Model[24] = new ModelRendererTurbo(this, 313, 1, textureX, textureY); // 26 ewsclass66Model[25] = new ModelRendererTurbo(this, 329, 1, textureX, textureY); // 27 ewsclass66Model[26] = new ModelRendererTurbo(this, 345, 1, textureX, textureY); // 28 - ewsclass66Model[27] = new ModelRendererTurbo(this, 249, 1, textureX, textureY); // 32 + ewsclass66Model[27] = new ModelRendererTurbo(this, 249, 1, textureX, textureY, "lamp"); // 32 ewsclass66Model[28] = new ModelRendererTurbo(this, 462, 1, textureX, textureY); // 33 ewsclass66Model[29] = new ModelRendererTurbo(this, 281, 1, textureX, textureY); // 34 ewsclass66Model[30] = new ModelRendererTurbo(this, 297, 1, textureX, textureY); // 35 ewsclass66Model[31] = new ModelRendererTurbo(this, 153, 17, textureX, textureY); // 36 ewsclass66Model[32] = new ModelRendererTurbo(this, 97, 9, textureX, textureY); // 37 ewsclass66Model[33] = new ModelRendererTurbo(this, 1, 17, textureX, textureY); // 38 - ewsclass66Model[34] = new ModelRendererTurbo(this, 257, 1, textureX, textureY); // 39 + ewsclass66Model[34] = new ModelRendererTurbo(this, 257, 1, textureX, textureY, "lamp"); // 39 ewsclass66Model[35] = new ModelRendererTurbo(this, 97, 25, textureX, textureY); // 40 ewsclass66Model[36] = new ModelRendererTurbo(this, 377, 1, textureX, textureY); // 41 ewsclass66Model[37] = new ModelRendererTurbo(this, 401, 1, textureX, textureY); // 42 @@ -72,14 +72,14 @@ public ModelEWSClass66() ewsclass66Model[43] = new ModelRendererTurbo(this, 441, 1, textureX, textureY); // 48 ewsclass66Model[44] = new ModelRendererTurbo(this, 281, 25, textureX, textureY); // 49 ewsclass66Model[45] = new ModelRendererTurbo(this, 1, 9, textureX, textureY); // 50 - ewsclass66Model[46] = new ModelRendererTurbo(this, 313, 1, textureX, textureY); // 51 - ewsclass66Model[47] = new ModelRendererTurbo(this, 17, 9, textureX, textureY); // 53 + ewsclass66Model[46] = new ModelRendererTurbo(this, 313, 1, textureX, textureY, "lamp"); // 51 + ewsclass66Model[47] = new ModelRendererTurbo(this, 17, 9, textureX, textureY, "lamp"); // 53 ewsclass66Model[48] = new ModelRendererTurbo(this, 377, 9, textureX, textureY); // 54 - ewsclass66Model[49] = new ModelRendererTurbo(this, 73, 17, textureX, textureY); // 55 + ewsclass66Model[49] = new ModelRendererTurbo(this, 73, 17, textureX, textureY, "lamp"); // 55 ewsclass66Model[50] = new ModelRendererTurbo(this, 65, 9, textureX, textureY); // 56 ewsclass66Model[51] = new ModelRendererTurbo(this, 377, 25, textureX, textureY); // 57 ewsclass66Model[52] = new ModelRendererTurbo(this, 425, 25, textureX, textureY); // 58 - ewsclass66Model[53] = new ModelRendererTurbo(this, 329, 1, textureX, textureY); // 59 + ewsclass66Model[53] = new ModelRendererTurbo(this, 329, 1, textureX, textureY, "lamp"); // 59 ewsclass66Model[54] = new ModelRendererTurbo(this, 281, 17, textureX, textureY); // 60 ewsclass66Model[55] = new ModelRendererTurbo(this, 401, 9, textureX, textureY); // 61 ewsclass66Model[56] = new ModelRendererTurbo(this, 345, 1, textureX, textureY); // 62 @@ -644,6 +644,9 @@ public ModelEWSClass66() fixRotation(ewsclass66Model, false, true, true); + fixRotation(ewsclass66Model); + bodyModel=ewsclass66Model; + } private ModelEWSClass66_Bogie fronttrucks = new ModelEWSClass66_Bogie(); private ModelEWSClass66_Bogie backtrucks = new ModelEWSClass66_Bogie(); @@ -651,16 +654,7 @@ public ModelEWSClass66() @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - for(int i = 0; i < 141; i++) - { - if (i==53 || i==46 || i== 27 || i==34 || i==8 || i==7 || i==47 || i==49){ - Minecraft.getMinecraft().entityRenderer.disableLightmap(1D); - } - ewsclass66Model[i].render(f5); - if (i==53 || i==46 || i== 27 || i==34 || i==8 || i==7 || i==47 || i==49){ - Minecraft.getMinecraft().entityRenderer.enableLightmap(1D); - } - } + super.render(entity, f, f1, f2, f3, f4, f5); Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/Class66Bogie.png")); GL11.glPushMatrix(); diff --git a/src/main/java/train/client/render/models/ModelF7A.java b/src/main/java/train/client/render/models/ModelF7A.java index 6094e3b845..f6c72d2512 100644 --- a/src/main/java/train/client/render/models/ModelF7A.java +++ b/src/main/java/train/client/render/models/ModelF7A.java @@ -9,6 +9,7 @@ package train.client.render.models; //Path where the model is located +import fexcraft.tmt.slim.ModelBase; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @@ -20,7 +21,7 @@ import train.common.core.util.DepreciatedUtil; import train.common.library.Info; -public class ModelF7A extends ModelConverter //Same as Filename +public class ModelF7A extends ModelBase //Same as Filename { int textureX = 512; int textureY = 256; @@ -34,7 +35,7 @@ public ModelF7A() //Same as Filename translateAll(0F, 0F, 0F); - flipAll(); + //flipAll(); } private void initbodyModel_1() @@ -1700,16 +1701,7 @@ private void initbodyModel_1() ModelBlombergBnew theTrucc = new ModelBlombergBnew(); @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - for (int i = 0; i < 411; i++) { - if (bodyModel[i].boxName != null && bodyModel[i].boxName.contains("lamp")) { - Minecraft.getMinecraft().entityRenderer.disableLightmap(1D); - bodyModel[i].render(f5); - Minecraft.getMinecraft().entityRenderer.enableLightmap(1D); - } else { - bodyModel[i].render(f5); - } - } - + super.render(entity, f, f1, f2, f3, f4, f5); if (entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor()) == 3||entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor()) == 11||entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor()) == 1||entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor()) == 4||entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor()) == 5||entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor()) == 16) { Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/blombergB_2_Silver.png")); GL11.glPushMatrix(); diff --git a/src/main/java/train/client/render/models/ModelFreightCarL.java b/src/main/java/train/client/render/models/ModelFreightCarL.java index bcc83636e9..98fcddb648 100644 --- a/src/main/java/train/client/render/models/ModelFreightCarL.java +++ b/src/main/java/train/client/render/models/ModelFreightCarL.java @@ -195,17 +195,16 @@ public ModelFreightCarL() freightcarlModel[41].setRotationPoint(43F, 3F, 12F); fixRotation(freightcarlModel, false, true, true); + fixRotation(freightcarlModel); + bodyModel=freightcarlModel; + } ModelWellcarBogie bogie = new ModelWellcarBogie(); @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - for(int i = 0; i < 42; i++) - { - freightcarlModel[i].render(f5); - } - + super.render(entity, f, f1, f2, f3, f4, f5); Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/wellcar_bogie.png")); diff --git a/src/main/java/train/client/render/models/ModelGS4Baggage.java b/src/main/java/train/client/render/models/ModelGS4Baggage.java index fbb03fca1e..a07a490732 100644 --- a/src/main/java/train/client/render/models/ModelGS4Baggage.java +++ b/src/main/java/train/client/render/models/ModelGS4Baggage.java @@ -411,15 +411,15 @@ public ModelGS4Baggage() gs4baggageModel[91].setRotationPoint(-30F, -10.2F, -9F); fixRotation(gs4baggageModel, false, true, true); + + fixRotation(gs4baggageModel); + bodyModel=gs4baggageModel; } ModelGs4Bogie bogie1 = new ModelGs4Bogie(); @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - for(int i = 0; i < 92; i++) - { - gs4baggageModel[i].render(f5); - } + super.render(entity, f, f1, f2, f3, f4, f5); if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==2){ Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/GS4_bogie_Red.png")); diff --git a/src/main/java/train/client/render/models/ModelGS4Loco.java b/src/main/java/train/client/render/models/ModelGS4Loco.java index 4828eb2888..4ec39a542c 100644 --- a/src/main/java/train/client/render/models/ModelGS4Loco.java +++ b/src/main/java/train/client/render/models/ModelGS4Loco.java @@ -548,28 +548,11 @@ public ModelGS4Loco() gs4locoModel[128].setRotationPoint(-110.4F, 2F, -12F); fixRotation(gs4locoModel, false, true, true); - } - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - for(int i = 0; i < 129; i++) - { - - if(gs4locoModel[i].boxName!= null && gs4locoModel[i].boxName.equals("lamp")){ - Minecraft.getMinecraft().entityRenderer.disableLightmap(1D); - gs4locoModel[i].render(f5); - Minecraft.getMinecraft().entityRenderer.enableLightmap(1D); - - } else { - gs4locoModel[i].render(f5); - } - } + fixRotation(gs4locoModel); + bodyModel=gs4locoModel; } - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) - { - } public ModelRendererTurbo gs4locoModel[]; } \ No newline at end of file diff --git a/src/main/java/train/client/render/models/ModelGS4Tail.java b/src/main/java/train/client/render/models/ModelGS4Tail.java index 1db0a10294..b37a936b17 100644 --- a/src/main/java/train/client/render/models/ModelGS4Tail.java +++ b/src/main/java/train/client/render/models/ModelGS4Tail.java @@ -662,6 +662,9 @@ public ModelGS4Tail() gs4tailModel[157].setRotationPoint(46F, -1F, -9.5F); fixRotation(gs4tailModel, false, true, true); + fixRotation(gs4tailModel); + bodyModel=gs4tailModel; + } @@ -669,10 +672,7 @@ public ModelGS4Tail() @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - for(int i = 0; i < 158; i++) - { - gs4tailModel[i].render(f5); - } + super.render(entity, f, f1, f2, f3, f4, f5); if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==2){ Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/GS4_bogie_Red.png")); } else { diff --git a/src/main/java/train/client/render/models/ModelMILWClassA.java b/src/main/java/train/client/render/models/ModelMILWClassA.java index 917d1c4f36..f6a3fac434 100644 --- a/src/main/java/train/client/render/models/ModelMILWClassA.java +++ b/src/main/java/train/client/render/models/ModelMILWClassA.java @@ -834,26 +834,9 @@ public ModelMILWClassA() milwclassaModel[200].setRotationPoint(-85F, -3F, 9F); fixRotation(milwclassaModel, false, true, true); - } - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - for(int i = 0; i < 201; i++) - { - if(milwclassaModel[i].boxName!= null && milwclassaModel[i].boxName.equals("lamp")){ - Minecraft.getMinecraft().entityRenderer.disableLightmap(1D); - milwclassaModel[i].render(f5); - Minecraft.getMinecraft().entityRenderer.enableLightmap(1D); - - } else { - milwclassaModel[i].render(f5); - } - } - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) - { + fixRotation(milwclassaModel); + bodyModel=milwclassaModel; } public ModelRendererTurbo milwclassaModel[]; diff --git a/src/main/java/train/client/render/models/ModelMILWPassenger.java b/src/main/java/train/client/render/models/ModelMILWPassenger.java index ecd16a4e5c..93c82104d1 100644 --- a/src/main/java/train/client/render/models/ModelMILWPassenger.java +++ b/src/main/java/train/client/render/models/ModelMILWPassenger.java @@ -598,19 +598,9 @@ public ModelMILWPassenger() fixRotation(passengermilwModel, false, true, true); - } + fixRotation(passengermilwModel); + bodyModel=passengermilwModel; - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - for(int i = 0; i < 142; i++) - { - passengermilwModel[i].render(f5); - } - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) - { } public ModelRendererTurbo passengermilwModel[]; diff --git a/src/main/java/train/client/render/models/ModelPassenger_DB_oriental.java b/src/main/java/train/client/render/models/ModelPassenger_DB_oriental.java index 3ac83fbb78..478e1fd464 100644 --- a/src/main/java/train/client/render/models/ModelPassenger_DB_oriental.java +++ b/src/main/java/train/client/render/models/ModelPassenger_DB_oriental.java @@ -400,7 +400,9 @@ public ModelPassenger_DB_oriental() passenger_db_orientalModel[83].rotateAngleY = -3.14159265F; fixRotation(passenger_db_orientalModel,false,true,true); - //bodyModel=passenger_db_orientalModel; + + fixRotation(passenger_db_orientalModel); + bodyModel=passenger_db_orientalModel; } ModelPassenger_DB_oriental_bogie bogie = new ModelPassenger_DB_oriental_bogie(); diff --git a/src/main/java/train/client/render/models/ModelPassenger_DB_oriental_bogie.java b/src/main/java/train/client/render/models/ModelPassenger_DB_oriental_bogie.java index a6f94a88a0..fa36535c41 100644 --- a/src/main/java/train/client/render/models/ModelPassenger_DB_oriental_bogie.java +++ b/src/main/java/train/client/render/models/ModelPassenger_DB_oriental_bogie.java @@ -61,6 +61,9 @@ public ModelPassenger_DB_oriental_bogie() fixRotation(passenger_db_oriental_bogieModel, false,false,false); + fixRotation(passenger_db_oriental_bogieModel); + bodyModel=passenger_db_oriental_bogieModel; + } diff --git a/src/main/java/train/client/render/models/ModelRheingoldPassenger_Dining2.java b/src/main/java/train/client/render/models/ModelRheingoldPassenger_Dining2.java index 2d664bef99..7f2d440ae5 100644 --- a/src/main/java/train/client/render/models/ModelRheingoldPassenger_Dining2.java +++ b/src/main/java/train/client/render/models/ModelRheingoldPassenger_Dining2.java @@ -641,6 +641,9 @@ public ModelRheingoldPassenger_Dining2() rheingoldpassenger_dining2Model[148].setRotationPoint(-73F, 2.1F, -1F); fixRotation(rheingoldpassenger_dining2Model, false, true, true); + + fixRotation(rheingoldpassenger_dining2Model); + bodyModel=rheingoldpassenger_dining2Model; } private ModelRheingoldBogie bogie1 = new ModelRheingoldBogie(); @@ -648,10 +651,7 @@ public ModelRheingoldPassenger_Dining2() @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - for(int i = 0; i < 149; i++) - { - rheingoldpassenger_dining2Model[i].render(f5); - } + super.render(entity, f, f1, f2, f3, f4, f5); Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/Rheingold_Bogie.png")); GL11.glPushMatrix(); diff --git a/src/main/java/train/client/render/models/ModelSouthern1102Tender.java b/src/main/java/train/client/render/models/ModelSouthern1102Tender.java index 651949766d..dc83a896a1 100644 --- a/src/main/java/train/client/render/models/ModelSouthern1102Tender.java +++ b/src/main/java/train/client/render/models/ModelSouthern1102Tender.java @@ -711,19 +711,9 @@ public ModelSouthern1102Tender() fixRotation(southern1102tenderModel, false, true, true); - } - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - for(int i = 0; i < 169; i++) - { - southern1102tenderModel[i].render(f5); - } - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) - { + fixRotation(southern1102tenderModel); + bodyModel=southern1102tenderModel; } public ModelRendererTurbo southern1102tenderModel[]; diff --git a/src/main/java/train/client/render/models/ModelSwitchStandOff.java b/src/main/java/train/client/render/models/ModelSwitchStandOff.java index 5b3ec9e33e..4101850ba0 100644 --- a/src/main/java/train/client/render/models/ModelSwitchStandOff.java +++ b/src/main/java/train/client/render/models/ModelSwitchStandOff.java @@ -190,20 +190,11 @@ public ModelSwitchStandOff() fixRotation(switchstandoffModel, false, true, true); - } + fixRotation(switchstandoffModel); + bodyModel=switchstandoffModel; - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - for(int i = 0; i < 37; i++) - { - switchstandoffModel[i].render(f5); - } } - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) - { - } public ModelRendererTurbo switchstandoffModel[]; } \ No newline at end of file diff --git a/src/main/java/train/client/render/models/ModelSwitchStandOn.java b/src/main/java/train/client/render/models/ModelSwitchStandOn.java index 13ec116a4e..87a676009c 100644 --- a/src/main/java/train/client/render/models/ModelSwitchStandOn.java +++ b/src/main/java/train/client/render/models/ModelSwitchStandOn.java @@ -193,19 +193,9 @@ public ModelSwitchStandOn() fixRotation(switchstandonModel, false, true, true); - } + fixRotation(switchstandonModel); + bodyModel=switchstandonModel; - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - for(int i = 0; i < 37; i++) - { - switchstandonModel[i].render(f5); - } - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) - { } public ModelRendererTurbo switchstandonModel[]; diff --git a/src/main/java/train/client/render/models/ModelVB040.java b/src/main/java/train/client/render/models/ModelVB040.java index 6db09dd5f0..fef599a742 100644 --- a/src/main/java/train/client/render/models/ModelVB040.java +++ b/src/main/java/train/client/render/models/ModelVB040.java @@ -300,19 +300,9 @@ public ModelVB040() fixRotation(vb040Model, false, true, true); - } + fixRotation(vb040Model); + bodyModel=vb040Model; - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - for(int i = 0; i < 68; i++) - { - vb040Model[i].render(f5); - } - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) - { } public ModelRendererTurbo vb040Model[]; diff --git a/src/main/java/train/client/render/models/ModelWLs40.java b/src/main/java/train/client/render/models/ModelWLs40.java index d3295a1743..12f4612e8a 100644 --- a/src/main/java/train/client/render/models/ModelWLs40.java +++ b/src/main/java/train/client/render/models/ModelWLs40.java @@ -1872,24 +1872,9 @@ public ModelWLs40() fixRotation(wls40Model, false, true, true); - } + fixRotation(wls40Model); + bodyModel=wls40Model; - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - for (ModelRendererTurbo mrt : wls40Model) { - if (mrt.boxName.equals("lamp")) { - Minecraft.getMinecraft().entityRenderer.disableLightmap(1D); - mrt.render(f5); - Minecraft.getMinecraft().entityRenderer.enableLightmap(1D); - } else { - mrt.render(f5); - } - } - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) - { } public ModelRendererTurbo wls40Model[];