Skip to content

Commit

Permalink
Merge pull request #43 from edayot/1.20.5-crafter
Browse files Browse the repository at this point in the history
feat(crafter + custom_block): update to 1.20.5
  • Loading branch information
TheNuclearNexus authored Jul 26, 2024
2 parents c25fdeb + bbb14a2 commit 196b5f6
Show file tree
Hide file tree
Showing 132 changed files with 1,000 additions and 995 deletions.
802 changes: 398 additions & 404 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
mecha = "^0.86.0"
bolt = "^0.44.0"
mecha = "^0.94.0"
bolt = "^0.48.0"
bolt-expressions = "^0.12.2"
beet = ">=0.100.0"
beet = ">=0.105.0"
pydantic = "^2.5.2"

[tool.poetry.group.dev.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions smithed_libraries/packs/crafter/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extend: "@smithed_libraries/common.yaml"

id: smithed.crafter
name: Smithed Crafter
version: "0.3.1"
version: "0.4.0"
description: Native Library for Smithed
author: TheNuclearNexus

Expand Down Expand Up @@ -31,4 +31,4 @@ pipeline:
meta:
depends_on: # used for metadata
custom-block: "0.1.0"
minecraft_version: "1.20.4"
minecraft_version: "1.20.6"

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"criteria": {
"click_paleontology_table": {
"trigger": "minecraft:item_used_on_block",
"trigger": "minecraft:default_block_use",
"conditions": {
"location": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
data modify storage smithed.crafter:main temp.output_item set from entity @s ArmorItems[3].tag.smithed.stored_output
data modify storage smithed.crafter:main temp.output_item set from entity @s ArmorItems[3].components."minecraft:custom_data".smithed.stored_output
data remove storage smithed.crafter:main temp.output_item.Slot
execute if data entity @s ArmorItems[3].tag.smithed.stored_output.id as @e[type=item,sort=nearest,distance=..2,tag=!global.ignore,tag=!global.ignore.kill] run function smithed.crafter:impl/block/table/break/delete_output
execute if data entity @s ArmorItems[3].components."minecraft:custom_data".smithed.stored_output.id as @e[type=item,sort=nearest,distance=..2,tag=!global.ignore,tag=!global.ignore.kill] run function smithed.crafter:impl/block/table/break/delete_output

execute if entity @e[type=item,nbt={Item:{id:"minecraft:barrel",Count:1b}},limit=1,sort=nearest,distance=..3] run function smithed.crafter:impl/block/table/break/drop_item
execute if entity @e[type=item,nbt={Item:{id:"minecraft:barrel",count:1}},limit=1,sort=nearest,distance=..3] run function smithed.crafter:impl/block/table/break/drop_item
kill @s
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kill @e[type=item,nbt={Item:{id:"minecraft:barrel",Count:1b}},limit=1,sort=nearest,distance=..3]
kill @e[type=item,nbt={Item:{id:"minecraft:barrel",count:1}},limit=1,sort=nearest,distance=..3]
execute if entity @s[tag=smithed.default] run loot spawn ~ ~ ~ loot smithed.crafter:blocks/table
execute if entity @s[tag=!smithed.default] run function #smithed.crafter:event/break

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute unless data storage smithed.crafter:main root.temp.crafting_input_temp[]
execute unless data storage smithed.crafter:main root.temp.crafting_input_temp[][0].Slot run data remove storage smithed.crafter:main root.temp.crafting_input_temp[][0]
execute unless data storage smithed.crafter:main root.temp.crafting_input_temp[][-1].Slot run data remove storage smithed.crafter:main root.temp.crafting_input_temp[][-1]

data remove storage smithed.crafter:main root.temp.crafting_input_temp[][].Count
data remove storage smithed.crafter:main root.temp.crafting_input_temp[][].count
data remove storage smithed.crafter:main root.temp.crafting_input_temp[][].Slot
data modify storage smithed.crafter:main root.temp.crafting_input set value {0:[{id:"minecraft:air",item_tag:"NONE",Slot:0b},{id:"minecraft:air",item_tag:"NONE",Slot:1b},{id:"minecraft:air",item_tag:"NONE",Slot:2b}],1:[{id:"minecraft:air",item_tag:"NONE",Slot:0b},{id:"minecraft:air",item_tag:"NONE",Slot:1b},{id:"minecraft:air",item_tag:"NONE",Slot:2b}],2:[{id:"minecraft:air",item_tag:"NONE",Slot:0b},{id:"minecraft:air",item_tag:"NONE",Slot:1b},{id:"minecraft:air",item_tag:"NONE",Slot:2b}]}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,74 +1,8 @@
data modify storage smithed.crafter:main root.temp.item_tag set value []

execute if predicate smithed.crafter:block/table/tags/acacia_logs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:acacia_logs"
execute if predicate smithed.crafter:block/table/tags/anvil run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:anvil"
execute if predicate smithed.crafter:block/table/tags/arrows run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:arrows"
execute if predicate smithed.crafter:block/table/tags/axolotl_tempt_items run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:axolotl_tempt_items"
execute if predicate smithed.crafter:block/table/tags/banners run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:banners"
execute if predicate smithed.crafter:block/table/tags/beacon_payment_items run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:beacon_payment_items"
execute if predicate smithed.crafter:block/table/tags/beds run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:beds"
execute if predicate smithed.crafter:block/table/tags/birch_logs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:birch_logs"
execute if predicate smithed.crafter:block/table/tags/boats run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:boats"
execute if predicate smithed.crafter:block/table/tags/buttons run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:buttons"
execute if predicate smithed.crafter:block/table/tags/candles run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:candles"
execute if predicate smithed.crafter:block/table/tags/carpets run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:carpets"
execute if predicate smithed.crafter:block/table/tags/cluster_max_harvestables run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:cluster_max_harvestables"
execute if predicate smithed.crafter:block/table/tags/coals run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:coals"
execute if predicate smithed.crafter:block/table/tags/coal_ores run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:coal_ores"
execute if predicate smithed.crafter:block/table/tags/copper_ores run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:copper_ores"
execute if predicate smithed.crafter:block/table/tags/creeper_drop_music_discs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:creeper_drop_music_discs"
execute if predicate smithed.crafter:block/table/tags/crimson_stems run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:crimson_stems"
execute if predicate smithed.crafter:block/table/tags/dark_oak_logs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:dark_oak_logs"
execute if predicate smithed.crafter:block/table/tags/diamond_ores run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:diamond_ores"
execute if predicate smithed.crafter:block/table/tags/doors run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:doors"
execute if predicate smithed.crafter:block/table/tags/emerald_ores run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:emerald_ores"
execute if predicate smithed.crafter:block/table/tags/fences run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:fences"
execute if predicate smithed.crafter:block/table/tags/fishes run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:fishes"
execute if predicate smithed.crafter:block/table/tags/flowers run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:flowers"
execute if predicate smithed.crafter:block/table/tags/fox_food run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:fox_food"
execute if predicate smithed.crafter:block/table/tags/freeze_immune_wearables run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:freeze_immune_wearables"
execute if predicate smithed.crafter:block/table/tags/gold_ores run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:gold_ores"
execute if predicate smithed.crafter:block/table/tags/ignored_by_piglin_babies run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:ignored_by_piglin_babies"
execute if predicate smithed.crafter:block/table/tags/iron_ores run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:iron_ores"
execute if predicate smithed.crafter:block/table/tags/jungle_logs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:jungle_logs"
execute if predicate smithed.crafter:block/table/tags/lapis_ores run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:lapis_ores"
execute if predicate smithed.crafter:block/table/tags/leaves run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:leaves"
execute if predicate smithed.crafter:block/table/tags/lectern_books run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:lectern_books"
execute if predicate smithed.crafter:block/table/tags/logs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:logs"
execute if predicate smithed.crafter:block/table/tags/logs_that_burn run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:logs_that_burn"
execute if predicate smithed.crafter:block/table/tags/music_discs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:music_discs"
execute if predicate smithed.crafter:block/table/tags/non_flammable_wood run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:non_flammable_wood"
execute if predicate smithed.crafter:block/table/tags/oak_logs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:oak_logs"
execute if predicate smithed.crafter:block/table/tags/occludes_vibration_signals run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:occludes_vibration_signals"
execute if predicate smithed.crafter:block/table/tags/piglin_food run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:piglin_food"
execute if predicate smithed.crafter:block/table/tags/piglin_loved run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:piglin_loved"
execute if predicate smithed.crafter:block/table/tags/piglin_repellents run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:piglin_repellents"
execute if predicate smithed.crafter:block/table/tags/planks run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:planks"
execute if predicate smithed.crafter:block/table/tags/rails run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:rails"
execute if predicate smithed.crafter:block/table/tags/redstone_ores run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:redstone_ores"
execute if predicate smithed.crafter:block/table/tags/sand run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:sand"
execute if predicate smithed.crafter:block/table/tags/saplings run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:saplings"
execute if predicate smithed.crafter:block/table/tags/signs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:signs"
execute if predicate smithed.crafter:block/table/tags/slabs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:slabs"
execute if predicate smithed.crafter:block/table/tags/small_flowers run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:small_flowers"
execute if predicate smithed.crafter:block/table/tags/soul_fire_base_blocks run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:soul_fire_base_blocks"
execute if predicate smithed.crafter:block/table/tags/spruce_logs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:spruce_logs"
execute if predicate smithed.crafter:block/table/tags/stairs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:stairs"
execute if predicate smithed.crafter:block/table/tags/stone_bricks run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:stone_bricks"
execute if predicate smithed.crafter:block/table/tags/stone_crafting_materials run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:stone_crafting_materials"
execute if predicate smithed.crafter:block/table/tags/stone_tool_materials run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:stone_tool_materials"
execute if predicate smithed.crafter:block/table/tags/tall_flowers run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:tall_flowers"
execute if predicate smithed.crafter:block/table/tags/trapdoors run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:trapdoors"
execute if predicate smithed.crafter:block/table/tags/walls run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:walls"
execute if predicate smithed.crafter:block/table/tags/warped_stems run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:warped_stems"
execute if predicate smithed.crafter:block/table/tags/wooden_buttons run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:wooden_buttons"
execute if predicate smithed.crafter:block/table/tags/wooden_doors run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:wooden_doors"
execute if predicate smithed.crafter:block/table/tags/wooden_fences run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:wooden_fences"
execute if predicate smithed.crafter:block/table/tags/wooden_pressure_plates run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:wooden_pressure_plates"
execute if predicate smithed.crafter:block/table/tags/wooden_slabs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:wooden_slabs"
execute if predicate smithed.crafter:block/table/tags/wooden_stairs run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:wooden_stairs"
execute if predicate smithed.crafter:block/table/tags/wooden_trapdoors run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:wooden_trapdoors"
execute if predicate smithed.crafter:block/table/tags/wool run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:wool"

function #smithed.crafter:event/query_tags

# auto generated by "smithed_librairies/packs/crafter.py" at build time
# commands in order :
# - data modify storage smithed.crafter:main root.temp.item_tag set value []
# - execute
# if predicate smithed.crafter:block/table/tags/acacia_logs
# run data modify storage smithed.crafter:main root.temp.item_tag append value "#minecraft:acacia_logs"
# - (...) (part auto generated by "smithed_librairies/packs/crafter.py" at build time)
# - function #smithed.crafter:event/query_tags
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ execute if entity @s[scores={smithed.data=0}] run function smithed.crafter:impl/
# If something was crafted, add the assembled output nonsense
execute if entity @s[scores={smithed.data=0}] run data remove block ~ ~ ~ Items[{Slot:16b}]
execute if entity @s[scores={smithed.data=1..}] run tag @s add smithed.crafter.assembled_output
data modify entity @s ArmorItems[3].tag.smithed.stored_barrel_data set from block ~ ~ ~ Items
execute if entity @s[scores={smithed.data=1..}] run data modify entity @s ArmorItems[3].tag.smithed.stored_output set from block ~ ~ ~ Items[{Slot:16b}]
data modify entity @s ArmorItems[3].components."minecraft:custom_data".smithed.stored_barrel_data set from block ~ ~ ~ Items
execute if entity @s[scores={smithed.data=1..}] run data modify entity @s ArmorItems[3].components."minecraft:custom_data".smithed.stored_output set from block ~ ~ ~ Items[{Slot:16b}]
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ execute if score @s smithed.data matches 0 run tag @s add smithed.no_shift_click
function smithed.crafter:impl/block/table/crafting/manage_invalids/spawn_loop

# Reset the saved tag to have nothing in it because you just exported the output
data modify entity @s ArmorItems[3].tag.smithed.stored_output set value {Slot:16b}
data modify entity @s ArmorItems[3].components."minecraft:custom_data".smithed.stored_output set value {Slot:16b}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
####################

scoreboard players remove @s smithed.data 1
execute as @p[tag=smithed.inside_crafter,gamemode=!spectator] at @s run summon item ~ ~ ~ {Item:{id:"stone",Count:1b},Tags:["smithed.replace_item","global.ignore"]}
execute as @p[tag=smithed.inside_crafter,gamemode=!spectator] at @s run summon item ~ ~ ~ {Item:{id:"stone",count:1},Tags:["smithed.replace_item","global.ignore"]}
data modify entity @e[type=item,limit=1,tag=smithed.replace_item] Item set from storage smithed.crafter:main root.temp.export_items[0]
data remove storage smithed.crafter:main root.temp.export_items[0]
tag @e[type=item,limit=1,tag=smithed.replace_item] remove smithed.replace_item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
####################

tag @s remove smithed.no_shift_click
execute if data entity @s ArmorItems[3].tag.smithed.stored_output.id run function smithed.crafter:impl/block/table/crafting/manage_invalids/export_output
execute if data entity @s ArmorItems[3].components."minecraft:custom_data".smithed.stored_output.id run function smithed.crafter:impl/block/table/crafting/manage_invalids/export_output
execute if entity @s[tag=smithed.crafter.assembled_output] run function smithed.crafter:impl/block/table/crafting/output/clear_input
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
execute unless data storage smithed.crafter:input {flags:["consume_buckets"]} if predicate smithed.crafter:block/table/special_clear/buckets store success score $temp smithed.data run function smithed.crafter:impl/block/table/crafting/output/clear_input/advanced/buckets
execute unless data storage smithed.crafter:input {flags:["consume_tools"]} if predicate smithed.crafter:block/table/special_clear/tools unless data entity @s {HandItems:[{tag:{Unbreakable:1b}}]} run function smithed.crafter:impl/block/table/crafting/output/clear_input/handle_tools

execute unless data storage smithed.crafter:input {flags:["consume_buckets"]} if predicate smithed.crafter:block/table/special_clear/buckets run function smithed.crafter:impl/block/table/crafting/output/clear_input/advanced/buckets
# if the item is a tool, not unbreakable and does not have not_tool:1b
execute
unless data storage smithed.crafter:input {flags:["consume_tools"]}
if items entity @s weapon.mainhand *[minecraft:max_damage,!minecraft:unbreakable,!minecraft:custom_data~{smithed:{not_tool:1b}}]
run function smithed.crafter:impl/block/table/crafting/output/clear_input/handle_tools
function #smithed.crafter:event/advanced_remove
Loading

0 comments on commit 196b5f6

Please sign in to comment.