Examples of MerchantRecipeList


Examples of net.minecraft.server.v1_7_R1.MerchantRecipeList

    return ReflectionUtil.getParameterDataForClass(this).toArray(new ParameterData[0]);
  }

  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)
View Full Code Here

Examples of net.minecraft.village.MerchantRecipeList

        this.wealth = par1NBTTagCompound.getInteger("Riches");

        if (par1NBTTagCompound.hasKey("Offers"))
        {
            final NBTTagCompound nbttagcompound1 = par1NBTTagCompound.getCompoundTag("Offers");
            this.buyingList = new MerchantRecipeList(nbttagcompound1);
        }
    }
View Full Code Here

Examples of net.minecraft.village.MerchantRecipeList

    private boolean attemptTrade(List<EntityVillager> villagers, int tradeSet) {
        ItemStack buy1 = recipeSlots.getStackInSlot(tradeSet * 3 + 0);
        ItemStack buy2 = recipeSlots.getStackInSlot(tradeSet * 3 + 1);
        ItemStack sell = recipeSlots.getStackInSlot(tradeSet * 3 + 2);
        for (EntityVillager villager : villagers) {
            MerchantRecipeList recipes = villager.getRecipes(null);
            for (MerchantRecipe recipe : (List<MerchantRecipe>) recipes) {
                if (recipe.isRecipeDisabled())
                    continue;
                if (recipe.getItemToBuy() != null && !InvTools.isItemLessThanOrEqualTo(recipe.getItemToBuy(), buy1))
                    continue;
View Full Code Here

Examples of net.minecraft.village.MerchantRecipeList

    }

    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.