本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager.color方法的典型用法代碼示例。如果您正苦於以下問題:Java GlStateManager.color方法的具體用法?Java GlStateManager.color怎麽用?Java GlStateManager.color使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.color方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();
if (iblockstate != null)
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 0.6875F, -0.75F);
GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.25F, 0.1875F, 0.25F);
float f = 0.5F;
GlStateManager.scale(-0.5F, -0.5F, 0.5F);
int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
}
}
示例2: 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)
{
if (this.entity != null)
{
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
rendermanager.setRenderPosition(Particle.interpPosX, Particle.interpPosY, Particle.interpPosZ);
float f = 0.42553192F;
float f1 = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge;
GlStateManager.depthMask(true);
GlStateManager.enableBlend();
GlStateManager.enableDepth();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
float f2 = 240.0F;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
GlStateManager.pushMatrix();
float f3 = 0.05F + 0.5F * MathHelper.sin(f1 * (float)Math.PI);
GlStateManager.color(1.0F, 1.0F, 1.0F, f3);
GlStateManager.translate(0.0F, 1.8F, 0.0F);
GlStateManager.rotate(180.0F - entityIn.rotationYaw, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(60.0F - 150.0F * f1 - entityIn.rotationPitch, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, -0.4F, -1.5F);
GlStateManager.scale(0.42553192F, 0.42553192F, 0.42553192F);
this.entity.rotationYaw = 0.0F;
this.entity.rotationYawHead = 0.0F;
this.entity.prevRotationYaw = 0.0F;
this.entity.prevRotationYawHead = 0.0F;
rendermanager.doRenderEntity(this.entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks, false);
GlStateManager.popMatrix();
GlStateManager.enableDepth();
}
}
示例3: drawGuiContainerBackgroundLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Args : renderPartialTicks, mouseX, mouseY
*/
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(horseGuiTextures);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
if (this.horseEntity.isChested())
{
this.drawTexturedModalRect(i + 79, j + 17, 0, this.ySize, 90, 54);
}
if (this.horseEntity.canWearArmor())
{
this.drawTexturedModalRect(i + 7, j + 35, 0, this.ySize + 54, 18, 18);
}
GuiInventory.drawEntityOnScreen(i + 51, j + 60, 17, (float)(i + 51) - this.mousePosx, (float)(j + 75 - 50) - this.mousePosY, this.horseEntity);
}
示例4: func_148224_c
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void func_148224_c(int p_148224_1_, int p_148224_2_, int p_148224_3_, int p_148224_4_)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(Gui.statIcons);
float f = 0.0078125F;
float f1 = 0.0078125F;
int i = 18;
int j = 18;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex();
worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex();
worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex();
worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex();
tessellator.draw();
}
示例5: drawButton
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Draws this button to the screen.
*/
public void drawButton(Minecraft mc, int mouseX, int mouseY)
{
if (this.visible)
{
boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(GuiScreenBook.BOOK_GUI_TEXTURES);
int i = 0;
int j = 192;
if (flag)
{
i += 23;
}
if (!this.isForward)
{
j += 13;
}
this.drawTexturedModalRect(this.xPosition, this.yPosition, i, j, 23, 13);
}
}
示例6: drawGuiContainerForegroundLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
protected void drawGuiContainerForegroundLayer(int mx, int my) {
if(title)
this.fontRendererObj.drawString(this.name, this.xSize / 2 - this.fontRendererObj.getStringWidth(this.name) / 2, 6, 0xa0a0a0);
GlStateManager.pushAttrib();
GlStateManager.color(1, 1, 1, 1);
Minecraft.getMinecraft().renderEngine.bindTexture(getTexture());
GlStateManager.popAttrib();
if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && getShouldOutline() != null)
drawOutlines();
}
示例7: drawIcon
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private static void drawIcon()
{
if(!Twitchy.persistantIcon && !Twitchy.isLive) return;
GlStateManager.color(1f, 1f, 1f, 1f);
GlStateManager.enableBlend();
mc.getTextureManager().bindTexture(twitch);
GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textU, textV, twitchRect.width, twitchRect.height, 0);
if(Twitchy.isLive)
GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textLU, textLV, twitchRect.width, twitchRect.height, 0);
}
示例8: drawGuiContainerBackgroundLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Args : renderPartialTicks, mouseX, mouseY
*/
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(craftingTableGuiTextures);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
}
示例9: drawGuiContainerBackgroundLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Args : renderPartialTicks, mouseX, mouseY
*/
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(HOPPER_GUI_TEXTURE);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
}
示例10: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntitySlime entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (!entitylivingbaseIn.isInvisible())
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableNormalize();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
this.slimeModel.setModelAttributes(this.slimeRenderer.getMainModel());
this.slimeModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.disableBlend();
GlStateManager.disableNormalize();
}
}
示例11: renderTooltip
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
protected void renderTooltip(ScaledResolution sr, float partialTicks)
{
if (this.mc.getRenderViewEntity() instanceof EntityPlayer)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(widgetsTexPath);
EntityPlayer entityplayer = (EntityPlayer)this.mc.getRenderViewEntity();
int i = sr.getScaledWidth() / 2;
float f = this.zLevel;
this.zLevel = -90.0F;
this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22);
this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20, sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22);
this.zLevel = f;
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
RenderHelper.enableGUIStandardItemLighting();
for (int j = 0; j < 9; ++j)
{
int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2;
int l = sr.getScaledHeight() - 16 - 3;
this.renderHotbarItem(j, k, l, partialTicks, entityplayer);
}
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.disableBlend();
}
}
示例12: preRenderCallback
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntityGhast entitylivingbaseIn, float partialTickTime)
{
float f = 1.0F;
float f1 = (8.0F + f) / 2.0F;
float f2 = (8.0F + 1.0F / f) / 2.0F;
GlStateManager.scale(f2, f1, f2);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例13: framebufferRenderExt
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void framebufferRenderExt(int p_178038_1_, int p_178038_2_, boolean p_178038_3_)
{
if (OpenGlHelper.isFramebufferEnabled())
{
GlStateManager.colorMask(true, true, true, false);
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double)p_178038_1_, (double)p_178038_2_, 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.viewport(0, 0, p_178038_1_, p_178038_2_);
GlStateManager.enableTexture2D();
GlStateManager.disableLighting();
GlStateManager.disableAlpha();
if (p_178038_3_)
{
GlStateManager.disableBlend();
GlStateManager.enableColorMaterial();
}
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.bindFramebufferTexture();
float f = (float)p_178038_1_;
float f1 = (float)p_178038_2_;
float f2 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth;
float f3 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double)f, (double)f1, 0.0D).tex((double)f2, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double)f, 0.0D, 0.0D).tex((double)f2, (double)f3).color(255, 255, 255, 255).endVertex();
worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)f3).color(255, 255, 255, 255).endVertex();
tessellator.draw();
this.unbindFramebufferTexture();
GlStateManager.depthMask(true);
GlStateManager.colorMask(true, true, true, true);
}
}
示例14: renderHUDEffect
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void renderHUDEffect(int x, int y, PotionEffect effect, Minecraft mc, float alpha) {
mc.renderEngine.bindTexture(TEXTURE_TIPSY);
GlStateManager.color(1, 1, 1, alpha);
Gui.drawModalRectWithCustomSizedTexture(x+3, y+3, 0, 0, 18, 18, 18, 18);
}
示例15: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
if (!itemstack.func_190926_b())
{
Item item = itemstack.getItem();
Minecraft minecraft = Minecraft.getMinecraft();
GlStateManager.pushMatrix();
if (entitylivingbaseIn.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F);
}
boolean flag = entitylivingbaseIn instanceof EntityVillager || entitylivingbaseIn instanceof EntityZombieVillager;
if (entitylivingbaseIn.isChild() && !(entitylivingbaseIn instanceof EntityVillager))
{
float f = 2.0F;
float f1 = 1.4F;
GlStateManager.translate(0.0F, 0.5F * scale, 0.0F);
GlStateManager.scale(0.7F, 0.7F, 0.7F);
GlStateManager.translate(0.0F, 16.0F * scale, 0.0F);
}
this.modelRenderer.postRender(0.0625F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
if (item == Items.SKULL)
{
float f2 = 1.1875F;
GlStateManager.scale(1.1875F, -1.1875F, -1.1875F);
if (flag)
{
GlStateManager.translate(0.0F, 0.0625F, 0.0F);
}
GameProfile gameprofile = null;
if (itemstack.hasTagCompound())
{
NBTTagCompound nbttagcompound = itemstack.getTagCompound();
if (nbttagcompound.hasKey("SkullOwner", 10))
{
gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner"));
}
else if (nbttagcompound.hasKey("SkullOwner", 8))
{
String s = nbttagcompound.getString("SkullOwner");
if (!StringUtils.isBlank(s))
{
gameprofile = TileEntitySkull.updateGameprofile(new GameProfile((UUID)null, s));
nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile));
}
}
}
TileEntitySkullRenderer.instance.renderSkull(-0.5F, 0.0F, -0.5F, EnumFacing.UP, 180.0F, itemstack.getMetadata(), gameprofile, -1, limbSwing);
}
else if (!(item instanceof ItemArmor) || ((ItemArmor)item).getEquipmentSlot() != EntityEquipmentSlot.HEAD)
{
float f3 = 0.625F;
GlStateManager.translate(0.0F, -0.25F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.scale(0.625F, -0.625F, -0.625F);
if (flag)
{
GlStateManager.translate(0.0F, 0.1875F, 0.0F);
}
minecraft.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.HEAD);
}
GlStateManager.popMatrix();
}
}