mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-30 14:55:07 +01:00
feat: add modFlower milling helper
This commit is contained in:
parent
e002d68dc2
commit
983677e958
1 changed files with 31 additions and 2 deletions
|
@ -720,7 +720,6 @@ public class MillingRecipeGen extends ProcessingRecipeGen {
|
||||||
|
|
||||||
RU_YELLOW_SNOWBELLE = ruFlower("yellow_snowbelle", List.of(1f),
|
RU_YELLOW_SNOWBELLE = ruFlower("yellow_snowbelle", List.of(1f),
|
||||||
List.of(Items.YELLOW_DYE), List.of(2))
|
List.of(Items.YELLOW_DYE), List.of(2))
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
protected GeneratedRecipe metalOre(String name, ItemEntry<? extends Item> crushed, int duration) {
|
protected GeneratedRecipe metalOre(String name, ItemEntry<? extends Item> crushed, int duration) {
|
||||||
|
@ -848,6 +847,36 @@ public class MillingRecipeGen extends ProcessingRecipeGen {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected GeneratedRecipe modFlower(Mods mod, String input, List<Float> chances,
|
||||||
|
List<Item> dyes, List<Integer> amounts){
|
||||||
|
return switch (chances.size()) {
|
||||||
|
// Milling recipe has a max of 4 outputs
|
||||||
|
case 1 -> create(mod.recipeId(input), b -> b.duration(50)
|
||||||
|
.require(mod, input)
|
||||||
|
.output(chances.get(0), dyes.get(0), amounts.get(0))
|
||||||
|
.whenModLoaded(mod.getId()));
|
||||||
|
case 2 -> create(mod.recipeId(input), b -> b.duration(50)
|
||||||
|
.require(mod, input)
|
||||||
|
.output(chances.get(0), dyes.get(0), amounts.get(0))
|
||||||
|
.output(chances.get(1), dyes.get(1), amounts.get(1))
|
||||||
|
.whenModLoaded(mod.getId()));
|
||||||
|
case 3 -> create(mod.recipeId(input), b -> b.duration(50)
|
||||||
|
.require(mod, input)
|
||||||
|
.output(chances.get(0), dyes.get(0), amounts.get(0))
|
||||||
|
.output(chances.get(1), dyes.get(1), amounts.get(1))
|
||||||
|
.output(chances.get(2), dyes.get(2), amounts.get(2))
|
||||||
|
.whenModLoaded(mod.getId()));
|
||||||
|
case 4 -> create(mod.recipeId(input), b -> b.duration(50)
|
||||||
|
.require(mod, input)
|
||||||
|
.output(chances.get(0), dyes.get(0), amounts.get(0))
|
||||||
|
.output(chances.get(1), dyes.get(1), amounts.get(1))
|
||||||
|
.output(chances.get(2), dyes.get(2), amounts.get(2))
|
||||||
|
.output(chances.get(3), dyes.get(3), amounts.get(3))
|
||||||
|
.whenModLoaded(mod.getId()));
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public MillingRecipeGen(PackOutput output) {
|
public MillingRecipeGen(PackOutput output) {
|
||||||
super(output);
|
super(output);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue