mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 11:49:37 +00:00
Null check for the wireframe render, it shouldn't be a problem, but might in some weird stupid cases.
This commit is contained in:
1 parent
4f502a82f5
commit
a5cb78df42
1 file changed
+26
-20
@@ -73,30 +73,36 @@ public final class BoundTileRenderer {
|
||||
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
Block block = world.getBlock(pos.posX, pos.posY, pos.posZ);
|
||||
if(block != null) {
|
||||
AxisAlignedBB axis;
|
||||
|
||||
if(block instanceof IWireframeAABBProvider)
|
||||
axis = ((IWireframeAABBProvider) block).getWireframeAABB(world, pos.posX, pos.posY, pos.posZ);
|
||||
else axis = block.getSelectedBoundingBoxFromPool(world, pos.posX, pos.posY, pos.posZ);
|
||||
|
||||
axis.minX -= pos.posX;
|
||||
axis.maxX -= pos.posX;
|
||||
axis.minY -= pos.posY;
|
||||
axis.maxY -= pos.posY;
|
||||
axis.minZ -= pos.posZ;
|
||||
axis.maxZ -= pos.posZ;
|
||||
drawWireframe : {
|
||||
if(block != null) {
|
||||
AxisAlignedBB axis;
|
||||
|
||||
GL11.glTranslated(axis.minX, axis.minY, axis.minZ);
|
||||
GL11.glScaled(axis.maxX - axis.minX, axis.maxY - axis.minY, axis.maxZ - axis.minZ);
|
||||
if(block instanceof IWireframeAABBProvider)
|
||||
axis = ((IWireframeAABBProvider) block).getWireframeAABB(world, pos.posX, pos.posY, pos.posZ);
|
||||
else axis = block.getSelectedBoundingBoxFromPool(world, pos.posX, pos.posY, pos.posZ);
|
||||
|
||||
GL11.glLineWidth(1F);
|
||||
renderBlockOutline();
|
||||
if(axis == null)
|
||||
break drawWireframe;
|
||||
|
||||
GL11.glLineWidth(4F);
|
||||
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64);
|
||||
renderBlockOutline();
|
||||
axis.minX -= pos.posX;
|
||||
axis.maxX -= pos.posX;
|
||||
axis.minY -= pos.posY;
|
||||
axis.maxY -= pos.posY;
|
||||
axis.minZ -= pos.posZ;
|
||||
axis.maxZ -= pos.posZ;
|
||||
|
||||
GL11.glTranslated(axis.minX, axis.minY, axis.minZ);
|
||||
GL11.glScaled(axis.maxX - axis.minX, axis.maxY - axis.minY, axis.maxZ - axis.minZ);
|
||||
|
||||
GL11.glLineWidth(1F);
|
||||
renderBlockOutline();
|
||||
|
||||
GL11.glLineWidth(4F);
|
||||
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64);
|
||||
renderBlockOutline();
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user