本文整理匯總了Java中net.minecraft.client.renderer.Tessellator.setBrightness方法的典型用法代碼示例。如果您正苦於以下問題:Java Tessellator.setBrightness方法的具體用法?Java Tessellator.setBrightness怎麽用?Java Tessellator.setBrightness使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.Tessellator
的用法示例。
在下文中一共展示了Tessellator.setBrightness方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setBrightness
import net.minecraft.client.renderer.Tessellator; //導入方法依賴的package包/類
private int setBrightness(Tessellator tessellator, IBlockAccess blockAccess, int x, int y, int z, Block block) {
int mb = block.getMixedBrightnessForBlock(blockAccess, x, y, z);
tessellator.setBrightness(mb);
float f = 1.0F;
int l = block.colorMultiplier(blockAccess, x, y, z);
float f1 = (l >> 16 & 0xFF) / 255.0F;
float f2 = (l >> 8 & 0xFF) / 255.0F;
float f3 = (l & 0xFF) / 255.0F;
if (EntityRenderer.anaglyphEnable) {
float f6 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
float f4 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
float f7 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
f1 = f6;
f2 = f4;
f3 = f7;
}
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
return mb;
}
示例2: renderWorldBlock
import net.minecraft.client.renderer.Tessellator; //導入方法依賴的package包/類
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
Tessellator tessellator = Tessellator.instance;
int meta = world.getBlockMetadata(x, y, z);
if ((meta & 8) != 0) {
if (world.getBlock(x, y - 1, z) != block)
return false;
} else if (world.getBlock(x, y + 1, z) != block)
return false;
int brightness = block.getMixedBrightnessForBlock(world, x, y, z);
tessellator.setBrightness(renderer.renderMinY > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y - 1, z));
tessellator.setColorOpaque_F(0.5F, 0.5F, 0.5F);
renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 0));
if ((meta & 8) != 0) {
tessellator.setBrightness(renderer.renderMaxY < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y + 1, z));
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
renderer.uvRotateTop = 2;
renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 1));
renderer.uvRotateTop = 0;
}
tessellator.setBrightness(renderer.renderMinZ > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y, z - 1));
tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F);
renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 2));
renderer.flipTexture = false;
tessellator.setBrightness(renderer.renderMaxZ < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y, z + 1));
tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F);
renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 3));
renderer.flipTexture = false;
tessellator.setBrightness(renderer.renderMinX > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x - 1, y, z));
tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F);
renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 4));
renderer.flipTexture = false;
tessellator.setBrightness(renderer.renderMaxX < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x + 1, y, z));
tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F);
renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 5));
renderer.flipTexture = false;
return true;
}
示例3: draw
import net.minecraft.client.renderer.Tessellator; //導入方法依賴的package包/類
private void draw(Tessellator tessellator, IIcon icon, int brightness, int metadata) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
tessellator.setBrightness(Math.max(brightness, 160));
tessellator.addVertexWithUV(0, 0, 0, icon.getMaxU(), icon.getMaxV());
tessellator.addVertexWithUV(0, 1, 0, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(1, 1, 0, icon.getMinU(), icon.getMinV());
tessellator.addVertexWithUV(1, 0, 0, icon.getMinU(), icon.getMaxV());
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
tessellator.setBrightness(Math.max(brightness, 160));
tessellator.addVertexWithUV(1, 0, 0, icon.getMaxU(), icon.getMaxV());
tessellator.addVertexWithUV(1, 1, 0, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(1, 1, 1, icon.getMinU(), icon.getMinV());
tessellator.addVertexWithUV(1, 0, 1, icon.getMinU(), icon.getMaxV());
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
tessellator.setBrightness(Math.max(brightness, 160));
tessellator.addVertexWithUV(1, 0, 1, icon.getMaxU(), icon.getMaxV());
tessellator.addVertexWithUV(1, 1, 1, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(0, 1, 1, icon.getMinU(), icon.getMinV());
tessellator.addVertexWithUV(0, 0, 1, icon.getMinU(), icon.getMaxV());
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
tessellator.setBrightness(Math.max(brightness, 160));
tessellator.addVertexWithUV(0, 0, 1, icon.getMaxU(), icon.getMaxV());
tessellator.addVertexWithUV(0, 1, 1, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(0, 1, 0, icon.getMinU(), icon.getMinV());
tessellator.addVertexWithUV(0, 0, 0, icon.getMinU(), icon.getMaxV());
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
tessellator.setBrightness(Math.max(brightness, 160));
tessellator.addVertexWithUV(1, 1, 1, icon.getMaxU(), icon.getMaxV());
tessellator.addVertexWithUV(1, 1, 0, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(0, 1, 0, icon.getMinU(), icon.getMinV());
tessellator.addVertexWithUV(0, 1, 1, icon.getMinU(), icon.getMaxV());
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
tessellator.setBrightness(Math.max(brightness, 160));
tessellator.addVertexWithUV(0, 0, 1, icon.getMaxU(), icon.getMaxV());
tessellator.addVertexWithUV(0, 0, 0, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(1, 0, 0, icon.getMinU(), icon.getMinV());
tessellator.addVertexWithUV(1, 0, 1, icon.getMinU(), icon.getMaxV());
tessellator.draw();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}