@Override public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { recipeList.add(new MerchantRecipe(in, out)); } }
public void addBuyItemStack(MerchantRecipeList recipeList, Random random, ItemStack stack, float chance, int price, int variation) { if (random.nextFloat() < chance) { MerchantRecipe recipe = new MerchantRecipe(stack, null, new ItemStack(Items.EMERALD, price + random.nextInt(variation))); recipeList.add(recipe); } }
public void addSellItemStack(MerchantRecipeList recipeList, Random random, ItemStack stack, float chance, int price, int variation) { if (random.nextFloat() < chance) { MerchantRecipe recipe = new MerchantRecipe(new ItemStack(Items.EMERALD, price + random.nextInt(variation)), null, stack); recipeList.add(recipe); } } }
/** * Add a recipe to SELL something for emeralds */ private void addRecipe(MerchantRecipeList list, ItemStack stack, int emeralds, Random rnd, float prop) { if (rnd.nextFloat() < prop) { list.add(new MerchantRecipe(new ItemStack(Items.EMERALD, emeralds), stack)); } }
/** * Add a recipe to BUY something for emeralds */ private void addRecipe(MerchantRecipeList list, int emeralds, ItemStack stack, Random rnd, float prop) { if (rnd.nextFloat() < prop) { list.add(new MerchantRecipe(new ItemStack(Items.EMERALD, emeralds), stack)); } }
public void addSellPart(MerchantRecipeList recipeList, Random random, int part, float chance, int price, int variation) { if (random.nextFloat() < chance) { MerchantRecipe recipe = new MerchantRecipe(new ItemStack(Items.EMERALD, price + random.nextInt(variation)), null, new ItemStack(MatterOverdrive.ITEMS.androidParts, 1, part)); recipeList.add(recipe); } }
public void addBuyPart(MerchantRecipeList recipeList, Random random, int part, float chance, int price, int variation) { if (random.nextFloat() < chance) { MerchantRecipe recipe = new MerchantRecipe(new ItemStack(MatterOverdrive.ITEMS.androidParts, 1, part), null, new ItemStack(Items.EMERALD, price + random.nextInt(variation))); recipeList.add(recipe); } }
@Override public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { int actualPrice = 1; if (priceInfo != null) { actualPrice = priceInfo.getPrice(random); } ItemStack stackToPay = new ItemStack(Items.EMERALD, actualPrice, 0); recipeList.add(new MerchantRecipe(stackToPay, stack)); // DEBUG System.out.println("Merchant recipe list = "+recipeList.getRecipiesAsTags()); } }
@Override public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { int i = 1; if (this.price != null) { i = this.price.getPrice(random); } recipeList.add(new MerchantRecipe(new ItemStack(this.buyingItem, i, 0), ModItems.sapphireGem)); } }
/** * Affects the given MerchantRecipeList to possibly add or remove MerchantRecipes. */ @Override public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { int buyAmount = 1; if (this.price != null) { buyAmount = this.price.getPrice(random); } ItemStack itemToBuy = this.buyingItem.copy(); itemToBuy.setCount(buyAmount); recipeList.add(new MerchantRecipe(itemToBuy, Items.EMERALD)); } }
private void addDefaultEquipmentAndRecipies(int maxRecipesToAdd) { MerchantRecipeList rec = new MerchantRecipeList(); addRecipies(rec); if (buyingList == null) { buyingList = new MerchantRecipeList(); } for (int i = 0; i < maxRecipesToAdd && i < rec.size(); ++i) { buyingList.add(rec.get(i)); } }
@Override public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { int emeraldCount = random.nextInt(maxEmeralds - minEmeralds) + minEmeralds; recipeList.add(new MerchantRecipe(new ItemStack(Items.LEATHER, leatherCount), new ItemStack(Items.EMERALD, emeraldCount), new ItemStack(backpack))); } }
@Override public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { int i = 1; if (this.sellInfo != null) { i = this.sellInfo.getPrice(random); } int j = 1; if (this.emeraldPriceInfo != null) { j = this.emeraldPriceInfo.getPrice(random); } ItemStack sellStack = this.itemToSell.copy(); sellStack.setCount(i); ItemStack emeralds = new ItemStack(Items.EMERALD, j); recipeList.add(new MerchantRecipe(emeralds, sellStack)); } }
@Override public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random){ ItemStack in = this.input.copy(); in.setCount(this.inputAmount.getPrice(random)); ItemStack out = this.output.copy(); out.setCount(this.outputAmount.getPrice(random)); recipeList.add(new MerchantRecipe(in, out)); } }
@Override public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { int price = this.buying.getPrice(random); int count = this.selling.getPrice(random); ItemStack selling = sellingStacks[random.nextInt(sellingStacks.length)].copy(); selling.setCount(count); ItemStack first = new ItemStack(ModItems.soul_orb_vampire, price); ItemStack second = ItemStack.EMPTY; if (price > 64) { second = new ItemStack(ModItems.soul_orb_vampire, price - 64); first.setCount(price - second.getCount()); } recipeList.add(new MerchantRecipe(first, second, selling)); } }
private void unlock(IMerchant merchant, MerchantRecipeList recipeList, Random random, TradeInfo info) { int i = random.nextInt(info.maxPrice - info.minPrice + 1) + info.minPrice; World world = merchant.getWorld(); ItemStack itemstack = createMap(merchant.getWorld(), merchant.getPos(), info); if(itemstack.isEmpty()) return; MerchantRecipe recipe = new MerchantRecipe(new ItemStack(Items.EMERALD, i), new ItemStack(Items.COMPASS), itemstack, 0, 1); recipeList.add(recipe); } }
@Override public void addMerchantRecipe(IMerchant p_190888_1_, MerchantRecipeList recipeList, Random random) { int i = 1; if (this.sellInfo != null) { i = this.sellInfo.getPrice(random); } int j = 1; if (this.emeraldPriceInfo != null) { j = this.emeraldPriceInfo.getPrice(random); } EnumForestryWoodType woodType = EnumForestryWoodType.getRandom(random); ItemStack sellStack = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.LOG, false); sellStack.setCount(i); ItemStack emeralds = new ItemStack(Items.EMERALD, j); recipeList.add(new MerchantRecipe(emeralds, sellStack)); } }
@Override public void addMerchantRecipe(IMerchant p_190888_1_, MerchantRecipeList recipeList, Random random) { int i = 1; if (this.sellInfo != null) { i = this.sellInfo.getPrice(random); } int j = 1; if (this.emeraldPriceInfo != null) { j = this.emeraldPriceInfo.getPrice(random); } EnumForestryWoodType woodType = EnumForestryWoodType.getRandom(random); ItemStack sellStack = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.PLANKS, false); sellStack.setCount(i); ItemStack emeralds = new ItemStack(Items.EMERALD, j); recipeList.add(new MerchantRecipe(emeralds, sellStack)); } }
@Override public void addMerchantRecipe (IMerchant merchant, MerchantRecipeList recipeList, Random random) { final ItemStack buy = this.buyFirst.copy(); buy.setCount(this.priceFirst.getPrice(random)); final ItemStack buy2 = this.buySecond.copy(); buy2.setCount(this.priceSecond.getPrice(random)); final ItemStack output = this.product.copy(); output.setCount(this.amount.getPrice(random)); recipeList.add(new MerchantRecipe(buy, buy2, output)); } }
public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { int i = firstPrice.getPrice(random); int j = secondPrice.getPrice(random); recipeList.add(new MerchantRecipe(new ItemStack(first.getItem(), i, first.getItemDamage()), new ItemStack(second.getItem(), j, second.getItemDamage()))); } }