diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-04 05:28:27 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-04 05:28:27 +1000 |
commit | 67adecfcbb9ffbcc5c111949d1689162605c2703 (patch) | |
tree | ff7bf84167a9321605f2d22a82036e84ab3f13bd /src/Java/miscutil/core | |
parent | c54ff0034c89d739ed90a1cf1aef05c7f5175fcf (diff) | |
download | GT5-Unofficial-67adecfcbb9ffbcc5c111949d1689162605c2703.tar.gz GT5-Unofficial-67adecfcbb9ffbcc5c111949d1689162605c2703.tar.bz2 GT5-Unofficial-67adecfcbb9ffbcc5c111949d1689162605c2703.zip |
+ Added a debug dependency on LibShapeDraw for multiblock structure rendering.
Diffstat (limited to 'src/Java/miscutil/core')
-rw-r--r-- | src/Java/miscutil/core/util/debug/UtilsRendering.java | 41 | ||||
-rw-r--r-- | src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialSinter.java | 14 |
2 files changed, 41 insertions, 14 deletions
diff --git a/src/Java/miscutil/core/util/debug/UtilsRendering.java b/src/Java/miscutil/core/util/debug/UtilsRendering.java index 6fc8736165..193e6004a6 100644 --- a/src/Java/miscutil/core/util/debug/UtilsRendering.java +++ b/src/Java/miscutil/core/util/debug/UtilsRendering.java @@ -2,6 +2,9 @@ package miscutil.core.util.debug; import javax.vecmath.Point3d; +import libshapedraw.LibShapeDraw; +import libshapedraw.primitive.Color; +import libshapedraw.shape.WireframeCuboid; import miscutil.core.util.Utils; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -27,16 +30,34 @@ public class UtilsRendering { static Tessellator drawBlock = Tessellator.instance; public static void drawBlockInWorld(int x, int y, int z){ - //drawBlock = new Tessellator(); - Utils.LOG_INFO("Drawing Debug Block in world.."); - /*drawBlock.startDrawingQuads(); - drawBlock.setTranslation(x, y, z); - drawBlock.addVertexWithUV(x+1, y-1, z, 0.0, 0.1); - drawBlock.addVertexWithUV(x+1, y+1, z, 0.1, 0.0); - drawBlock.addVertexWithUV(x-1, y+1, z, 0.1, 0.0); - drawBlock.addVertexWithUV(x-1, y-1, z, 0.0, 0.1); - drawBlock.draw();*/ - Block_Render(null, x, y, z); + Utils.LOG_INFO("Drawing Debug Block in world..."); + + LibShapeDraw libShapeDraw = new LibShapeDraw(); + WireframeCuboid box = new WireframeCuboid(x,y,z, x+1,y+1,z+1); + box.setLineStyle(Color.CYAN.copy(), 2.0F, true); + libShapeDraw.addShape(box); + + } + + public static void renderStuff (int x, int y, int z){ + Utils.LOG_INFO("Doing Some Debug Rendering."); + double doubleX = Minecraft.getMinecraft().thePlayer.posX - 0.5; + double doubleY = Minecraft.getMinecraft().thePlayer.posY + 0.1; + double doubleZ = Minecraft.getMinecraft().thePlayer.posZ - 0.5; + + GL11.glPushMatrix(); + GL11.glTranslated(-doubleX, -doubleY, -doubleZ); + GL11.glColor3ub((byte)255,(byte)0,(byte)0); + float mx = x; + float my = y; + float mz = z; + GL11.glBegin(GL11.GL_LINES); + GL11.glVertex3f(mx+0.4f,my,mz+0.4f); + GL11.glVertex3f(mx-0.4f,my,mz-0.4f); + GL11.glVertex3f(mx+0.4f,my,mz-0.4f); + GL11.glVertex3f(mx-0.4f,my,mz+0.4f); + GL11.glEnd(); + GL11.glPopMatrix(); } diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialSinter.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialSinter.java index 5067552e67..f1b35230e7 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialSinter.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialSinter.java @@ -25,6 +25,10 @@ import net.minecraft.item.ItemStack; public class GregtechMetaTileEntityIndustrialSinter extends GT_MetaTileEntity_MultiBlockBase { + + + RenderBlocks asdasd = RenderBlocks.getInstance(); + public GregtechMetaTileEntityIndustrialSinter(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -121,7 +125,6 @@ extends GT_MetaTileEntity_MultiBlockBase { int controllerX = aBaseMetaTileEntity.getXCoord(); int controllerY = aBaseMetaTileEntity.getYCoord(); int controllerZ = aBaseMetaTileEntity.getZCoord(); - RenderBlocks asdasd = RenderBlocks.getInstance(); byte tSide = getBaseMetaTileEntity().getBackFacing(); if ((getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3)))) { @@ -131,9 +134,10 @@ extends GT_MetaTileEntity_MultiBlockBase { for (byte k = -1; k < 2; k = (byte) (k + 1)) { if (getBaseMetaTileEntity().getAirOffset(i, j, k)) { Utils.LOG_INFO("Found Air at: "+(controllerX+i)+" "+(controllerY+k)+" "+(controllerZ+k)); - if (aBaseMetaTileEntity.getWorld().isRemote){ - UtilsRendering.renderBoxAt((controllerX+i), (controllerY+k), (controllerZ+k)); - } + //if (aBaseMetaTileEntity.getWorld().isRemote){ + //asdasd.renderStandardBlock(ModBlocks.MatterFabricatorEffectBlock, (controllerX+i), (controllerY+k), (controllerZ+k)); + UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k)); + //} tAirCount++; } } @@ -144,6 +148,7 @@ extends GT_MetaTileEntity_MultiBlockBase { return false; } for (byte i = 2; i < 6; i = (byte) (i + 1)) { + UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY), (controllerZ)); IGregTechTileEntity tTileEntity; if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) && (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) && @@ -159,6 +164,7 @@ extends GT_MetaTileEntity_MultiBlockBase { for (byte j = -1; j < 2; j = (byte) (j + 1)) { if ((i != 0) || (j != 0)) { for (byte k = 0; k < 5; k = (byte) (k + 1)) { + UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k)); if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) { if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) { } |