本文整理匯總了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;
}
}
示例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));
}
}
示例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);
}
}
}
示例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;
}
}
示例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));
}
}
示例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);
}
}
}
示例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));
}
}
示例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);
}
}
}