Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private boolean remove(AbstractAltarRecipe recipe) {

@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<AbstractAltarRecipe> streamRecipes() {
return new SimpleObjectStream<>(AltarRecipeRegistry.recipes.entrySet().stream().flatMap(r -> r.getValue().stream()).collect(Collectors.toList()))
return new SimpleObjectStream<>(AltarRecipeRegistry.recipes.entrySet().stream().flatMap(r -> r.getValue().stream()).collect(Collectors.toList()), false)
.setRemover(this::remove);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public SimpleObjectStream<IManyToOneRecipe> streamRecipes() {
.filter(r -> r instanceof IManyToOneRecipe)
.map(r -> (IManyToOneRecipe) r)
.collect(Collectors.toList());
return new SimpleObjectStream<>(list)
return new SimpleObjectStream<>(list, false)
.setRemover(this::remove);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public SimpleObjectStream<TankMachineRecipe> streamRecipes() {
List<TankMachineRecipe> list = new ArrayList<>();
list.addAll((Collection<? extends TankMachineRecipe>) MachineRecipeRegistry.instance.getRecipesForMachine(MachineRecipeRegistry.TANK_FILLING).values());
list.addAll((Collection<? extends TankMachineRecipe>) MachineRecipeRegistry.instance.getRecipesForMachine(MachineRecipeRegistry.TANK_EMPTYING).values());
return new SimpleObjectStream<>(list).setRemover(this::remove);
return new SimpleObjectStream<>(list, false).setRemover(this::remove);
}

@MethodDescription(priority = 2000, example = @Example(commented = true))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void onReload() {

@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<VatRecipe> streamRecipes() {
return new SimpleObjectStream<>(VatRecipeManager.getInstance().getRecipes().stream().map(r -> (VatRecipe) r).collect(Collectors.toList()))
return new SimpleObjectStream<>(VatRecipeManager.getInstance().getRecipes().stream().map(r -> (VatRecipe) r).collect(Collectors.toList()), false)
.setRemover(this::remove);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public SimpleObjectStream<IMachineRecipe> streamRecipes() {
for (IMachineRecipe recipe : XUMachineCrusher.INSTANCE.recipes_registry) {
list.add(recipe);
}
return new SimpleObjectStream<>(list).setRemover(this::remove);
return new SimpleObjectStream<>(list, false).setRemover(this::remove);
}

@MethodDescription(priority = 2000, example = @Example(commented = true))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public SimpleObjectStream<IMachineRecipe> streamRecipes() {
for (IMachineRecipe recipe : XUMachineEnchanter.INSTANCE.recipes_registry) {
list.add(recipe);
}
return new SimpleObjectStream<>(list).setRemover(this::remove);
return new SimpleObjectStream<>(list, false).setRemover(this::remove);
}

@MethodDescription(priority = 2000, example = @Example(commented = true))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public SimpleObjectStream<IMachineRecipe> streamRecipes() {
for (IMachineRecipe recipe : XUMachineFurnace.INSTANCE.recipes_registry) {
list.add(recipe);
}
return new SimpleObjectStream<>(list).setRemover(this::remove);
return new SimpleObjectStream<>(list, false).setRemover(this::remove);
}

@MethodDescription(priority = 2000, example = @Example(commented = true))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public SimpleObjectStream<Pair<Machine, IMachineRecipe>> streamRecipes() {
list.add(Pair.of(generator, recipe));
}
}
return new SimpleObjectStream<>(list).setRemover(x -> x.getKey().recipes_registry.removeRecipe(x.getValue()));
return new SimpleObjectStream<>(list, false).setRemover(x -> x.getKey().recipes_registry.removeRecipe(x.getValue()));
}

@MethodDescription(description = "groovyscript.wiki.extrautils2.generator.removeByGenerator")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void removeAll() {
}

public SimpleObjectStream<MachineRecipe<IRecipeInput, Collection<ItemStack>>> streamRecipes() {
return new SimpleObjectStream<>(asList()).setRemover(this::remove);
return new SimpleObjectStream<>(asList(), false).setRemover(this::remove);
}

private boolean remove(MachineRecipe<IRecipeInput, Collection<ItemStack>> recipe, boolean backup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public MachineRecipe<IRecipeInput, Collection<ItemStack>> add(int type, IIngredi
}

public SimpleObjectStream<MachineRecipe<IRecipeInput, Collection<ItemStack>>> streamRecipes() {
return new SimpleObjectStream<>(asList()).setRemover(this::remove);
return new SimpleObjectStream<>(asList(), false).setRemover(this::remove);
}

public SimpleObjectStream<MachineRecipe<IRecipeInput, Collection<ItemStack>>> streamRecipes(int type) {
return new SimpleObjectStream<>(asList(type)).setRemover(r -> this.remove(type, r));
return new SimpleObjectStream<>(asList(type), false).setRemover(r -> this.remove(type, r));
}

public boolean remove(int type, MachineRecipe<IRecipeInput, Collection<ItemStack>> recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public MachineRecipe<IRecipeInput, Collection<ItemStack>> add(IIngredient input,
}

public SimpleObjectStream<MachineRecipe<IRecipeInput, Collection<ItemStack>>> streamRecipes() {
return new SimpleObjectStream<>(asList()).setRemover(this::remove);
return new SimpleObjectStream<>(asList(), false).setRemover(this::remove);
}

public boolean remove(MachineRecipe<IRecipeInput, Collection<ItemStack>> recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public MachineRecipe<IRecipeInput, Collection<ItemStack>> add(IIngredient input,
}

public SimpleObjectStream<MachineRecipe<IRecipeInput, Collection<ItemStack>>> streamRecipes() {
return new SimpleObjectStream<>(asList()).setRemover(this::remove);
return new SimpleObjectStream<>(asList(), false).setRemover(this::remove);
}

public boolean remove(MachineRecipe<IRecipeInput, Collection<ItemStack>> recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public MachineRecipe<IRecipeInput, Collection<ItemStack>> add(IIngredient input,
}

public SimpleObjectStream<MachineRecipe<IRecipeInput, Collection<ItemStack>>> streamRecipes() {
return new SimpleObjectStream<>(asList()).setRemover(this::remove);
return new SimpleObjectStream<>(asList(), false).setRemover(this::remove);
}

public boolean remove(MachineRecipe<IRecipeInput, Collection<ItemStack>> recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public MachineRecipe<IRecipeInput, Collection<ItemStack>> add(IIngredient input,
}

public SimpleObjectStream<MachineRecipe<IRecipeInput, Collection<ItemStack>>> streamRecipes() {
return new SimpleObjectStream<>(asList()).setRemover(this::remove);
return new SimpleObjectStream<>(asList(), false).setRemover(this::remove);
}

public boolean remove(MachineRecipe<IRecipeInput, Collection<ItemStack>> recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public MachineRecipe<IRecipeInput, Collection<ItemStack>> add(IIngredient input,
}

public SimpleObjectStream<MachineRecipe<IRecipeInput, Collection<ItemStack>>> streamRecipes() {
return new SimpleObjectStream<>(asList()).setRemover(this::remove);
return new SimpleObjectStream<>(asList(), false).setRemover(this::remove);
}

public boolean remove(MachineRecipe<IRecipeInput, Collection<ItemStack>> recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public MachineRecipe<ICannerEnrichRecipeManager.Input, FluidStack> add(FluidStac
}

public SimpleObjectStream<MachineRecipe<ICannerEnrichRecipeManager.Input, FluidStack>> streamRecipes() {
return new SimpleObjectStream<>(asList()).setRemover(this::remove);
return new SimpleObjectStream<>(asList(), false).setRemover(this::remove);
}

public boolean remove(MachineRecipe<ICannerEnrichRecipeManager.Input, FluidStack> recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public MachineRecipe<IRecipeInput, Collection<ItemStack>> add(ItemStack output,
}

public SimpleObjectStream<MachineRecipe<IRecipeInput, Collection<ItemStack>>> streamRecipes() {
return new SimpleObjectStream<>(asList()).setRemover(this::remove);
return new SimpleObjectStream<>(asList(), false).setRemover(this::remove);
}

public boolean remove(MachineRecipe<IRecipeInput, Collection<ItemStack>> recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public MachineRecipe<ICannerBottleRecipeManager.Input, ItemStack> add(IIngredien
}

public SimpleObjectStream<MachineRecipe<ICannerBottleRecipeManager.Input, ItemStack>> streamRecipes() {
return new SimpleObjectStream<>(asList()).setRemover(this::remove);
return new SimpleObjectStream<>(asList(), false).setRemover(this::remove);
}

public boolean remove(MachineRecipe<ICannerBottleRecipeManager.Input, ItemStack> recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void removeAll() {
@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<MetalPressRecipe> streamRecipes() {
List<MetalPressRecipe> recipes = new ArrayList<>(MetalPressRecipe.recipeList.values());
return new SimpleObjectStream<>(recipes).setRemover(this::remove);
return new SimpleObjectStream<>(recipes, false).setRemover(this::remove);
}

@Property(property = "input", comp = @Comp(eq = 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public SimpleObjectStream<AmadronOffer> streamRecipes() {
List<AmadronOffer> list = new ArrayList<>();
list.addAll(AmadronOfferManager.getInstance().getStaticOffers());
list.addAll(AmadronOfferManager.getInstance().getPeriodicOffers());
return new SimpleObjectStream<>(list).setRemover(this::removeStatic);
return new SimpleObjectStream<>(list, false).setRemover(this::removeStatic);
}

@Property(property = "input", comp = @Comp(gte = 0, lte = 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void removeAll() {

@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<AssemblyRecipe> streamRecipes() {
return new SimpleObjectStream<>(Arrays.stream(AssemblyType.values()).map(this::map).flatMap(Collection::stream).collect(Collectors.toList()))
return new SimpleObjectStream<>(Arrays.stream(AssemblyType.values()).map(this::map).flatMap(Collection::stream).collect(Collectors.toList()), false)
.setRemover(this::remove);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ public SimpleObjectStream<IIngredient> streamRecipes() {
.stream()
.map(OreDictIngredient::new);
List<IIngredient> items = Stream.concat(normalRecipes, oreDictRecipes).collect(Collectors.toList());
return new SimpleObjectStream<>(items).setRemover(this::remove);
return new SimpleObjectStream<>(items, false).setRemover(this::remove);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void removeByOutput(IIngredient output) {
@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<Map.Entry<ResourceLocation, IThaumcraftRecipe>> streamRecipes() {
List<Map.Entry<ResourceLocation, IThaumcraftRecipe>> recipes = ThaumcraftApi.getCraftingRecipes().entrySet().stream().filter(x -> x.getValue() instanceof CrucibleRecipe).collect(Collectors.toList());
return new SimpleObjectStream<>(recipes)
return new SimpleObjectStream<>(recipes, false)
.setRemover(x -> remove((CrucibleRecipe) x));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void removeByOutput(IIngredient output) {
@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<Map.Entry<ResourceLocation, IThaumcraftRecipe>> streamRecipes() {
List<Map.Entry<ResourceLocation, IThaumcraftRecipe>> recipes = ThaumcraftApi.getCraftingRecipes().entrySet().stream().filter(x -> x.getValue() instanceof InfusionRecipe).collect(Collectors.toList());
return new SimpleObjectStream<>(recipes)
return new SimpleObjectStream<>(recipes, false)
.setRemover(x -> remove((InfusionRecipe) x.getValue()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public SimpleObjectStream<DiffuserRecipe> streamRecipes() {
.filter(DiffuserManagerAccessor.getReagentDurMap()::containsKey)
.map(DiffuserRecipe::new)
.collect(Collectors.toList());
return new SimpleObjectStream<>(list).setRemover(this::remove);
return new SimpleObjectStream<>(list, false).setRemover(this::remove);
}

@MethodDescription(priority = 2000, example = @Example(commented = true))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public boolean removeByOutput(IIngredient output) {

@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<FactorizerManager.FactorizerRecipe> streamRecipes() {
return new SimpleObjectStream<>(Booleans.asList(true, false).stream().map(this::map).map(Map::values).flatMap(Collection::stream).collect(Collectors.toList()))
return new SimpleObjectStream<>(Booleans.asList(true, false).stream().map(this::map).map(Map::values).flatMap(Collection::stream).collect(Collectors.toList()), false)
.setRemover(this::remove);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ public boolean removeBlockByInput(IIngredient input) {

@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<TapperItemRecipe> streamRecipes() {
return new SimpleObjectStream<>(TapperManagerAccessor.getItemMap().entrySet().stream().map(x -> new TapperItemRecipe(x.getKey(), x.getValue())).collect(Collectors.toList()))
return new SimpleObjectStream<>(TapperManagerAccessor.getItemMap().entrySet().stream().map(x -> new TapperItemRecipe(x.getKey(), x.getValue())).collect(Collectors.toList()), false)
.setRemover(this::removeItem);
}

@MethodDescription(description = "groovyscript.wiki.streamRecipes", type = MethodDescription.Type.QUERY)
public SimpleObjectStream<TapperBlockRecipe> streamBlockRecipes() {
return new SimpleObjectStream<>(TapperManagerAccessor.getBlockMap().entrySet().stream().map(x -> new TapperBlockRecipe(x.getKey(), x.getValue())).collect(Collectors.toList()))
return new SimpleObjectStream<>(TapperManagerAccessor.getBlockMap().entrySet().stream().map(x -> new TapperBlockRecipe(x.getKey(), x.getValue())).collect(Collectors.toList()), false)
.setRemover(this::removeBlock);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public boolean removeByOutput(IIngredient output) {

@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<CompactorRecipe> streamRecipes() {
return new SimpleObjectStream<>(Arrays.stream(CompactorManager.Mode.values()).map(this::map).map(Map::values).flatMap(Collection::stream).collect(Collectors.toList()))
return new SimpleObjectStream<>(Arrays.stream(CompactorManager.Mode.values()).map(this::map).map(Map::values).flatMap(Collection::stream).collect(Collectors.toList()), false)
.setRemover(this::remove);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public boolean removeByOutput(IIngredient output) {

@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<ExtruderRecipe> streamRecipes() {
return new SimpleObjectStream<>(Booleans.asList(true, false).stream().map(this::map).map(Map::values).flatMap(Collection::stream).collect(Collectors.toList()))
return new SimpleObjectStream<>(Booleans.asList(true, false).stream().map(this::map).map(Map::values).flatMap(Collection::stream).collect(Collectors.toList()), false)
.setRemover(this::remove);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void removeAll() {

@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<EntityMeltingRecipe> streamRecipes() {
return new SimpleObjectStream<>(getAllRecipes()).setRemover(this::remove);
return new SimpleObjectStream<>(getAllRecipes(), false).setRemover(this::remove);
}

public class RecipeBuilder implements IRecipeBuilder<EntityMeltingRecipe> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ public void removeAll() {

@MethodDescription(type = MethodDescription.Type.QUERY)
public SimpleObjectStream<SmelteryFuelRecipe> streamRecipes() {
return new SimpleObjectStream<>(getAllRecipes()).setRemover(this::remove);
return new SimpleObjectStream<>(getAllRecipes(), false).setRemover(this::remove);
}
}