本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.enableDepth方法的典型用法代码示例。如果您正苦于以下问题:Java GlStateManager.enableDepth方法的具体用法?Java GlStateManager.enableDepth怎么用?Java GlStateManager.enableDepth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.enableDepth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBindFramebuffer
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void createBindFramebuffer(int width, int height)
{
if (!OpenGlHelper.isFramebufferEnabled())
{
this.framebufferWidth = width;
this.framebufferHeight = height;
}
else
{
GlStateManager.enableDepth();
if (this.framebufferObject >= 0)
{
this.deleteFramebuffer();
}
this.createFramebuffer(width, height);
this.checkFramebufferComplete();
OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, 0);
}
}
示例2: renderPumpkinOverlay
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void renderPumpkinOverlay(ScaledResolution p_180476_1_)
{
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableAlpha();
this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(0.0D, (double)p_180476_1_.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
worldrenderer.pos((double)p_180476_1_.getScaledWidth(), (double)p_180476_1_.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex();
worldrenderer.pos((double)p_180476_1_.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例3: renderBlocks
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private static void renderBlocks(RenderWorldLastEvent evt, Set<BlockPos> blocks) {
EntityPlayerSP player = MinecraftTools.getPlayer(Minecraft.getMinecraft());
double doubleX = player.lastTickPosX + (player.posX - player.lastTickPosX) * evt.getPartialTicks();
double doubleY = player.lastTickPosY + (player.posY - player.lastTickPosY) * evt.getPartialTicks();
double doubleZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * evt.getPartialTicks();
GlStateManager.pushMatrix();
GlStateManager.translate(-doubleX, -doubleY, -doubleZ);
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
for (BlockPos pos : blocks) {
renderBoxOutline(pos);
}
GlStateManager.enableDepth();
GlStateManager.popMatrix();
}
示例4: setViewport
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void setViewport(int vx, int vy, int vw, int vh)
{
GlStateManager.colorMask(true, true, true, true);
if (isShadowPass)
{
GL11.glViewport(0, 0, shadowMapWidth, shadowMapHeight);
}
else
{
GL11.glViewport(0, 0, renderWidth, renderHeight);
EXTFramebufferObject.glBindFramebufferEXT(36160, dfb);
isRenderingDfb = true;
GlStateManager.enableCull();
GlStateManager.enableDepth();
setDrawBuffers(drawBuffersNone);
useProgram(2);
checkGLError("beginRenderPass");
}
}
示例5: drawScreen
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
if(mc == null)
{
mc = Minecraft.getMinecraft();
fontRenderer = mc.fontRenderer;
}
drawDefaultBackground();
GlStateManager.color(1F, 1F, 1F, 1F);
this.mc.getTextureManager().bindTexture(texBackground);
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
trackList.drawScreen(mouseX, mouseY, partialTicks);
super.drawScreen(mouseX, mouseY, partialTicks);
GlStateManager.pushMatrix();
GlStateManager.enableDepth();
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.translate(guiLeft + xSize + 3, guiTop + 2, 0);
mc.getRenderItem().renderItemAndEffectIntoGUI(new ItemStack(GeneralLaymansAestheticSpyingScreen.blockGlass, 1, 2), 0, 0);
RenderHelper.disableStandardItemLighting();
GlStateManager.disableDepth();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
fontRenderer.drawString(I18n.translateToLocal("glass.gui.availableChannels"), (guiLeft + 5) / 0.5F, (guiTop + 5) / 0.5F, 16777215, true);
GlStateManager.popMatrix();
}
示例6: drawBackground
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void drawBackground(float lines, float maxWidth, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth, FontRenderer font)
{
if (lines > 0)
{
GlStateManager.disableRescaleNormal();
RenderHelper.disableStandardItemLighting();
GlStateManager.disableLighting();
GlStateManager.disableDepth();
float tooltipTextWidth = maxWidth;
float tooltipX = mouseX + 12;
float tooltipY = mouseY - 12;
float tooltipHeight = lines;
if (tooltipY + tooltipHeight + 6 > screenHeight)
{
tooltipY = screenHeight - tooltipHeight - 6;
}
final int zLevel = 300;
final int backgroundColor = 0xF0100010;
GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY - 4, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY - 3, backgroundColor, backgroundColor);
GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY + (int)tooltipHeight + 3, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY + (int)tooltipHeight + 4, backgroundColor, backgroundColor);
GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY - 3, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY + (int)tooltipHeight + 3, backgroundColor, backgroundColor);
GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 4, (int)tooltipY - 3, (int)tooltipX - 3, (int)tooltipY + (int)tooltipHeight + 3, backgroundColor, backgroundColor);
GuiUtils.drawGradientRect(zLevel, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY - 3, (int)tooltipX + (int)tooltipTextWidth + 4, (int)tooltipY + (int)tooltipHeight + 3, backgroundColor, backgroundColor);
final int borderColorStart = 0x505000FF;
final int borderColorEnd = (borderColorStart & 0xFEFEFE) >> 1 | borderColorStart & 0xFF000000;
GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY - 3 + 1, (int)tooltipX - 3 + 1, (int)tooltipY + (int)tooltipHeight + 3 - 1, borderColorStart, borderColorEnd);
GuiUtils.drawGradientRect(zLevel, (int)tooltipX + (int)tooltipTextWidth + 2,(int) tooltipY - 3 + 1,(int) tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY + (int)tooltipHeight + 3 - 1, borderColorStart, borderColorEnd);
GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY - 3, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY - 3 + 1, borderColorStart, borderColorStart);
GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY +(int)tooltipHeight + 2, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY + (int)tooltipHeight + 3, borderColorEnd, borderColorEnd);
GlStateManager.enableDepth();
GlStateManager.enableRescaleNormal();
}
}
示例7: func_181554_e
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void func_181554_e()
{
GlStateManager.disableDepth();
FrameTimer frametimer = this.mc.func_181539_aj();
int i = frametimer.func_181749_a();
int j = frametimer.func_181750_b();
long[] along = frametimer.func_181746_c();
ScaledResolution scaledresolution = new ScaledResolution(this.mc);
int k = i;
int l = 0;
drawRect(0, scaledresolution.getScaledHeight() - 60, 240, scaledresolution.getScaledHeight(), -1873784752);
while (k != j)
{
int i1 = frametimer.func_181748_a(along[k], 30);
int j1 = this.func_181552_c(MathHelper.clamp_int(i1, 0, 60), 0, 30, 60);
this.drawVerticalLine(l, scaledresolution.getScaledHeight(), scaledresolution.getScaledHeight() - i1, j1);
++l;
k = frametimer.func_181751_b(k + 1);
}
drawRect(1, scaledresolution.getScaledHeight() - 30 + 1, 14, scaledresolution.getScaledHeight() - 30 + 10, -1873784752);
this.fontRenderer.drawString("60", 2, scaledresolution.getScaledHeight() - 30 + 2, 14737632);
this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 30, -1);
drawRect(1, scaledresolution.getScaledHeight() - 60 + 1, 14, scaledresolution.getScaledHeight() - 60 + 10, -1873784752);
this.fontRenderer.drawString("30", 2, scaledresolution.getScaledHeight() - 60 + 2, 14737632);
this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 60, -1);
this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 1, -1);
this.drawVerticalLine(0, scaledresolution.getScaledHeight() - 60, scaledresolution.getScaledHeight(), -1);
this.drawVerticalLine(239, scaledresolution.getScaledHeight() - 60, scaledresolution.getScaledHeight(), -1);
if (this.mc.gameSettings.limitFramerate <= 120)
{
this.drawHorizontalLine(0, 239, scaledresolution.getScaledHeight() - 60 + this.mc.gameSettings.limitFramerate / 2, -16711681);
}
GlStateManager.enableDepth();
}
示例8: renderDebugText
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void renderDebugText(String str, double x, double y, double z, float partialTicks, int color)
{
Minecraft minecraft = Minecraft.getMinecraft();
if (minecraft.thePlayer != null && minecraft.getRenderManager() != null && minecraft.getRenderManager().options != null)
{
FontRenderer fontrenderer = minecraft.fontRendererObj;
EntityPlayer entityplayer = minecraft.thePlayer;
double d0 = entityplayer.lastTickPosX + (entityplayer.posX - entityplayer.lastTickPosX) * (double)partialTicks;
double d1 = entityplayer.lastTickPosY + (entityplayer.posY - entityplayer.lastTickPosY) * (double)partialTicks;
double d2 = entityplayer.lastTickPosZ + (entityplayer.posZ - entityplayer.lastTickPosZ) * (double)partialTicks;
GlStateManager.pushMatrix();
GlStateManager.translate((float)(x - d0), (float)(y - d1) + 0.07F, (float)(z - d2));
GlStateManager.glNormal3f(0.0F, 1.0F, 0.0F);
GlStateManager.scale(0.02F, -0.02F, 0.02F);
RenderManager rendermanager = minecraft.getRenderManager();
GlStateManager.rotate(-rendermanager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate((float)(rendermanager.options.thirdPersonView == 2 ? 1 : -1) * rendermanager.playerViewX, 1.0F, 0.0F, 0.0F);
GlStateManager.disableLighting();
GlStateManager.enableTexture2D();
GlStateManager.enableDepth();
GlStateManager.depthMask(true);
GlStateManager.scale(-1.0F, 1.0F, 1.0F);
fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, 0, color);
GlStateManager.enableLighting();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
}
示例9: func_180474_b
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void func_180474_b(float p_180474_1_, ScaledResolution p_180474_2_)
{
if (p_180474_1_ < 1.0F)
{
p_180474_1_ = p_180474_1_ * p_180474_1_;
p_180474_1_ = p_180474_1_ * p_180474_1_;
p_180474_1_ = p_180474_1_ * 0.8F + 0.2F;
}
GlStateManager.disableAlpha();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.color(1.0F, 1.0F, 1.0F, p_180474_1_);
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.portal.getDefaultState());
float f = textureatlassprite.getMinU();
float f1 = textureatlassprite.getMinV();
float f2 = textureatlassprite.getMaxU();
float f3 = textureatlassprite.getMaxV();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(0.0D, (double)p_180474_2_.getScaledHeight(), -90.0D).tex((double)f, (double)f3).endVertex();
worldrenderer.pos((double)p_180474_2_.getScaledWidth(), (double)p_180474_2_.getScaledHeight(), -90.0D).tex((double)f2, (double)f3).endVertex();
worldrenderer.pos((double)p_180474_2_.getScaledWidth(), 0.0D, -90.0D).tex((double)f2, (double)f1).endVertex();
worldrenderer.pos(0.0D, 0.0D, -90.0D).tex((double)f, (double)f1).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例10: updateAchievementWindow
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void updateAchievementWindow()
{
if (this.theAchievement != null && this.notificationTime != 0L && Minecraft.getMinecraft().thePlayer != null)
{
double d0 = (double)(Minecraft.getSystemTime() - this.notificationTime) / 3000.0D;
if (!this.permanentNotification)
{
if (d0 < 0.0D || d0 > 1.0D)
{
this.notificationTime = 0L;
return;
}
}
else if (d0 > 0.5D)
{
d0 = 0.5D;
}
this.updateAchievementWindowScale();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
double d1 = d0 * 2.0D;
if (d1 > 1.0D)
{
d1 = 2.0D - d1;
}
d1 = d1 * 4.0D;
d1 = 1.0D - d1;
if (d1 < 0.0D)
{
d1 = 0.0D;
}
d1 = d1 * d1;
d1 = d1 * d1;
int i = this.width - 160;
int j = 0 - (int)(d1 * 36.0D);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableTexture2D();
this.mc.getTextureManager().bindTexture(achievementBg);
GlStateManager.disableLighting();
this.drawTexturedModalRect(i, j, 96, 202, 160, 32);
if (this.permanentNotification)
{
this.mc.fontRendererObj.drawSplitString(this.achievementDescription, i + 30, j + 7, 120, -1);
}
else
{
this.mc.fontRendererObj.drawString(this.achievementTitle, i + 30, j + 7, -256);
this.mc.fontRendererObj.drawString(this.achievementDescription, i + 30, j + 18, -1);
}
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.disableLighting();
GlStateManager.enableRescaleNormal();
GlStateManager.enableColorMaterial();
GlStateManager.enableLighting();
this.renderItem.renderItemAndEffectIntoGUI(this.theAchievement.theItemStack, i + 8, j + 8);
GlStateManager.disableLighting();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
}
}
示例11: drawSlot
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
* Draws the given slot: any item in it, the slot's background, the hovered highlight, etc.
*/
private void drawSlot(Slot slotIn)
{
int i = slotIn.xDisplayPosition;
int j = slotIn.yDisplayPosition;
ItemStack itemstack = slotIn.getStack();
boolean flag = false;
boolean flag1 = slotIn == this.clickedSlot && !this.draggedStack.func_190926_b() && !this.isRightMouseClick;
ItemStack itemstack1 = this.mc.player.inventory.getItemStack();
String s = null;
if (slotIn == this.clickedSlot && !this.draggedStack.func_190926_b() && this.isRightMouseClick && !itemstack.func_190926_b())
{
itemstack = itemstack.copy();
itemstack.func_190920_e(itemstack.func_190916_E() / 2);
}
else if (this.dragSplitting && this.dragSplittingSlots.contains(slotIn) && !itemstack1.func_190926_b())
{
if (this.dragSplittingSlots.size() == 1)
{
return;
}
if (Container.canAddItemToSlot(slotIn, itemstack1, true) && this.inventorySlots.canDragIntoSlot(slotIn))
{
itemstack = itemstack1.copy();
flag = true;
Container.computeStackSize(this.dragSplittingSlots, this.dragSplittingLimit, itemstack, slotIn.getStack().func_190926_b() ? 0 : slotIn.getStack().func_190916_E());
int k = Math.min(itemstack.getMaxStackSize(), slotIn.getItemStackLimit(itemstack));
if (itemstack.func_190916_E() > k)
{
s = TextFormatting.YELLOW.toString() + k;
itemstack.func_190920_e(k);
}
}
else
{
this.dragSplittingSlots.remove(slotIn);
this.updateDragSplitting();
}
}
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
if (itemstack.func_190926_b() && slotIn.canBeHovered())
{
String s1 = slotIn.getSlotTexture();
if (s1 != null)
{
TextureAtlasSprite textureatlassprite = this.mc.getTextureMapBlocks().getAtlasSprite(s1);
GlStateManager.disableLighting();
this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
this.drawTexturedModalRect(i, j, textureatlassprite, 16, 16);
GlStateManager.enableLighting();
flag1 = true;
}
}
if (!flag1)
{
if (flag)
{
drawRect(i, j, i + 16, j + 16, -2130706433);
}
GlStateManager.enableDepth();
this.itemRender.renderItemAndEffectIntoGUI(this.mc.player, itemstack, i, j);
this.itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, itemstack, i, j, s);
}
this.itemRender.zLevel = 0.0F;
this.zLevel = 0.0F;
}
示例12: drawTooltip
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
protected void drawTooltip(List par1List, int par2, int par3)
{
if (!par1List.isEmpty())
{
GlStateManager.disableRescaleNormal();
GlStateManager.disableDepth();
int k = 0;
for(Object aPar1List : par1List)
{
String s = (String)aPar1List;
int l = this.fontRenderer.getStringWidth(s);
if(l > k)
{
k = l;
}
}
int i1 = par2 + 12;
int j1 = par3 - 12;
int k1 = 8;
if (par1List.size() > 1)
{
k1 += 2 + (par1List.size() - 1) * 10;
}
if (i1 + k > this.width)
{
i1 -= 28 + k;
}
if (j1 + k1 + 6 > this.height)
{
j1 = this.height - k1 - 6;
}
this.zLevel = 300.0F;
int l1 = -267386864;
this.drawGradientRect(i1 - 3, j1 - 4, i1 + k + 3, j1 - 3, l1, l1);
this.drawGradientRect(i1 - 3, j1 + k1 + 3, i1 + k + 3, j1 + k1 + 4, l1, l1);
this.drawGradientRect(i1 - 3, j1 - 3, i1 + k + 3, j1 + k1 + 3, l1, l1);
this.drawGradientRect(i1 - 4, j1 - 3, i1 - 3, j1 + k1 + 3, l1, l1);
this.drawGradientRect(i1 + k + 3, j1 - 3, i1 + k + 4, j1 + k1 + 3, l1, l1);
int i2 = 1347420415;
int j2 = (i2 & 16711422) >> 1 | i2 & -16777216;
this.drawGradientRect(i1 - 3, j1 - 3 + 1, i1 - 3 + 1, j1 + k1 + 3 - 1, i2, j2);
this.drawGradientRect(i1 + k + 2, j1 - 3 + 1, i1 + k + 3, j1 + k1 + 3 - 1, i2, j2);
this.drawGradientRect(i1 - 3, j1 - 3, i1 + k + 3, j1 - 3 + 1, i2, i2);
this.drawGradientRect(i1 - 3, j1 + k1 + 2, i1 + k + 3, j1 + k1 + 3, j2, j2);
for (int k2 = 0; k2 < par1List.size(); ++k2)
{
String s1 = (String)par1List.get(k2);
this.fontRenderer.drawStringWithShadow(s1, i1, j1, -1);
if (k2 == 0)
{
j1 += 2;
}
j1 += 10;
}
this.zLevel = 0.0F;
GlStateManager.enableDepth();
GlStateManager.enableRescaleNormal();
}
}
示例13: render
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public String render(int dy, float ix, float iy) {
if (ItemStackTools.isEmpty(item)) {
return null;
}
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.depthMask(true);
GlStateManager.enableLighting();
GlStateManager.enableDepth();
GlStateManager.pushMatrix();
GlStateManager.translate(0, scale * 25 - 25, -150);
renderSlot(item, x, y + dy);
GlStateManager.popMatrix();
GlStateManager.disableLighting();
RenderHelper.disableStandardItemLighting();
return null;
}
示例14: drawSlot
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void drawSlot(Slot slotIn)
{
int i = slotIn.xDisplayPosition;
int j = slotIn.yDisplayPosition;
ItemStack itemstack = slotIn.getStack();
boolean flag = false;
boolean flag1 = slotIn == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick;
ItemStack itemstack1 = this.mc.thePlayer.inventory.getItemStack();
String s = null;
if (slotIn == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && itemstack != null)
{
itemstack = itemstack.copy();
itemstack.stackSize /= 2;
}
else if (this.dragSplitting && this.dragSplittingSlots.contains(slotIn) && itemstack1 != null)
{
if (this.dragSplittingSlots.size() == 1)
{
return;
}
if (Container.canAddItemToSlot(slotIn, itemstack1, true) && this.inventorySlots.canDragIntoSlot(slotIn))
{
itemstack = itemstack1.copy();
flag = true;
Container.computeStackSize(this.dragSplittingSlots, this.dragSplittingLimit, itemstack, slotIn.getStack() == null ? 0 : slotIn.getStack().stackSize);
if (itemstack.stackSize > itemstack.getMaxStackSize())
{
s = EnumChatFormatting.YELLOW + "" + itemstack.getMaxStackSize();
itemstack.stackSize = itemstack.getMaxStackSize();
}
if (itemstack.stackSize > slotIn.getItemStackLimit(itemstack))
{
s = EnumChatFormatting.YELLOW + "" + slotIn.getItemStackLimit(itemstack);
itemstack.stackSize = slotIn.getItemStackLimit(itemstack);
}
}
else
{
this.dragSplittingSlots.remove(slotIn);
this.updateDragSplitting();
}
}
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
if (itemstack == null)
{
String s1 = slotIn.getSlotTexture();
if (s1 != null)
{
TextureAtlasSprite textureatlassprite = this.mc.getTextureMapBlocks().getAtlasSprite(s1);
GlStateManager.disableLighting();
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
this.drawTexturedModalRect(i, j, textureatlassprite, 16, 16);
GlStateManager.enableLighting();
flag1 = true;
}
}
if (!flag1)
{
if (flag)
{
drawRect(i, j, i + 16, j + 16, -2130706433);
}
GlStateManager.enableDepth();
this.itemRender.renderItemAndEffectIntoGUI(itemstack, i, j);
this.itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, itemstack, i, j, s);
}
this.itemRender.zLevel = 0.0F;
this.zLevel = 0.0F;
}
示例15: onRenderWorld
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderWorld(RenderWorldLastEvent event) {
GlStateManager.pushMatrix();
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.shadeModel(GL11.GL_SMOOTH);
GlStateManager.disableDepth();
GlStateManager.glLineWidth(1.f);
Vec3d renderPos = EntityUtils.getInterpolatedPos(getLocalPlayer(), event.getPartialTicks());
RenderEvent e = new RenderEvent(TESSELLATOR, renderPos);
e.resetTranslation();
MinecraftForge.EVENT_BUS.post(e);
GlStateManager.glLineWidth(1.f);
GlStateManager.shadeModel(GL11.GL_FLAT);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
GlStateManager.enableTexture2D();
GlStateManager.enableDepth();
GlStateManager.enableCull();
GlStateManager.popMatrix();
}