Skip to content

Commit

Permalink
Merge pull request #266 from Gu-ZT/AnvilHammer
Browse files Browse the repository at this point in the history
调整铁砧锤配方
  • Loading branch information
Gu-ZT authored Apr 13, 2024
2 parents 25eb2e2 + 63ddb9c commit 6beb95d
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 22 deletions.
21 changes: 13 additions & 8 deletions common/src/main/java/dev/dubhe/anvilcraft/init/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ public void appendHoverText(
})
.recipe((ctx, provider) ->
ShapedTagRecipeBuilder.shaped(RecipeCategory.TOOLS, ctx.get().asItem().getDefaultInstance())
.pattern("AAA")
.pattern(" B ")
.pattern(" B ")
.define('A', Items.AMETHYST_SHARD)
.define('B', Items.STICK)
.unlockedBy("hasitem", RegistrateRecipeProvider.has(Items.AMETHYST_SHARD))
.save(provider)
.pattern("AAA")
.pattern(" B ")
.pattern(" B ")
.define('A', Items.AMETHYST_SHARD)
.define('B', Items.STICK)
.unlockedBy("hasitem", RegistrateRecipeProvider.has(Items.AMETHYST_SHARD))
.save(provider)
)
.model((ctx, provider) -> provider.handheld(ctx))
.tag(ModItemTags.PICKAXES)
Expand Down Expand Up @@ -459,9 +459,14 @@ public void appendHoverText(
.recipe((ctx, provider) -> ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ctx.get())
.pattern("A")
.pattern("B")
.pattern("C")
.define('A', Items.ANVIL)
.define('B', Items.LIGHTNING_ROD)
.unlockedBy("hasitem", RegistrateRecipeProvider.has(Items.LIGHTNING_ROD))
.define('C', Items.IRON_INGOT)
.unlockedBy(AnvilCraftDatagen.hasItem(Items.ANVIL), RegistrateRecipeProvider.has(Items.ANVIL))
.unlockedBy(AnvilCraftDatagen.hasItem(Items.LIGHTNING_ROD),
RegistrateRecipeProvider.has(Items.LIGHTNING_ROD))
.unlockedBy(AnvilCraftDatagen.hasItem(Items.IRON_INGOT), RegistrateRecipeProvider.has(Items.IRON_INGOT))
.save(provider))
.register();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_the_recipe": {
"has_anvil": {
"conditions": {
"recipe": "anvilcraft:anvil_hammer"
"items": [
{
"items": [
"minecraft:anvil"
]
}
]
},
"trigger": "minecraft:recipe_unlocked"
"trigger": "minecraft:inventory_changed"
},
"has_iron_ingot": {
"conditions": {
"items": [
{
"items": [
"minecraft:iron_ingot"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"hasitem": {
"has_lightning_rod": {
"conditions": {
"items": [
{
Expand All @@ -18,11 +36,19 @@
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "anvilcraft:anvil_hammer"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"hasitem",
"has_anvil",
"has_lightning_rod",
"has_iron_ingot",
"has_the_recipe"
]
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
},
"B": {
"item": "minecraft:lightning_rod"
},
"C": {
"item": "minecraft:iron_ingot"
}
},
"pattern": [
"A",
"B"
"B",
"C"
],
"result": {
"item": "anvilcraft:anvil_hammer"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_the_recipe": {
"has_anvil": {
"conditions": {
"recipe": "anvilcraft:anvil_hammer"
"items": [
{
"items": [
"minecraft:anvil"
]
}
]
},
"trigger": "minecraft:recipe_unlocked"
"trigger": "minecraft:inventory_changed"
},
"has_iron_ingot": {
"conditions": {
"items": [
{
"items": [
"minecraft:iron_ingot"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"hasitem": {
"has_lightning_rod": {
"conditions": {
"items": [
{
Expand All @@ -18,11 +36,19 @@
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "anvilcraft:anvil_hammer"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"hasitem",
"has_anvil",
"has_lightning_rod",
"has_iron_ingot",
"has_the_recipe"
]
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
},
"B": {
"item": "minecraft:lightning_rod"
},
"C": {
"item": "minecraft:iron_ingot"
}
},
"pattern": [
"A",
"B"
"B",
"C"
],
"result": {
"item": "anvilcraft:anvil_hammer"
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ minecraft_version=1.20.1
# Mod info
mod_id = anvilcraft
mod_name = AnvilCraft
mod_description = ...
mod_description = The mod is an anvil-centric vanilla survival expansion
mod_license = LGPL-3.0 license
mod_version = 1.2.2
mod_version = 1.2.3
mod_url = https://github.com/

maven_group=dev.dubhe
Expand Down

0 comments on commit 6beb95d

Please sign in to comment.