-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added salvaging recipes for tools and armor
also made wooden mattocks and mining tools useable as fuel
- Loading branch information
Showing
91 changed files
with
3,069 additions
and
1 deletion.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
...inmailstudios/astromine/datagen/generator/recipe/set/MultiBlastingSetRecipeGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.github.chainmailstudios.astromine.datagen.generator.recipe.set; | ||
|
||
import net.minecraft.advancement.criterion.ImpossibleCriterion; | ||
import net.minecraft.data.server.recipe.CookingRecipeJsonFactory; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.recipe.Ingredient; | ||
|
||
import com.github.chainmailstudios.astromine.datagen.material.MaterialItemType; | ||
import com.github.chainmailstudios.astromine.datagen.material.MaterialSet; | ||
import me.shedaniel.cloth.api.datagen.v1.RecipeData; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
public class MultiBlastingSetRecipeGenerator extends MultiCookingSetRecipeGenerator { | ||
public MultiBlastingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output, int time, float experience) { | ||
super(inputs, output, time, experience); | ||
} | ||
|
||
public MultiBlastingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output, float experience) { | ||
this(inputs, output, 100, experience); | ||
} | ||
|
||
public MultiBlastingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output) { | ||
this(inputs, output, 100, 0.1f); | ||
} | ||
|
||
@Override | ||
public void generate(RecipeData recipes, MaterialSet set) { | ||
Collection<Item> items = getInputs(set); | ||
CookingRecipeJsonFactory | ||
.createBlasting( | ||
Ingredient.ofItems(items.toArray(new Item[0])), | ||
set.getItem(output), | ||
experience, | ||
time) | ||
.criterion("impossible", new ImpossibleCriterion.Conditions()) | ||
.offerTo(recipes, getRecipeId(set)); | ||
} | ||
|
||
@Override | ||
public String getRecipeName(MaterialSet set) { | ||
return set.getItemIdPath(output) + "_from_blasting"; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...ainmailstudios/astromine/datagen/generator/recipe/set/MultiCookingSetRecipeGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.github.chainmailstudios.astromine.datagen.generator.recipe.set; | ||
|
||
import net.minecraft.item.Item; | ||
|
||
import com.github.chainmailstudios.astromine.datagen.generator.recipe.set.base.CookingSetRecipeGenerator; | ||
import com.github.chainmailstudios.astromine.datagen.material.MaterialItemType; | ||
import com.github.chainmailstudios.astromine.datagen.material.MaterialSet; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
public abstract class MultiCookingSetRecipeGenerator extends CookingSetRecipeGenerator { | ||
private final Collection<MaterialItemType> inputs; | ||
|
||
public MultiCookingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output, int time, float experience) { | ||
super(inputs.stream().findFirst().get(), output, time, experience); | ||
this.inputs = inputs; | ||
} | ||
|
||
public Collection<MaterialItemType> getInputs() { | ||
return inputs; | ||
} | ||
|
||
public Collection<Item> getInputs(MaterialSet set) { | ||
ArrayList<Item> items = new ArrayList<>(); | ||
for(MaterialItemType type:getInputs()) { | ||
if(shouldGenerate(set, type)) items.add(set.getItem(type)); | ||
} | ||
return items; | ||
} | ||
|
||
@Override | ||
public boolean shouldGenerate(MaterialSet set) { | ||
boolean hasInput = false; | ||
for(MaterialItemType type:getInputs()) { | ||
if(set.hasType(type)) hasInput = true; | ||
} | ||
return hasInput && set.hasType(output); | ||
} | ||
|
||
public boolean shouldGenerate(MaterialSet set, MaterialItemType type) { | ||
return set.hasType(output) && set.hasType(type) && !(set.isFromVanilla(type) && set.isFromVanilla(output)); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...inmailstudios/astromine/datagen/generator/recipe/set/MultiSmeltingSetRecipeGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.github.chainmailstudios.astromine.datagen.generator.recipe.set; | ||
|
||
import net.minecraft.advancement.criterion.ImpossibleCriterion; | ||
import net.minecraft.data.server.recipe.CookingRecipeJsonFactory; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.recipe.Ingredient; | ||
|
||
import com.github.chainmailstudios.astromine.datagen.material.MaterialItemType; | ||
import com.github.chainmailstudios.astromine.datagen.material.MaterialSet; | ||
import me.shedaniel.cloth.api.datagen.v1.RecipeData; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
public class MultiSmeltingSetRecipeGenerator extends MultiCookingSetRecipeGenerator { | ||
|
||
public MultiSmeltingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output, int time, float experience) { | ||
super(inputs, output, time, experience); | ||
} | ||
|
||
public MultiSmeltingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output, float experience) { | ||
this(inputs, output, 200, experience); | ||
} | ||
|
||
public MultiSmeltingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output) { | ||
this(inputs, output, 200, 0.1f); | ||
} | ||
|
||
@Override | ||
public void generate(RecipeData recipes, MaterialSet set) { | ||
Collection<Item> items = getInputs(set); | ||
CookingRecipeJsonFactory | ||
.createSmelting( | ||
Ingredient.ofItems(items.toArray(new Item[0])), | ||
set.getItem(output), | ||
experience, | ||
time) | ||
.criterion("impossible", new ImpossibleCriterion.Conditions()) | ||
.offerTo(recipes, getRecipeId(set)); | ||
} | ||
|
||
@Override | ||
public String getRecipeName(MaterialSet set) { | ||
return set.getItemIdPath(output) + "_from_smelting"; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...udios/astromine/foundations/datagen/generators/recipe/SalvageBlastingRecipeGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.github.chainmailstudios.astromine.foundations.datagen.generators.recipe; | ||
|
||
import com.github.chainmailstudios.astromine.datagen.generator.recipe.set.MultiBlastingSetRecipeGenerator; | ||
import com.github.chainmailstudios.astromine.datagen.generator.recipe.set.MultiSmeltingSetRecipeGenerator; | ||
import com.github.chainmailstudios.astromine.datagen.material.MaterialItemType; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.AXE; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.BOOTS; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.CHESTPLATE; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.EXCAVATOR; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.HAMMER; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.HELMET; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.HOE; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.LEGGINGS; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.MATTOCK; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.MINING_TOOL; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.PICKAXE; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.SHOVEL; | ||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.SWORD; | ||
|
||
public class SalvageBlastingRecipeGenerator extends MultiBlastingSetRecipeGenerator { | ||
public static final List<MaterialItemType> SALVAGEABLE = Arrays.asList( | ||
PICKAXE, AXE, SHOVEL, SWORD, HOE, | ||
HAMMER, EXCAVATOR, MINING_TOOL, MATTOCK, | ||
HELMET, CHESTPLATE, LEGGINGS, BOOTS | ||
); | ||
|
||
public SalvageBlastingRecipeGenerator(MaterialItemType output) { | ||
super(SALVAGEABLE, output); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...udios/astromine/foundations/datagen/generators/recipe/SalvageSmeltingRecipeGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.github.chainmailstudios.astromine.foundations.datagen.generators.recipe; | ||
|
||
import com.github.chainmailstudios.astromine.datagen.generator.recipe.set.MultiSmeltingSetRecipeGenerator; | ||
import com.github.chainmailstudios.astromine.datagen.material.MaterialItemType; | ||
|
||
import static com.github.chainmailstudios.astromine.datagen.material.MaterialItemType.*; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class SalvageSmeltingRecipeGenerator extends MultiSmeltingSetRecipeGenerator { | ||
public static final List<MaterialItemType> SALVAGEABLE = Arrays.asList( | ||
PICKAXE, AXE, SHOVEL, SWORD, HOE, | ||
HAMMER, EXCAVATOR, MINING_TOOL, MATTOCK, | ||
HELMET, CHESTPLATE, LEGGINGS, BOOTS | ||
); | ||
|
||
public SalvageSmeltingRecipeGenerator(MaterialItemType output) { | ||
super(SALVAGEABLE, output); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...astromine/advancements/recipes/astromine.foundations/asterite_fragment_from_blasting.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"rewards": { | ||
"recipes": [ | ||
"astromine:asterite_fragment_from_blasting" | ||
] | ||
}, | ||
"criteria": { | ||
"impossible": { | ||
"trigger": "minecraft:impossible" | ||
}, | ||
"has_the_recipe": { | ||
"trigger": "minecraft:recipe_unlocked", | ||
"conditions": { | ||
"recipe": "astromine:asterite_fragment_from_blasting" | ||
} | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"impossible", | ||
"has_the_recipe" | ||
] | ||
] | ||
} |
25 changes: 25 additions & 0 deletions
25
...astromine/advancements/recipes/astromine.foundations/asterite_fragment_from_smelting.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"rewards": { | ||
"recipes": [ | ||
"astromine:asterite_fragment_from_smelting" | ||
] | ||
}, | ||
"criteria": { | ||
"impossible": { | ||
"trigger": "minecraft:impossible" | ||
}, | ||
"has_the_recipe": { | ||
"trigger": "minecraft:recipe_unlocked", | ||
"conditions": { | ||
"recipe": "astromine:asterite_fragment_from_smelting" | ||
} | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"impossible", | ||
"has_the_recipe" | ||
] | ||
] | ||
} |
25 changes: 25 additions & 0 deletions
25
...ata/astromine/advancements/recipes/astromine.foundations/bronze_nugget_from_blasting.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"rewards": { | ||
"recipes": [ | ||
"astromine:bronze_nugget_from_blasting" | ||
] | ||
}, | ||
"criteria": { | ||
"impossible": { | ||
"trigger": "minecraft:impossible" | ||
}, | ||
"has_the_recipe": { | ||
"trigger": "minecraft:recipe_unlocked", | ||
"conditions": { | ||
"recipe": "astromine:bronze_nugget_from_blasting" | ||
} | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"impossible", | ||
"has_the_recipe" | ||
] | ||
] | ||
} |
25 changes: 25 additions & 0 deletions
25
...ata/astromine/advancements/recipes/astromine.foundations/bronze_nugget_from_smelting.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"rewards": { | ||
"recipes": [ | ||
"astromine:bronze_nugget_from_smelting" | ||
] | ||
}, | ||
"criteria": { | ||
"impossible": { | ||
"trigger": "minecraft:impossible" | ||
}, | ||
"has_the_recipe": { | ||
"trigger": "minecraft:recipe_unlocked", | ||
"conditions": { | ||
"recipe": "astromine:bronze_nugget_from_smelting" | ||
} | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"impossible", | ||
"has_the_recipe" | ||
] | ||
] | ||
} |
25 changes: 25 additions & 0 deletions
25
...ata/astromine/advancements/recipes/astromine.foundations/copper_nugget_from_blasting.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"rewards": { | ||
"recipes": [ | ||
"astromine:copper_nugget_from_blasting" | ||
] | ||
}, | ||
"criteria": { | ||
"impossible": { | ||
"trigger": "minecraft:impossible" | ||
}, | ||
"has_the_recipe": { | ||
"trigger": "minecraft:recipe_unlocked", | ||
"conditions": { | ||
"recipe": "astromine:copper_nugget_from_blasting" | ||
} | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"impossible", | ||
"has_the_recipe" | ||
] | ||
] | ||
} |
25 changes: 25 additions & 0 deletions
25
...ata/astromine/advancements/recipes/astromine.foundations/copper_nugget_from_smelting.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"rewards": { | ||
"recipes": [ | ||
"astromine:copper_nugget_from_smelting" | ||
] | ||
}, | ||
"criteria": { | ||
"impossible": { | ||
"trigger": "minecraft:impossible" | ||
}, | ||
"has_the_recipe": { | ||
"trigger": "minecraft:recipe_unlocked", | ||
"conditions": { | ||
"recipe": "astromine:copper_nugget_from_smelting" | ||
} | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"impossible", | ||
"has_the_recipe" | ||
] | ||
] | ||
} |
Oops, something went wrong.