use of net.minecraft.util.IIcon in project ArsMagica2 by Mithion.
the class SimpleBlockRenderHandler method renderCraftingAltar.
private void renderCraftingAltar(Block block, Block mimic, int x, int y, int z, int metadata, RenderBlocks renderer) {
IIcon icon = mimic.getIcon(1, metadata);
if (icon == null)
icon = block.getIcon(1, 0);
renderer.renderFaceYPos(block, x, y, z, icon);
icon = mimic.getIcon(0, metadata);
if (icon == null)
icon = block.getIcon(0, 0);
renderer.renderFaceYNeg(block, x, y, z, icon);
icon = mimic.getIcon(2, metadata);
if (icon == null)
icon = block.getIcon(2, 0);
renderer.renderFaceXPos(block, x, y, z, icon);
icon = mimic.getIcon(3, metadata);
if (icon == null)
icon = block.getIcon(3, 0);
renderer.renderFaceXNeg(block, x, y, z, icon);
icon = mimic.getIcon(4, metadata);
if (icon == null)
icon = block.getIcon(4, 0);
renderer.renderFaceZPos(block, x, y, z, icon);
icon = mimic.getIcon(5, metadata);
if (icon == null)
icon = block.getIcon(5, 0);
renderer.renderFaceZNeg(block, x, y, z, icon);
renderer.renderFaceYPos(block, x, y, z, block.getIcon(1, 1));
renderer.renderFaceYNeg(block, x, y, z, block.getIcon(0, 1));
renderer.renderFaceXPos(block, x, y, z, block.getIcon(2, 1));
renderer.renderFaceXNeg(block, x, y, z, block.getIcon(3, 1));
renderer.renderFaceZPos(block, x, y, z, block.getIcon(4, 1));
renderer.renderFaceZNeg(block, x, y, z, block.getIcon(5, 1));
}
use of net.minecraft.util.IIcon in project ArsMagica2 by Mithion.
the class SpellScrollRenderer method RenderByAffinity.
public void RenderByAffinity(Affinity affinity) {
Minecraft.getMinecraft().renderEngine.bindTexture(rLoc);
IIcon icon = icons.get(affinity);
if (icon == null)
return;
float TLX = icon.getMinU();
float BRX = icon.getMaxU();
float TLY = icon.getMinV();
float BRY = icon.getMaxV();
doRender(TLX, TLY, BRX, BRY);
}
use of net.minecraft.util.IIcon in project Engine by VoltzEngine-Project.
the class GuiContainerBase method displayGauge.
/**
* Based on BuildCraft
*/
protected void displayGauge(int j, int k, int line, int col, int width, int squaled, FluidStack liquid) {
squaled -= 1;
if (liquid == null) {
return;
}
int start = 0;
IIcon liquidIcon = null;
Fluid fluid = liquid.getFluid();
if (fluid != null && fluid.getStillIcon() != null) {
liquidIcon = fluid.getStillIcon();
}
RenderUtility.setSpriteTexture(fluid.getSpriteNumber());
if (liquidIcon != null) {
while (true) {
int x;
if (squaled > 16) {
x = 16;
squaled -= 16;
} else {
x = squaled;
squaled = 0;
}
this.drawTexturedModelRectFromIcon(j + col, k + line + 58 - x - start, liquidIcon, width, 16 - (16 - x));
start = start + 16;
if (x == 0 || squaled == 0) {
break;
}
}
}
}
use of net.minecraft.util.IIcon in project Engine by VoltzEngine-Project.
the class RenderUtility method renderCube.
/**
* Renders a cube with custom block boundaries.
*/
public static void renderCube(double x1, double y1, double z1, double x2, double y2, double z2, Block block, IIcon overrideTexture, int meta) {
GL11.glPushMatrix();
if (RenderManager.instance != null && RenderManager.instance.renderEngine != null && TextureMap.locationBlocksTexture != null) {
RenderManager.instance.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
}
Tessellator t = Tessellator.instance;
GL11.glColor4f(1, 1, 1, 1);
renderBlocks.setRenderBounds(x1, y1, z1, x2, y2, z2);
t.startDrawingQuads();
IIcon useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 0, meta);
t.setNormal(0.0F, -1.0F, 0.0F);
renderBlocks.renderFaceYNeg(block, 0, 0, 0, useTexture);
useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 1, meta);
t.setNormal(0.0F, 1.0F, 0.0F);
renderBlocks.renderFaceYPos(block, 0, 0, 0, useTexture);
useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 2, meta);
t.setNormal(0.0F, 0.0F, -1.0F);
renderBlocks.renderFaceZNeg(block, 0, 0, 0, useTexture);
useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 3, meta);
t.setNormal(0.0F, 0.0F, 1.0F);
renderBlocks.renderFaceZPos(block, 0, 0, 0, useTexture);
useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 4, meta);
t.setNormal(-1.0F, 0.0F, 0.0F);
renderBlocks.renderFaceXNeg(block, 0, 0, 0, useTexture);
useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 5, meta);
t.setNormal(1.0F, 0.0F, 0.0F);
renderBlocks.renderFaceXPos(block, 0, 0, 0, useTexture);
t.draw();
GL11.glPopMatrix();
}
use of net.minecraft.util.IIcon in project Engine by VoltzEngine-Project.
the class BlockTile method getIcon.
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) {
Tile tile = inject(access, x, y, z);
IIcon value = tile.getIcon(side, access.getBlockMetadata(x, y, z));
eject();
return value;
}
Aggregations