当前位置: 首页>>代码示例>>Java>>正文


Java MerchantRecipe.isRecipeDisabled方法代码示例

本文整理汇总了Java中net.minecraft.village.MerchantRecipe.isRecipeDisabled方法的典型用法代码示例。如果您正苦于以下问题:Java MerchantRecipe.isRecipeDisabled方法的具体用法?Java MerchantRecipe.isRecipeDisabled怎么用?Java MerchantRecipe.isRecipeDisabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.village.MerchantRecipe的用法示例。


在下文中一共展示了MerchantRecipe.isRecipeDisabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_146976_a

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(field_147038_v);
    int var4 = (this.width - this.field_146999_f) / 2;
    int var5 = (this.height - this.field_147000_g) / 2;
    this.drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g);
    MerchantRecipeList var6 = this.field_147037_w.getRecipes(this.mc.thePlayer);

    if (var6 != null && !var6.isEmpty())
    {
        int var7 = this.field_147041_z;
        MerchantRecipe var8 = (MerchantRecipe)var6.get(var7);

        if (var8.isRecipeDisabled())
        {
            this.mc.getTextureManager().bindTexture(field_147038_v);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glDisable(GL11.GL_LIGHTING);
            this.drawTexturedModalRect(this.field_147003_i + 83, this.field_147009_r + 21, 212, 0, 28, 21);
            this.drawTexturedModalRect(this.field_147003_i + 83, this.field_147009_r + 51, 212, 0, 28, 21);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:25,代码来源:GuiMerchant.java

示例2: drawGuiContainerBackgroundLayer

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(field_147038_v);
    int k = (this.width - this.xSize) / 2;
    int l = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
    MerchantRecipeList merchantrecipelist = this.field_147037_w.getRecipes(this.mc.thePlayer);

    if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
    {
        int i1 = this.field_147041_z;
        MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(i1);

        if (merchantrecipe.isRecipeDisabled())
        {
            this.mc.getTextureManager().bindTexture(field_147038_v);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glDisable(GL11.GL_LIGHTING);
            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:xtrafrancyz,项目名称:Cauldron,代码行数:25,代码来源:GuiMerchant.java

示例3: drawGuiContainerBackgroundLayer

import net.minecraft.village.MerchantRecipe; //导入方法依赖的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: drawGuiContainerBackgroundLayer

import net.minecraft.village.MerchantRecipe; //导入方法依赖的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

示例5: drawGuiContainerBackgroundLayer

import net.minecraft.village.MerchantRecipe; //导入方法依赖的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

示例6: updateAITasks

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
protected void updateAITasks() {
    if (!this.isTrading() && this.timeUntilReset > 0) {
        --this.timeUntilReset;

        if (this.timeUntilReset <= 0) {
            if (this.needsInitilization) {
                AOTA.logDebug("Initializing Tradeable entity " + hashCode());
                for (MerchantRecipe merchantrecipe : this.buyingList) {
                    if (merchantrecipe.isRecipeDisabled()) {
                        merchantrecipe.increaseMaxTradeUses(this.rand.nextInt(6) + this.rand.nextInt(6) + 2);
                    }
                }

                this.populateBuyingList();
                this.needsInitilization = false;

                if (this.lastBuyingPlayer != null) {
                    this.world.setEntityState(this, (byte) 14);
                }
            }

            this.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 200, 0));
        }
    }

    super.updateAITasks();
}
 
开发者ID:CountGrimhart,项目名称:Count-Armours,代码行数:29,代码来源:EntityTradeable.java

示例7: drawGuiContainerBackgroundLayer

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
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 = 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:CountGrimhart,项目名称:Count-Armours,代码行数:28,代码来源:GuiTrading.java

示例8: onEntityInteractEvent

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@SubscribeEvent
public void onEntityInteractEvent(EntityInteract event) {
  if (event.getEntity() instanceof EntityPlayer == false) {
    return;
  }
  EntityPlayer player = (EntityPlayer) event.getEntity();
  //    ItemStack held = player.getHeldItemMainhand();
  ItemStack itemstack = event.getItemStack();
  if (itemstack != null && itemstack.getItem() instanceof ItemAppleEmerald && itemstack.getCount() > 0) {
    if (event.getTarget() instanceof EntityVillager) {
      EntityVillager villager = ((EntityVillager) event.getTarget());
      int count = 0;
      for (MerchantRecipe merchantrecipe : villager.getRecipes(player)) {
        if (merchantrecipe.isRecipeDisabled()) {
          //vanilla code as of 1.9.4 odes this (2d6+2) 
          merchantrecipe.increaseMaxTradeUses(villager.getEntityWorld().rand.nextInt(6) + villager.getEntityWorld().rand.nextInt(6) + 2);
          count++;
        }
      }
      if (count > 0) {
        UtilChat.addChatMessage(player, UtilChat.lang("item.apple_emerald.merchant") + count);
        consumeSelf(itemstack);
      }
      event.setCanceled(true);// stop the GUI inventory opening && horse mounting
    }
  }
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:28,代码来源:ItemAppleEmerald.java

示例9: drawButton

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float p) {
  super.drawButton(mc, mouseX, mouseY, p);
  if (this.visible) {
    MerchantRecipeList merchantrecipelist = parent.getContainer().getTrades();
    if (merchantrecipelist == null) {
      return;
    }
    if (recipeIndex >= merchantrecipelist.size()) {
      //in 1.11.2 the draw cycles happen before the recipe list is finished syncing from server, so we get index OOB errors
      //just keep it hidden if we have and index for a recipe that is valid but not in the current list.  
      // see https://github.com/PrinceOfAmber/Cyclic/issues/324
      this.visible = false;
      return;//wait until its done loading until next draw
    }
    this.visible = true;
    MerchantRecipe r = merchantrecipelist.get(recipeIndex);
    if (r == null) {
      return;
    }
    int x = this.x + 2;
    int y = this.y + 1;
    GlStateManager.pushMatrix();
    ModCyclic.proxy.renderItemOnGui(r.getItemToBuy(), parent.itemRender, parent.fontRenderer, x, y);
    x += spacing;
    ModCyclic.proxy.renderItemOnGui(r.getSecondItemToBuy(), parent.itemRender, parent.fontRenderer, x, y);
    x += spacing;
    ModCyclic.proxy.renderItemOnGui(r.getItemToSell(), parent.itemRender, parent.fontRenderer, x, y);
    GlStateManager.popMatrix();
    RenderHelper.enableGUIStandardItemLighting();//IMPORTANT: without this, any button with transparent item (glass) well have messed up shading
    if (r.isRecipeDisabled()) {
      parent.mc.getTextureManager().bindTexture(TRADE_REDX);
      GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
      GlStateManager.disableLighting();
      int sizeOfX = 30 / 2;//real physical texture is 30x30 pixels, and we just reduce it a touch
      Gui.drawModalRectWithCustomSizedTexture(x - 18, y + 1, 0, 0, sizeOfX, sizeOfX,
          sizeOfX, sizeOfX);
    }
  }
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:41,代码来源:GuiMerchantBetter.java

示例10: getTooltips

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
public List<String> getTooltips() {
  List<String> tt = new ArrayList<String>();
  MerchantRecipeList merchantrecipelist = parent.getContainer().getTrades();
  if (merchantrecipelist == null) {
    return tt;
  }
  MerchantRecipe r = merchantrecipelist.get(recipeIndex);
  if (r == null) {
    return tt;
  }
  if (r.isRecipeDisabled()) {
    tt.add(UtilChat.lang("merchant.deprecated"));
  }
  else {
    tt.add(UtilChat.lang("tile.tool_trade.button.tooltip"));
  }
  if (r.getItemToSell() != null) {// && r.getItemToSell().getItem() == Items.ENCHANTED_BOOK
    Map<Enchantment, Integer> map = EnchantmentHelper.getEnchantments(r.getItemToSell());
    if (map != null) {
      for (Map.Entry<Enchantment, Integer> entry : map.entrySet()) {
        tt.add(entry.getKey().getTranslatedName(entry.getValue()));
      }
    }
  }
  return tt;
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:28,代码来源:GuiMerchantBetter.java

示例11: resetRecipeAndSlots

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void resetRecipeAndSlots() {
  this.currentRecipe = null;
  ItemStack itemstack = this.inv.get(0);
  ItemStack itemstack1 = this.inv.get(1);
  if (itemstack.isEmpty()) {
    itemstack = itemstack1;
    itemstack1 = ItemStack.EMPTY;
  }
  if (itemstack.isEmpty()) {
    this.setInventorySlotContents(2, ItemStack.EMPTY);
  }
  else {
    MerchantRecipeList merchantrecipelist = this.getRecipes();
    if (merchantrecipelist != null) {
      MerchantRecipe merchantrecipe = merchantrecipelist.canRecipeBeUsed(itemstack, itemstack1, this.currentRecipeIndex);
      if (merchantrecipe != null && !merchantrecipe.isRecipeDisabled()) {
        this.currentRecipe = merchantrecipe;
        this.setInventorySlotContents(2, merchantrecipe.getItemToSell().copy());
      }
      else if (!itemstack1.isEmpty()) {
        merchantrecipe = merchantrecipelist.canRecipeBeUsed(itemstack1, itemstack, this.currentRecipeIndex);
        if (merchantrecipe != null && !merchantrecipe.isRecipeDisabled()) {
          this.currentRecipe = merchantrecipe;
          this.setInventorySlotContents(2, merchantrecipe.getItemToSell().copy());
        }
        else {
          this.setInventorySlotContents(2, ItemStack.EMPTY);
        }
      }
      else {
        this.setInventorySlotContents(2, ItemStack.EMPTY);
      }
    }
  }
  this.theMerchant.verifySellingItem(this.getStackInSlot(2));
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:37,代码来源:InventoryMerchantBetter.java

示例12: updateAITasks

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
@SuppressWarnings("rawtypes")
protected void updateAITasks() {

	if (!isTrading() && timeUntilReset > 0)
	{
		--timeUntilReset;

		if (timeUntilReset <= 0)
		{
			if (needsInitilization)
			{
				if (tradingList.size() > 1)
				{
					Iterator iterator = tradingList.iterator();

					while (iterator.hasNext())
					{
						MerchantRecipe merchantrecipe = (MerchantRecipe)iterator.next();

						if (merchantrecipe.isRecipeDisabled())
							merchantrecipe.increaseMaxTradeUses(rand.nextInt(6) + rand.nextInt(6) + 2);
					}
				}

				addDefaultEquipmentAndRecipies(1);
				needsInitilization = false;
			}

			addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 200, 0));
		}
	}

	super.updateAITasks();
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:36,代码来源:EntityRemnant.java

示例13: refreshTradingList

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
protected void refreshTradingList() {
	for (ListIterator<MerchantRecipe> iterator = trades.listIterator(); iterator.hasNext();) {
		MerchantRecipe trade = iterator.next();
		// replace bomb trades so he can't ever become sold out
		if (isBombTrade(trade) && trade.getToolUses() > 49) {
			iterator.set(getRefreshedBombTrade(trade));
		} else if (trade.isRecipeDisabled()) {
			trade.increaseMaxTradeUses(rand.nextInt(6) + rand.nextInt(6) + 2);
		}
	}
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:13,代码来源:EntityNpcBarnes.java

示例14: refreshTradingList

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
/**
 * Called each time the trading list is refreshed. The default implementation
 * increases the max trade uses of any disabled recipes, just as vanilla does.
 */
protected void refreshTradingList() {
	for (Iterator<MerchantRecipe> iterator = trades.iterator(); iterator.hasNext();) {
		MerchantRecipe trade = iterator.next();
		if (trade.isRecipeDisabled()) {
			trade.increaseMaxTradeUses(rand.nextInt(6) + rand.nextInt(6) + 2);
		}
	}
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:13,代码来源:EntityNpcMerchantBase.java

示例15: resetRecipeAndSlots

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void resetRecipeAndSlots()
{
    this.currentRecipe = null;
    ItemStack itemstack = this.theInventory[0];
    ItemStack itemstack1 = this.theInventory[1];

    if (itemstack == null)
    {
        itemstack = itemstack1;
        itemstack1 = null;
    }

    if (itemstack == null)
    {
        this.setInventorySlotContents(2, (ItemStack)null);
    }
    else
    {
        MerchantRecipeList merchantrecipelist = this.theMerchant.getRecipes(this.thePlayer);

        if (merchantrecipelist != null)
        {
            MerchantRecipe merchantrecipe = merchantrecipelist.canRecipeBeUsed(itemstack, itemstack1, this.currentRecipeIndex);

            if (merchantrecipe != null && !merchantrecipe.isRecipeDisabled())
            {
                this.currentRecipe = merchantrecipe;
                this.setInventorySlotContents(2, merchantrecipe.getItemToSell().copy());
            }
            else if (itemstack1 != null)
            {
                merchantrecipe = merchantrecipelist.canRecipeBeUsed(itemstack1, itemstack, this.currentRecipeIndex);

                if (merchantrecipe != null && !merchantrecipe.isRecipeDisabled())
                {
                    this.currentRecipe = merchantrecipe;
                    this.setInventorySlotContents(2, merchantrecipe.getItemToSell().copy());
                }
                else
                {
                    this.setInventorySlotContents(2, (ItemStack)null);
                }
            }
            else
            {
                this.setInventorySlotContents(2, (ItemStack)null);
            }
        }
    }

    this.theMerchant.verifySellingItem(this.getStackInSlot(2));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:53,代码来源:InventoryMerchant.java


注:本文中的net.minecraft.village.MerchantRecipe.isRecipeDisabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。