use of net.minecraft.util.IIcon in project TecTech by Technus.
the class QuantumGlassRender method renderInventoryBlock.
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
Tessellator tessellator = Tessellator.instance;
GL11.glPushMatrix();
// Get icons from custom register (useful for renderers and fluids)
IIcon side = QuantumGlassBlock.stuff;
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, side);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, side);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, side);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, side);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, side);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, side);
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
GL11.glPopMatrix();
}
use of net.minecraft.util.IIcon in project TecTech by Technus.
the class QuantumGlassRender method renderWorldBlock.
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
renderer.renderStandardBlock(block, x, y, z);
Tessellator tes = Tessellator.instance;
GL11.glPushMatrix();
tes.setNormal(0F, 1F, 0F);
tes.setBrightness(15728880);
tes.setColorOpaque_F(0F, 1F, 1F);
IIcon side = QuantumGlassBlock.stuff;
GL11.glDisable(GL11.GL_CULL_FACE);
// South
if (world.getBlock(x, y, z + 1).getClass() != QuantumGlassBlock.class) {
// 0.999 instead of 1 for fighting (textures overlapping)
tes.addVertexWithUV(x, y, z + 0.999, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x, y + 1, z + 0.999, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x + 1, y + 1, z + 0.999, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x + 1, y, z + 0.999, side.getMaxU(), side.getMaxV());
}
// East
if (world.getBlock(x + 1, y, z).getClass() != QuantumGlassBlock.class) {
tes.addVertexWithUV(x + 0.999, y, z + 1, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x + 0.999, y + 1, z + 1, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x + 0.999, y + 1, z, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x + 0.999, y, z, side.getMaxU(), side.getMaxV());
}
// North
if (world.getBlock(x, y, z - 1).getClass() != QuantumGlassBlock.class) {
tes.addVertexWithUV(x + 1, y, z + 0.001, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x + 1, y + 1, z + 0.001, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x, y + 1, z + 0.001, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x, y, z + 0.001, side.getMaxU(), side.getMaxV());
}
// West
if (world.getBlock(x - 1, y, z).getClass() != QuantumGlassBlock.class) {
tes.addVertexWithUV(x + 0.001, y, z, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x + 0.001, y + 1, z, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x + 0.001, y + 1, z + 1, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x + 0.001, y, z + 1, side.getMaxU(), side.getMaxV());
}
// Top
if (world.getBlock(x, y + 1, z).getClass() != QuantumGlassBlock.class) {
tes.addVertexWithUV(x, y + 0.999, z + 1, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x, y + 0.999, z, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x + 1, y + 0.999, z, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x + 1, y + 0.999, z + 1, side.getMaxU(), side.getMaxV());
}
// Bottom
if (world.getBlock(x, y - 1, z).getClass() != QuantumGlassBlock.class) {
tes.addVertexWithUV(x, y + 0.001, z, side.getMinU(), side.getMaxV());
tes.addVertexWithUV(x, y + 0.001, z + 1, side.getMinU(), side.getMinV());
tes.addVertexWithUV(x + 1, y + 0.001, z + 1, side.getMaxU(), side.getMinV());
tes.addVertexWithUV(x + 1, y + 0.001, z, side.getMaxU(), side.getMaxV());
}
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
return true;
}
use of net.minecraft.util.IIcon in project TecTech by Technus.
the class QuantumStuffRender method renderWorldBlock.
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
// renderer.renderStandardBlock(block, x, y, z);
GL11.glPushMatrix();
tes.setNormal(0F, 1F, 0F);
tes.setBrightness(15728880);
IIcon side = QuantumStuffBlock.stuff;
for (int i = 0; i < 6; i++) {
float f = 1 - TecTech.Rnd.nextFloat() / 4f, g = f - TecTech.Rnd.nextFloat() / 4f, r = g - TecTech.Rnd.nextFloat() / 4f - 0.25f;
tes.setColorOpaque_F(r, g, f);
float rotX = TecTech.Rnd.nextFloat() * 2 * (float) Math.PI, rotY = TecTech.Rnd.nextFloat() * 2 * (float) Math.PI, rotZ = TecTech.Rnd.nextFloat() * 2 * (float) Math.PI;
tesAbuse(x, y, z, -1.425f, -1.425f, .1f, rotX, rotY, rotZ, side.getMinU(), side.getMaxV());
tesAbuse(x, y, z, -1.425f, 1.425f, .1f, rotX, rotY, rotZ, side.getMinU(), side.getMinV());
tesAbuse(x, y, z, 1.425f, 1.425f, .1f, rotX, rotY, rotZ, side.getMaxU(), side.getMinV());
tesAbuse(x, y, z, 1.425f, -1.425f, .1f, rotX, rotY, rotZ, side.getMaxU(), side.getMaxV());
tesAbuse(x, y, z, 1.425f, -1.425f, -.1f, rotX, rotY, rotZ, side.getMaxU(), side.getMaxV());
tesAbuse(x, y, z, 1.425f, 1.425f, -.1f, rotX, rotY, rotZ, side.getMaxU(), side.getMinV());
tesAbuse(x, y, z, -1.425f, 1.425f, -.1f, rotX, rotY, rotZ, side.getMinU(), side.getMinV());
tesAbuse(x, y, z, -1.425f, -1.425f, -.1f, rotX, rotY, rotZ, side.getMinU(), side.getMaxV());
}
GL11.glPopMatrix();
return true;
}
use of net.minecraft.util.IIcon in project ClaySoldiersMod by SanAndreasP.
the class SoldierLeftHandRenderHandler method renderShield.
private static void renderShield(EntityClayMan clayMan, RenderClayMan renderer) {
IIcon icon = clayMan.hasUpgrade(SoldierUpgrades.UPG_IRON_BLOCK) ? Textures.s_shieldStudIcon : Textures.s_shieldIcon;
GL11.glPushMatrix();
renderer.modelBipedMain.bipedLeftArm.postRender(0.0625F);
GL11.glTranslatef(-0.4F, 0.15F, -0.2F);
GL11.glScalef(0.75F, 0.75F, 0.75F);
ItemRenderHelper.renderIconIn3D(icon, false, false, 0xFFFFFF);
GL11.glPopMatrix();
}
use of net.minecraft.util.IIcon in project ArsMagica2 by Mithion.
the class ItemSpellPart method registerIcons.
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister IIconRegister) {
ArrayList<Integer> parts = SkillManager.instance.getAllShapes();
parts.addAll(SkillManager.instance.getAllComponents());
parts.addAll(SkillManager.instance.getAllModifiers());
parts.addAll(SkillManager.instance.getAllTalents());
int count = 0;
for (Integer i : parts) {
if (i == null)
continue;
ISkillTreeEntry entry = SkillManager.instance.getSkill(i);
String subfolder = "";
if (entry instanceof ISpellShape)
subfolder = "shapes";
else if (entry instanceof ISpellComponent)
subfolder = "components";
else if (entry instanceof ISpellModifier)
subfolder = "modifiers";
else
subfolder = "skills";
String skillName = SkillManager.instance.getSkillName(entry);
IIcon IIcon = ResourceManager.RegisterTexture(String.format("spells/%s/%s.png", subfolder, skillName), IIconRegister);
SpellIconManager.instance.registerIcon(skillName, IIcon);
}
}
Aggregations