當前位置: 首頁>>代碼示例>>Java>>正文


Java MerchantRecipeList.isEmpty方法代碼示例

本文整理匯總了Java中net.minecraft.village.MerchantRecipeList.isEmpty方法的典型用法代碼示例。如果您正苦於以下問題:Java MerchantRecipeList.isEmpty方法的具體用法?Java MerchantRecipeList.isEmpty怎麽用?Java MerchantRecipeList.isEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.village.MerchantRecipeList的用法示例。


在下文中一共展示了MerchantRecipeList.isEmpty方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawGuiContainerBackgroundLayer

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的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(MERCHANT_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);
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

    if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
    {
        int k = this.selectedMerchantRecipe;

        if (k < 0 || k >= merchantrecipelist.size())
        {
            return;
        }

        MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k);

        if (merchantrecipe.isRecipeDisabled())
        {
            this.mc.getTextureManager().bindTexture(MERCHANT_GUI_TEXTURE);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.disableLighting();
            this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 21, 212, 0, 28, 21);
            this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 51, 212, 0, 28, 21);
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:34,代碼來源:GuiMerchant.java

示例2: drawGuiContainerBackgroundLayer

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的package包/類
/**
 * Draws the background layer of this container (behind the items).
 */
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(MERCHANT_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);
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.player);

    if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
    {
        int k = this.selectedMerchantRecipe;

        if (k < 0 || k >= merchantrecipelist.size())
        {
            return;
        }

        MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k);

        if (merchantrecipe.isRecipeDisabled())
        {
            this.mc.getTextureManager().bindTexture(MERCHANT_GUI_TEXTURE);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.disableLighting();
            this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 21, 212, 0, 28, 21);
            this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 51, 212, 0, 28, 21);
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:34,代碼來源:GuiMerchant.java

示例3: drawGuiContainerBackgroundLayer

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的package包/類
/**
 * Draws the background layer of this container (behind the items).
 */
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(MERCHANT_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);
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

    if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
    {
        int k = this.selectedMerchantRecipe;

        if (k < 0 || k >= merchantrecipelist.size())
        {
            return;
        }

        MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k);

        if (merchantrecipe.isRecipeDisabled())
        {
            this.mc.getTextureManager().bindTexture(MERCHANT_GUI_TEXTURE);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.disableLighting();
            this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 21, 212, 0, 28, 21);
            this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 51, 212, 0, 28, 21);
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:34,代碼來源:GuiMerchant.java

示例4: drawScreen

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的package包/類
/**
 * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    super.drawScreen(mouseX, mouseY, partialTicks);
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

    if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
    {
        int i = (this.width - this.xSize) / 2;
        int j = (this.height - this.ySize) / 2;
        int k = this.selectedMerchantRecipe;
        MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k);
        ItemStack itemstack = merchantrecipe.getItemToBuy();
        ItemStack itemstack1 = merchantrecipe.getSecondItemToBuy();
        ItemStack itemstack2 = merchantrecipe.getItemToSell();
        GlStateManager.pushMatrix();
        RenderHelper.enableGUIStandardItemLighting();
        GlStateManager.disableLighting();
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableColorMaterial();
        GlStateManager.enableLighting();
        this.itemRender.zLevel = 100.0F;
        this.itemRender.renderItemAndEffectIntoGUI(itemstack, i + 36, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack, i + 36, j + 24);

        if (itemstack1 != null)
        {
            this.itemRender.renderItemAndEffectIntoGUI(itemstack1, i + 62, j + 24);
            this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack1, i + 62, j + 24);
        }

        this.itemRender.renderItemAndEffectIntoGUI(itemstack2, i + 120, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack2, i + 120, j + 24);
        this.itemRender.zLevel = 0.0F;
        GlStateManager.disableLighting();

        if (this.isPointInRegion(36, 24, 16, 16, mouseX, mouseY) && itemstack != null)
        {
            this.renderToolTip(itemstack, mouseX, mouseY);
        }
        else if (itemstack1 != null && this.isPointInRegion(62, 24, 16, 16, mouseX, mouseY) && itemstack1 != null)
        {
            this.renderToolTip(itemstack1, mouseX, mouseY);
        }
        else if (itemstack2 != null && this.isPointInRegion(120, 24, 16, 16, mouseX, mouseY) && itemstack2 != null)
        {
            this.renderToolTip(itemstack2, mouseX, mouseY);
        }
        else if (merchantrecipe.isRecipeDisabled() && (this.isPointInRegion(83, 21, 28, 21, mouseX, mouseY) || this.isPointInRegion(83, 51, 28, 21, mouseX, mouseY)))
        {
            this.drawCreativeTabHoveringText(I18n.format("merchant.deprecated", new Object[0]), mouseX, mouseY);
        }

        GlStateManager.popMatrix();
        GlStateManager.enableLighting();
        GlStateManager.enableDepth();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:62,代碼來源:GuiMerchant.java

示例5: drawScreen

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的package包/類
/**
 * Draws the screen and all the components in it.
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    super.drawScreen(mouseX, mouseY, partialTicks);
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.player);

    if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
    {
        int i = (this.width - this.xSize) / 2;
        int j = (this.height - this.ySize) / 2;
        int k = this.selectedMerchantRecipe;
        MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k);
        ItemStack itemstack = merchantrecipe.getItemToBuy();
        ItemStack itemstack1 = merchantrecipe.getSecondItemToBuy();
        ItemStack itemstack2 = merchantrecipe.getItemToSell();
        GlStateManager.pushMatrix();
        RenderHelper.enableGUIStandardItemLighting();
        GlStateManager.disableLighting();
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableColorMaterial();
        GlStateManager.enableLighting();
        this.itemRender.zLevel = 100.0F;
        this.itemRender.renderItemAndEffectIntoGUI(itemstack, i + 36, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack, i + 36, j + 24);

        if (!itemstack1.func_190926_b())
        {
            this.itemRender.renderItemAndEffectIntoGUI(itemstack1, i + 62, j + 24);
            this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack1, i + 62, j + 24);
        }

        this.itemRender.renderItemAndEffectIntoGUI(itemstack2, i + 120, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack2, i + 120, j + 24);
        this.itemRender.zLevel = 0.0F;
        GlStateManager.disableLighting();

        if (this.isPointInRegion(36, 24, 16, 16, mouseX, mouseY) && !itemstack.func_190926_b())
        {
            this.renderToolTip(itemstack, mouseX, mouseY);
        }
        else if (!itemstack1.func_190926_b() && this.isPointInRegion(62, 24, 16, 16, mouseX, mouseY) && !itemstack1.func_190926_b())
        {
            this.renderToolTip(itemstack1, mouseX, mouseY);
        }
        else if (!itemstack2.func_190926_b() && this.isPointInRegion(120, 24, 16, 16, mouseX, mouseY) && !itemstack2.func_190926_b())
        {
            this.renderToolTip(itemstack2, mouseX, mouseY);
        }
        else if (merchantrecipe.isRecipeDisabled() && (this.isPointInRegion(83, 21, 28, 21, mouseX, mouseY) || this.isPointInRegion(83, 51, 28, 21, mouseX, mouseY)))
        {
            this.drawCreativeTabHoveringText(I18n.format("merchant.deprecated", new Object[0]), mouseX, mouseY);
        }

        GlStateManager.popMatrix();
        GlStateManager.enableLighting();
        GlStateManager.enableDepth();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:62,代碼來源:GuiMerchant.java

示例6: drawScreen

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的package包/類
/**
 * Draws the screen and all the components in it.
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    super.drawScreen(mouseX, mouseY, partialTicks);
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

    if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
    {
        int i = (this.width - this.xSize) / 2;
        int j = (this.height - this.ySize) / 2;
        int k = this.selectedMerchantRecipe;
        MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k);
        ItemStack itemstack = merchantrecipe.getItemToBuy();
        ItemStack itemstack1 = merchantrecipe.getSecondItemToBuy();
        ItemStack itemstack2 = merchantrecipe.getItemToSell();
        GlStateManager.pushMatrix();
        RenderHelper.enableGUIStandardItemLighting();
        GlStateManager.disableLighting();
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableColorMaterial();
        GlStateManager.enableLighting();
        this.itemRender.zLevel = 100.0F;
        this.itemRender.renderItemAndEffectIntoGUI(itemstack, i + 36, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack, i + 36, j + 24);

        if (itemstack1 != null)
        {
            this.itemRender.renderItemAndEffectIntoGUI(itemstack1, i + 62, j + 24);
            this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack1, i + 62, j + 24);
        }

        this.itemRender.renderItemAndEffectIntoGUI(itemstack2, i + 120, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack2, i + 120, j + 24);
        this.itemRender.zLevel = 0.0F;
        GlStateManager.disableLighting();

        if (this.isPointInRegion(36, 24, 16, 16, mouseX, mouseY) && itemstack != null)
        {
            this.renderToolTip(itemstack, mouseX, mouseY);
        }
        else if (itemstack1 != null && this.isPointInRegion(62, 24, 16, 16, mouseX, mouseY) && itemstack1 != null)
        {
            this.renderToolTip(itemstack1, mouseX, mouseY);
        }
        else if (itemstack2 != null && this.isPointInRegion(120, 24, 16, 16, mouseX, mouseY) && itemstack2 != null)
        {
            this.renderToolTip(itemstack2, mouseX, mouseY);
        }
        else if (merchantrecipe.isRecipeDisabled() && (this.isPointInRegion(83, 21, 28, 21, mouseX, mouseY) || this.isPointInRegion(83, 51, 28, 21, mouseX, mouseY)))
        {
            this.drawCreativeTabHoveringText(I18n.format("merchant.deprecated", new Object[0]), mouseX, mouseY);
        }

        GlStateManager.popMatrix();
        GlStateManager.enableLighting();
        GlStateManager.enableDepth();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:62,代碼來源:GuiMerchant.java


注:本文中的net.minecraft.village.MerchantRecipeList.isEmpty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。