Package net.minecraft.village

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


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

  }

  @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

    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

            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

    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

        PneumaticCraft.proxy.registerVillagerSkins();
    }

    @Override
    public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random rand){
        recipeList.addToListWithCheck(new MerchantRecipe(new ItemStack(net.minecraft.init.Items.emerald, 10 + rand.nextInt(10)), null, new ItemStack(Itemss.PCBBlueprint)));
        for(int i = 0; i < ItemAssemblyProgram.PROGRAMS_AMOUNT; i++) {
            recipeList.addToListWithCheck(new MerchantRecipe(new ItemStack(net.minecraft.init.Items.emerald, rand.nextInt(5) + 7), null, new ItemStack(Itemss.assemblyProgram, 1, i)));
        }
        recipeList.addToListWithCheck(new MerchantRecipe(new ItemStack(net.minecraft.init.Items.emerald, rand.nextInt(5) + 1), null, new ItemStack(Itemss.nukeVirus)));
        recipeList.addToListWithCheck(new MerchantRecipe(new ItemStack(net.minecraft.init.Items.emerald, rand.nextInt(5) + 1), null, new ItemStack(Itemss.stopWorm)));
    }
View Full Code Here

TOP

Related Classes of net.minecraft.village.MerchantRecipe

Copyright © 2018 www.massapicom. 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.