-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Gu-ZT:releases/1.20.1' into releases/1.20.1
- Loading branch information
Showing
10 changed files
with
359 additions
and
11 deletions.
There are no files selected for viewing
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
35 changes: 35 additions & 0 deletions
35
...generated/resources/data/anvilcraft/advancements/recipes/misc/stamping/geode_2_jewel.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,35 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_prismarine_cluster": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"anvilcraft:prismarine_cluster" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "anvilcraft:stamping/geode_2_jewel" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_prismarine_cluster", | ||
"has_the_recipe" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"anvilcraft:stamping/geode_2_jewel" | ||
] | ||
}, | ||
"sends_telemetry_event": false | ||
} |
89 changes: 89 additions & 0 deletions
89
fabric/src/generated/resources/data/anvilcraft/recipes/stamping/geode_2_jewel.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,89 @@ | ||
{ | ||
"type": "anvilcraft:anvil_processing", | ||
"icon": { | ||
"count": 2, | ||
"item": "minecraft:amethyst_shard" | ||
}, | ||
"outcomes": [ | ||
{ | ||
"type": "spawn_item", | ||
"chance": 1.0, | ||
"offset": [ | ||
0.0, | ||
-0.75, | ||
0.0 | ||
], | ||
"result": { | ||
"count": 2, | ||
"item": "minecraft:amethyst_shard" | ||
} | ||
}, | ||
{ | ||
"type": "spawn_item", | ||
"chance": 0.25, | ||
"offset": [ | ||
0.0, | ||
-0.75, | ||
0.0 | ||
], | ||
"result": { | ||
"item": "anvilcraft:topaz" | ||
} | ||
}, | ||
{ | ||
"type": "spawn_item", | ||
"chance": 0.25, | ||
"offset": [ | ||
0.0, | ||
-0.75, | ||
0.0 | ||
], | ||
"result": { | ||
"item": "anvilcraft:sapphire" | ||
} | ||
}, | ||
{ | ||
"type": "spawn_item", | ||
"chance": 0.25, | ||
"offset": [ | ||
0.0, | ||
-0.75, | ||
0.0 | ||
], | ||
"result": { | ||
"item": "anvilcraft:ruby" | ||
} | ||
} | ||
], | ||
"predicates": [ | ||
{ | ||
"type": "has_block", | ||
"match_block": { | ||
"blocks": [ | ||
"anvilcraft:stamping_platform" | ||
] | ||
}, | ||
"offset": [ | ||
0.0, | ||
-1.0, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"type": "has_item_ingredient", | ||
"match_item": { | ||
"count": { | ||
"min": 1 | ||
}, | ||
"items": [ | ||
"anvilcraft:geode" | ||
] | ||
}, | ||
"offset": [ | ||
0.0, | ||
-0.75, | ||
0.0 | ||
] | ||
} | ||
] | ||
} |
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
34 changes: 34 additions & 0 deletions
34
fabric/src/main/java/dev/dubhe/anvilcraft/listener/fabric/LootTableListener.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 dev.dubhe.anvilcraft.listener.fabric; | ||
|
||
import dev.dubhe.anvilcraft.AnvilCraft; | ||
import dev.dubhe.anvilcraft.init.ModItems; | ||
import net.fabricmc.fabric.api.loot.v2.LootTableEvents; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.storage.loot.BuiltInLootTables; | ||
import net.minecraft.world.level.storage.loot.LootPool; | ||
import net.minecraft.world.level.storage.loot.entries.LootItem; | ||
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction; | ||
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; | ||
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator; | ||
|
||
public class LootTableListener { | ||
/** | ||
* 修改战利品表 | ||
*/ | ||
public static void register() { | ||
LootTableEvents.MODIFY.register((resourceManager, lootManager, id, tableBuilder, source) -> { | ||
if (Blocks.BUDDING_AMETHYST.getLootTable().equals(id)) { | ||
tableBuilder.withPool(new LootPool.Builder() | ||
.add(LootItem.lootTableItem(ModItems.GEODE)) | ||
.apply(SetItemCountFunction.setCount(ConstantValue.exactly(1))) | ||
); | ||
} | ||
if (BuiltInLootTables.SPAWN_BONUS_CHEST.equals(id)) { | ||
tableBuilder.withPool(new LootPool.Builder() | ||
.add(LootItem.lootTableItem(ModItems.GEODE)) | ||
.apply(SetItemCountFunction.setCount(UniformGenerator.between(3, 6))) | ||
); | ||
} | ||
}); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...generated/resources/data/anvilcraft/advancements/recipes/misc/stamping/geode_2_jewel.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,35 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_prismarine_cluster": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"anvilcraft:prismarine_cluster" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "anvilcraft:stamping/geode_2_jewel" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_prismarine_cluster", | ||
"has_the_recipe" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"anvilcraft:stamping/geode_2_jewel" | ||
] | ||
}, | ||
"sends_telemetry_event": false | ||
} |
89 changes: 89 additions & 0 deletions
89
forge/src/generated/resources/data/anvilcraft/recipes/stamping/geode_2_jewel.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,89 @@ | ||
{ | ||
"type": "anvilcraft:anvil_processing", | ||
"icon": { | ||
"count": 2, | ||
"item": "minecraft:amethyst_shard" | ||
}, | ||
"outcomes": [ | ||
{ | ||
"type": "spawn_item", | ||
"chance": 1.0, | ||
"offset": [ | ||
0.0, | ||
-0.75, | ||
0.0 | ||
], | ||
"result": { | ||
"count": 2, | ||
"item": "minecraft:amethyst_shard" | ||
} | ||
}, | ||
{ | ||
"type": "spawn_item", | ||
"chance": 0.25, | ||
"offset": [ | ||
0.0, | ||
-0.75, | ||
0.0 | ||
], | ||
"result": { | ||
"item": "anvilcraft:topaz" | ||
} | ||
}, | ||
{ | ||
"type": "spawn_item", | ||
"chance": 0.25, | ||
"offset": [ | ||
0.0, | ||
-0.75, | ||
0.0 | ||
], | ||
"result": { | ||
"item": "anvilcraft:sapphire" | ||
} | ||
}, | ||
{ | ||
"type": "spawn_item", | ||
"chance": 0.25, | ||
"offset": [ | ||
0.0, | ||
-0.75, | ||
0.0 | ||
], | ||
"result": { | ||
"item": "anvilcraft:ruby" | ||
} | ||
} | ||
], | ||
"predicates": [ | ||
{ | ||
"type": "has_block", | ||
"match_block": { | ||
"blocks": [ | ||
"anvilcraft:stamping_platform" | ||
] | ||
}, | ||
"offset": [ | ||
0.0, | ||
-1.0, | ||
0.0 | ||
] | ||
}, | ||
{ | ||
"type": "has_item_ingredient", | ||
"match_item": { | ||
"count": { | ||
"min": 1 | ||
}, | ||
"items": [ | ||
"anvilcraft:geode" | ||
] | ||
}, | ||
"offset": [ | ||
0.0, | ||
-0.75, | ||
0.0 | ||
] | ||
} | ||
] | ||
} |
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
9 changes: 7 additions & 2 deletions
9
forge/src/main/java/dev/dubhe/anvilcraft/listener/AnvilHammerListener.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
Oops, something went wrong.