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 915616f commit 0451efa
Show file tree
Hide file tree
Showing 4 changed files with 60 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.2-1.0.1
mod_version=1.21.2-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"
]
}
}
17 changes: 17 additions & 0 deletions src/generated/resources/data/infinityores/recipe/tool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"D": "minecraft:diamond",
"O": "minecraft:obsidian"
},
"pattern": [
"D D",
" O ",
" O "
],
"result": {
"count": 1,
"id": "infinityores:tool"
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/sherman/datagen/server/ModRecipeProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import com.sherman.registry.ModRegistry;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.Registries;
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 @@ -30,6 +32,14 @@ protected void buildRecipes() {
threeByThreePacker(RecipeCategory.MISC, ModRegistry.LAPIS_ORE.get(), Blocks.LAPIS_BLOCK);
threeByThreePacker(RecipeCategory.MISC, ModRegistry.NETHER_QUARTZ_ORE.get(), Blocks.QUARTZ_BLOCK);
threeByThreePacker(RecipeCategory.MISC, ModRegistry.REDSTONE_ORE.get(), Blocks.REDSTONE_BLOCK);
ShapedRecipeBuilder.shaped(this.registries.lookupOrThrow(Registries.ITEM),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(this.output);
}

// The runner class, this should be added to the DataGenerator as a DataProvider
Expand Down

0 comments on commit 0451efa

Please sign in to comment.