本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager.popAttrib方法的典型用法代碼示例。如果您正苦於以下問題:Java GlStateManager.popAttrib方法的具體用法?Java GlStateManager.popAttrib怎麽用?Java GlStateManager.popAttrib使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.popAttrib方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderParchmentFirstPerson
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void renderParchmentFirstPerson(float pitch, float p_187463_2_, float p_187463_3_,
ItemStack parchment)
{
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
float f = MathHelper.sqrt(p_187463_3_);
float f1 = -0.2F * MathHelper.sin(p_187463_3_ * (float) Math.PI);
float f2 = -0.4F * MathHelper.sin(f * (float) Math.PI);
GlStateManager.translate(0.0F, -f1 / 2.0F, f2);
float f3 = Minecraft.getMinecraft().getItemRenderer().getMapAngleFromPitch(pitch);
GlStateManager.translate(0.0F, 0.04F + p_187463_2_ * -1.2F + f3 * -0.5F, -0.72F);
GlStateManager.rotate(f3 * -85.0F, 1.0F, 0.0F, 0.0F);
Minecraft.getMinecraft().getItemRenderer().renderArms();
float f4 = MathHelper.sin(f * (float) Math.PI);
GlStateManager.rotate(f4 * 20.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(2.0F, 2.0F, 2.0F);
renderParchmentFirstPerson(parchment);
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}
示例2: drawItemstackTooltip
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void drawItemstackTooltip(ItemStack stack, int x, int y, int mouseX, int mouseY, GuiScreen notebook)
{
if (mouseX >= x && mouseY >= y && mouseX <= x + 16 && mouseY <= y + 16)
{
if (stack != null && !stack.isEmpty())
{
// A seperate matrix because tooltip rendering changes a bunch of things that we don't want
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
// Cache the itemstack for drawing
net.minecraftforge.fml.client.config.GuiUtils.preItemToolTip(stack);
// Actually draw the tooltip
notebook.drawHoveringText(notebook.getItemToolTip(stack), mouseX, mouseY);
// Goodbye cached itemstack
net.minecraftforge.fml.client.config.GuiUtils.postItemToolTip();
// Matrix now gone see u again soon
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}
}
}
示例3: render
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void render(TilePotteryKiln te, double x, double y, double z, float partialTicks, int destroyStage,
float alpha) {
GlStateManager.pushAttrib();
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
GlStateManager.disableRescaleNormal();
if(te.getWorld().getBlockState(te.getPos()).getBlock()==BlocksRegistry.potteryKiln&&te.getWorld().getBlockState(te.getPos()).getValue(BlockPotteryKiln.TYPE)==EnumKilnTypes.EMPTY){
ItemStack stack=te.pottery.getStackInSlot(0);
if(!stack.isEmpty()){
item=new EntityItem(te.getWorld());
item.setItem(stack);
item.hoverStart=0F;
RenderHelper.enableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.pushMatrix();
GlStateManager.translate(0.5D, -0.1D, 0.5D);
GlStateManager.scale(1D, 1D, 1D);
Minecraft.getMinecraft().getRenderManager().renderEntity(item, 0, 0, 0, 0, 0, false);
GlStateManager.popMatrix();
}
}
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}
示例4: renderTileEntityAt
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void renderTileEntityAt(TilePedestal te, double x, double y, double z, float partialTicks, int destroyStage) {
GlStateManager.pushAttrib();
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
GlStateManager.disableRescaleNormal();
renderItem(te);
GlStateManager.popMatrix();
GlStateManager.popAttrib();
}
示例5: renderSkull
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void renderSkull(float rot, ModelSkullBase modelIn, ItemStack stack) {
ModelSkullBase modelbase = modelIn;
bindTexture(modelbase.getTexture());
GlStateManager.pushAttrib();
GlStateManager.pushMatrix();
//GlStateManager.disableCull();
//GlStateManager.enableAlpha();
//GlStateManager.disableDepth();
GlStateManager.enableLighting();
GlStateManager.translate(0.5, 0.0, 0.5);
if (stack.isOnItemFrame()) {
GlStateManager.scale(-2.0F, -2.0F, 2.0F);
}
else {
GlStateManager.scale(-1.5F, -1.5F, 1.5F);
}
if (stack.isOnItemFrame()) {
rot = 180.0F;
}
modelbase.render(rot);
modelbase.renderOverlay(rot);
if (modelbase.getLightMap() != null) {
bindTexture(modelbase.getLightMap());
modelbase.renderLightMap(rot);
}
GlStateManager.translate(-0.5, -0.0, -0.5);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
//GlStateManager.enableDepth();
GlStateManager.popMatrix();
GlStateManager.popAttrib();
}
示例6: onRenderHand
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@SubscribeEvent
public static void onRenderHand(RenderSpecificHandEvent ev)
{
EntityPlayer player = Minecraft.getMinecraft().player;
if (!player.isSneaking() && ev.getItemStack().getItem() instanceof ItemParchment)
{
float f = player.getSwingProgress(ev.getPartialTicks());
float f1 = player.prevRotationPitch
+ (player.rotationPitch - player.prevRotationPitch) * ev.getPartialTicks();
ItemRenderer itemrenderer = Minecraft.getMinecraft().getItemRenderer();
float prevEquipProgress = ev.getHand() == EnumHand.MAIN_HAND ? itemrenderer.prevEquippedProgressMainHand
: itemrenderer.prevEquippedProgressOffHand;
float equipProgress = ev.getHand() == EnumHand.MAIN_HAND ? itemrenderer.equippedProgressMainHand
: itemrenderer.equippedProgressOffHand;
float f5 = 1.0F - (prevEquipProgress + (equipProgress - prevEquipProgress) * ev.getPartialTicks());
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
if (ev.getHand() == EnumHand.MAIN_HAND && player.getHeldItemOffhand().isEmpty())
{
GLHelper.renderParchmentFirstPerson(f1, f5, f, ev.getItemStack());
} else
{
EnumHandSide enumhandside = ev.getHand() == EnumHand.MAIN_HAND ? player.getPrimaryHand()
: player.getPrimaryHand().opposite();
GLHelper.renderParchmentFirstPersonSide(f5, enumhandside, f, ev.getItemStack());
}
GlStateManager.popAttrib();
GlStateManager.popMatrix();
ev.setCanceled(true);
}
}
示例7: drawPost
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void drawPost(int x, int y, int mouseX, int mouseY, GuiScreen notebook)
{
// New matrix!
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
// Adjust the x and y values to fit the tooltips properly
x += 22;
y += 3;
// Render the tooltips for the recipe matrix
for (int inputX = 0; inputX < 3; inputX++)
{
for (int inputY = 0; inputY < 3; inputY++)
{
if (recipeIn[inputY][inputX] != ItemStack.EMPTY)
{
// Render the tooltip if the mouse is over the item
drawItemstackTooltip(recipeIn[inputY][inputX], x + (inputX * 25), y + (inputY * 25), mouseX, mouseY,
notebook);
}
}
}
// Draw the tooltip for the output item
drawItemstackTooltip(recipeOut, x + 113, y + 25, mouseX, mouseY, notebook);
// Go back to the main render matrix
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}
示例8: 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();
}
示例9: drawGeneratorProgress
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void drawGeneratorProgress(int x, int y, GeneratorBase tile) {
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
int barHeight = (int) (((float) tile.generationTimer / tile.generationTimerDefault) * 16);
drawTexturedModalRect(x, y + barHeight, 176, barHeight, 16, barHeight + 16);
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}
示例10: drawGuiContainerBackgroundLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GlStateManager.pushAttrib();
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
Minecraft.getMinecraft().renderEngine.bindTexture(getTexture());
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
GlStateManager.popAttrib();
}
示例11: render
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void render( double x, double y, double z)
{
if(child==null)
{
parent.connectionLines.remove(this);
return;
}
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
//if(dim!=Minecraft.getMinecraft().theWorld.provider.getDimension())return;
Minecraft.getMinecraft().getTextureManager().bindTexture(this.type.texture);
Tessellator tessellator = Tessellator.getInstance();
//tessellator.getBuffer().setTranslation(x,y,x);
GlStateManager.translate(x,y,z);
GL11.glEnable(GL11.GL_BLEND);
GlStateManager.enableAlpha();
//long angle = (System.currentTimeMillis() / 10) % 360;
//GlStateManager.translate(0, 0.07 * Math.sin(Math.PI * angle / 180), 0);
//GlStateManager.rotate(-angle, 1, 1, 1);
GlStateManager.rotate(180, 1, 0, 0);
RenderHelper.disableStandardItemLighting();
GlStateManager.translate(0.33D*parent.x+0.1666,-0.08,-0.33D*parent.z-0.1666);
GlStateManager.rotate(90+(float)heading, 0, 1, 0);
if (Minecraft.isAmbientOcclusionEnabled()) {
GlStateManager.shadeModel(GL11.GL_SMOOTH);
} else {
GlStateManager.shadeModel(GL11.GL_FLAT);
}
//GlStateManager.translate(-(pX+cX)/2,-(pY+cY)/2+0.5,-(pZ+cZ)/2);
Color newColor = new Color(this.parent.getSignal().type.color);
tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
int state = (int)(System.currentTimeMillis()/100)%4+1;
tessellator.getBuffer().pos(width/2,0,0).tex(0.25D*state,length).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
tessellator.getBuffer().pos(width/2,0,length).tex(0.25D*state,0).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
tessellator.getBuffer().pos(-width/2,0,length).tex(0.25D*(state-1),0).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
tessellator.getBuffer().pos(-width/2,0,0).tex(0.25D*(state-1),length).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
tessellator.draw();
GL11.glDisable(GL11.GL_BLEND);
RenderHelper.enableStandardItemLighting();
GlStateManager.popMatrix();
GlStateManager.popAttrib();
}
示例12: 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();
}
}
示例13: renderTubeItems
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void renderTubeItems(TileTube tile, double x, double y, double z, float parTicks) {
for (TubeItem item : tile.getItemList()) {
if (item.getItemStack() == null)
continue;
GlStateManager.pushMatrix();
{
GlStateManager.translate(x, y, z);
GlStateManager.disableLighting();
ItemStack stack = item.getItemStack();
float xPos = item.getItemX(parTicks);
float yPos = item.getItemY(parTicks);
float zPos = item.getItemZ(parTicks);
GlStateManager.translate(xPos, yPos, zPos);
if (item.getColor() != null)
renderItemColor(new Color(item.getColor().getMapColor().colorValue));
EntityItem entityitem = new EntityItem(tile.getWorld(), 0.0D, 0.0D, 0.0D, stack);
entityitem.getItem().setCount(stack.getCount());
entityitem.hoverStart = 0.0F;
GlStateManager.pushMatrix();
{
GlStateManager.disableLighting();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.pushAttrib();
RenderHelper.enableStandardItemLighting();
Minecraft.getMinecraft().getRenderItem().renderItem(entityitem.getItem(), ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popAttrib();
GlStateManager.enableLighting();
}
GlStateManager.popMatrix();
}
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}
示例14: renderItem
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void renderItem(EntityItemFrame itemFrame)
{
ItemStack itemstack = itemFrame.getDisplayedItem();
if (itemstack != null)
{
EntityItem entityitem = new EntityItem(itemFrame.worldObj, 0.0D, 0.0D, 0.0D, itemstack);
Item item = entityitem.getEntityItem().getItem();
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
int i = itemFrame.getRotation();
if (item instanceof net.minecraft.item.ItemMap)
{
i = i % 4 * 2;
}
GlStateManager.rotate((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);
net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(itemFrame, this);
if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
{
if (item instanceof net.minecraft.item.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.worldObj);
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);
if (!this.itemRenderer.shouldRenderItemIn3D(entityitem.getEntityItem()) || item instanceof ItemSkull)
{
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
}
GlStateManager.pushAttrib();
RenderHelper.enableStandardItemLighting();
this.itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popAttrib();
}
}
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}
示例15: drawTriangle2D
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void drawTriangle2D(double width, float rotation, double x, double y, Color color, int lineWidth)
{
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GlStateManager.translate(x, y, 0);
GlStateManager.rotate(rotation, 0, 0, 1);
double p = (3 * width) / 2;
double area = Math.sqrt((p * (p - width) * (p - width) * (p - width)));
double height = 2 * (area / width);
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
GlStateManager.DestFactor.ZERO);
GlStateManager.shadeModel(7425);
GL11.glLineWidth(lineWidth);
Tessellator tes = Tessellator.getInstance();
BufferBuilder vb = tes.getBuffer();
GlStateManager.rotate(60f, 0, 0, 1);
vb.begin(GL11.GL_LINE_LOOP, DefaultVertexFormats.POSITION_COLOR);
vb.pos(0, 0, 0).color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()).endVertex();
vb.pos(width, 0, 0).color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()).endVertex();
tes.draw();
GlStateManager.rotate(60f, 0, 0, 1);
vb.begin(GL11.GL_LINE_LOOP, DefaultVertexFormats.POSITION_COLOR);
vb.pos(0, 0, 0).color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()).endVertex();
vb.pos(width, 0, 0).color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()).endVertex();
tes.draw();
GlStateManager.rotate(60f, 0, 0, 1);
GlStateManager.translate(0, -height, 0);
vb.begin(GL11.GL_LINE_LOOP, DefaultVertexFormats.POSITION_COLOR);
vb.pos(-width / 2, 0, 0).color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()).endVertex();
vb.pos(width / 2, 0, 0).color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()).endVertex();
tes.draw();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.disableBlend();
GlStateManager.shadeModel(GL11.GL_FLAT);
GlStateManager.color(1, 1, 1, 1);
GlStateManager.enableTexture2D();
GlStateManager.enableAlpha();
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}