diff --git a/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/ModelPipe.java b/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/ModelPipe.java index 3ce7ebd4..226c5e19 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/ModelPipe.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/ModelPipe.java @@ -1,13 +1,11 @@ -// Date: 9/20/2012 12:00:21 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - package resonantinduction.mechanical.fluid.pipe; +import org.lwjgl.opengl.GL11; + +import calclavia.lib.render.RenderUtility; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import net.minecraftforge.common.ForgeDirection; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -15,233 +13,186 @@ import cpw.mods.fml.relauncher.SideOnly; public class ModelPipe extends ModelBase { // fields - ModelRenderer Mid; - ModelRenderer RightPipe; - ModelRenderer RightInter; - ModelRenderer RightConnect; - ModelRenderer LeftInter; - ModelRenderer LeftPipe; - ModelRenderer LeftConnect; - ModelRenderer TopInter; - ModelRenderer TopPipe; - ModelRenderer TopConnect; - ModelRenderer BottomPipe; - ModelRenderer BottomInter; - ModelRenderer BottomConnect; - ModelRenderer BackPipe; - ModelRenderer BackInter; - ModelRenderer BackConnect; - ModelRenderer FrontInter; - ModelRenderer FrontPipe; - ModelRenderer FrontConnect; + ModelRenderer Body; + ModelRenderer Deco1; + ModelRenderer Deco4; + ModelRenderer Deco2; + ModelRenderer Deco3; + ModelRenderer Deco5; + ModelRenderer Deco6; + ModelRenderer Deco7; + ModelRenderer Deco8; + ModelRenderer Deco9; + ModelRenderer Body2; + ModelRenderer Deco11; + ModelRenderer Deco12; + ModelRenderer Deco13; + ModelRenderer Deco14; + ModelRenderer Deco15; + ModelRenderer Deco16; public ModelPipe() { - textureWidth = 128; + textureWidth = 64; textureHeight = 32; - Mid = new ModelRenderer(this, 50, 13); - Mid.addBox(-3F, -3F, -3F, 6, 6, 6); - Mid.setRotationPoint(0F, 16F, 0F); - Mid.setTextureSize(128, 32); - Mid.mirror = true; - setRotation(Mid, 0F, 0F, 0F); - RightPipe = new ModelRenderer(this, 25, 0); - RightPipe.addBox(0F, -3F, -3F, 4, 6, 6); - RightPipe.setRotationPoint(3F, 16F, 0F); - RightPipe.setTextureSize(128, 32); - RightPipe.mirror = true; - setRotation(RightPipe, 0F, 0F, 0F); - RightInter = new ModelRenderer(this, 98, 0); - RightInter.addBox(0F, -4F, -4F, 1, 8, 8); - RightInter.setRotationPoint(2F, 16F, 0F); - RightInter.setTextureSize(128, 32); - RightInter.mirror = true; - setRotation(RightInter, 0F, 0F, 0F); - RightConnect = new ModelRenderer(this, 98, 0); - RightConnect.addBox(0F, -4F, -4F, 1, 8, 8); - RightConnect.setRotationPoint(7F, 16F, 0F); - RightConnect.setTextureSize(128, 32); - RightConnect.mirror = true; - setRotation(RightConnect, 0F, 0F, 0F); - LeftInter = new ModelRenderer(this, 98, 0); - LeftInter.addBox(-1F, -4F, -4F, 1, 8, 8); - LeftInter.setRotationPoint(-2F, 16F, 0F); - LeftInter.setTextureSize(128, 32); - LeftInter.mirror = true; - setRotation(LeftInter, 0F, 0F, 0F); - LeftPipe = new ModelRenderer(this, 25, 0); - LeftPipe.addBox(-4F, -3F, -3F, 4, 6, 6); - LeftPipe.setRotationPoint(-3F, 16F, 0F); - LeftPipe.setTextureSize(128, 32); - LeftPipe.mirror = true; - setRotation(LeftPipe, 0F, 0F, 0F); - LeftConnect = new ModelRenderer(this, 98, 0); - LeftConnect.addBox(-1F, -4F, -4F, 1, 8, 8); - LeftConnect.setRotationPoint(-7F, 16F, 0F); - LeftConnect.setTextureSize(128, 32); - LeftConnect.mirror = true; - setRotation(LeftConnect, 0F, 0F, 0F); - TopInter = new ModelRenderer(this, 77, 17); - TopInter.addBox(-4F, -1F, -4F, 8, 1, 8); - TopInter.setRotationPoint(0F, 14F, 0F); - TopInter.setTextureSize(128, 32); - TopInter.mirror = true; - setRotation(TopInter, 0F, 0F, 0F); - TopPipe = new ModelRenderer(this, 50, 0); - TopPipe.addBox(-3F, -4F, -3F, 6, 4, 6); - TopPipe.setRotationPoint(0F, 13F, 0F); - TopPipe.setTextureSize(128, 32); - TopPipe.mirror = true; - setRotation(TopPipe, 0F, 0F, 0F); - TopConnect = new ModelRenderer(this, 77, 17); - TopConnect.addBox(-4F, -1F, -4F, 8, 1, 8); - TopConnect.setRotationPoint(0F, 9F, 0F); - TopConnect.setTextureSize(128, 32); - TopConnect.mirror = true; - setRotation(TopConnect, 0F, 0F, 0F); - BottomPipe = new ModelRenderer(this, 50, 0); - BottomPipe.addBox(-3F, 0F, -3F, 6, 4, 6); - BottomPipe.setRotationPoint(0F, 19F, 0F); - BottomPipe.setTextureSize(128, 32); - BottomPipe.mirror = true; - setRotation(BottomPipe, 0F, 0F, 0F); - BottomInter = new ModelRenderer(this, 77, 17); - BottomInter.addBox(-4F, 0F, -4F, 8, 1, 8); - BottomInter.setRotationPoint(0F, 18F, 0F); - BottomInter.setTextureSize(128, 32); - BottomInter.mirror = true; - setRotation(BottomInter, 0F, 0F, 0F); - BottomConnect = new ModelRenderer(this, 77, 17); - BottomConnect.addBox(-4F, 0F, -4F, 8, 1, 8); - BottomConnect.setRotationPoint(0F, 23F, 0F); - BottomConnect.setTextureSize(128, 32); - BottomConnect.mirror = true; - setRotation(BottomConnect, 0F, 0F, 0F); - BackPipe = new ModelRenderer(this, 0, 0); - BackPipe.addBox(-3F, -3F, 0F, 6, 6, 4); - BackPipe.setRotationPoint(0F, 16F, 3F); - BackPipe.setTextureSize(128, 32); - BackPipe.mirror = true; - setRotation(BackPipe, 0F, 0F, 0F); - BackInter = new ModelRenderer(this, 0, 23); - BackInter.addBox(-4F, -4F, 0F, 8, 8, 1); - BackInter.setRotationPoint(0F, 16F, 2F); - BackInter.setTextureSize(128, 32); - BackInter.mirror = true; - setRotation(BackInter, 0F, 0F, 0F); - BackConnect = new ModelRenderer(this, 0, 23); - BackConnect.addBox(-4F, -4F, 0F, 8, 8, 1); - BackConnect.setRotationPoint(0F, 16F, 7F); - BackConnect.setTextureSize(128, 32); - BackConnect.mirror = true; - setRotation(BackConnect, 0F, 0F, 0F); - FrontInter = new ModelRenderer(this, 0, 23); - FrontInter.addBox(-4F, -4F, -1F, 8, 8, 1); - FrontInter.setRotationPoint(0F, 16F, -2F); - FrontInter.setTextureSize(128, 32); - FrontInter.mirror = true; - setRotation(FrontInter, 0F, 0F, 0F); - FrontPipe = new ModelRenderer(this, 0, 0); - FrontPipe.addBox(-3F, -3F, -4F, 6, 6, 4); - FrontPipe.setRotationPoint(0F, 16F, -3F); - FrontPipe.setTextureSize(128, 32); - FrontPipe.mirror = true; - setRotation(FrontPipe, 0F, 0F, 0F); - FrontConnect = new ModelRenderer(this, 0, 23); - FrontConnect.addBox(-4F, -4F, -1F, 8, 8, 1); - FrontConnect.setRotationPoint(0F, 16F, -7F); - FrontConnect.setTextureSize(128, 32); - FrontConnect.mirror = true; - setRotation(FrontConnect, 0F, 0F, 0F); + Body = new ModelRenderer(this, 0, 0); + Body.addBox(0F, 0F, 0F, 5, 5, 16); + Body.setRotationPoint(-2F, 17F, -8F); + Body.setTextureSize(64, 32); + Body.mirror = true; + setRotation(Body, 0F, 0F, 0F); + Deco1 = new ModelRenderer(this, 42, 0); + Deco1.addBox(0F, 0F, 0F, 5, 1, 1); + Deco1.setRotationPoint(-2F, 16.5F, 0F); + Deco1.setTextureSize(64, 32); + Deco1.mirror = true; + setRotation(Deco1, 0F, 0F, 0F); + Deco4 = new ModelRenderer(this, 42, 0); + Deco4.addBox(0F, 0F, 0F, 5, 1, 1); + Deco4.setRotationPoint(-2F, 21.5F, 4F); + Deco4.setTextureSize(64, 32); + Deco4.mirror = true; + setRotation(Deco4, 0F, 0F, 0F); + Deco2 = new ModelRenderer(this, 42, 2); + Deco2.addBox(0F, 0F, 0F, 6, 1, 1); + Deco2.setRotationPoint(-1.5F, 16.5F, 4F); + Deco2.setTextureSize(64, 32); + Deco2.mirror = true; + setRotation(Deco2, 0F, 0F, 1.570796F); + Deco3 = new ModelRenderer(this, 42, 2); + Deco3.addBox(0F, 0F, 0F, 6, 1, 1); + Deco3.setRotationPoint(3.5F, 16.5F, 4F); + Deco3.setTextureSize(64, 32); + Deco3.mirror = true; + setRotation(Deco3, 0F, 0F, 1.570796F); + Deco5 = new ModelRenderer(this, 42, 0); + Deco5.addBox(0F, 0F, 0F, 5, 1, 1); + Deco5.setRotationPoint(-2F, 16.5F, 4F); + Deco5.setTextureSize(64, 32); + Deco5.mirror = true; + setRotation(Deco5, 0F, 0F, 0F); + Deco6 = new ModelRenderer(this, 42, 0); + Deco6.addBox(0F, 0F, 0F, 5, 1, 1); + Deco6.setRotationPoint(-2F, 21.5F, 0F); + Deco6.setTextureSize(64, 32); + Deco6.mirror = true; + setRotation(Deco6, 0F, 0F, 0F); + Deco7 = new ModelRenderer(this, 42, 2); + Deco7.addBox(0F, 0F, -5F, 6, 1, 1); + Deco7.setRotationPoint(-1.5F, 16.5F, 5F); + Deco7.setTextureSize(64, 32); + Deco7.mirror = true; + setRotation(Deco7, 0F, 0F, 1.570796F); + Deco8 = new ModelRenderer(this, 42, 2); + Deco8.addBox(0F, 0F, 0F, 6, 1, 1); + Deco8.setRotationPoint(3.5F, 16.5F, 0F); + Deco8.setTextureSize(64, 32); + Deco8.mirror = true; + setRotation(Deco8, 0F, 0F, 1.570796F); + Deco9 = new ModelRenderer(this, 42, 0); + Deco9.addBox(0F, 0F, 0F, 5, 1, 1); + Deco9.setRotationPoint(-2F, 16.5F, -4F); + Deco9.setTextureSize(64, 32); + Deco9.mirror = true; + setRotation(Deco9, 0F, 0F, 0F); + Body2 = new ModelRenderer(this, 42, 0); + Body2.addBox(0F, 0F, 0F, 5, 1, 1); + Body2.setRotationPoint(-2F, 21.5F, -4F); + Body2.setTextureSize(64, 32); + Body2.mirror = true; + setRotation(Body2, 0F, 0F, 0F); + Deco11 = new ModelRenderer(this, 42, 2); + Deco11.addBox(0F, 0F, -5F, 6, 1, 1); + Deco11.setRotationPoint(-1.5F, 16.5F, 1F); + Deco11.setTextureSize(64, 32); + Deco11.mirror = true; + setRotation(Deco11, 0F, 0F, 1.570796F); + Deco12 = new ModelRenderer(this, 42, 2); + Deco12.addBox(0F, 0F, 0F, 6, 1, 1); + Deco12.setRotationPoint(3.5F, 16.5F, -4F); + Deco12.setTextureSize(64, 32); + Deco12.mirror = true; + setRotation(Deco12, 0F, 0F, 1.570796F); + Deco13 = new ModelRenderer(this, 42, 0); + Deco13.addBox(0F, 0F, 0F, 5, 1, 1); + Deco13.setRotationPoint(-2F, 16.5F, -8F); + Deco13.setTextureSize(64, 32); + Deco13.mirror = true; + setRotation(Deco13, 0F, 0F, 0F); + Deco14 = new ModelRenderer(this, 42, 0); + Deco14.addBox(0F, 0F, 0F, 5, 1, 1); + Deco14.setRotationPoint(-2F, 21.5F, -8F); + Deco14.setTextureSize(64, 32); + Deco14.mirror = true; + setRotation(Deco14, 0F, 0F, 0F); + Deco15 = new ModelRenderer(this, 42, 2); + Deco15.addBox(0F, 0F, -5F, 6, 1, 1); + Deco15.setRotationPoint(-1.5F, 16.5F, -3F); + Deco15.setTextureSize(64, 32); + Deco15.mirror = true; + setRotation(Deco15, 0F, 0F, 1.570796F); + Deco16 = new ModelRenderer(this, 42, 2); + Deco16.addBox(0F, 0F, -4F, 6, 1, 1); + Deco16.setRotationPoint(3.5F, 16.5F, -4F); + Deco16.setTextureSize(64, 32); + Deco16.mirror = true; + setRotation(Deco16, 0F, 0F, 1.570796F); } - public void render(boolean[] side) + public void render(float f5) { - if (side[0]) + Body.render(f5); + Deco1.render(f5); + Deco4.render(f5); + Deco2.render(f5); + Deco3.render(f5); + Deco5.render(f5); + Deco6.render(f5); + Deco7.render(f5); + Deco8.render(f5); + Deco9.render(f5); + Body2.render(f5); + Deco11.render(f5); + Deco12.render(f5); + Deco13.render(f5); + Deco14.render(f5); + Deco15.render(f5); + Deco16.render(f5); + } + + public void render(byte side) + { + float f5 = 0.0625f; + + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - renderBottom(); + if (RenderUtility.canRenderSide(side, dir)) + { + GL11.glPushMatrix(); + RenderUtility.rotateBlockBasedOnDirection(dir); + Deco1.render(f5); + Deco4.render(f5); + Deco2.render(f5); + Deco3.render(f5); + Deco5.render(f5); + Deco6.render(f5); + Deco7.render(f5); + Deco8.render(f5); + Deco9.render(f5); + Deco11.render(f5); + Deco12.render(f5); + Deco13.render(f5); + Deco14.render(f5); + Deco15.render(f5); + Deco16.render(f5); + GL11.glPopMatrix(); + + } } - if (side[1]) - { - renderTop(); - } - if (side[3]) - { - renderFront(); - } - if (side[2]) - { - renderBack(); - } - if (side[5]) - { - renderRight(); - } - if (side[4]) - { - renderLeft(); - } - renderMiddle(); - } - public void renderAll() - { - this.renderMiddle(); - this.renderBottom(); - this.renderTop(); - this.renderLeft(); - this.renderRight(); - this.renderBack(); - this.renderFront(); - - } - - public void renderMiddle() - { - Mid.render(0.0625F); - } - - public void renderBottom() - { - BottomPipe.render(0.0625F); - BottomConnect.render(0.0625F); - BottomInter.render(0.0625F); - } - - public void renderTop() - { - TopPipe.render(0.0625F); - TopConnect.render(0.0625F); - TopInter.render(0.0625F); - } - - public void renderLeft() - { - LeftPipe.render(0.0625F); - LeftConnect.render(0.0625F); - LeftInter.render(0.0625F); - } - - public void renderRight() - { - RightPipe.render(0.0625F); - RightConnect.render(0.0625F); - RightInter.render(0.0625F); - } - - public void renderBack() - { - BackPipe.render(0.0625F); - BackConnect.render(0.0625F); - BackInter.render(0.0625F); - } - - public void renderFront() - { - FrontPipe.render(0.0625F); - FrontConnect.render(0.0625F); - FrontInter.render(0.0625F); + Body.render(f5); + Body2.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) diff --git a/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/RenderPipe.java b/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/RenderPipe.java index c6fe29df..7b599fba 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/RenderPipe.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/RenderPipe.java @@ -21,7 +21,7 @@ public class RenderPipe public static ModelPipe MODEL_PIPE = new ModelPipe(); public static ModelOpenTrough MODEL_TROUGH_PIPE = new ModelOpenTrough(); private static HashMap TEXTURES = new HashMap(); - public static ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "pipe/iron.png"); + public static ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "pipe.png"); public void render(PartPipe part, double x, double y, double z, float f) { @@ -30,60 +30,35 @@ public class RenderPipe GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glScalef(1.0F, -1F, -1F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(getTexture(material)); - render(material, part.getAllCurrentConnections()); + MODEL_PIPE.render(part.getAllCurrentConnections()); GL11.glPopMatrix(); } public static ResourceLocation getTexture(EnumPipeMaterial material) { - if (material != null) - { - if (!TEXTURES.containsKey(material)) - { - TEXTURES.put(material, new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "pipe/" + material.matName + ".png")); - } + /* + * if (material != null) + * { + * if (!TEXTURES.containsKey(material)) + * { + * TEXTURES.put(material, new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + + * "pipe/" + material.matName + ".png")); + * } + * return TEXTURES.get(material); + * } + */ - return TEXTURES.get(material); - } return TEXTURE; } - public static void render(EnumPipeMaterial mat, byte side) - { - if (RenderUtility.canRenderSide(side, ForgeDirection.DOWN)) - { - MODEL_PIPE.renderBottom(); - } - if (RenderUtility.canRenderSide(side, ForgeDirection.UP)) - { - MODEL_PIPE.renderTop(); - } - if (RenderUtility.canRenderSide(side, ForgeDirection.NORTH)) - { - MODEL_PIPE.renderBack(); - } - if (RenderUtility.canRenderSide(side, ForgeDirection.SOUTH)) - { - MODEL_PIPE.renderFront(); - } - if (RenderUtility.canRenderSide(side, ForgeDirection.WEST)) - { - MODEL_PIPE.renderLeft(); - } - if (RenderUtility.canRenderSide(side, ForgeDirection.EAST)) - { - MODEL_PIPE.renderRight(); - } - - MODEL_PIPE.renderMiddle(); - } - public static void render(int meta, byte sides) { if (meta < EnumPipeMaterial.values().length) { + RenderUtility.enableBlending(); FMLClientHandler.instance().getClient().renderEngine.bindTexture(getTexture(EnumPipeMaterial.values()[meta])); - render(EnumPipeMaterial.values()[meta], sides); + MODEL_PIPE.render(sides); + RenderUtility.disableBlending(); } } } \ No newline at end of file diff --git a/src/main/resources/assets/resonantinduction/models/pipe.png b/src/main/resources/assets/resonantinduction/models/pipe.png new file mode 100644 index 00000000..8adb608a Binary files /dev/null and b/src/main/resources/assets/resonantinduction/models/pipe.png differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/bronze.png b/src/main/resources/assets/resonantinduction/models/pipe/bronze.png deleted file mode 100644 index b10e7382..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/bronze.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/copper.png b/src/main/resources/assets/resonantinduction/models/pipe/copper.png deleted file mode 100644 index 6bd0cac5..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/copper.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/glass.png b/src/main/resources/assets/resonantinduction/models/pipe/glass.png deleted file mode 100644 index f156e14e..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/glass.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/gold.png b/src/main/resources/assets/resonantinduction/models/pipe/gold.png deleted file mode 100644 index b6461dbf..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/gold.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/hell.png b/src/main/resources/assets/resonantinduction/models/pipe/hell.png deleted file mode 100644 index 9feeb8d9..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/hell.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/iron.png b/src/main/resources/assets/resonantinduction/models/pipe/iron.png deleted file mode 100644 index a408ad4c..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/iron.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/obsidian.png b/src/main/resources/assets/resonantinduction/models/pipe/obsidian.png deleted file mode 100644 index df31cb4f..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/obsidian.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/pipe.png b/src/main/resources/assets/resonantinduction/models/pipe/pipe.png deleted file mode 100644 index 9576758d..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/pipe.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/steel.png b/src/main/resources/assets/resonantinduction/models/pipe/steel.png deleted file mode 100644 index c371da09..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/steel.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/stone.png b/src/main/resources/assets/resonantinduction/models/pipe/stone.png deleted file mode 100644 index 5c67c068..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/stone.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/tin.png b/src/main/resources/assets/resonantinduction/models/pipe/tin.png deleted file mode 100644 index ce6a9c09..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/tin.png and /dev/null differ diff --git a/src/main/resources/assets/resonantinduction/models/pipe/wood.png b/src/main/resources/assets/resonantinduction/models/pipe/wood.png deleted file mode 100644 index ee7d2af4..00000000 Binary files a/src/main/resources/assets/resonantinduction/models/pipe/wood.png and /dev/null differ