More wireframe work.

This commit is contained in:
Vasco Lavos committed 2014-03-24 20:53:46 +00:00
1 parent 2426f95296
commit 209382f8ea
5 files changed
+40 -3

No files matched your search

@@ -17,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Icon;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.LexiconEntry;
@@ -86,6 +87,15 @@ public class SubTileEntity {
return null;
}
/**
* Gets the block coordinates this is bound to, for use with the wireframe render
* when the sub tile is being hovered with a wand of the forest.
*/
@SideOnly(Side.CLIENT)
public ChunkCoordinates getBinding() {
return null;
}
/**
* Called on the client when the block being pointed at is the one with this sub tile.
* Used to render a HUD portraying some data from this sub tile.
@@ -151,6 +151,13 @@ public class SubTileFunctional extends SubTileEntity {
cmp.setInteger(TAG_POOL_Y, y);
cmp.setInteger(TAG_POOL_Z, z);
}
@Override
public ChunkCoordinates getBinding() {
if(linkedPool == null)
return null;
return new ChunkCoordinates(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord);
}
@Override
public void renderHUD(Minecraft mc, ScaledResolution res) {
@@ -184,6 +184,13 @@ public class SubTileGenerating extends SubTileEntity {
cmp.setInteger(TAG_COLLECTOR_Y, y);
cmp.setInteger(TAG_COLLECTOR_Z, z);
}
@Override
public ChunkCoordinates getBinding() {
if(linkedCollector == null)
return null;
return new ChunkCoordinates(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord);
}
@Override
public void renderHUD(Minecraft mc, ScaledResolution res) {
@@ -68,7 +68,7 @@ public final class BoundTileRenderer {
GL11.glPushMatrix();
GL11.glTranslated(pos.posX - RenderManager.renderPosX, pos.posY - RenderManager.renderPosY, pos.posZ - RenderManager.renderPosZ + 1);
Color colorRGB = new Color(color);
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 0xFF);
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 255);
World world = Minecraft.getMinecraft().theWorld;
Block block = Block.blocksList[world.getBlockId(pos.posX, pos.posY, pos.posZ)];
@@ -83,6 +83,12 @@ public final class BoundTileRenderer {
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();
@@ -92,7 +98,6 @@ public final class BoundTileRenderer {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(GL11.GL_LINES);
GL11.glLineWidth(1F);
tessellator.addVertex(0, 0, 0);
tessellator.addVertex(0, 1, 0);
tessellator.addVertex(0, 1, 0);
@@ -17,12 +17,14 @@ import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Icon;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.ITileBound;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.subtile.SubTileEntity;
public class TileSpecialFlower extends TileMod {
public class TileSpecialFlower extends TileMod implements ITileBound {
private static final String TAG_SUBTILE_NAME = "subTileName";
private static final String TAG_SUBTILE_CMP = "subTileCmp";
@@ -103,4 +105,10 @@ public class TileSpecialFlower extends TileMod {
subTile.renderHUD(mc, res);
}
@Override
public ChunkCoordinates getBinding() {
if(subTile == null)
return null;
return subTile.getBinding();
}
}