@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)); } }
public Materials(Random random) { IWoodType woodType; boolean fireproof; if (ModuleHelper.isEnabled(ForestryModuleUids.ARBORICULTURE)) { woodType = EnumForestryWoodType.getRandom(random); fireproof = random.nextInt(4) == 0; } else { woodType = EnumVanillaWoodType.getRandom(random); fireproof = false; } IWoodAccess woodAccess = TreeManager.woodAccess; this.logs = woodAccess.getBlock(woodType, WoodBlockKind.LOG, fireproof).withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X); this.planks = woodAccess.getBlock(woodType, WoodBlockKind.PLANKS, fireproof); this.slabs = woodAccess.getBlock(woodType, WoodBlockKind.SLAB, fireproof); this.stairs = woodAccess.getBlock(woodType, WoodBlockKind.STAIRS, fireproof); this.fence = woodAccess.getBlock(woodType, WoodBlockKind.FENCE, fireproof); this.door = woodAccess.getBlock(woodType, WoodBlockKind.DOOR, false); this.fenceGate = woodAccess.getBlock(woodType, WoodBlockKind.FENCE_GATE, fireproof); } }