public HelmRevealingRecipe(Item output, Item botaniaHelm) { super("botania:helm_revealing", new ItemStack(output), NonNullList.from(Ingredient.EMPTY, Ingredient.fromItem(botaniaHelm), Ingredient.fromItem(goggles))); this.botaniaHelm = botaniaHelm; }
protected NonNullList<ItemStack> createList(ItemStack... stacks) { return NonNullList.from(ItemStack.EMPTY, stacks); }
@Override protected NonNullList<ItemStack> getDrops(World world, IBlockState state, BlockPos pos, int fortune) { return NonNullList.from(ItemStack.EMPTY, drop.copy()); } }
public ReColourRecipe(@Nonnull ItemStack result, Ingredient ingredient, Ingredient dyeIngredient) { super(new ResourceLocation(EnderStorage.MOD_ID, "crafting_recipe"), result, NonNullList.from(Ingredient.EMPTY, ingredient)); this.ingredient = ingredient; this.dyeIngredient = dyeIngredient; }
public IngredientElement(int xPos, int yPos, Ingredient ingredient) { super(xPos, yPos); items = NonNullList.from(ItemStack.EMPTY, ingredient.getMatchingStacks()); }
public static void syncConfig(Configuration config) { String category = Const.ConfigCategory.modpackMisc; String[] deflist = new String[0]; String[] blacklist = config.getStringList("AutoUserTargetBlacklist", category, deflist, "Blocks in-world that cannot be targeted by the auto user. Use block id; for example minecraft:chest"); blacklistAll = NonNullList.from("", blacklist); } }
@Override public void addAlchemyTable(@Nonnull ItemStack output, @Nonnegative int syphon, @Nonnegative int ticks, @Nonnegative int minimumTier, @Nonnull Ingredient... input) { Preconditions.checkNotNull(output, "output cannot be null."); Preconditions.checkArgument(syphon >= 0, "syphon cannot be negative."); Preconditions.checkArgument(ticks >= 0, "ticks cannot be negative."); Preconditions.checkArgument(minimumTier >= 0, "minimumTier cannot be negative."); Preconditions.checkNotNull(input, "input cannot be null."); NonNullList<Ingredient> inputs = NonNullList.from(Ingredient.EMPTY, input); alchemyRecipes.add(new RecipeAlchemyTable(inputs, output, syphon, ticks, minimumTier)); }
@Override public void addTartaricForge(@Nonnull ItemStack output, @Nonnegative double minimumSouls, @Nonnegative double soulDrain, @Nonnull Ingredient... input) { Preconditions.checkNotNull(output, "output cannot be null."); Preconditions.checkArgument(minimumSouls >= 0, "minimumSouls cannot be negative."); Preconditions.checkArgument(soulDrain >= 0, "soulDrain cannot be negative."); Preconditions.checkNotNull(input, "input cannot be null."); NonNullList<Ingredient> inputs = NonNullList.from(Ingredient.EMPTY, input); tartaricForgeRecipes.add(new RecipeTartaricForge(inputs, output, minimumSouls, soulDrain)); }
@Override public void addSacrificeCraft(@Nonnull ItemStack output, @Nonnegative double healthRequired, @Nonnull Ingredient... input) { Preconditions.checkNotNull(output, "output cannot be null."); Preconditions.checkArgument(healthRequired >= 0, "healthRequired cannot be negative."); Preconditions.checkNotNull(input, "input cannot be null."); NonNullList<Ingredient> inputs = NonNullList.from(Ingredient.EMPTY, input); sacrificeCraftRecipes.add(new RecipeSacrificeCraft(inputs, output, healthRequired)); }
public static NonNullList<ItemStack> copyStackList(List<ItemStack> itemStacks) { ItemStack[] stacks = new ItemStack[itemStacks.size()]; for (int i = 0; i < itemStacks.size(); i++) { stacks[i] = copy(itemStacks.get(i)); } return NonNullList.from(ItemStack.EMPTY, stacks); }
@Override public void syncConfig(Configuration config) { String category = Const.ConfigCategory.modpackMisc; String[] deflist = new String[] { "extracells:fluidcrafter", "extracells:ecbaseblock", "extracells:fluidfiller", "refinedstorage:disk_drive" }; String[] blacklist = config.getStringList("SackHoldingBlacklist", category, deflist, "Containers that cannot be lifted up with the Empty Sack of Holding. Use block id; for example minecraft:chest"); blacklistAll = NonNullList.from("", blacklist); } }
@Override public NonNullList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { return NonNullList.from(ItemStack.EMPTY, new ItemStack(Item.getItemFromBlock(Blocks.CHORUS_FLOWER))); } }
@Override public NonNullList<Ingredient> getIngredients() { return NonNullList.from(Ingredient.EMPTY, Ingredient.fromStacks(getRecipeOutput())); } }
@Nonnull @Override public NonNullList<ItemStack> getItemStacks(){ NBTTagCompound nbt = new NBTTagCompound(); nbt.setUniqueId("Questbook", this.getUUID()); ItemStack stack = new ItemStack(Registry.itemQuestBook); stack.setTagCompound(nbt); return NonNullList.from(ItemStack.EMPTY, stack); } }
public DeadBushRecipe() { super(new ResourceLocation(Reference.MOD_ID, "deadbush"), NonNullList.from(Ingredient.EMPTY, Ingredient.fromItem(Items.SHEARS), new OreIngredient("treeSapling")), new ItemStack(Blocks.DEADBUSH)); }
@Override public NonNullList<Ingredient> getIngredients() { return NonNullList.from(Ingredient.EMPTY, Ingredient.fromStacks(getRecipeOutput()), Ingredient.fromStacks(getRecipeOutput())); } }
public R fromRecipe(Recipe recipe) { this.inputs = recipe.getInputs(); this.outputs = NonNullList.from(ItemStack.EMPTY, recipe.getOutputs().toArray(new ItemStack[0])); this.chancedOutputs = new TObjectIntHashMap<>(recipe.getChancedOutputs()); this.fluidInputs = new ArrayList<>(recipe.getFluidInputs()); this.fluidOutputs = new ArrayList<>(recipe.getFluidOutputs()); this.duration = recipe.getDuration(); this.EUt = recipe.getEUt(); this.hidden = recipe.isHidden(); this.canBeBuffered = recipe.canBeBuffered(); this.needsEmptyOutput = recipe.needsEmptyOutput(); return (R) this; }
public AltarRecipeJEI(RecipeBloodAltar recipe) { this.input = NonNullList.from(ItemStack.EMPTY, recipe.getInput().getMatchingStacks()); this.output = recipe.getOutput(); this.infoString = new String[]{TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(recipe.getMinimumTier().toInt())), TextHelper.localize("jei.bloodmagic.recipe.requiredLP", recipe.getSyphon())}; this.consumptionRate = recipe.getConsumeRate(); this.drainRate = recipe.getDrainRate(); }
/** * TODO: make a unit testing module, or install a framework for now these pass so i removed call to them */ public static void unitTests() { NonNullList<String> blacklist = NonNullList.from("", "terraqueous:pergola", "harvestcraft:*_sapling", "croparia:block_cane_*"); ModCyclic.logger.logTestResult("1] expect true " + isInList(blacklist, new ResourceLocation("harvestcraft:fruit_sapling"))); ModCyclic.logger.logTestResult("2] expect true " + isInList(blacklist, new ResourceLocation("croparia:block_cane_zzzzzz"))); ModCyclic.logger.logTestResult("3] expect false " + isInList(blacklist, new ResourceLocation("harvestcraft:pampeach"))); ModCyclic.logger.logTestResult("4] expect false " + isInList(blacklist, new ResourceLocation("harvestcraft:groundtrap"))); } }