From 51334d19db4208e876e6fd52f19102a7677b7c0d Mon Sep 17 00:00:00 2001 From: Antifluxfield Date: Thu, 9 Nov 2017 15:50:03 +0800 Subject: [PATCH] Draw the cross in the hint grid --- .../GT_MetaPipeEntity_Fluid.java | 16 ++-- src/main/java/gregtech/common/GT_Client.java | 74 +++++++++++++++++-- 2 files changed, 74 insertions(+), 16 deletions(-) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java index 1c33a8c4..0b6edbe2 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java @@ -89,19 +89,19 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { return new GT_MetaPipeEntity_Fluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof, mPipeAmount); } - protected static final byte[][] sRestrictionArray = new byte[][]{ - {2, 3, 5, 4}, - {2, 3, 4, 5}, - {1, 0, 4, 5}, - {1, 0, 4, 5}, - {1, 0, 2, 3}, - {1, 0, 2, 3}}; - @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { float tThickNess = getThickNess(); if (mDisableInput == 0) return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; byte tMask = 0; + byte[][] sRestrictionArray = new byte[][]{ + {2, 3, 5, 4}, + {2, 3, 4, 5}, + {1, 0, 4, 5}, + {1, 0, 4, 5}, + {1, 0, 2, 3}, + {1, 0, 2, 3} + }; if (aSide >= 0 && aSide < 6) for (byte i = 0; i < 4; i++) if ((mDisableInput & (1 << sRestrictionArray[aSide][i])) != 0) tMask |= 1 << i; return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), getRestrictorTexture(tMask)}; } diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index a9eac1c6..41efcd81 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -137,14 +137,72 @@ public class GT_Client extends GT_Proxy GL11.glLineWidth(2.0F); GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.5F); GL11.glBegin(1); - GL11.glVertex3d(0.5D, 0.0D, -0.25D); - GL11.glVertex3d(-0.5D, 0.0D, -0.25D); - GL11.glVertex3d(0.5D, 0.0D, 0.25D); - GL11.glVertex3d(-0.5D, 0.0D, 0.25D); - GL11.glVertex3d(0.25D, 0.0D, -0.5D); - GL11.glVertex3d(0.25D, 0.0D, 0.5D); - GL11.glVertex3d(-0.25D, 0.0D, -0.5D); - GL11.glVertex3d(-0.25D, 0.0D, 0.5D); + GL11.glVertex3d(+.50D, .0D, -.25D); + GL11.glVertex3d(-.50D, .0D, -.25D); + GL11.glVertex3d(+.50D, .0D, +.25D); + GL11.glVertex3d(-.50D, .0D, +.25D); + GL11.glVertex3d(+.25D, .0D, -.50D); + GL11.glVertex3d(+.25D, .0D, +.50D); + GL11.glVertex3d(-.25D, .0D, -.50D); + GL11.glVertex3d(-.25D, .0D, +.50D); + int[][] GridSwitchArr = new int[][]{ + {0, 5, 3, 1, 2, 4}, + {5, 0, 1, 3, 2, 4}, + {1, 3, 0, 5, 2, 4}, + {3, 1, 5, 0, 2, 4}, + {4, 2, 3, 1, 0, 5}, + {2, 4, 3, 1, 5, 0}, + }; + switch (GridSwitchArr[aEvent.target.sideHit][GT_Utility.determineWrenchingSide((byte) aEvent.target.sideHit, (float) aEvent.target.hitVec.xCoord - (float) aEvent.target.blockX, (float) aEvent.target.hitVec.yCoord - (float) aEvent.target.blockY, (float) aEvent.target.hitVec.zCoord - (float) aEvent.target.blockZ)]) { + case 0: + GL11.glVertex3d(+.25D, .0D, +.25D); + GL11.glVertex3d(-.25D, .0D, -.25D); + GL11.glVertex3d(-.25D, .0D, +.25D); + GL11.glVertex3d(+.25D, .0D, -.25D); + break; + case 1: + GL11.glVertex3d(-.25D, .0D, +.50D); + GL11.glVertex3d(+.25D, .0D, +.25D); + GL11.glVertex3d(-.25D, .0D, +.25D); + GL11.glVertex3d(+.25D, .0D, +.50D); + break; + case 2: + GL11.glVertex3d(-.50D, .0D, -.25D); + GL11.glVertex3d(-.25D, .0D, +.25D); + GL11.glVertex3d(-.50D, .0D, +.25D); + GL11.glVertex3d(-.25D, .0D, -.25D); + break; + case 3: + GL11.glVertex3d(-.25D, .0D, -.50D); + GL11.glVertex3d(+.25D, .0D, -.25D); + GL11.glVertex3d(-.25D, .0D, -.25D); + GL11.glVertex3d(+.25D, .0D, -.50D); + break; + case 4: + GL11.glVertex3d(+.50D, .0D, -.25D); + GL11.glVertex3d(+.25D, .0D, +.25D); + GL11.glVertex3d(+.50D, .0D, +.25D); + GL11.glVertex3d(+.25D, .0D, -.25D); + break; + case 5: + GL11.glVertex3d(+.50D, .0D, +.50D); + GL11.glVertex3d(+.25D, .0D, +.25D); + GL11.glVertex3d(+.50D, .0D, +.25D); + GL11.glVertex3d(+.25D, .0D, +.50D); + GL11.glVertex3d(+.50D, .0D, -.50D); + GL11.glVertex3d(+.25D, .0D, -.25D); + GL11.glVertex3d(+.50D, .0D, -.25D); + GL11.glVertex3d(+.25D, .0D, -.50D); + GL11.glVertex3d(-.50D, .0D, +.50D); + GL11.glVertex3d(-.25D, .0D, +.25D); + GL11.glVertex3d(-.50D, .0D, +.25D); + GL11.glVertex3d(-.25D, .0D, +.50D); + GL11.glVertex3d(-.50D, .0D, -.50D); + GL11.glVertex3d(-.25D, .0D, -.25D); + GL11.glVertex3d(-.50D, .0D, -.25D); + GL11.glVertex3d(-.25D, .0D, -.50D); + break; + } GL11.glEnd(); GL11.glPopMatrix(); }