Finish tank textures

This commit is contained in:
Calclavia 2014-01-13 20:39:07 +08:00
parent 96c5b39192
commit dc803af4e4
5 changed files with 44 additions and 89 deletions

View file

@ -54,7 +54,7 @@ public class BlockTank extends BlockFluidNetwork
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side)
{
int checkBlockID = blockAccess.getBlockId(x, y, z);
return checkBlockID == this.blockID ? false : super.shouldSideBeRendered(blockAccess, x, y, z, side);
return super.shouldSideBeRendered(blockAccess, x, y, z, side);
}
@Override

View file

@ -1,5 +1,6 @@
package resonantinduction.mechanical.fluid.tank;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
@ -10,6 +11,7 @@ import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
import resonantinduction.core.render.RenderFluidHelper;
import resonantinduction.electrical.Electrical;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.old.client.model.ModelTankSide;
import calclavia.lib.render.RenderUtility;
@ -31,21 +33,43 @@ public class RenderTank extends TileEntitySpecialRenderer
public void renderTank(TileEntity tileEntity, double x, double y, double z, FluidStack fluid)
{
byte renderSides = 0;
if (tileEntity instanceof TileTank)
{
renderSides = ((TileTank) tileEntity).renderSides;
byte renderSides = ((TileTank) tileEntity).renderSides;
boolean down = TileTank.canRenderSide(renderSides, ForgeDirection.UP);
boolean up = TileTank.canRenderSide(renderSides, ForgeDirection.DOWN);
boolean down = TileTank.canRenderSide(renderSides, ForgeDirection.DOWN);
boolean up = TileTank.canRenderSide(renderSides, ForgeDirection.UP);
boolean north = TileTank.canRenderSide(renderSides, ForgeDirection.NORTH);
boolean south = TileTank.canRenderSide(renderSides, ForgeDirection.SOUTH);
boolean east = TileTank.canRenderSide(renderSides, ForgeDirection.EAST);
boolean west = TileTank.canRenderSide(renderSides, ForgeDirection.WEST);
bindTexture(TextureMap.locationBlocksTexture);
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
for (int i = 0; i < 6; i++)
{
ForgeDirection dir = ForgeDirection.getOrientation(i);
if (!TileTank.canRenderSide(renderSides, dir))
{
GL11.glPushMatrix();
if (i < 2)
{
GL11.glRotatef(180 * i + 90, 0, 0, 1);
}
else
{
GL11.glRotatef(90 * i, 1, 0, 0);
}
RenderUtility.renderCube(-0.501, -0.501, -0.501, 0.501, -0.475, 0.501, Mechanical.blockTank);
GL11.glPopMatrix();
}
}
GL11.glPushMatrix();
if (!east)
@ -53,24 +77,24 @@ public class RenderTank extends TileEntitySpecialRenderer
if (!north)
{
// north east
RenderUtility.renderCube(0.475, -0.501, -0.501, 0.501, 0.501, -0.475, Mechanical.blockTank, null);
RenderUtility.renderCube(0.475, -0.501, -0.501, 0.501, 0.501, -0.475, Electrical.blockMachinePart);
}
if (!south)
{
// south east
RenderUtility.renderCube(0.475, -0.501, 0.475, 0.501, 0.501, 0.501, Mechanical.blockTank, null);
RenderUtility.renderCube(0.475, -0.501, 0.475, 0.501, 0.501, 0.501, Electrical.blockMachinePart);
}
if (!down)
{
// bottom east
RenderUtility.renderCube(0.475, -0.501, -0.501, 0.501, -0.475, 0.501, Mechanical.blockTank, null);
RenderUtility.renderCube(0.475, -0.501, -0.501, 0.501, -0.475, 0.501, Electrical.blockMachinePart);
}
if (!up)
{
// top east
RenderUtility.renderCube(0.475, 0.475, -0.501, 0.501, 0.501, 0.501, Mechanical.blockTank, null);
RenderUtility.renderCube(0.475, 0.475, -0.501, 0.501, 0.501, 0.501, Electrical.blockMachinePart);
}
}
@ -79,22 +103,22 @@ public class RenderTank extends TileEntitySpecialRenderer
if (!north)
{
// north west
RenderUtility.renderCube(-0.501, -0.501, -0.501, -0.475, 0.501, -0.475, Mechanical.blockTank, null);
RenderUtility.renderCube(-0.501, -0.501, -0.501, -0.475, 0.501, -0.475, Electrical.blockMachinePart);
}
if (!south)
{
// south west
RenderUtility.renderCube(-0.501, -0.501, 0.475, -0.475, 0.501, 0.501, Mechanical.blockTank, null);
RenderUtility.renderCube(-0.501, -0.501, 0.475, -0.475, 0.501, 0.501, Electrical.blockMachinePart);
}
if (!down)
{
// bottom west
RenderUtility.renderCube(-0.501, -0.501, -0.501, -0.475, -0.475, 0.501, Mechanical.blockTank, null);
RenderUtility.renderCube(-0.501, -0.501, -0.501, -0.475, -0.475, 0.501, Electrical.blockMachinePart);
}
if (!up)
{
// top west
RenderUtility.renderCube(-0.501, 0.475, -0.501, -0.475, 0.501, 0.501, Mechanical.blockTank, null);
RenderUtility.renderCube(-0.501, 0.475, -0.501, -0.475, 0.501, 0.501, Electrical.blockMachinePart);
}
}
if (!north)
@ -102,12 +126,12 @@ public class RenderTank extends TileEntitySpecialRenderer
if (!up)
{
// top north
RenderUtility.renderCube(-0.501, 0.475, -0.501, 0.501, 0.501, -0.475, Mechanical.blockTank, null);
RenderUtility.renderCube(-0.501, 0.475, -0.501, 0.501, 0.501, -0.475, Electrical.blockMachinePart);
}
if (!down)
{
// bottom north
RenderUtility.renderCube(-0.501, -0.501, -0.501, 0.501, -0.475, -0.475, Mechanical.blockTank, null);
RenderUtility.renderCube(-0.501, -0.501, -0.501, 0.501, -0.475, -0.475, Electrical.blockMachinePart);
}
}
@ -116,19 +140,19 @@ public class RenderTank extends TileEntitySpecialRenderer
if (!up)
{
// top south
RenderUtility.renderCube(-0.501, 0.475, 0.475, 0.501, 0.501, 0.501, Mechanical.blockTank, null);
RenderUtility.renderCube(-0.501, 0.475, 0.475, 0.501, 0.501, 0.501, Electrical.blockMachinePart);
}
if (!down)
{
// bottom south
RenderUtility.renderCube(-0.501, -0.501, 0.475, 0.501, -0.475, 0.501, Mechanical.blockTank, null);
RenderUtility.renderCube(-0.501, -0.501, 0.475, 0.501, -0.475, 0.501, Electrical.blockMachinePart);
}
}
GL11.glPopMatrix();
GL11.glPopMatrix();
//TODO: Remove
// TODO: Remove
fluid = new FluidStack(FluidRegistry.WATER, 8000);
if (fluid != null && fluid.amount > 100)

View file

@ -1,69 +0,0 @@
# This file uses centimeters as units for non-parametric coordinates.
mtllib Cheese.mtl
g default
v -1.556552 -0.011497 1.556552
v 1.556552 -0.011497 0.011593
v -1.556552 2.011497 1.556552
v 1.556552 2.011497 0.011593
v -1.556552 2.011497 -1.556552
v 1.556552 2.011497 -0.014496
v -1.556552 -0.011497 -1.556552
v 1.556552 -0.011497 -0.014496
vt 0.596198 0.335232
vt 0.925735 0.335232
vt 0.925735 0.664769
vt 0.596198 0.664769
vt 0.001848 0.001992
vt 0.331385 0.165533
vt 0.331385 0.168295
vt 0.001848 0.331529
vt 0.338282 0.001992
vt 0.667819 0.001992
vt 0.667819 0.331529
vt 0.338282 0.331529
vt 0.260970 0.335232
vt 0.590507 0.498466
vt 0.590507 0.501227
vt 0.260970 0.664769
vt 0.252517 0.335231
vt 0.255279 0.335231
vt 0.255279 0.664768
vt 0.252517 0.664768
vt 0.001848 0.668471
vt 0.331385 0.668471
vt 0.331385 0.998008
vt 0.001848 0.998008
vn 0.444543 0.000000 0.895757
vn 0.444543 0.000000 0.895757
vn 0.444543 0.000000 0.895757
vn 0.444543 0.000000 0.895757
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.443872 0.000000 -0.896090
vn 0.443872 0.000000 -0.896090
vn 0.443872 0.000000 -0.896090
vn 0.443872 0.000000 -0.896090
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn -1.000000 0.000000 0.000000
vn -1.000000 0.000000 0.000000
vn -1.000000 0.000000 0.000000
vn -1.000000 0.000000 0.000000
s off
g pCube1
usemtl initialShadingGroup
f 1/1/1 2/2/2 4/3/3 3/4/4
f 3/5/5 4/6/6 6/7/7 5/8/8
f 5/9/9 6/10/10 8/11/11 7/12/12
f 7/13/13 8/14/14 2/15/15 1/16/16
f 2/17/17 8/18/18 6/19/19 4/20/20
f 7/21/21 1/22/22 3/23/23 5/24/24

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 808 B

After

Width:  |  Height:  |  Size: 2.8 KiB