本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager.enableLighting方法的典型用法代碼示例。如果您正苦於以下問題:Java GlStateManager.enableLighting方法的具體用法?Java GlStateManager.enableLighting怎麽用?Java GlStateManager.enableLighting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.enableLighting方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntityEnderman 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)
{
this.endermanRenderer.bindTexture(field_177203_a);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(1, 1);
GlStateManager.disableLighting();
GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
int i = 61680;
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
GlStateManager.enableLighting();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.endermanRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
this.endermanRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
GlStateManager.depthMask(true);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
}
示例2: renderItem
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void renderItem(TileEntityAnimaConjurer te)
{
ItemStack stack = te.getStack();
if (!stack.isEmpty())
{
RenderHelper.enableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.pushMatrix();
GlStateManager.translate(.5, 0.935, .5);
GlStateManager.scale(.2f, .2f, .2f);
GlStateManager.rotate(te.getFrameAge(), 0, 1, 0);
GlStateManager.translate(0, Math.sin((Math.PI / 180) * (te.increaseFrameAge())) / 3.2 + 0.1, 0);
if (te.getFrameAge() < 0 || te.getFrameAge() == Integer.MAX_VALUE)
{
te.setFrameAge(0);
}
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
}
示例3: unsetScoreTeamColor
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
protected void unsetScoreTeamColor()
{
GlStateManager.enableLighting();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
示例4: func_177183_a
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void func_177183_a(EntityLivingBase entitylivingbaseIn, T modelbaseIn, float p_177183_3_, float p_177183_4_, float p_177183_5_, float p_177183_6_, float p_177183_7_, float p_177183_8_, float p_177183_9_)
{
float f = (float)entitylivingbaseIn.ticksExisted + p_177183_5_;
this.renderer.bindTexture(ENCHANTED_ITEM_GLINT_RES);
GlStateManager.enableBlend();
GlStateManager.depthFunc(514);
GlStateManager.depthMask(false);
float f1 = 0.5F;
GlStateManager.color(f1, f1, f1, 1.0F);
for (int i = 0; i < 2; ++i)
{
GlStateManager.disableLighting();
GlStateManager.blendFunc(768, 1);
float f2 = 0.76F;
GlStateManager.color(0.5F * f2, 0.25F * f2, 0.8F * f2, 1.0F);
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
float f3 = 0.33333334F;
GlStateManager.scale(f3, f3, f3);
GlStateManager.rotate(30.0F - (float)i * 60.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(0.0F, f * (0.001F + (float)i * 0.003F) * 20.0F, 0.0F);
GlStateManager.matrixMode(5888);
modelbaseIn.render(entitylivingbaseIn, p_177183_3_, p_177183_4_, p_177183_6_, p_177183_7_, p_177183_8_, p_177183_9_);
}
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
GlStateManager.matrixMode(5888);
GlStateManager.enableLighting();
GlStateManager.depthMask(true);
GlStateManager.depthFunc(515);
GlStateManager.disableBlend();
}
示例5: renderParticle
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Renders the particle
*/
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
float f = ((float)this.footstepAge + partialTicks) / (float)this.footstepMaxAge;
f = f * f;
float f1 = 2.0F - f * 2.0F;
if (f1 > 1.0F)
{
f1 = 1.0F;
}
f1 = f1 * 0.2F;
GlStateManager.disableLighting();
float f2 = 0.125F;
float f3 = (float)(this.posX - interpPosX);
float f4 = (float)(this.posY - interpPosY);
float f5 = (float)(this.posZ - interpPosZ);
float f6 = this.worldObj.getLightBrightness(new BlockPos(this.posX, this.posY, this.posZ));
this.currentFootSteps.bindTexture(FOOTPRINT_TEXTURE);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
worldRendererIn.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(0.0D, 1.0D).color(f6, f6, f6, f1).endVertex();
worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(1.0D, 1.0D).color(f6, f6, f6, f1).endVertex();
worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 - 0.125F)).tex(1.0D, 0.0D).color(f6, f6, f6, f1).endVertex();
worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 - 0.125F)).tex(0.0D, 0.0D).color(f6, f6, f6, f1).endVertex();
Tessellator.getInstance().draw();
GlStateManager.disableBlend();
GlStateManager.enableLighting();
}
示例6: 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);
}
示例7: renderParticle
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Renders the particle
*/
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
int i = (int)(((float)this.field_70581_a + partialTicks) * 15.0F / (float)this.field_70584_aq);
if (i <= 15)
{
this.theRenderEngine.bindTexture(EXPLOSION_TEXTURE);
float f = (float)(i % 4) / 4.0F;
float f1 = f + 0.24975F;
float f2 = (float)(i / 4) / 4.0F;
float f3 = f2 + 0.24975F;
float f4 = 2.0F * this.field_70582_as;
float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX);
float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY);
float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
RenderHelper.disableStandardItemLighting();
worldRendererIn.begin(7, field_181549_az);
worldRendererIn.pos((double)(f5 - p_180434_4_ * f4 - p_180434_7_ * f4), (double)(f6 - p_180434_5_ * f4), (double)(f7 - p_180434_6_ * f4 - p_180434_8_ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
worldRendererIn.pos((double)(f5 - p_180434_4_ * f4 + p_180434_7_ * f4), (double)(f6 + p_180434_5_ * f4), (double)(f7 - p_180434_6_ * f4 + p_180434_8_ * f4)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
worldRendererIn.pos((double)(f5 + p_180434_4_ * f4 + p_180434_7_ * f4), (double)(f6 + p_180434_5_ * f4), (double)(f7 + p_180434_6_ * f4 + p_180434_8_ * f4)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
worldRendererIn.pos((double)(f5 + p_180434_4_ * f4 - p_180434_7_ * f4), (double)(f6 - p_180434_5_ * f4), (double)(f7 + p_180434_6_ * f4 - p_180434_8_ * f4)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
Tessellator.getInstance().draw();
GlStateManager.enableLighting();
}
}
示例8: renderParticle
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Renders the particle
*/
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
float f = ((float)this.footstepAge + partialTicks) / (float)this.footstepMaxAge;
f = f * f;
float f1 = 2.0F - f * 2.0F;
if (f1 > 1.0F)
{
f1 = 1.0F;
}
f1 = f1 * 0.2F;
GlStateManager.disableLighting();
float f2 = 0.125F;
float f3 = (float)(this.posX - interpPosX);
float f4 = (float)(this.posY - interpPosY);
float f5 = (float)(this.posZ - interpPosZ);
float f6 = this.worldObj.getLightBrightness(new BlockPos(this));
this.currentFootSteps.bindTexture(FOOTPRINT_TEXTURE);
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
worldRendererIn.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(0.0D, 1.0D).color(f6, f6, f6, f1).endVertex();
worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(1.0D, 1.0D).color(f6, f6, f6, f1).endVertex();
worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 - 0.125F)).tex(1.0D, 0.0D).color(f6, f6, f6, f1).endVertex();
worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 - 0.125F)).tex(0.0D, 0.0D).color(f6, f6, f6, f1).endVertex();
Tessellator.getInstance().draw();
GlStateManager.disableBlend();
GlStateManager.enableLighting();
}
示例9: doRender
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doe
*/
public void doRender(EntityFallingBlock entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if (entity.getBlock() != null)
{
this.bindTexture(TextureMap.locationBlocksTexture);
IBlockState iblockstate = entity.getBlock();
Block block = iblockstate.getBlock();
BlockPos blockpos = new BlockPos(entity);
World world = entity.getWorldObj();
if (iblockstate != world.getBlockState(blockpos) && block.getRenderType() != -1)
{
if (block.getRenderType() == 3)
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
GlStateManager.disableLighting();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.BLOCK);
int i = blockpos.getX();
int j = blockpos.getY();
int k = blockpos.getZ();
worldrenderer.setTranslation((double)((float)(-i) - 0.5F), (double)(-j), (double)((float)(-k) - 0.5F));
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
IBakedModel ibakedmodel = blockrendererdispatcher.getModelFromBlockState(iblockstate, world, (BlockPos)null);
blockrendererdispatcher.getBlockModelRenderer().renderModel(world, ibakedmodel, iblockstate, blockpos, worldrenderer, false);
worldrenderer.setTranslation(0.0D, 0.0D, 0.0D);
tessellator.draw();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
}
}
}
示例10: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntityCreeper 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.getPowered())
{
boolean flag = entitylivingbaseIn.isInvisible();
GlStateManager.depthMask(!flag);
this.creeperRenderer.bindTexture(LIGHTNING_TEXTURE);
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
float f = (float)entitylivingbaseIn.ticksExisted + partialTicks;
GlStateManager.translate(f * 0.01F, f * 0.01F, 0.0F);
GlStateManager.matrixMode(5888);
GlStateManager.enableBlend();
float f1 = 0.5F;
GlStateManager.color(f1, f1, f1, 1.0F);
GlStateManager.disableLighting();
GlStateManager.blendFunc(1, 1);
this.creeperModel.setModelAttributes(this.creeperRenderer.getMainModel());
this.creeperModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
GlStateManager.matrixMode(5888);
GlStateManager.enableLighting();
GlStateManager.disableBlend();
GlStateManager.depthMask(flag);
}
}
示例11: doRender
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void doRender(EntityDispenser living, double p_76986_2_, double p_76986_4_, double p_76986_6_,
float p_76986_8_, float p_76986_9_) {
if (living.isConstructing())
this.mainModel = this.box;
else {
if (living.getLevel() == 1)
this.mainModel = this.level1;
else if (living.getLevel() == 2)
this.mainModel = this.level2;
else
this.mainModel = this.level3;
}
super.doRender(living, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder renderer = tessellator.getBuffer();
if (living.dispenserTarget != null)
for (EntityLivingBase target : living.dispenserTarget) {
double xPos2 = target.prevPosX + (target.posX - target.prevPosX) * p_76986_9_;
double yPos2 = target.prevPosY + (target.posY - target.prevPosY) * p_76986_9_;
double zPos2 = target.prevPosZ + (target.posZ - target.prevPosZ) * p_76986_9_;
double xDist = xPos2 - (living.prevPosX + (living.posX - living.prevPosX) * p_76986_9_);
double yDist = (yPos2 + target.height / 2)
- (living.prevPosY + (living.posY - living.prevPosY) * p_76986_9_ + living.height / 2);
double zDist = zPos2 - (living.prevPosZ + (living.posZ - living.prevPosZ) * p_76986_9_);
float f = MathHelper.sqrt(xDist * xDist + zDist * zDist);
float fullDist = MathHelper.sqrt(xDist * xDist + yDist * yDist + zDist * zDist);
GlStateManager.pushMatrix();
GlStateManager.translate((float) p_76986_2_, (float) p_76986_4_ + living.height / 2,
(float) p_76986_6_);
GL11.glRotatef((float) (Math.atan2(xDist, zDist) * 180.0D / Math.PI), 0.0F, 1.0F, 0.0F);
GL11.glRotatef((float) (Math.atan2(yDist, f) * 180.0D / Math.PI) * -1, 1.0F, 0.0F, 0.0F);
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
ClientProxy.setColor(TF2Util.getTeamColor(living), 0.23f, 0, 0f, 1f);
renderer.begin(7, DefaultVertexFormats.POSITION);
renderer.pos(-0.04, -0.04, 0).endVertex();
renderer.pos(0.04, 0.04, 0).endVertex();
renderer.pos(0.04, 0.04, fullDist).endVertex();
renderer.pos(-0.04, -0.04, fullDist).endVertex();
tessellator.draw();
renderer.begin(7, DefaultVertexFormats.POSITION);
renderer.pos(-0.04, -0.04, fullDist).endVertex();
renderer.pos(0.04, 0.04, fullDist).endVertex();
renderer.pos(0.04, 0.04, 0).endVertex();
renderer.pos(-0.04, -0.04, 0).endVertex();
tessellator.draw();
renderer.begin(7, DefaultVertexFormats.POSITION);
renderer.pos(0.04, -0.04, 0).endVertex();
renderer.pos(-0.04, 0.04, 0).endVertex();
renderer.pos(-0.04, 0.04, fullDist).endVertex();
renderer.pos(0.04, -0.04, fullDist).endVertex();
tessellator.draw();
renderer.begin(7, DefaultVertexFormats.POSITION);
renderer.pos(0.04, -0.04, fullDist).endVertex();
renderer.pos(-0.04, 0.04, fullDist).endVertex();
renderer.pos(-0.04, 0.04, 0).endVertex();
renderer.pos(0.04, -0.04, 0).endVertex();
tessellator.draw();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_BLEND);
GlStateManager.enableLighting();
GlStateManager.enableTexture2D();
GlStateManager.popMatrix();
}
}
示例12: drawTab
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Draws the given tab and its background, deciding whether to highlight the tab or not based off of the selected
* index.
*/
protected void drawTab(CreativeTabs tab)
{
boolean flag = tab.getTabIndex() == selectedTabIndex;
boolean flag1 = tab.isTabInFirstRow();
int i = tab.getTabColumn();
int j = i * 28;
int k = 0;
int l = this.guiLeft + 28 * i;
int i1 = this.guiTop;
int j1 = 32;
if (flag)
{
k += 32;
}
if (i == 5)
{
l = this.guiLeft + this.xSize - 28;
}
else if (i > 0)
{
l += i;
}
if (flag1)
{
i1 = i1 - 28;
}
else
{
k += 64;
i1 = i1 + (this.ySize - 4);
}
GlStateManager.disableLighting();
this.drawTexturedModalRect(l, i1, j, k, 28, 32);
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
l = l + 6;
i1 = i1 + 8 + (flag1 ? 1 : -1);
GlStateManager.enableLighting();
GlStateManager.enableRescaleNormal();
ItemStack itemstack = tab.getIconItemStack();
this.itemRender.renderItemAndEffectIntoGUI(itemstack, l, i1);
this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack, l, i1);
GlStateManager.disableLighting();
this.itemRender.zLevel = 0.0F;
this.zLevel = 0.0F;
}
示例13: renderEntityOnFire
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Renders a layer of fire on top of an entity.
*/
private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks)
{
GlStateManager.disableLighting();
TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
float f = entity.width * 1.4F;
GlStateManager.scale(f, f, f);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
float f1 = 0.5F;
float f2 = 0.0F;
float f3 = entity.height / f;
float f4 = (float)(entity.posY - entity.getEntityBoundingBox().minY);
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.0F, 0.0F, -0.3F + (float)((int)f3) * 0.02F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float f5 = 0.0F;
int i = 0;
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
while (f3 > 0.0F)
{
TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1;
this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
float f6 = textureatlassprite2.getMinU();
float f7 = textureatlassprite2.getMinV();
float f8 = textureatlassprite2.getMaxU();
float f9 = textureatlassprite2.getMaxV();
if (i / 2 % 2 == 0)
{
float f10 = f8;
f8 = f6;
f6 = f10;
}
vertexbuffer.pos((double)(f1 - 0.0F), (double)(0.0F - f4), (double)f5).tex((double)f8, (double)f9).endVertex();
vertexbuffer.pos((double)(-f1 - 0.0F), (double)(0.0F - f4), (double)f5).tex((double)f6, (double)f9).endVertex();
vertexbuffer.pos((double)(-f1 - 0.0F), (double)(1.4F - f4), (double)f5).tex((double)f6, (double)f7).endVertex();
vertexbuffer.pos((double)(f1 - 0.0F), (double)(1.4F - f4), (double)f5).tex((double)f8, (double)f7).endVertex();
f3 -= 0.45F;
f4 -= 0.45F;
f1 *= 0.9F;
f5 += 0.03F;
++i;
}
tessellator.draw();
GlStateManager.popMatrix();
GlStateManager.enableLighting();
}
示例14: doRender
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityThrown entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if(entity.isLocation())
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
GlStateManager.disableLighting();
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f);
this.bindEntityTexture(entity);
int i = entity.getLocation().getId();
if(i == 1)
GlStateManager.depthFunc(519);
float f = (float)(i % 4 * 16 + 0) / 64.0F;
float f1 = (float)(i % 4 * 16 + 16) / 64.0F;
float f2 = (float)(i / 4 * 16 + 0) / 64.0F;
float f3 = (float)(i / 4 * 16 + 16) / 64.0F;
GlStateManager.translate(0.0F, -0.1F, 0.0F);
GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * -this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
float f7 = 0.3F;
GlStateManager.scale(0.3F, 0.3F, 0.3F);
GlStateManager.translate(0.1F, 0.0F, 0.0F);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferbuilder = tessellator.getBuffer();
bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
if (this.renderOutlines)
{
GlStateManager.enableColorMaterial();
GlStateManager.enableOutlineMode(this.getTeamColor(entity));
}
bufferbuilder.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).color(255, 255, 255, 255).normal(0.0F, 1.0F, 0.0F).endVertex();
bufferbuilder.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).color(255, 255, 255, 255).normal(0.0F, 1.0F, 0.0F).endVertex();
bufferbuilder.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).color(255, 255, 255, 255).normal(0.0F, 1.0F, 0.0F).endVertex();
bufferbuilder.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).color(255, 255, 255, 255).normal(0.0F, 1.0F, 0.0F).endVertex();
tessellator.draw();
GlStateManager.disableRescaleNormal();
GlStateManager.depthFunc(515);
GlStateManager.enableLighting();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
else
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
GlStateManager.enableRescaleNormal();
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
if (this.renderOutlines)
{
GlStateManager.enableColorMaterial();
GlStateManager.enableOutlineMode(this.getTeamColor(entity));
}
Minecraft.getMinecraft().getRenderItem().renderItem(entity.getStack(), ItemCameraTransforms.TransformType.GROUND);
if (this.renderOutlines)
{
GlStateManager.disableOutlineMode();
GlStateManager.disableColorMaterial();
}
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
}
}
示例15: renderItem
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void renderItem(EntityItemFrame itemFrame)
{
ItemStack itemstack = itemFrame.getDisplayedItem();
if (!itemstack.func_190926_b())
{
if (!Config.zoomMode)
{
Entity entity = this.mc.player;
double d0 = itemFrame.getDistanceSq(entity.posX, entity.posY, entity.posZ);
if (d0 > 4096.0D)
{
return;
}
}
EntityItem entityitem = new EntityItem(itemFrame.world, 0.0D, 0.0D, 0.0D, itemstack);
Item item = entityitem.getEntityItem().getItem();
entityitem.getEntityItem().func_190920_e(1);
entityitem.hoverStart = 0.0F;
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
int i = itemFrame.getRotation();
if (item instanceof ItemMap)
{
i = i % 4 * 2;
}
GlStateManager.rotate((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);
if (!Reflector.postForgeBusEvent(Reflector.RenderItemInFrameEvent_Constructor, new Object[] {itemFrame, this}))
{
if (item instanceof ItemMap)
{
this.renderManager.renderEngine.bindTexture(MAP_BACKGROUND_TEXTURES);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
float f = 0.0078125F;
GlStateManager.scale(0.0078125F, 0.0078125F, 0.0078125F);
GlStateManager.translate(-64.0F, -64.0F, 0.0F);
MapData mapdata = Items.FILLED_MAP.getMapData(entityitem.getEntityItem(), itemFrame.world);
GlStateManager.translate(0.0F, 0.0F, -1.0F);
if (mapdata != null)
{
this.mc.entityRenderer.getMapItemRenderer().renderMap(mapdata, true);
}
}
else
{
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.pushAttrib();
RenderHelper.enableStandardItemLighting();
this.itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popAttrib();
}
}
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
if (Config.isShaders())
{
ShadersTex.updatingTex = null;
}
}