本文整理汇总了Java中net.minecraft.inventory.Slot.getBackgroundSprite方法的典型用法代码示例。如果您正苦于以下问题:Java Slot.getBackgroundSprite方法的具体用法?Java Slot.getBackgroundSprite怎么用?Java Slot.getBackgroundSprite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.inventory.Slot
的用法示例。
在下文中一共展示了Slot.getBackgroundSprite方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawDankNullSlot
import net.minecraft.inventory.Slot; //导入方法依赖的package包/类
private void drawDankNullSlot(Slot slotIn) {
GuiContainer gui = this;
int i = EasyMappings.slotPosX(slotIn);
int j = EasyMappings.slotPosY(slotIn);
ItemStack itemstack = slotIn.getStack();
boolean flag = false;
boolean flag1 = (slotIn == MCPrivateUtils.getGuiClickedSlot(gui)) && (MCPrivateUtils.getGuiDraggedStack(gui) != null) && (!MCPrivateUtils.getGuiIsRightMouseClick(gui));
ItemStack itemstack1 = EasyMappings.player().inventory.getItemStack();
String s = null;
if ((slotIn == MCPrivateUtils.getGuiClickedSlot(gui)) && (MCPrivateUtils.getGuiDraggedStack(gui) != null) && (MCPrivateUtils.getGuiIsRightMouseClick(gui)) && (!itemstack.isEmpty())) {
itemstack = itemstack.copy();
itemstack.setCount(itemstack.getCount() / 2);
}
else if ((MCPrivateUtils.getGuiDragSplitting(gui)) && (MCPrivateUtils.getGuiDragSplittingSlots(gui).contains(slotIn)) && (!itemstack1.isEmpty())) {
if (MCPrivateUtils.getGuiDragSplittingSlots(gui).size() == 1) {
return;
}
MCPrivateUtils.getGuiDragSplittingSlots(gui).remove(slotIn);
GuiUtils.updateDragSplitting(gui);
}
MCPrivateUtils.setGuiZLevel(gui, 100.0F);
MCPrivateUtils.setGuiScreenRendererZLevel(gui, 100.0F);
if (itemstack.isEmpty()) {
TextureAtlasSprite textureatlassprite = slotIn.getBackgroundSprite();
if (textureatlassprite != null) {
GlStateManager.disableLighting();
GuiUtils.bindTexture(slotIn.getBackgroundLocation());
GuiUtils.drawTexturedModalRect(gui, i, j, textureatlassprite, 16, 16);
GlStateManager.enableLighting();
flag1 = true;
}
}
if (!flag1) {
if (flag) {
Gui.drawRect(i, j, i + 16, j + 16, -2130706433);
}
GlStateManager.enableDepth();
Minecraft.getMinecraft().getRenderItem().renderItemAndEffectIntoGUI(itemstack, i, j);
pRenderItem.renderItemOverlayIntoGUI(RenderUtils.getFontRenderer(), itemstack, i, j, s);
}
MCPrivateUtils.setGuiScreenRendererZLevel(gui, 0.0F);
MCPrivateUtils.setGuiZLevel(gui, 0.0F);
}
示例2: drawSlot
import net.minecraft.inventory.Slot; //导入方法依赖的package包/类
private void drawSlot(Slot slotIn)
{
int i = slotIn.xPos;
int j = slotIn.yPos;
ItemStack itemstack = slotIn.getStack();
boolean flag = false;
boolean flag1 = false;
String s = null;
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
if (itemstack.isEmpty() && slotIn.isEnabled())
{
TextureAtlasSprite textureatlassprite = slotIn.getBackgroundSprite();
if (textureatlassprite != null)
{
GlStateManager.disableLighting();
this.mc.getTextureManager().bindTexture(slotIn.getBackgroundLocation());
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.fontRenderer, itemstack, i, j, s);
}
this.itemRender.zLevel = 0.0F;
this.zLevel = 0.0F;
}