Here are the examples of the java api blade.x2 taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
14
Source : TileEntityBreakerRenderer.java
with MIT License
from DaedalusGame
with MIT License
from DaedalusGame
@Override
public void render(TileEnreplacedyBreaker tile, double x, double y, double z, float partialTicks, int destroyStage, float tileAlpha) {
if (tile != null && tile.getWorld().getBlockState(tile.getPos()).getBlock() instanceof BlockBreaker) {
float ticks = tile.ticksExisted;
GlStateManager.pushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GlStateManager.disableCull();
Tessellator tess = Tessellator.getInstance();
BufferBuilder buffer = tess.getBuffer();
GlStateManager.translate(x, y, z);
EnumFacing facing = tile.getWorld().getBlockState(tile.getPos()).getValue(BlockAutoHammer.facing);
float angle = 0;
float pitch = -90;
if (facing == EnumFacing.SOUTH) {
angle = 180;
}
if (facing == EnumFacing.EAST) {
angle = 270;
}
if (facing == EnumFacing.WEST) {
angle = 90;
}
if (facing == EnumFacing.UP) {
pitch = 0;
}
if (facing == EnumFacing.DOWN) {
pitch = 180;
}
/*float hammerAngle = -45.0f;
if (progress != -1){
hammerAngle = -45.0f - 90.0f*(1.0f-((progress-partialTicks)/5.0f)+1.0f);
if (hammerAngle < -135.0f){
hammerAngle = -135.0f - (hammerAngle + 135.0f);
}
}*/
GlStateManager.translate(0.5f, 0.5f, 0.5f);
GlStateManager.rotate(angle, 0, 1, 0);
GlStateManager.rotate(pitch, 1, 0, 0);
if (tile.isActive())
GlStateManager.rotate(9.0f * (ticks + partialTicks), 0, 1, 0);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, blade.x1, blade.y1, blade.z1, blade.x2, blade.y2, blade.z2, blade.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
}
}
3
Source : TileEntityEmberBoreRenderer.java
with MIT License
from DaedalusGame
with MIT License
from DaedalusGame
@Override
public void render(TileEnreplacedyEmberBore tile, double x, double y, double z, float partialTicks, int destroyStage, float tileAlpha) {
if (tile != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GlStateManager.disableCull();
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
Tessellator tess = Tessellator.getInstance();
BufferBuilder buffer = tess.getBuffer();
float angle = tile.angle * partialTicks + tile.lastAngle * (1 - partialTicks);
GlStateManager.pushMatrix();
GlStateManager.translate(x - 0.5, y - 0.5, z + 0.5);
GlStateManager.rotate(angle, 1, 0, 0);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, blade.x1, blade.y1, blade.z1, blade.x2, blade.y2, blade.z2, blade.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x, y - 0.5, z + 0.5);
GlStateManager.rotate(angle + 72.0f, 1, 0, 0);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, blade.x1, blade.y1, blade.z1, blade.x2, blade.y2, blade.z2, blade.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x + 0.5, y - 0.5, z + 0.5);
GlStateManager.rotate(angle + 144.0f, 1, 0, 0);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, blade.x1, blade.y1, blade.z1, blade.x2, blade.y2, blade.z2, blade.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x + 1.0, y - 0.5, z + 0.5);
GlStateManager.rotate(angle + 216.0f, 1, 0, 0);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, blade.x1, blade.y1, blade.z1, blade.x2, blade.y2, blade.z2, blade.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x + 1.5, y - 0.5, z + 0.5);
GlStateManager.rotate(angle + 288.0f, 1, 0, 0);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, blade.x1, blade.y1, blade.z1, blade.x2, blade.y2, blade.z2, blade.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x - 0.75, y - 0.625, z + 0.5);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, pole.x1, pole.y1, pole.z1, pole.x2, pole.y2, pole.z2, pole.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x - 0.25, y - 0.625, z + 0.5);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, pole.x1, pole.y1, pole.z1, pole.x2, pole.y2, pole.z2, pole.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x + 0.25, y - 0.625, z + 0.5);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, pole.x1, pole.y1, pole.z1, pole.x2, pole.y2, pole.z2, pole.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x + 0.75, y - 0.625, z + 0.5);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, pole.x1, pole.y1, pole.z1, pole.x2, pole.y2, pole.z2, pole.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x + 1.25, y - 0.625, z + 0.5);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, pole.x1, pole.y1, pole.z1, pole.x2, pole.y2, pole.z2, pole.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x + 1.75, y - 0.625, z + 0.5);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
RenderUtil.addBox(buffer, pole.x1, pole.y1, pole.z1, pole.x2, pole.y2, pole.z2, pole.textures, new int[] { 1, 1, 1, 1, 1, 1 });
tess.draw();
GlStateManager.popMatrix();
}
}