Examples of MerchantRecipe


Examples of net.minecraft.server.v1_7_R1.MerchantRecipe

  public void removeOffer(TradeOffer inOffer)
  {
    Iterator it = this.m_recipeList.iterator();
    while(it.hasNext())
    {
      MerchantRecipe recipe = (MerchantRecipe)it.next();
      if(isSameOffer(inOffer, recipe))
        it.remove();
    }
    this.m_offerings.remove(inOffer);
  }
View Full Code Here

Examples of net.minecraft.server.v1_7_R1.MerchantRecipe

    while(it.hasNext())
    {
      TradeOffer next = it.next();
      if(next.getCost().equals(inForItem))
      {
        MerchantRecipe recipe = this.getRecipeFromOffer(next);
        this.m_recipeList.remove(recipe);
        it.remove();
      }
    }
  }
View Full Code Here

Examples of net.minecraft.server.v1_7_R1.MerchantRecipe

  public MerchantRecipe getRecipeFromOffer(TradeOffer inOffer)
  {
    for(Object o : this.m_recipeList)
    {
      MerchantRecipe recipe = (MerchantRecipe)o;
      if(isSameOffer(inOffer, recipe))
        return recipe;
    }

    return null;
View Full Code Here

Examples of net.minecraft.server.v1_7_R1.MerchantRecipe

  private void populateRecipeList()
  {
    this.m_recipeList = new MerchantRecipeList();
    for(TradeOffer offer : this.m_offerings)
    {
      MerchantRecipe recipe = new MerchantRecipe(CraftItemStack.asNMSCopy(offer.getCost()), (offer.getSecondCost() != null ? CraftItemStack.asNMSCopy(offer.getSecondCost()) : null), CraftItemStack.asNMSCopy(offer.getResult()));
      recipe.a(-7); //reset to 0
      if(offer.getRemainingUses() == -1)
        recipe.a(2);
      else
        recipe.a(offer.getRemainingUses());

      this.m_recipeList.a(recipe);
    }
  }
View Full Code Here

Examples of net.minecraft.village.MerchantRecipe

{
  @SuppressWarnings("unchecked")
  @Override
  public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random)
  {
    recipeList.add(new MerchantRecipe(new ItemStack(Item.emerald, 1), new ItemStack(MineFactoryReloadedCore.safariNetSingleItem)));
    recipeList.add(new MerchantRecipe(new ItemStack(Item.emerald, 3), new ItemStack(MineFactoryReloadedCore.safariNetItem)));
   
    recipeList.add(new MerchantRecipe(new ItemStack(Item.emerald, 1), new ItemStack(MineFactoryReloadedCore.safariNetSingleItem), getHiddenNetStack()));
   
    recipeList.add(new MerchantRecipe(new ItemStack(Item.emerald, 1), new ItemStack(Block.sapling, 8, 0), new ItemStack(MineFactoryReloadedCore.rubberSaplingBlock, 8, 0)));
  }
View Full Code Here

Examples of net.minecraft.village.MerchantRecipe

public class VillageHandlerArboriculture implements IVillageTradeHandler {

  @SuppressWarnings("unchecked")
  @Override
  public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
    recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 8), PluginArboriculture.treeInterface.getMemberStack(
        PluginArboriculture.treeInterface.getTree(villager.worldObj,
            PluginArboriculture.treeInterface.templateAsGenome(PluginArboriculture.treeInterface.getRandomTemplate(random))),
            EnumGermlingType.SAPLING.ordinal())));

    recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 2), ForestryItem.grafterProven.getItemStack()));

    WoodType sells = WoodType.VALUES[random.nextInt(WoodType.VALUES.length)];
    Block plankBlock;
    int meta;
    if(!sells.hasPlank) {
      plankBlock = ForestryBlock.planks1.block();
      meta = 0;
    } else if(sells.ordinal() > 15) {
      plankBlock = ForestryBlock.planks2.block();
      meta = sells.ordinal() - 16;
    } else {
      plankBlock = ForestryBlock.planks1.block();
      meta = sells.ordinal();
    }

    recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 1), new ItemStack(plankBlock, 32, meta)));
  }
View Full Code Here

Examples of net.minecraft.village.MerchantRecipe

  }

  @SuppressWarnings("unchecked")
  @Override
  public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
    recipeList.add(new MerchantRecipe(ForestryItem.beePrincessGE.getItemStack(1, Defaults.WILDCARD), new ItemStack(Items.emerald, 1)));
    recipeList.add(new MerchantRecipe(new ItemStack(Items.wheat, 2), ItemHoneycomb.getRandomComb(1, random, false)));
    recipeList.add(new MerchantRecipe(new ItemStack(Blocks.log, 24, Defaults.WILDCARD), ForestryBlock.apiculture.getItemStack(1, Defaults.DEFINITION_APIARY_META)));
    recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 1), ForestryItem.frameProven.getItemStack(6)));
    recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 12), ForestryItem.beePrincessGE.getItemStack(1, Defaults.WILDCARD),
        PluginApiculture.beeInterface.getMemberStack(
            PluginApiculture.beeInterface.getBee(villager.worldObj, PluginApiculture.beeInterface.templateAsGenome(BeeTemplates.getMonasticTemplate())),
            EnumBeeType.DRONE.ordinal())));
  }
View Full Code Here

Examples of net.minecraft.village.MerchantRecipe

    if ( a.stackSize > a.getMaxStackSize() )
      a.stackSize = a.getMaxStackSize();
    if ( b.stackSize > b.getMaxStackSize() )
      b.stackSize = b.getMaxStackSize();

    l.add( new MerchantRecipe( a, b ) );
  }
View Full Code Here

Examples of net.minecraft.village.MerchantRecipe

            ItemStack sellStack = prepareStack(rand, sale);
            ItemStack buyStack1 = prepareStack(rand, offers[0]);
            ItemStack buyStack2 = null;
            if (offers.length >= 2)
                buyStack2 = prepareStack(rand, offers[1]);
            recipeList.add(new MerchantRecipe(buyStack1, buyStack2, sellStack));
        }
    }
View Full Code Here

Examples of net.minecraft.village.MerchantRecipe

    public void nextTrade(int tradeSet) {
        EntityVillager villager = new EntityVillager(worldObj);
        villager.setProfession(profession);
        MerchantRecipeList recipes = villager.getRecipes(null);
        MerchantRecipe recipe = (MerchantRecipe) recipes.get(MiscTools.RANDOM.nextInt(recipes.size()));
        recipeSlots.setInventorySlotContents(tradeSet * 3 + 0, recipe.getItemToBuy());
        recipeSlots.setInventorySlotContents(tradeSet * 3 + 1, recipe.getSecondItemToBuy());
        recipeSlots.setInventorySlotContents(tradeSet * 3 + 2, recipe.getItemToSell());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.