@Override public List<List<ItemStack>> getItems() { ImmutableList.Builder<List<ItemStack>> builder = ImmutableList.builder(); for(RecipeMatch rm : items) { List<ItemStack> in = rm.getInputs(); if(!in.isEmpty()) { builder.add(in); } } return builder.build(); } }
@Override public List<List<ItemStack>> getItems() { ImmutableList.Builder<List<ItemStack>> builder = ImmutableList.builder(); for(RecipeMatch rm : items) { List<ItemStack> in = rm.getInputs(); if(!in.isEmpty()) { builder.add(in); } } return builder.build(); }
public static List<MeltingRecipe> getSmeltingRecipes() { List<MeltingRecipe> recipes = new ArrayList<>(); for(MeltingRecipe recipe : TinkerRegistry.getAllMeltingRecipies()) { if(recipe.output != null && recipe.input != null && recipe.input.getInputs() != null && recipe.input.getInputs().size() > 0) { recipes.add(recipe); } } return recipes; } }
public static List<DryingRecipe> getDryingRecipes() { List<DryingRecipe> recipes = new ArrayList<>(); for(DryingRecipe recipe : TinkerRegistry.getAllDryingRecipes()) { if(recipe.output != null && recipe.input != null && recipe.input.getInputs() != null && recipe.input.getInputs().size() > 0) { recipes.add(recipe); } } return recipes; } }
public DryingRecipeWrapper(DryingRecipe recipe) { this.input = ImmutableList.of(recipe.input.getInputs()); this.output = ImmutableList.of(recipe.getResult()); this.time = recipe.getTime(); }
public CastingRecipeWrapper(CastingRecipe recipe, IDrawable castingBlock) { // cast is not required if(recipe.cast != null) { cast = recipe.cast.getInputs(); } else { cast = ImmutableList.of(); } this.inputFluid = ImmutableList.of(recipe.getFluid()); this.recipe = recipe; this.output = ImmutableList.of(recipe.getResult()); this.castingBlock = castingBlock; }
public static void addDryingRecipe(DryingRecipe recipe) { if(new TinkerRegisterEvent.DryingRackRegisterEvent(recipe).fire()) { dryingRegistry.add(recipe); } else { try { String input = recipe.input.getInputs().stream().findFirst().map(ItemStack::getUnlocalizedName).orElse("?"); String output = recipe.getResult().getUnlocalizedName(); log.debug("Registration of drying rack recipe for " + output + " from " + input + " has been cancelled by event"); } catch(Exception e) { log.error("Error when logging drying rack event", e); } } }
public static void registerMelting(MeltingRecipe recipe) { if(new TinkerRegisterEvent.MeltingRegisterEvent(recipe).fire()) { meltingRegistry.add(recipe); } else { try { String input = recipe.input.getInputs().stream().findFirst().map(ItemStack::getUnlocalizedName).orElse("?"); log.debug("Registration of melting recipe for " + recipe.getResult().getUnlocalizedName() + " from " + input + " has been cancelled by event"); } catch(Exception e) { log.error("Error when logging melting event", e); } } }
public SmeltingRecipeWrapper(MeltingRecipe recipe) { this.inputs = ImmutableList.of(recipe.input.getInputs()); this.outputs = ImmutableList.of(recipe.getResult()); this.temperature = recipe.getTemperature(); ImmutableList.Builder<FluidStack> builder = ImmutableList.builder(); for(FluidStack fs : TinkerRegistry.getSmelteryFuels()) { if(fs.getFluid().getTemperature(fs) >= temperature) { fs = fs.copy(); fs.amount = 1000; builder.add(fs); } } fuels = builder.build(); }
castDict.get(output).addAll(recipe.cast.getInputs());