Skip to content

Commit

Permalink
feat.recipes: implement new Infinity Smithing recipes and advancements
Browse files Browse the repository at this point in the history
- Add Infinity Smithing Template item
- Create new recipes for Endless Cake, Infinity Bucket, and Infinity Totem
- Generate corresponding advancements for new recipes
- Update translations and rename existing items
  • Loading branch information
cnlimiter committed Dec 21, 2024
1 parent c6e0d72 commit fe1f2a4
Show file tree
Hide file tree
Showing 11 changed files with 234 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": [
"avaritia:infinity_smithing_template"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "avaritia:endless_cake"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"avaritia:endless_cake"
]
},
"sends_telemetry_event": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": [
"avaritia:infinity_smithing_template"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "avaritia:infinity_bucket"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"avaritia:infinity_bucket"
]
},
"sends_telemetry_event": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": [
"avaritia:infinity_smithing_template"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "avaritia:infinity_totem"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"avaritia:infinity_totem"
]
},
"sends_telemetry_event": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": [
"avaritia:infinity_smithing_template"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "avaritia:neutron_horse_armor"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"avaritia:neutron_horse_armor"
]
},
"sends_telemetry_event": false
}
23 changes: 23 additions & 0 deletions src/generated/resources/data/avaritia/recipes/endless_cake.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "avaritia:extreme_smithing",
"addition": [
{
"item": "minecraft:golden_carrot"
},
{
"item": "minecraft:dragon_egg"
},
{
"item": "avaritia:enhancement_core"
}
],
"base": {
"item": "minecraft:cake"
},
"result": {
"item": "avaritia:endless_cake"
},
"template": {
"item": "avaritia:infinity_smithing_template"
}
}
39 changes: 14 additions & 25 deletions src/generated/resources/data/avaritia/recipes/infinity_bucket.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
{
"type": "avaritia:shaped_table",
"category": "equipment",
"key": {
"B": {
"item": "minecraft:bucket"
"type": "avaritia:extreme_smithing",
"addition": [
{
"item": "minecraft:lava_bucket"
},
"I": {
"item": "avaritia:infinity_ingot"
{
"item": "minecraft:powder_snow_bucket"
},
"N": {
"item": "avaritia:neutron_ingot"
},
"X": {
"item": "avaritia:infinity_catalyst"
{
"item": "avaritia:enhancement_core"
}
},
"pattern": [
"NN NN",
"NNX XNN",
"NBBX XBBN",
"NBBI IBBN",
"NBBI IBBN",
"NBBIIIBBN",
"NNBBBBBNN",
" NNBBBNN ",
" NNNNN "
],
"base": {
"item": "minecraft:bucket"
},
"result": {
"item": "avaritia:infinity_bucket"
},
"show_notification": true,
"tier": 4
"template": {
"item": "avaritia:infinity_smithing_template"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "avaritia:extreme_smithing",
"addition": [
{
"item": "minecraft:potion"
},
{
"item": "minecraft:blue_ice"
},
{
"item": "avaritia:enhancement_core"
}
],
"base": {
"item": "minecraft:diamond_horse_armor"
},
"result": {
"item": "avaritia:neutron_horse_armor"
},
"template": {
"item": "avaritia:infinity_smithing_template"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.alchemy.PotionUtils;
import net.minecraft.world.item.alchemy.Potions;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.Blocks;
Expand Down Expand Up @@ -229,7 +232,34 @@ protected void buildRecipes(@NotNull Consumer<FinishedRecipe> consumer) {
RecipeCategory.MISC,
ModItems.infinity_totem.get())
.unlockedBy("has_item", has(ModItems.infinity_smithing_template.get()))
.save(consumer, Static.rl(getModItemName(ModItems.infinity_totem.get()) + "_smithing"));
.save(consumer);

ModExtremeSmithingRecipeBuilder.smithing(
Ingredient.of(ModItems.infinity_smithing_template.get()),
Ingredient.of(Items.CAKE),
CompoundIngredient.of(Ingredient.of(Items.GOLDEN_CARROT), Ingredient.of(Items.DRAGON_EGG), Ingredient.of(ModItems.enhancement_core.get())),
RecipeCategory.MISC,
ModBlocks.endless_cake.get().asItem())
.unlockedBy("has_item", has(ModItems.infinity_smithing_template.get()))
.save(consumer);

ModExtremeSmithingRecipeBuilder.smithing(
Ingredient.of(ModItems.infinity_smithing_template.get()),
Ingredient.of(Items.DIAMOND_HORSE_ARMOR),
CompoundIngredient.of(Ingredient.of(PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.SWIFTNESS)), Ingredient.of(Items.BLUE_ICE), Ingredient.of(ModItems.enhancement_core.get())),
RecipeCategory.MISC,
ModItems.neutron_horse_armor.get().asItem())
.unlockedBy("has_item", has(ModItems.infinity_smithing_template.get()))
.save(consumer);

ModExtremeSmithingRecipeBuilder.smithing(
Ingredient.of(ModItems.infinity_smithing_template.get()),
Ingredient.of(Items.BUCKET),
CompoundIngredient.of(Ingredient.of(Items.LAVA_BUCKET), Ingredient.of(Items.POWDER_SNOW_BUCKET), Ingredient.of(ModItems.enhancement_core.get())),
RecipeCategory.MISC,
ModItems.infinity_bucket.get().asItem())
.unlockedBy("has_item", has(ModItems.infinity_smithing_template.get()))
.save(consumer);

ModShapelessRecipeBuilder.shapeless(RecipeCategory.TOOLS, ModItems.cosmic_meatballs.get())
.requires(Items.PORKCHOP)
Expand Down Expand Up @@ -676,39 +706,6 @@ protected void buildRecipes(@NotNull Consumer<FinishedRecipe> consumer) {

.unlockedBy("has_item", has(ModItems.neutron_ingot.get())).save(consumer);

// ModShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.infinity_totem.get())
// .pattern(" NNN ")
// .pattern(" NIIIN ")
// .pattern(" NYIYN ")
// .pattern("CCCIIICCC")
// .pattern(" CCIIICC ")
// .pattern(" NIIIN ")
// .pattern(" NNNNN ")
// .pattern(" CCC ")
// .pattern(" C ")
// .define('N', ModItems.neutron_ingot.get())
// .define('I', ModItems.infinity_nugget.get())
// .define('Y', Items.TOTEM_OF_UNDYING)
// .define('C', ModItems.crystal_matrix_ingot.get())
//
// .unlockedBy("has_item", has(Items.TOTEM_OF_UNDYING)).save(consumer);

ModShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.infinity_bucket.get())
.pattern("NN NN")
.pattern("NNX XNN")
.pattern("NBBX XBBN")
.pattern("NBBI IBBN")
.pattern("NBBI IBBN")
.pattern("NBBIIIBBN")
.pattern("NNBBBBBNN")
.pattern(" NNBBBNN ")
.pattern(" NNNNN ")
.define('N', ModItems.neutron_ingot.get())
.define('X', ModItems.infinity_catalyst.get())
.define('I', ModItems.infinity_ingot.get())
.define('B', Items.BUCKET)

.unlockedBy("has_item", has(Items.BUCKET)).save(consumer);

ConditionalRecipe.builder().addCondition(modLoaded("ae2")).addRecipe(
ModShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ResourceLocation.tryBuild("ae2", "creative_energy_cell"))
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/avaritia/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"item.avaritia.neutron_horse_armor": "Neutronium Horse Armor",
"item.avaritia.neutron_gear": "Neutronium Gear",
"item.avaritia.enhancement_core": "Enhancement Core",
"item.avaritia.infinity_smithing_template": "Infinity Smithing Template",
"tooltip.crystal_pickaxe.enchant_1": "Set to Fortune III",
"tooltip.crystal_pickaxe.enchant_2": "Set to Silk Touch",
"tooltip.infinity_bow.type_1": "Set to Range Attack Mode",
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/assets/avaritia/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"item.avaritia.star_fuel": "恒星燃料",
"item.avaritia.infinity_nugget": "无尽之泪",
"item.avaritia.neutron_gear": "中子齿轮",
"item.avaritia.enhancement_core": "无暇核心",
"item.avaritia.enhancement_core": "无瑕核心",
"item.avaritia.infinity_smithing_template": "羽化模板",
"item.avaritia.infinity_totem": "无尽图腾",
"item.avaritia.neutron_horse_armor": "中子战马铠",
"item.avaritia.infinity_bucket": "远海鲸吞之桶",
Expand Down

0 comments on commit fe1f2a4

Please sign in to comment.