Skip to content

Commit

Permalink
Adds recipe for Infinity Tool
Browse files Browse the repository at this point in the history
  • Loading branch information
shermanflima committed Feb 14, 2025
1 parent 74be0f7 commit eb81f48
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod_name=Infinity Ores
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT
# The mod version. See https://semver.org/
mod_version=1.21.1-1.0.1
mod_version=1.21.1-1.0.2
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_obsidian": {
"conditions": {
"items": [
{
"items": "minecraft:obsidian"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "infinityores:tool"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_obsidian"
]
],
"rewards": {
"recipes": [
"infinityores:tool"
]
}
}
21 changes: 21 additions & 0 deletions src/generated/resources/data/infinityores/recipe/tool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"D": {
"item": "minecraft:diamond"
},
"O": {
"item": "minecraft:obsidian"
}
},
"pattern": [
"D D",
" O ",
" O "
],
"result": {
"count": 1,
"id": "infinityores:tool"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.*;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Blocks;
import org.jetbrains.annotations.NotNull;

Expand All @@ -29,5 +30,13 @@ protected void buildRecipes(@NotNull RecipeOutput recipeOutput) {
threeByThreePacker(recipeOutput, RecipeCategory.MISC, ModRegistry.LAPIS_ORE.get(), Blocks.LAPIS_BLOCK);
threeByThreePacker(recipeOutput, RecipeCategory.MISC, ModRegistry.NETHER_QUARTZ_ORE.get(), Blocks.QUARTZ_BLOCK);
threeByThreePacker(recipeOutput, RecipeCategory.MISC, ModRegistry.REDSTONE_ORE.get(), Blocks.REDSTONE_BLOCK);
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModRegistry.TOOL.get())
.pattern("D D")
.pattern(" O ")
.pattern(" O ")
.define('D', Items.DIAMOND)
.define('O', Blocks.OBSIDIAN)
.unlockedBy("has_obsidian", has(Blocks.OBSIDIAN))
.save(recipeOutput);
}
}

0 comments on commit eb81f48

Please sign in to comment.