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


Java MerchantRecipeList.size方法代碼示例

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


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

示例1: updateScreen

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的package包/類
/**
 * Called from the main game loop to update the screen.
 */
public void updateScreen()
{
    super.updateScreen();
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

    if (merchantrecipelist != null)
    {
        this.nextButton.enabled = this.selectedMerchantRecipe < merchantrecipelist.size() - 1;
        this.previousButton.enabled = this.selectedMerchantRecipe > 0;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:15,代碼來源:GuiMerchant.java

示例2: actionPerformed

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的package包/類
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    boolean flag = false;

    if (button == this.nextButton)
    {
        ++this.selectedMerchantRecipe;
        MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

        if (merchantrecipelist != null && this.selectedMerchantRecipe >= merchantrecipelist.size())
        {
            this.selectedMerchantRecipe = merchantrecipelist.size() - 1;
        }

        flag = true;
    }
    else if (button == this.previousButton)
    {
        --this.selectedMerchantRecipe;

        if (this.selectedMerchantRecipe < 0)
        {
            this.selectedMerchantRecipe = 0;
        }

        flag = true;
    }

    if (flag)
    {
        ((ContainerMerchant)this.inventorySlots).setCurrentRecipeIndex(this.selectedMerchantRecipe);
        PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
        packetbuffer.writeInt(this.selectedMerchantRecipe);
        this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload("MC|TrSel", packetbuffer));
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:40,代碼來源:GuiMerchant.java

示例3: 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

示例4: updateScreen

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的package包/類
/**
 * Called from the main game loop to update the screen.
 */
public void updateScreen()
{
    super.updateScreen();
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.player);

    if (merchantrecipelist != null)
    {
        this.nextButton.enabled = this.selectedMerchantRecipe < merchantrecipelist.size() - 1;
        this.previousButton.enabled = this.selectedMerchantRecipe > 0;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:15,代碼來源:GuiMerchant.java

示例5: actionPerformed

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的package包/類
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    boolean flag = false;

    if (button == this.nextButton)
    {
        ++this.selectedMerchantRecipe;
        MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.player);

        if (merchantrecipelist != null && this.selectedMerchantRecipe >= merchantrecipelist.size())
        {
            this.selectedMerchantRecipe = merchantrecipelist.size() - 1;
        }

        flag = true;
    }
    else if (button == this.previousButton)
    {
        --this.selectedMerchantRecipe;

        if (this.selectedMerchantRecipe < 0)
        {
            this.selectedMerchantRecipe = 0;
        }

        flag = true;
    }

    if (flag)
    {
        ((ContainerMerchant)this.inventorySlots).setCurrentRecipeIndex(this.selectedMerchantRecipe);
        PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
        packetbuffer.writeInt(this.selectedMerchantRecipe);
        this.mc.getConnection().sendPacket(new CPacketCustomPayload("MC|TrSel", packetbuffer));
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:40,代碼來源:GuiMerchant.java

示例6: 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

示例7: actionPerformed

import net.minecraft.village.MerchantRecipeList; //導入方法依賴的package包/類
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    boolean flag = false;

    if (button == this.nextButton)
    {
        ++this.selectedMerchantRecipe;
        MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

        if (merchantrecipelist != null && this.selectedMerchantRecipe >= merchantrecipelist.size())
        {
            this.selectedMerchantRecipe = merchantrecipelist.size() - 1;
        }

        flag = true;
    }
    else if (button == this.previousButton)
    {
        --this.selectedMerchantRecipe;

        if (this.selectedMerchantRecipe < 0)
        {
            this.selectedMerchantRecipe = 0;
        }

        flag = true;
    }

    if (flag)
    {
        ((ContainerMerchant)this.inventorySlots).setCurrentRecipeIndex(this.selectedMerchantRecipe);
        PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
        packetbuffer.writeInt(this.selectedMerchantRecipe);
        this.mc.getConnection().sendPacket(new CPacketCustomPayload("MC|TrSel", packetbuffer));
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:40,代碼來源:GuiMerchant.java

示例8: 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


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