@Override public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { recipeList.add(new MerchantRecipe(in, out)); } }
@Override public BlockPos getCenter() { return village.getCenter(); }
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)); } }
if(!pstack.isEmpty() && recipes != null) for(MerchantRecipe recipe : recipes) if(recipe != null && !recipe.isRecipeDisabled() && (equalStacks(pstack, recipe.getItemToBuy()) || equalStacks(pstack, recipe.getItemToSell()))) { entIdBuilder.add(villager.getEntityId()); break;
private VillageDoorInfo findNearestDoor(Village villageIn) { VillageDoorInfo villagedoorinfo = null; int i = Integer.MAX_VALUE; for (VillageDoorInfo villagedoorinfo1 : villageIn.getVillageDoorInfoList()) { int j = villagedoorinfo1.getDistanceSquared(MathHelper.floor(this.theEntity.posX), MathHelper.floor(this.theEntity.posY), MathHelper.floor(this.theEntity.posZ)); if (j < i && !this.doesDoorListContain(villagedoorinfo1)) { villagedoorinfo = villagedoorinfo1; i = j; } } return villagedoorinfo; }
public static VampirismVillage get(Village v) { return (VampirismVillage) v.getCapability(CAP, null); }
/** * Resets the task */ public void resetTask() { this.insidePosX = this.doorInfo.getInsideBlockPos().getX(); this.insidePosZ = this.doorInfo.getInsideBlockPos().getZ(); this.doorInfo = null; }
/** * 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)); } }
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); } }
/** * 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 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); } } }
@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)); } }
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 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){ 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) { 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()))); } }