本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager.disableCull方法的典型用法代碼示例。如果您正苦於以下問題:Java GlStateManager.disableCull方法的具體用法?Java GlStateManager.disableCull怎麽用?Java GlStateManager.disableCull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.disableCull方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawCircle
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void drawCircle(double radius, double innerWidth, double x, double y, double z, Color color,
int segments)
{
Tessellator tes = Tessellator.getInstance();
BufferBuilder vb = tes.getBuffer();
GlStateManager.disableCull();
vb.begin(GL11.GL_TRIANGLE_STRIP, DefaultVertexFormats.POSITION_COLOR);
for (int deg = 0; deg <= segments; deg++)
{
double radius1 = deg % 2 == 0 ? radius : innerWidth;
vb.pos(x + Math.cos(Math.toRadians(deg)) * (radius1), y, z + Math.sin(Math.toRadians(deg)) * radius1)
.color(color.getRed(), color.getGreen(), color.getBlue(), 1).endVertex();
vb.pos(x + Math.cos(Math.toRadians(deg + 1)) * (radius), y, z + Math.sin(Math.toRadians(deg + 1)) * radius)
.color(color.getRed(), color.getGreen(), color.getBlue(), 1).endVertex();
vb.pos(x + Math.cos(Math.toRadians(deg + 2)) * (radius1), y,
z + Math.sin(Math.toRadians(deg + 2)) * radius1)
.color(color.getRed(), color.getGreen(), color.getBlue(), 1).endVertex();
}
tes.draw();
}
示例2: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void doRenderLayer(EntityPlayer entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
GlStateManager.pushMatrix();
GlStateManager.disableCull();
//GlStateManager.enableAlpha();
//GlStateManager.depthMask(true);
//GlStateManager.disableRescaleNormal();
//GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
//GlStateManager.enableTexture2D();
Minecraft.getMinecraft().getTextureManager().bindTexture(ENDERMAN_TEXTURES);
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
endermanModel.isCarrying = false;
endermanModel.isAttacking = false;
endermanModel.bipedHead.offsetY = 0.25F;
endermanModel.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.translate(0.5F, 0.0F, 0.5F);
//GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.enableCull();
GlStateManager.popMatrix();
}
示例3: renderEquippedItems
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
protected void renderEquippedItems(EntityLivingBase p_renderEquippedItems_1_, float p_renderEquippedItems_2_, float p_renderEquippedItems_3_)
{
if (Config.isShowCapes())
{
if (p_renderEquippedItems_1_ instanceof AbstractClientPlayer)
{
AbstractClientPlayer abstractclientplayer = (AbstractClientPlayer)p_renderEquippedItems_1_;
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableRescaleNormal();
GlStateManager.enableCull();
ModelBiped modelbiped = this.renderPlayer.getMainModel();
PlayerConfigurations.renderPlayerItems(modelbiped, abstractclientplayer, p_renderEquippedItems_2_, p_renderEquippedItems_3_);
GlStateManager.disableCull();
}
}
}
示例4: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntityMooshroom entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (!entitylivingbaseIn.isChild() && !entitylivingbaseIn.isInvisible())
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
this.mooshroomRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.enableCull();
GlStateManager.cullFace(GlStateManager.CullFace.FRONT);
GlStateManager.pushMatrix();
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.2F, 0.35F, 0.5F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.RED_MUSHROOM.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(0.1F, 0.0F, -0.6F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.RED_MUSHROOM.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
((ModelQuadruped)this.mooshroomRenderer.getMainModel()).head.postRender(0.0625F);
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.0F, 0.7F, -0.2F);
GlStateManager.rotate(12.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.RED_MUSHROOM.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.cullFace(GlStateManager.CullFace.BACK);
GlStateManager.disableCull();
}
}
示例5: renderArms
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private static void renderArms() {
Minecraft mc = Minecraft.getMinecraft();
if (!mc.player.isInvisible()) {
GlStateManager.disableCull();
GlStateManager.pushMatrix();
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
renderArm(EnumHandSide.RIGHT);
renderArm(EnumHandSide.LEFT);
GlStateManager.popMatrix();
GlStateManager.enableCull();
}
}
示例6: doRender
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityLeashKnot entity, double x, double y, double z, float entityYaw, float partialTicks)
{
GlStateManager.pushMatrix();
GlStateManager.disableCull();
GlStateManager.translate((float)x, (float)y, (float)z);
float f = 0.0625F;
GlStateManager.enableRescaleNormal();
GlStateManager.scale(-1.0F, -1.0F, 1.0F);
GlStateManager.enableAlpha();
this.bindEntityTexture(entity);
if (this.renderOutlines)
{
GlStateManager.enableColorMaterial();
GlStateManager.enableOutlineMode(this.getTeamColor(entity));
}
this.leashKnotModel.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
if (this.renderOutlines)
{
GlStateManager.disableOutlineMode();
GlStateManager.disableColorMaterial();
}
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
示例7: render
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
GlStateManager.disableRescaleNormal();
GlStateManager.disableCull();
this.leftWing.render(scale);
this.rightWing.render(scale);
}
示例8: renderDebugBoundingBox
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Renders the bounding box around an entity when F3+B is pressed
*/
private void renderDebugBoundingBox(Entity entityIn, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_)
{
GlStateManager.depthMask(false);
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
GlStateManager.disableCull();
GlStateManager.disableBlend();
float f = entityIn.width / 2.0F;
AxisAlignedBB axisalignedbb = entityIn.getEntityBoundingBox();
AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.minX - entityIn.posX + p_85094_2_, axisalignedbb.minY - entityIn.posY + p_85094_4_, axisalignedbb.minZ - entityIn.posZ + p_85094_6_, axisalignedbb.maxX - entityIn.posX + p_85094_2_, axisalignedbb.maxY - entityIn.posY + p_85094_4_, axisalignedbb.maxZ - entityIn.posZ + p_85094_6_);
RenderGlobal.func_181563_a(axisalignedbb1, 255, 255, 255, 255);
if (entityIn instanceof EntityLivingBase)
{
float f1 = 0.01F;
RenderGlobal.func_181563_a(new AxisAlignedBB(p_85094_2_ - (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() - 0.009999999776482582D, p_85094_6_ - (double)f, p_85094_2_ + (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() + 0.009999999776482582D, p_85094_6_ + (double)f), 255, 0, 0, 255);
}
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
Vec3 vec3 = entityIn.getLook(p_85094_9_);
worldrenderer.begin(3, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos(p_85094_2_, p_85094_4_ + (double)entityIn.getEyeHeight(), p_85094_6_).color(0, 0, 255, 255).endVertex();
worldrenderer.pos(p_85094_2_ + vec3.xCoord * 2.0D, p_85094_4_ + (double)entityIn.getEyeHeight() + vec3.yCoord * 2.0D, p_85094_6_ + vec3.zCoord * 2.0D).color(0, 0, 255, 255).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
GlStateManager.enableCull();
GlStateManager.disableBlend();
GlStateManager.depthMask(true);
}
示例9: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntityMooshroom entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
if (!entitylivingbaseIn.isChild() && !entitylivingbaseIn.isInvisible())
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
this.mooshroomRenderer.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.enableCull();
GlStateManager.cullFace(1028);
GlStateManager.pushMatrix();
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.2F, 0.35F, 0.5F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(0.1F, 0.0F, -0.6F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
((ModelQuadruped)this.mooshroomRenderer.getMainModel()).head.postRender(0.0625F);
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.0F, 0.7F, -0.2F);
GlStateManager.rotate(12.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.cullFace(1029);
GlStateManager.disableCull();
}
}
示例10: preRenderChunkLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void preRenderChunkLayer(BlockRenderLayer blockLayerIn)
{
if (Shaders.isRenderBackFace(blockLayerIn))
{
GlStateManager.disableCull();
}
if (OpenGlHelper.useVbo())
{
GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
}
}
示例11: drawBatch
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Render all TESRs batched so far.
* You probably shouldn't call this manually.
*/
public void drawBatch(int pass)
{
renderEngine.bindTexture(net.minecraft.client.renderer.texture.TextureMap.LOCATION_BLOCKS_TEXTURE);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
GlStateManager.blendFunc(org.lwjgl.opengl.GL11.GL_SRC_ALPHA, org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.enableBlend();
GlStateManager.disableCull();
if (net.minecraft.client.Minecraft.isAmbientOcclusionEnabled())
{
GlStateManager.shadeModel(org.lwjgl.opengl.GL11.GL_SMOOTH);
}
else
{
GlStateManager.shadeModel(org.lwjgl.opengl.GL11.GL_FLAT);
}
if(pass > 0)
{
batchBuffer.getBuffer().sortVertexData((float)staticPlayerX, (float)staticPlayerY, (float)staticPlayerZ);
}
batchBuffer.draw();
net.minecraft.client.renderer.RenderHelper.enableStandardItemLighting();
drawingBatch = false;
}
示例12: render
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void render(TileEntityEmberBurst tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha){
if (tile != null){
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GlStateManager.disableCull();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
Tessellator tess = Tessellator.getInstance();
BufferBuilder buffer = tess.getBuffer();
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
if (tile.up == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, up.x1+x, up.y1+y, up.z1+z, up.x2+x, up.y2+y, up.z2+z, up.textures, new int[]{1,1,1,1,1,1});
}
if (tile.down == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, down.x1+x, down.y1+y, down.z1+z, down.x2+x, down.y2+y, down.z2+z, down.textures, new int[]{-1,-1,1,1,1,1});
}
if (tile.north == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, north.x1+x, north.y1+y, north.z1+z, north.x2+x, north.y2+y, north.z2+z, north.textures, new int[]{1,1,1,1,1,1});
}
if (tile.south == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, south.x1+x, south.y1+y, south.z1+z, south.x2+x, south.y2+y, south.z2+z, south.textures, new int[]{1,1,-1,-1,1,1});
}
if (tile.west == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, west.x1+x, west.y1+y, west.z1+z, west.x2+x, west.y2+y, west.z2+z, west.textures, new int[]{1,1,1,1,1,1});
}
if (tile.east == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, east.x1+x, east.y1+y, east.z1+z, east.x2+x, east.y2+y, east.z2+z, east.textures, new int[]{1,1,1,1,-1,-1});
}
if (tile.up == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, upEnd.x1+x, upEnd.y1+y, upEnd.z1+z, upEnd.x2+x, upEnd.y2+y, upEnd.z2+z, upEnd.textures, new int[]{1,1,1,1,1,1});
}
if (tile.down == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, downEnd.x1+x, downEnd.y1+y, downEnd.z1+z, downEnd.x2+x, downEnd.y2+y, downEnd.z2+z, downEnd.textures, new int[]{-1,-1,1,1,1,1});
}
if (tile.north == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, northEnd.x1+x, northEnd.y1+y, northEnd.z1+z, northEnd.x2+x, northEnd.y2+y, northEnd.z2+z, northEnd.textures, new int[]{1,1,1,1,1,1});
}
if (tile.south == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, southEnd.x1+x, southEnd.y1+y, southEnd.z1+z, southEnd.x2+x, southEnd.y2+y, southEnd.z2+z, southEnd.textures, new int[]{1,1,-1,-1,1,1});
}
if (tile.west == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, westEnd.x1+x, westEnd.y1+y, westEnd.z1+z, westEnd.x2+x, westEnd.y2+y, westEnd.z2+z, westEnd.textures, new int[]{1,1,1,1,1,1});
}
if (tile.east == TileEntityEmberBurst.EnumConnection.LEVER){
RenderUtil.addBox(buffer, eastEnd.x1+x, eastEnd.y1+y, eastEnd.z1+z, eastEnd.x2+x, eastEnd.y2+y, eastEnd.z2+z, eastEnd.textures, new int[]{1,1,1,1,-1,-1});
}
tess.draw();
}
}
示例13: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntityDragon entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (entitylivingbaseIn.deathTicks > 0)
{
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
RenderHelper.disableStandardItemLighting();
float f = ((float)entitylivingbaseIn.deathTicks + partialTicks) / 200.0F;
float f1 = 0.0F;
if (f > 0.8F)
{
f1 = (f - 0.8F) / 0.2F;
}
Random random = new Random(432L);
GlStateManager.disableTexture2D();
GlStateManager.shadeModel(7425);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
GlStateManager.disableAlpha();
GlStateManager.enableCull();
GlStateManager.depthMask(false);
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, -1.0F, -2.0F);
for (int i = 0; (float)i < (f + f * f) / 2.0F * 60.0F; ++i)
{
GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F);
float f2 = random.nextFloat() * 20.0F + 5.0F + f1 * 10.0F;
float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F;
vertexbuffer.begin(6, DefaultVertexFormats.POSITION_COLOR);
vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(255, 255, 255, (int)(255.0F * (1.0F - f1))).endVertex();
vertexbuffer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
vertexbuffer.pos(0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
vertexbuffer.pos(0.0D, (double)f2, (double)(1.0F * f3)).color(255, 0, 255, 0).endVertex();
vertexbuffer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
tessellator.draw();
}
GlStateManager.popMatrix();
GlStateManager.depthMask(true);
GlStateManager.disableCull();
GlStateManager.disableBlend();
GlStateManager.shadeModel(7424);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableTexture2D();
GlStateManager.enableAlpha();
RenderHelper.enableStandardItemLighting();
}
}
示例14: renderTileEntityAt
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void renderTileEntityAt(TileEntityPiston te, double x, double y, double z, float partialTicks, int destroyStage)
{
BlockPos blockpos = te.getPos();
IBlockState iblockstate = te.getPistonState();
Block block = iblockstate.getBlock();
if (iblockstate.getMaterial() != Material.AIR && te.getProgress(partialTicks) < 1.0F)
{
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
RenderHelper.disableStandardItemLighting();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.enableBlend();
GlStateManager.disableCull();
if (Minecraft.isAmbientOcclusionEnabled())
{
GlStateManager.shadeModel(7425);
}
else
{
GlStateManager.shadeModel(7424);
}
vertexbuffer.begin(7, DefaultVertexFormats.BLOCK);
vertexbuffer.setTranslation(x - (double)blockpos.getX() + (double)te.getOffsetX(partialTicks), y - (double)blockpos.getY() + (double)te.getOffsetY(partialTicks), z - (double)blockpos.getZ() + (double)te.getOffsetZ(partialTicks));
World world = this.getWorld();
if (block == Blocks.PISTON_HEAD && te.getProgress(partialTicks) <= 0.25F)
{
iblockstate = iblockstate.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(true));
this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, true);
}
else if (te.shouldPistonHeadBeRendered() && !te.isExtending())
{
BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = block == Blocks.STICKY_PISTON ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT;
IBlockState iblockstate1 = Blocks.PISTON_HEAD.getDefaultState().withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype).withProperty(BlockPistonExtension.FACING, iblockstate.getValue(BlockPistonBase.FACING));
iblockstate1 = iblockstate1.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(te.getProgress(partialTicks) >= 0.5F));
this.renderStateModel(blockpos, iblockstate1, vertexbuffer, world, true);
vertexbuffer.setTranslation(x - (double)blockpos.getX(), y - (double)blockpos.getY(), z - (double)blockpos.getZ());
iblockstate = iblockstate.withProperty(BlockPistonBase.EXTENDED, Boolean.valueOf(true));
this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, true);
}
else
{
this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, false);
}
vertexbuffer.setTranslation(0.0D, 0.0D, 0.0D);
tessellator.draw();
RenderHelper.enableStandardItemLighting();
}
}
示例15: renderPapers
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void renderPapers(ItemStack stack, int slot, TileEntityWritingDesk te)
{
if (stack != null && !stack.isEmpty())
{
RenderHelper.enableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.pushMatrix();
GlStateManager.translate(0.75, .8, 0.5);
GlStateManager.scale(.5f, .5f, .5f);
GlStateManager.disableLighting();
GlStateManager.disableCull();
Minecraft.getMinecraft().getTextureManager()
.bindTexture(new ResourceLocation(ArcaneMagic.MODID, "textures/misc/parchment.png"));
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferbuilder = tessellator.getBuffer();
GlStateManager.translate(-0.5F, -0.5F, 0.0F);
//GlStateManager.rotate(te.getAge(), 0,1,0);
bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
bufferbuilder.pos(0, 0, -0.4).tex(0.0D, 1.0D).endVertex();
bufferbuilder.pos(0, 0, 0.4).tex(1.0D, 1.0D).endVertex();
bufferbuilder.pos(0, 0.8, 0.4).tex(1.0D, 0.0D).endVertex();
bufferbuilder.pos(0, 0.8, -0.4).tex(0.0D, 0.0D).endVertex();
tessellator.draw();
GlStateManager.rotate(180, 0, 0, 1);
GlStateManager.rotate(90, 0, 1, 0);
GlStateManager.translate(0, -0.59, 0);
GlStateManager.translate(0, 0, -0.0005);
for (int side = 0; side < 2; side++)
{
if (side == 1)
{
GlStateManager.translate(0, 0, 0.001);
GlStateManager.rotate(180, 0, 1, 0);
//GlStateManager.rotate(180,0,0,1);
}
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GlStateManager.scale(0.008, 0.008, 0.008);
GLHelper.drawCenteredSplitString(Minecraft.getMinecraft().fontRenderer, "Manipulation Magic", 0, -15,
100, 0x000000);
GlStateManager.popAttrib();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GlStateManager.scale(0.005, 0.005, 0.005);
GLHelper.drawCenteredSplitString(Minecraft.getMinecraft().fontRenderer,
"Manipulating Anima directly would be a powerful ability, if only you could obtain the right items to learn how.\n\nLuckily, your new discoveries should aid you greatly in this process.",
0, 0, 130, 0x000000);
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}
GlStateManager.popMatrix();
}
}