From 79b92c30f4728fc60ba5d07ecf79bc00169cf1fe Mon Sep 17 00:00:00 2001 From: Thanathor Date: Fri, 25 Aug 2023 16:10:51 +0200 Subject: [PATCH 01/26] add furniture datapack --- gm4_furniture/README.md | 6 ++ gm4_furniture/beet.yaml | 30 +++++++ .../tags/functions/check_recipes.json | 5 ++ .../advancements/hit_furniture.json | 37 +++++++++ .../advancements/interact_with_furniture.json | 23 ++++++ .../advancements/place_furniture.json | 49 ++++++++++++ .../advancements/use_paintbrush_on_horse.json | 29 +++++++ .../functions/break/destroy.mcfunction | 5 ++ .../functions/break/detect_hit.mcfunction | 6 ++ .../functions/break/drop_item.mcfunction | 2 + .../functions/break/find_main.mcfunction | 5 ++ .../functions/break/process_hit.mcfunction | 10 +++ .../functions/break/remove_block.mcfunction | 4 + .../functions/check_recipe.mcfunction | 4 + .../gm4_furniture/functions/init.mcfunction | 13 +++ .../functions/interact/detect.mcfunction | 13 +++ .../interact/paint/detect.mcfunction | 4 + .../interact/paint/process.mcfunction | 8 ++ .../functions/interact/sit/detect.mcfunction | 4 + .../functions/interact/sit/process.mcfunction | 4 + .../gm4_furniture/functions/main.mcfunction | 4 + .../functions/place/check_layer.mcfunction | 68 ++++++++++++++++ .../place/check_size/depth_loop.mcfunction | 12 +++ .../place/check_size/depth_offset.mcfunction | 9 +++ .../place/check_size/depth_prep.mcfunction | 9 +++ .../place/check_size/height_loop.mcfunction | 12 +++ .../place/check_size/height_offset.mcfunction | 9 +++ .../place/check_size/height_prep.mcfunction | 10 +++ .../place/check_size/length_loop.mcfunction | 12 +++ .../place/check_size/length_offset.mcfunction | 10 +++ .../place/check_size/length_prep.mcfunction | 8 ++ .../place/count_heads/east.mcfunction | 27 +++++++ .../place/count_heads/north.mcfunction | 27 +++++++ .../place/count_heads/south.mcfunction | 27 +++++++ .../place/count_heads/west.mcfunction | 27 +++++++ .../place/place_furniture.mcfunction | 29 +++++++ .../functions/place/prep_place.mcfunction | 19 +++++ .../functions/place/resolve_id.mcfunction | 5 ++ .../paintbrush/remove_from_horse.mcfunction | 3 + .../paintbrush/used_on_horse.mcfunction | 9 +++ .../loot_tables/crafting/paintbrush.json | 29 +++++++ .../loot_tables/furniture/base.json | 20 +++++ .../loot_tables/items/paintbrush.json | 28 +++++++ .../predicates/holding_paintbrush.json | 14 ++++ .../tags/blocks/player_heads.json | 6 ++ .../templates/functions/template.mcfunction | 69 ++++++++++++++++ .../templates/loot_tables/template.json | 31 +++++++ gm4_furniture/generate.py | 80 +++++++++++++++++++ 48 files changed, 874 insertions(+) create mode 100644 gm4_furniture/README.md create mode 100644 gm4_furniture/beet.yaml create mode 100644 gm4_furniture/data/gm4_custom_crafters/tags/functions/check_recipes.json create mode 100644 gm4_furniture/data/gm4_furniture/advancements/hit_furniture.json create mode 100644 gm4_furniture/data/gm4_furniture/advancements/interact_with_furniture.json create mode 100644 gm4_furniture/data/gm4_furniture/advancements/place_furniture.json create mode 100644 gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json create mode 100644 gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/check_recipe.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/init.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/detect.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/paint/detect.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/sit/detect.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/main.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_layer.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_size/length_prep.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/count_heads/east.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/count_heads/north.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/count_heads/south.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/count_heads/west.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/remove_from_horse.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/used_on_horse.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/loot_tables/crafting/paintbrush.json create mode 100644 gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json create mode 100644 gm4_furniture/data/gm4_furniture/loot_tables/items/paintbrush.json create mode 100644 gm4_furniture/data/gm4_furniture/predicates/holding_paintbrush.json create mode 100644 gm4_furniture/data/gm4_furniture/tags/blocks/player_heads.json create mode 100644 gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/templates/loot_tables/template.json create mode 100644 gm4_furniture/generate.py diff --git a/gm4_furniture/README.md b/gm4_furniture/README.md new file mode 100644 index 0000000000..7a86e8f4b7 --- /dev/null +++ b/gm4_furniture/README.md @@ -0,0 +1,6 @@ +# Furniture + +Add Furniture TODO: improve this readme! + +### Features +- Add Furniture diff --git a/gm4_furniture/beet.yaml b/gm4_furniture/beet.yaml new file mode 100644 index 0000000000..1fff13d64b --- /dev/null +++ b/gm4_furniture/beet.yaml @@ -0,0 +1,30 @@ +id: gm4_furniture +name: Furniture +version: 1.0.X + +data_pack: + load: . + +pipeline: + - gm4_furniture.generate + - gm4.plugins.extend.module + - gm4.plugins.include.lib_custom_crafters + +meta: + gm4: + versioning: + required: + - lib_custom_crafters: 3.0.0 + schedule_loops: [main] + website: + description: Furniture! + recommended: [] + notes: + - Resourcepack is required for this module to work. + video: null + wiki: https://wiki.gm4.co/wiki/Furniture + credits: + Creator: + - Thanathor + Textures: + - kyrkis diff --git a/gm4_furniture/data/gm4_custom_crafters/tags/functions/check_recipes.json b/gm4_furniture/data/gm4_custom_crafters/tags/functions/check_recipes.json new file mode 100644 index 0000000000..eb50d22499 --- /dev/null +++ b/gm4_furniture/data/gm4_custom_crafters/tags/functions/check_recipes.json @@ -0,0 +1,5 @@ +{ + "values": [ + "gm4_furniture:check_recipe" + ] +} diff --git a/gm4_furniture/data/gm4_furniture/advancements/hit_furniture.json b/gm4_furniture/data/gm4_furniture/advancements/hit_furniture.json new file mode 100644 index 0000000000..3069fa9e28 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/advancements/hit_furniture.json @@ -0,0 +1,37 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "player": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type_specific": { + "type": "player", + "gamemode": "adventure" + } + } + } + } + ], + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:interaction", + "nbt": "{Tags:[\"gm4_furniture\"]}" + } + } + ] + } + } + }, + "rewards": { + "function": "gm4_furniture:break/detect_hit" + } +} diff --git a/gm4_furniture/data/gm4_furniture/advancements/interact_with_furniture.json b/gm4_furniture/data/gm4_furniture/advancements/interact_with_furniture.json new file mode 100644 index 0000000000..f171a1b3de --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/advancements/interact_with_furniture.json @@ -0,0 +1,23 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "player": [], + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:interaction", + "nbt": "{Tags:[\"gm4_furniture\"]}" + } + } + ] + } + } + }, + "rewards": { + "function": "gm4_furniture:interact/detect" + } +} diff --git a/gm4_furniture/data/gm4_furniture/advancements/place_furniture.json b/gm4_furniture/data/gm4_furniture/advancements/place_furniture.json new file mode 100644 index 0000000000..ab8a39e6c8 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/advancements/place_furniture.json @@ -0,0 +1,49 @@ +{ + "criteria": { + "placed_furniture": { + "trigger": "minecraft:placed_block", + "conditions": { + "location": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:player_head" + ], + "nbt": "{SkullOwner:{Properties:{textures:[{Signature:\"gm4_furniture\"}]}}}" + } + } + ], + "player": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "gm4_furniture" + }, + "score": "load.status" + }, + "range": 1 + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "gm4_furniture_minor" + }, + "score": "load.status" + }, + "range": 0 + } + ] + } + } + }, + "rewards": { + "function": "gm4_furniture:place/place_furniture" + } +} diff --git a/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json b/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json new file mode 100644 index 0000000000..907c746189 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json @@ -0,0 +1,29 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "player": [], + "item": { + "items": [ + "minecraft:leather_horse_armor" + ], + "nbt": "{gm4_furniture:paintbrush}" + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:horse" + } + } + ] + } + } + }, + "rewards": { + "function": "gm4_furniture:technical/paintbrush/used_on_horse" + } + } + \ No newline at end of file diff --git a/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction new file mode 100644 index 0000000000..222b0c8a6f --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction @@ -0,0 +1,5 @@ + +execute if score $creative gm4_furniture_data matches 0 positioned ~-0.4999 ~0.0001 ~-0.4999 as @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] run function gm4_furniture:break/drop_item with entity @s item.tag.data + +execute as @e[type=interaction,tag=gm4_furniture,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s run function gm4_furniture:break/remove_block +playsound minecraft:entity.armor_stand.break block @a[distance=..8] ~ ~ ~ 1 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction new file mode 100644 index 0000000000..b81602e0ce --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction @@ -0,0 +1,6 @@ + +advancement revoke @s only gm4_furniture:hit_furniture + +execute store success score $creative gm4_furniture_data if entity @s[gamemode=creative] + +execute as @e[type=interaction,tag=gm4_furniture,distance=..8] if data entity @s attack at @s run function gm4_furniture:break/find_main diff --git a/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction new file mode 100644 index 0000000000..1bc940ac4b --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction @@ -0,0 +1,2 @@ + +$loot spawn ~.5 ~.25 ~.5 loot $(loot_table) diff --git a/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction new file mode 100644 index 0000000000..82cdd51a74 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction @@ -0,0 +1,5 @@ + +execute store result score $hit gm4_furniture_last_hit run data get entity @s attack.timestamp +scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id +execute as @e[type=interaction,tag=gm4_furniture.main,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s run function gm4_furniture:break/process_hit +data remove entity @s attack diff --git a/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction new file mode 100644 index 0000000000..d0826bd81c --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction @@ -0,0 +1,10 @@ + +scoreboard players operation $check_break gm4_furniture_last_hit = $hit gm4_furniture_last_hit +scoreboard players operation $check_break gm4_furniture_last_hit -= @s gm4_furniture_last_hit +execute if score $creative gm4_furniture_data matches 1 run scoreboard players set $check_break gm4_furniture_last_hit 0 + +execute if score $check_break gm4_furniture_last_hit matches ..4 run function gm4_furniture:break/destroy +execute unless score $check_break gm4_furniture_last_hit matches ..4 run scoreboard players operation @s gm4_furniture_last_hit = $hit gm4_furniture_last_hit + +playsound minecraft:entity.armor_stand.hit block @a[distance=..8] ~ ~ ~ 1 1 +playsound minecraft:entity.player.attack.strong block @a[distance=..8] ~ ~ ~ 1 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction new file mode 100644 index 0000000000..5451e91190 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction @@ -0,0 +1,4 @@ + +execute positioned ~0.0001 ~0.5001 ~0.0001 run setblock ~ ~ ~ air +execute positioned ~-0.4999 ~0.0001 ~-0.4999 run kill @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] +kill @s diff --git a/gm4_furniture/data/gm4_furniture/functions/check_recipe.mcfunction b/gm4_furniture/data/gm4_furniture/functions/check_recipe.mcfunction new file mode 100644 index 0000000000..08f01b6c30 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/check_recipe.mcfunction @@ -0,0 +1,4 @@ +# @s = custom crafter running recipes +# run from #gm4_custom_crafters:check_recipes + +execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 5 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:0b,id:"minecraft:string"},{Slot:1b,id:"minecraft:string"},{Slot:2b,id:"minecraft:string"},{Slot:4b,id:"minecraft:iron_ingot"},{Slot:7b,id:"minecraft:stick"}]} run loot replace block ~ ~ ~ container.0 loot gm4_furniture:crafting/paintbrush diff --git a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction new file mode 100644 index 0000000000..8071506d61 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction @@ -0,0 +1,13 @@ +execute unless score furniture gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Furniture"} +execute unless score furniture gm4_earliest_version < furniture gm4_modules run scoreboard players operation furniture gm4_earliest_version = furniture gm4_modules +scoreboard players set furniture gm4_modules 1 + +scoreboard objectives add gm4_furniture_data dummy +scoreboard objectives add gm4_furniture_last_hit dummy +scoreboard objectives add gm4_furniture_id dummy + +scoreboard players set #2 gm4_furniture_data 2 + +schedule function gm4_furniture:main 1t + +#$moduleUpdateList diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/detect.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/detect.mcfunction new file mode 100644 index 0000000000..c004bf23d1 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/detect.mcfunction @@ -0,0 +1,13 @@ + +advancement revoke @s only gm4_furniture:interact_with_furniture + +scoreboard players set $interaction_processed gm4_furniture_data 0 + +# check for painting +execute if predicate gm4_furniture:holding_paintbrush run function gm4_furniture:interact/paint/detect + +# check for sitting +execute if score $interaction_processed gm4_furniture_data matches 0 unless predicate gm4_furniture:holding_paintbrush run function gm4_furniture:interact/sit/detect + +# cleanup if nothing else triggered +execute if score $interaction_processed gm4_furniture_data matches 0 as @e[type=interaction,tag=gm4_furniture,distance=..8] if data entity @s interaction run data remove entity @s interaction diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/paint/detect.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/paint/detect.mcfunction new file mode 100644 index 0000000000..0d1e010da4 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/paint/detect.mcfunction @@ -0,0 +1,4 @@ + +data modify storage gm4_furniture:temp color set from entity @s SelectedItem.tag.display.color +execute if data storage gm4_furniture:temp color as @e[type=interaction,tag=gm4_furniture.dyable,distance=..8] if data entity @s interaction at @s run function gm4_furniture:interact/paint/process +data remove storage gm4_furniture:temp color diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction new file mode 100644 index 0000000000..dff5b0ca93 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction @@ -0,0 +1,8 @@ + +scoreboard players set $interaction_processed gm4_furniture_data 1 + +scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id +execute as @e[type=interaction,tag=gm4_furniture.main,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s positioned ~-0.4999 ~0.0001 ~-0.4999 as @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] store success score $paint_changed gm4_furniture_data run data modify entity @s item.tag.display.color set from storage gm4_furniture:temp color +data remove entity @s interaction + +execute if score $paint_changed gm4_furniture_data matches 1 run playsound item.dye.use player @a[distance=..8] ~ ~ ~ 1 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sit/detect.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/sit/detect.mcfunction new file mode 100644 index 0000000000..5c08c1d110 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/sit/detect.mcfunction @@ -0,0 +1,4 @@ + +tag @s add gm4_furniture_target +execute as @e[type=interaction,tag=gm4_furniture.sittable,distance=..8] if data entity @s interaction at @s positioned ~-0.4999 ~0.0001 ~-0.4999 run function gm4_furniture:interact/sit/process +tag @s remove gm4_furniture_target diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction new file mode 100644 index 0000000000..79357e0980 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction @@ -0,0 +1,4 @@ + +ride @p[tag=gm4_furniture_target] dismount +ride @p[tag=gm4_furniture_target] mount @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] +data remove entity @s interaction diff --git a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction new file mode 100644 index 0000000000..2309a28baa --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction @@ -0,0 +1,4 @@ +schedule function gm4_furniture:main 8t + +# check horses, remove paintbrushes that have been equipped +execute as @e[type=horse,nbt={ArmorItems:[{tag:{gm4_furniture:"paintbrush"}}]}] at @s run function gm4_furniture:technical/paintbrush/remove_from_horse diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_layer.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_layer.mcfunction new file mode 100644 index 0000000000..9a49ee6582 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_layer.mcfunction @@ -0,0 +1,68 @@ +# replaces any furniture player heads with their corresponding furniture +# @s = player that just placed a furniture player head +# at @s rotated positioned ^-4 ^X ^-1, X = layer number - 4 +# run from place/place_furniture + +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^ ^ ^ if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^1 ^ ^ if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^2 ^ ^ if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^3 ^ ^ if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^4 ^ ^ if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^5 ^ ^ if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^6 ^ ^ if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^7 ^ ^ if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^8 ^ ^ if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place + +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^ ^ ^1 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^1 ^ ^1 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^2 ^ ^1 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^3 ^ ^1 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^4 ^ ^1 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^5 ^ ^1 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^6 ^ ^1 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^7 ^ ^1 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^8 ^ ^1 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place + +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^ ^ ^2 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^1 ^ ^2 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^2 ^ ^2 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^3 ^ ^2 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^4 ^ ^2 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^5 ^ ^2 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^6 ^ ^2 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^7 ^ ^2 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^8 ^ ^2 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place + +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^ ^ ^3 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^1 ^ ^3 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^2 ^ ^3 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^3 ^ ^3 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^4 ^ ^3 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^5 ^ ^3 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^6 ^ ^3 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^7 ^ ^3 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^8 ^ ^3 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place + +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^ ^ ^4 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^1 ^ ^4 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^2 ^ ^4 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^3 ^ ^4 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^4 ^ ^4 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^5 ^ ^4 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^6 ^ ^4 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^7 ^ ^4 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^8 ^ ^4 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place + +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^ ^ ^5 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^1 ^ ^5 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^2 ^ ^5 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^3 ^ ^5 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^4 ^ ^5 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^5 ^ ^5 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^6 ^ ^5 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^7 ^ ^5 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place +execute if score $player_head_count gm4_furniture_data matches 1.. positioned ^8 ^ ^5 if block ~ ~ ~ #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} run function gm4_furniture:place/prep_place + + +scoreboard players add $layer_count gm4_furniture_data 1 +execute if score $player_head_count gm4_furniture_data matches 1.. if score $layer_count gm4_furniture_data matches ..10 positioned ~ ~1 ~ run function gm4_furniture:place/check_layer diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction new file mode 100644 index 0000000000..e2b95624ac --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction @@ -0,0 +1,12 @@ +# check if furniture fits here +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^ ^ ^x +# run from place/check_size/depth_prep +# run from here + +execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 +summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} + +scoreboard players remove $depth gm4_furniture_data 1 +execute if score $depth gm4_furniture_data matches 1.. positioned ^ ^ ^1 run function gm4_furniture:place/check_size/depth_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction new file mode 100644 index 0000000000..179465b445 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction @@ -0,0 +1,9 @@ +# check if furniture fits here +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^x ^ ^ +# run from place/check_size/depth_prep +# run from here + +execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 +summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction new file mode 100644 index 0000000000..233b64594d --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction @@ -0,0 +1,9 @@ +# check if furniture fits here +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall, or at any placed marker +# run from any in place/furniture/ + +execute if score $depth gm4_furniture_data matches 3.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^ ^-1 run function gm4_furniture:place/check_size/depth_offset +execute if score $depth gm4_furniture_data matches 3.. run scoreboard players remove $depth gm4_furniture_data 1 +scoreboard players remove $depth gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^ ^1 run function gm4_furniture:place/check_size/depth_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction new file mode 100644 index 0000000000..0999a555b2 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction @@ -0,0 +1,12 @@ +# check if furniture fits here +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^ ^ ^x +# run from place/check_size/height_prep +# run from here + +execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 +summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} + +scoreboard players remove $height gm4_furniture_data 1 +execute if score $height gm4_furniture_data matches 1.. positioned ^ ^ ^1 run function gm4_furniture:place/check_size/height_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction new file mode 100644 index 0000000000..64a412445f --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction @@ -0,0 +1,9 @@ +# check if furniture fits here +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^x ^ ^ +# run from place/check_size/height_prep +# run from here + +execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 +summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction new file mode 100644 index 0000000000..c0df450528 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction @@ -0,0 +1,10 @@ +# check if furniture fits here +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall, or at any placed marker +# run from any in place/furniture/ + +# height is only offset down if this is a wall placed furniture (painting) +execute if score $height gm4_furniture_data matches 3.. if score $wall_only gm4_furniture_data matches 1 at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^-1 ^ run function gm4_furniture:place/check_size/height_offset +execute if score $height gm4_furniture_data matches 3.. if score $wall_only gm4_furniture_data matches 1 run scoreboard players remove $height gm4_furniture_data 1 +scoreboard players remove $height gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^ ^1 run function gm4_furniture:place/check_size/height_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction new file mode 100644 index 0000000000..12107b826f --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction @@ -0,0 +1,12 @@ +# check if furniture fits here +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^x ^ ^ +# run from place/check_size/length_prep +# run from here + +execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 +summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} + +scoreboard players remove $length gm4_furniture_data 1 +execute if score $length gm4_furniture_data matches 1.. positioned ^-1 ^ ^ run function gm4_furniture:place/check_size/length_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction new file mode 100644 index 0000000000..87ced544fc --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction @@ -0,0 +1,10 @@ +# check if furniture fits here +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^x ^ ^ +# run from place/check_size/length_prep +# run from here + +execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 +summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} +scoreboard players remove $length gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_prep.mcfunction new file mode 100644 index 0000000000..9b178395af --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_prep.mcfunction @@ -0,0 +1,8 @@ +# check if furniture fits here +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall +# run from any in place/furniture/ + +execute if score $length gm4_furniture_data matches 3.. positioned ^1 ^ ^ run function gm4_furniture:place/check_size/length_offset +scoreboard players remove $length gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 0 positioned ^-1 ^ ^ run function gm4_furniture:place/check_size/length_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/count_heads/east.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/count_heads/east.mcfunction new file mode 100644 index 0000000000..2425a603fa --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/count_heads/east.mcfunction @@ -0,0 +1,27 @@ +# counts the number of players heads +# @s = player that just placed a furniture player head +# at @s +# run from place/place_furniture + +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~-4 ~-4 ~4 ~-4 ~4 ~-1 ~-4 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~-3 ~-4 ~4 ~-3 ~4 ~-1 ~-3 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~-2 ~-4 ~4 ~-2 ~4 ~-1 ~-2 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~-1 ~-4 ~4 ~-1 ~4 ~-1 ~-1 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~ ~-4 ~4 ~ ~4 ~-1 ~ ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~1 ~-4 ~4 ~1 ~4 ~-1 ~1 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~2 ~-4 ~4 ~2 ~4 ~-1 ~2 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~3 ~-4 ~4 ~3 ~4 ~-1 ~3 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~4 ~-4 ~4 ~4 ~4 ~-1 ~4 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~5 ~-4 ~4 ~5 ~4 ~-1 ~5 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-1 ~6 ~-4 ~4 ~6 ~4 ~-1 ~6 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data diff --git a/gm4_furniture/data/gm4_furniture/functions/place/count_heads/north.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/count_heads/north.mcfunction new file mode 100644 index 0000000000..7803ff3c6a --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/count_heads/north.mcfunction @@ -0,0 +1,27 @@ +# counts the number of players heads +# @s = player that just placed a furniture player head +# at @s +# run from place/place_furniture + +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-4 ~-4 ~4 ~-4 ~1 ~-4 ~-4 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-3 ~-4 ~4 ~-3 ~1 ~-4 ~-3 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-2 ~-4 ~4 ~-2 ~1 ~-4 ~-2 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-1 ~-4 ~4 ~-1 ~1 ~-4 ~-1 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~ ~-4 ~4 ~ ~1 ~-4 ~ ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~1 ~-4 ~4 ~1 ~1 ~-4 ~1 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~2 ~-4 ~4 ~2 ~1 ~-4 ~2 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~3 ~-4 ~4 ~3 ~1 ~-4 ~3 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~4 ~-4 ~4 ~4 ~1 ~-4 ~4 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~5 ~-4 ~4 ~5 ~1 ~-4 ~5 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~6 ~-4 ~4 ~6 ~1 ~-4 ~6 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data diff --git a/gm4_furniture/data/gm4_furniture/functions/place/count_heads/south.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/count_heads/south.mcfunction new file mode 100644 index 0000000000..079d88568c --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/count_heads/south.mcfunction @@ -0,0 +1,27 @@ +# counts the number of players heads +# @s = player that just placed a furniture player head +# at @s +# run from place/place_furniture + +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-4 ~-1 ~4 ~-4 ~4 ~-4 ~-4 ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-3 ~-1 ~4 ~-3 ~4 ~-4 ~-3 ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-2 ~-1 ~4 ~-2 ~4 ~-4 ~-2 ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-1 ~-1 ~4 ~-1 ~4 ~-4 ~-1 ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~ ~-1 ~4 ~ ~4 ~-4 ~ ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~1 ~-1 ~4 ~1 ~4 ~-4 ~1 ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~2 ~-1 ~4 ~2 ~4 ~-4 ~2 ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~3 ~-1 ~4 ~3 ~4 ~-4 ~3 ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~4 ~-1 ~4 ~4 ~4 ~-4 ~4 ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~5 ~-1 ~4 ~5 ~4 ~-4 ~5 ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~6 ~-1 ~4 ~6 ~4 ~-4 ~6 ~-1 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data diff --git a/gm4_furniture/data/gm4_furniture/functions/place/count_heads/west.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/count_heads/west.mcfunction new file mode 100644 index 0000000000..4cb670ccfc --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/count_heads/west.mcfunction @@ -0,0 +1,27 @@ +# counts the number of players heads +# @s = player that just placed a furniture player head +# at @s +# run from place/place_furniture + +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-4 ~-4 ~1 ~-4 ~4 ~-4 ~-4 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-3 ~-4 ~1 ~-3 ~4 ~-4 ~-3 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-2 ~-4 ~1 ~-2 ~4 ~-4 ~-2 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~-1 ~-4 ~1 ~-1 ~4 ~-4 ~-1 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~ ~-4 ~1 ~ ~4 ~-4 ~ ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~1 ~-4 ~1 ~1 ~4 ~-4 ~1 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~2 ~-4 ~1 ~2 ~4 ~-4 ~2 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~3 ~-4 ~1 ~3 ~4 ~-4 ~3 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~4 ~-4 ~1 ~4 ~4 ~-4 ~4 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~5 ~-4 ~1 ~5 ~4 ~-4 ~5 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data +execute store result score $player_head_add gm4_furniture_data run clone ~-4 ~6 ~-4 ~1 ~6 ~4 ~-4 ~6 ~-4 filtered #gm4_furniture:player_heads{SkullOwner:{Properties:{textures:[{Signature:"gm4_furniture"}]}}} force +scoreboard players operation $player_head_count gm4_furniture_data += $player_head_add gm4_furniture_data diff --git a/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction new file mode 100644 index 0000000000..7c75d161df --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction @@ -0,0 +1,29 @@ +# finds the player head that was placed by the player +# @s = player that just placed a furniture player head +# at @s +advancement revoke @s only gm4_furniture:place_furniture + +# get rotation of player +# key: direction of player +# 1: north, 2: east, 3: south, 4: west +execute store result score $y_rotation gm4_furniture_data run data get entity @s Rotation[0] +scoreboard players set $rotation gm4_furniture_data 0 + +execute if score $y_rotation gm4_furniture_data matches 45..135 run scoreboard players set $rotation gm4_furniture_data 4 +execute if score $rotation gm4_furniture_data matches 0 if score $y_rotation gm4_furniture_data matches -45..45 run scoreboard players set $rotation gm4_furniture_data 3 +execute if score $rotation gm4_furniture_data matches 0 if score $y_rotation gm4_furniture_data matches -135..-45 run scoreboard players set $rotation gm4_furniture_data 2 +execute if score $rotation gm4_furniture_data matches 0 run scoreboard players set $rotation gm4_furniture_data 1 + +# find player heads in the specific region +scoreboard players set $player_head_count gm4_furniture_data 0 +execute if score $rotation gm4_furniture_data matches 1 run function gm4_furniture:place/count_heads/north +execute if score $rotation gm4_furniture_data matches 2 run function gm4_furniture:place/count_heads/east +execute if score $rotation gm4_furniture_data matches 3 run function gm4_furniture:place/count_heads/south +execute if score $rotation gm4_furniture_data matches 4 run function gm4_furniture:place/count_heads/west + +# replace player heads with the corresponding block +scoreboard players set $layer_count gm4_furniture_data 0 +execute if score $player_head_count gm4_furniture_data matches 1.. if score $rotation gm4_furniture_data matches 1 align xyz positioned ~0.5 ~0.5 ~0.5 rotated 180 0 positioned ^-4 ^-4 ^-1 run function gm4_furniture:place/check_layer +execute if score $player_head_count gm4_furniture_data matches 1.. if score $rotation gm4_furniture_data matches 2 align xyz positioned ~0.5 ~0.5 ~0.5 rotated -90 0 positioned ^-4 ^-4 ^-1 run function gm4_furniture:place/check_layer +execute if score $player_head_count gm4_furniture_data matches 1.. if score $rotation gm4_furniture_data matches 3 align xyz positioned ~0.5 ~0.5 ~0.5 rotated 0 0 positioned ^-4 ^-4 ^-1 run function gm4_furniture:place/check_layer +execute if score $player_head_count gm4_furniture_data matches 1.. if score $rotation gm4_furniture_data matches 4 align xyz positioned ~0.5 ~0.5 ~0.5 rotated 90 0 positioned ^-4 ^-4 ^-1 run function gm4_furniture:place/check_layer diff --git a/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction new file mode 100644 index 0000000000..537be3652e --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction @@ -0,0 +1,19 @@ +# prepares the storage and scores for furniture placement +# @s = player that just placed a furniture player head +# at the center of the furniture player head that was placed +# run from place/check_layer + +# override rotation if furniture was placed against a wall (opposite of wall facing) +# 1: north, 2: east, 3: south, 4: west +execute store success score $wall_placement gm4_furniture_data if block ~ ~ ~ player_wall_head +execute if score $wall_placement gm4_furniture_data matches 1 run scoreboard players set $rotation gm4_furniture_data 3 +execute if score $wall_placement gm4_furniture_data matches 1 if block ~ ~ ~ player_wall_head[facing=east] run scoreboard players set $rotation gm4_furniture_data 4 +execute if score $wall_placement gm4_furniture_data matches 1 if block ~ ~ ~ player_wall_head[facing=south] run scoreboard players set $rotation gm4_furniture_data 1 +execute if score $wall_placement gm4_furniture_data matches 1 if block ~ ~ ~ player_wall_head[facing=west] run scoreboard players set $rotation gm4_furniture_data 2 + +scoreboard players set $placed_block gm4_furniture_data 0 +scoreboard players remove $player_head_count gm4_furniture_data 1 + +data modify storage gm4_furniture:temp command.function set from block ~ ~ ~ SkullOwner.Name +function gm4_furniture:place/resolve_id with storage gm4_furniture:temp command +data remove storage gm4_furniture:temp command diff --git a/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction new file mode 100644 index 0000000000..4b69b7f7f7 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction @@ -0,0 +1,5 @@ + +$execute if score $rotation gm4_furniture_data matches 1 rotated 0 0 run function $(function) +$execute if score $rotation gm4_furniture_data matches 2 rotated 90 0 run function $(function) +$execute if score $rotation gm4_furniture_data matches 3 rotated 180 0 run function $(function) +$execute if score $rotation gm4_furniture_data matches 4 rotated -90 0 run function $(function) diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/remove_from_horse.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/remove_from_horse.mcfunction new file mode 100644 index 0000000000..692f215e64 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/remove_from_horse.mcfunction @@ -0,0 +1,3 @@ + +item replace entity @s horse.armor with air +loot spawn ~ ~1.6 ~ loot gm4_furniture:items/paintbrush diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/used_on_horse.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/used_on_horse.mcfunction new file mode 100644 index 0000000000..2b82b3c8d4 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/used_on_horse.mcfunction @@ -0,0 +1,9 @@ + +advancement revoke @s only gm4_furniture:use_paintbrush_on_horse + +tag @s add gm4_furniture_target +execute as @e[type=horse,distance=..8] if data entity @s ArmorItems[2].tag{gm4_furniture:"paintbrush"} store success score $armor_replaced gm4_furniture_data run item replace entity @s horse.armor with air +execute if score $armor_replaced gm4_furniture_data matches 1 run item replace entity @s weapon.mainhand with air +execute if score $armor_replaced gm4_furniture_data matches 1 run loot replace entity @s weapon.mainhand loot gm4_furniture:items/paintbrush +scoreboard players reset $armor_replaced gm4_furniture_data +tag @s remove gm4_furniture_target diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/crafting/paintbrush.json b/gm4_furniture/data/gm4_furniture/loot_tables/crafting/paintbrush.json new file mode 100644 index 0000000000..d57b97a53c --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/loot_tables/crafting/paintbrush.json @@ -0,0 +1,29 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 8, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:air" + } + ] + }, + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "gm4_furniture:items/paintbrush", + "functions": [ + { + "function": "minecraft:set_count", + "count": 1 + } + ] + } + ] + } + ] +} diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json b/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json new file mode 100644 index 0000000000..3578abd77b --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json @@ -0,0 +1,20 @@ +{ + "type": "block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "minecraft:player_head", + "functions": [ + { + "function": "set_nbt", + "tag": "{SkullOwner:{Id:[I;1862739911,-1668725896,-1286726243,-1817885533],Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/items/paintbrush.json b/gm4_furniture/data/gm4_furniture/loot_tables/items/paintbrush.json new file mode 100644 index 0000000000..f5e5db18d7 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/loot_tables/items/paintbrush.json @@ -0,0 +1,28 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:leather_horse_armor", + "functions": [ + { + "function": "minecraft:set_nbt", + "tag": "{CustomModelData:3420200,gm4_furniture:paintbrush}" + }, + { + "function": "minecraft:set_name", + "name": { + "translate": "item.gm4_furniture.paintbrush", + "fallback": "Paintbrush", + "color": "white", + "italic": false + } + } + ] + } + ] + } + ] +} diff --git a/gm4_furniture/data/gm4_furniture/predicates/holding_paintbrush.json b/gm4_furniture/data/gm4_furniture/predicates/holding_paintbrush.json new file mode 100644 index 0000000000..9d64e37052 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/predicates/holding_paintbrush.json @@ -0,0 +1,14 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": [ + "minecraft:leather_horse_armor" + ], + "nbt": "{gm4_furniture:paintbrush}" + } + } + } +} diff --git a/gm4_furniture/data/gm4_furniture/tags/blocks/player_heads.json b/gm4_furniture/data/gm4_furniture/tags/blocks/player_heads.json new file mode 100644 index 0000000000..389c902b9d --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/tags/blocks/player_heads.json @@ -0,0 +1,6 @@ +{ + "values": [ + "minecraft:player_head", + "minecraft:player_wall_head" + ] +} diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction new file mode 100644 index 0000000000..0df85dbf77 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction @@ -0,0 +1,69 @@ +# try to place the furniture +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall +# run from place/resolve_id + +# first perform checks to see if furniture fits where it was placed +scoreboard players set $valid_placement gm4_furniture_data 1 + +# wall only furniture must be placed on a wall +scoreboard players set $wall_only gm4_furniture_data {{ wall_only }} +execute if score $wall_only gm4_furniture_data matches 1 unless score $wall_placement gm4_furniture_data matches 1 run scoreboard players set $valid_placement gm4_furniture_data 0 + +# wall placed furniture is not allowed to have depth, if any size is bigger than 1 check if there is space +scoreboard players set $length gm4_furniture_data {{ length }} +scoreboard players set $depth gm4_furniture_data {{ depth }} +scoreboard players set $heigth gm4_furniture_data {{ heigth }} +execute if score $wall_placement gm4_furniture_data matches 1 if score $depth gm4_furniture_data matches 2.. run scoreboard players set $valid_placement gm4_furniture_data 0 +scoreboard players set $placement_blocked gm4_furniture_data 0 +execute if score $valid_placement gm4_furniture_data matches 1 if score $length gm4_furniture_data matches 2.. run function gm4_furniture:place/check_size/length_prep +summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block","gm4_furniture.middle"]} +setblock ~ ~ ~ air +execute if score $valid_placement gm4_furniture_data matches 1 if score $depth gm4_furniture_data matches 2.. run function gm4_furniture:place/check_size/depth_prep +execute if score $valid_placement gm4_furniture_data matches 1 if score $heigth gm4_furniture_data matches 2.. run function gm4_furniture:place/check_size/heigth_prep +kill @e[type=marker,tag=gm4_furniture.middle,distance=..2,limit=1,sort=nearest] +execute if score $placement_blocked gm4_furniture_data matches 1 run scoreboard players set $valid_placement gm4_furniture_data 0 +execute if score $placement_blocked gm4_furniture_data matches 1 run kill @e[type=marker,tag=gm4_furniture.marked_block] + +# if placement is not valid cancel placement +execute if score $valid_placement gm4_furniture_data matches 0 run loot spawn ~ ~ ~ loot gm4_furniture:furniture/{{ technical_id }} +execute if score $valid_placement gm4_furniture_data matches 0 run return 0 + +# set variables +scoreboard players set $sittable gm4_furniture_data {{ sittable }} +scoreboard players set $dyable gm4_furniture_data {{ dyable }} +scoreboard players set $table gm4_furniture_data {{ table }} + +# spawn the furniture +execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{loot_table:"gm4_furniture:furniture/{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} +summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} +setblock ~ ~ ~ {{ block_id }} + +# spawn extensions if they exist and set id +execute at @e[type=marker,tag=gm4_furniture.marked_block] run summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} +execute at @e[type=marker,tag=gm4_furniture.marked_block] run setblock ~ ~ ~ {{ block_id }} +execute store result score @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 + +# if furniture is a table reduce interaction height +execute if score $table gm4_furniture_data matches 1 as @e[type=interaction,tag=gm4_new_furniture,distance=..8] run data modify entity @s height set value 1f + +# if furniture is dyable set to basic white +execute if score $dyable gm4_furniture_data matches 1 run data modify entity @e[type=item_display,distance=..2,tag=gm4_new_furniture,limit=1,sort=nearest] item.tag.display.color set value 16777215 +execute if score $dyable gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.dyable + +# if furniture is sittable spawn sitting item_displays at appropiate locations and add tag +execute if score $sittable gm4_furniture_data matches 1.. run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.sittable +scoreboard players set $sit_height gm4_furniture_data 50 +execute if score $sittable gm4_furniture_data matches 1.. store result entity @e[type=item_display,tag=gm4_new_furniture,distance=..2,limit=1,sort=nearest] transformation.translation[1] float 0.01 run scoreboard players operation $sit_height gm4_furniture_data -= $sittable gm4_furniture_data +execute if score $sittable gm4_furniture_data matches 1.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ~ ~-4.999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.seat","gm4_furniture.sittable","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}_seat"',item:{id:"air",Count:1},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1f,1f,1f]}} + +# rotate furniture depending on rotation set by player (if rotation is 1 default rotation can be kept) +execute if score $rotation gm4_furniture_data matches 2 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ 90 0 +execute if score $rotation gm4_furniture_data matches 3 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ 180 0 +execute if score $rotation gm4_furniture_data matches 4 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ -90 0 + +# mark block as placed +playsound minecraft:block.barrel.close block @a[distance=..6] ~ ~ ~ 1 1.6 +scoreboard players set $placed_block gm4_furniture_data 1 +tag @e[distance=..2] remove gm4_new_furniture +kill @e[type=marker,tag=gm4_furniture.marked_block] diff --git a/gm4_furniture/data/gm4_furniture/templates/loot_tables/template.json b/gm4_furniture/data/gm4_furniture/templates/loot_tables/template.json new file mode 100644 index 0000000000..d26b92b766 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/templates/loot_tables/template.json @@ -0,0 +1,31 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "gm4_furniture:furniture/base", + "functions": [ + { + "function": "minecraft:set_nbt", + "tag": "{CustomModelData:{{ cmd }},gm4_furniture:{id:\"gm4.{{ technical_id }}\"},SkullOwner:{Name:\"gm4_furniture:place/furniture/{{ technical_id }}\"}}" + }, + { + "function": "minecraft:set_name", + "name": [ + { + "translate": "block.gm4_furniture.gm4_{{ technical_id }}", + "fallback": "{{ display_name }}", + "color": "white", + "italic": false + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py new file mode 100644 index 0000000000..fdc5407ac3 --- /dev/null +++ b/gm4_furniture/generate.py @@ -0,0 +1,80 @@ +from beet import Context, subproject + + +class furnitures: + def __init__(self, technical_id, display_name, cmd, block_id="barrier", sittable=0, dyable=0, wall_only=0, length=1, depth=1, height=1, table=0): + self.technical_id = technical_id + self.display_name = display_name + self.cmd = cmd + self.block_id = block_id + self.sittable = sittable + self.wall_only = wall_only + self.dyable = dyable + self.length = length + self.depth = depth + self.height = height + self.table = table + + +def beet_default(ctx: Context): + + furniture_list = [] + furniture_list.append(furnitures( + 'wooden_stool_1', 'Wooden Stool', 3420201, sittable=50)) + furniture_list.append(furnitures( + 'wooden_stool_2', 'Wooden Stool', 3420202, sittable=50)) + furniture_list.append(furnitures( + 'wooden_chair_1', 'Wooden Chair', 3420203, sittable=50)) + furniture_list.append(furnitures( + 'wooden_chair_2', 'Wooden Chair', 3420204, sittable=50)) + furniture_list.append(furnitures( + 'wooden_bench_1', 'Wooden Bench', 3420205, sittable=50, length=3)) + furniture_list.append(furnitures( + 'wooden_bench_2', 'Wooden Bench', 3420206, sittable=50, length=3)) + furniture_list.append(furnitures( + 'dyable_armchair_1', 'Cloth Armchair', 3420207, sittable=1, dyable=1)) + furniture_list.append(furnitures( + 'wooden_candelabra_1', 'Candelabra', 3420208, block_id="light[level=15]", dyable=1)) + furniture_list.append(furnitures( + 'wooden_candelabra_2', 'Candelabra', 3420209, block_id="light[level=15]", dyable=1)) + furniture_list.append(furnitures( + 'dyable_stool_1', 'Ottoman', 3420210, sittable=50, dyable=1)) + furniture_list.append(furnitures( + 'wooden_table_1', 'Wooden Table', 3420211, table=1)) + furniture_list.append(furnitures( + 'wooden_table_2', 'Wooden Table', 3420212, table=1)) + furniture_list.append(furnitures( + 'dyable_wooden_table_1', 'Wooden Table with Cloth', 3420213, dyable=1, table=1)) + + + for furniture_data in furniture_list: + subproject_config = { + "data_pack": { + "load": [ + { + f"data/gm4_furniture/loot_tables/furniture/{furniture_data.technical_id}.json": "data/gm4_furniture/templates/loot_tables/template.json", + f"data/gm4_furniture/functions/place/furniture/{furniture_data.technical_id}.mcfunction": "data/gm4_furniture/templates/functions/template.mcfunction", + } + ], + "render": { + "loot_tables": "*", + "functions": "*" + } + }, + "meta": { + "technical_id": furniture_data.technical_id, + "display_name": furniture_data.display_name, + "cmd": furniture_data.cmd, + "block_id": furniture_data.block_id, + "sittable": furniture_data.sittable, + "wall_only": furniture_data.wall_only, + "dyable": furniture_data.dyable, + "length": furniture_data.length, + "depth": furniture_data.depth, + "height": furniture_data.height, + "table": furniture_data.table, + + } + } + + ctx.require(subproject(subproject_config)) From a22c161fc67845b6dd259a5dc4331062be46e356 Mon Sep 17 00:00:00 2001 From: Thanathor Date: Fri, 25 Aug 2023 21:19:48 +0200 Subject: [PATCH 02/26] add furniture table for crafting --- .../tags/functions/check_recipes.json | 2 +- .../advancements/hit_furniture_station.json | 37 +++++++++++++++++++ .../functions/break/destroy.mcfunction | 1 + .../functions/break/find_main.mcfunction | 2 +- .../break/remove_furniture_station.mcfunction | 3 ++ .../functions/check_recipe.mcfunction | 4 -- .../functions/check_recipes.mcfunction | 5 +++ .../gm4_furniture/functions/init.mcfunction | 9 +++++ .../functions/interact/sawmill/hit.mcfunction | 4 ++ .../place/check_size/depth_loop.mcfunction | 1 + .../place/check_size/depth_offset.mcfunction | 1 + .../place/check_size/height_loop.mcfunction | 1 + .../place/check_size/height_offset.mcfunction | 1 + .../place/check_size/length_loop.mcfunction | 1 + .../place/check_size/length_offset.mcfunction | 1 + .../furniture/furniture_station.mcfunction | 37 +++++++++++++++++++ .../functions/place/prep_place.mcfunction | 1 - .../crafting/furniture_station.json | 29 +++++++++++++++ .../loot_tables/items/furniture_station.json | 29 +++++++++++++++ .../templates/functions/template.mcfunction | 5 +-- gm4_furniture/generate.py | 9 +++-- 21 files changed, 169 insertions(+), 14 deletions(-) create mode 100644 gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json create mode 100644 gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction delete mode 100644 gm4_furniture/data/gm4_furniture/functions/check_recipe.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/sawmill/hit.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/loot_tables/crafting/furniture_station.json create mode 100644 gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json diff --git a/gm4_furniture/data/gm4_custom_crafters/tags/functions/check_recipes.json b/gm4_furniture/data/gm4_custom_crafters/tags/functions/check_recipes.json index eb50d22499..42a5c540cd 100644 --- a/gm4_furniture/data/gm4_custom_crafters/tags/functions/check_recipes.json +++ b/gm4_furniture/data/gm4_custom_crafters/tags/functions/check_recipes.json @@ -1,5 +1,5 @@ { "values": [ - "gm4_furniture:check_recipe" + "gm4_furniture:check_recipes" ] } diff --git a/gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json b/gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json new file mode 100644 index 0000000000..79082986d9 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json @@ -0,0 +1,37 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "player": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type_specific": { + "type": "player", + "gamemode": "adventure" + } + } + } + } + ], + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:wandering_trader", + "nbt": "{Tags:[\"gm4_furniture.furniture_station\"]}" + } + } + ] + } + } + }, + "rewards": { + "function": "gm4_furniture:interact/furniture_station/hit" + } +} diff --git a/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction index 222b0c8a6f..5e8dacea58 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction @@ -2,4 +2,5 @@ execute if score $creative gm4_furniture_data matches 0 positioned ~-0.4999 ~0.0001 ~-0.4999 as @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] run function gm4_furniture:break/drop_item with entity @s item.tag.data execute as @e[type=interaction,tag=gm4_furniture,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s run function gm4_furniture:break/remove_block +execute if entity @s[tag=gm4_furniture.furniture_station] run function gm4_furniture:break/remove_furniture_station playsound minecraft:entity.armor_stand.break block @a[distance=..8] ~ ~ ~ 1 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction index 82cdd51a74..66fda88303 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction @@ -1,5 +1,5 @@ -execute store result score $hit gm4_furniture_last_hit run data get entity @s attack.timestamp +execute store result score $hit gm4_furniture_last_hit run time query gametime scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id execute as @e[type=interaction,tag=gm4_furniture.main,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s run function gm4_furniture:break/process_hit data remove entity @s attack diff --git a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction new file mode 100644 index 0000000000..318b91d687 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction @@ -0,0 +1,3 @@ + +setblock ~ ~2 ~ air +execute as @e[type=wandering_trader,tag=gm4_furniture,distance=..4] if score @s gm4_furniture_id = $check_id gm4_furniture_id run tp @s ~ -100000 ~ diff --git a/gm4_furniture/data/gm4_furniture/functions/check_recipe.mcfunction b/gm4_furniture/data/gm4_furniture/functions/check_recipe.mcfunction deleted file mode 100644 index 08f01b6c30..0000000000 --- a/gm4_furniture/data/gm4_furniture/functions/check_recipe.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -# @s = custom crafter running recipes -# run from #gm4_custom_crafters:check_recipes - -execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 5 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:0b,id:"minecraft:string"},{Slot:1b,id:"minecraft:string"},{Slot:2b,id:"minecraft:string"},{Slot:4b,id:"minecraft:iron_ingot"},{Slot:7b,id:"minecraft:stick"}]} run loot replace block ~ ~ ~ container.0 loot gm4_furniture:crafting/paintbrush diff --git a/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction b/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction new file mode 100644 index 0000000000..58aa5a9e64 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction @@ -0,0 +1,5 @@ +# @s = custom crafter running recipes +# run from #gm4_custom_crafters:check_recipes + +execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 5 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:0b,id:"minecraft:string"},{Slot:1b,id:"minecraft:string"},{Slot:2b,id:"minecraft:string"},{Slot:4b,id:"minecraft:iron_ingot"},{Slot:7b,id:"minecraft:stick"}]} run loot replace block ~ ~ ~ container.0 loot gm4_furniture:crafting/paintbrush +execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 8 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:0b,id:"minecraft:oak_planks"},{Slot:1b,id:"minecraft:crafting_table"},{Slot:2b,id:"minecraft:oak_planks"},{Slot:4b,id:"minecraft:iron_ingot"},{Slot:5b,id:"minecraft:oak_planks"},{Slot:6b,id:"minecraft:oak_planks"},{Slot:8b,id:"minecraft:oak_planks"}]} run loot replace block ~ ~ ~ container.0 loot gm4_furniture:crafting/furniture_station diff --git a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction index 8071506d61..b613670272 100644 --- a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction @@ -8,6 +8,15 @@ scoreboard objectives add gm4_furniture_id dummy scoreboard players set #2 gm4_furniture_data 2 +team add gm4_furniture_nocol +team modify gm4_furniture_nocol collisionRule never + +data modify storage gm4_furniture:furniture_station categories set value [] +data modify storage gm4_furniture:furniture_station categories append value {test:1} +data modify storage gm4_furniture:furniture_station categories append value {test:2} +data modify storage gm4_furniture:furniture_station categories append value {test:3} +function #gm4_furniture:add_categories + schedule function gm4_furniture:main 1t #$moduleUpdateList diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sawmill/hit.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/sawmill/hit.mcfunction new file mode 100644 index 0000000000..eff59e554b --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/sawmill/hit.mcfunction @@ -0,0 +1,4 @@ + +advancement revoke @s only gm4_furniture:hit_furniture_station + +execute as @e[type=wandering_trader,tag=gm4_furniture.furniture_station,distance=..8,nbt={HurtTime:10s}] at @s run say hit diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction index e2b95624ac..970119114e 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction @@ -5,6 +5,7 @@ # run from here execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 0 align y if entity @e[type=interaction,tag=gm4_furniture,tag=!gm4_new_furniture,distance=..0.1] run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction index 179465b445..f5208954db 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction @@ -5,5 +5,6 @@ # run from here execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 0 align y if entity @e[type=interaction,tag=gm4_furniture,tag=!gm4_new_furniture,distance=..0.1] run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction index 0999a555b2..3583e0d548 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction @@ -5,6 +5,7 @@ # run from here execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 0 align y if entity @e[type=interaction,tag=gm4_furniture,tag=!gm4_new_furniture,distance=..0.1] run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction index 64a412445f..7abdf623e8 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction @@ -5,5 +5,6 @@ # run from here execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 0 align y if entity @e[type=interaction,tag=gm4_furniture,tag=!gm4_new_furniture,distance=..0.1] run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction index 12107b826f..6c204395bd 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction @@ -5,6 +5,7 @@ # run from here execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 0 align y if entity @e[type=interaction,tag=gm4_furniture,tag=!gm4_new_furniture,distance=..0.1] run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction index 87ced544fc..cfa6d0b0b6 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction @@ -5,6 +5,7 @@ # run from here execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 +execute if score $placement_blocked gm4_furniture_data matches 0 align y if entity @e[type=interaction,tag=gm4_furniture,tag=!gm4_new_furniture,distance=..0.1] run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} scoreboard players remove $length gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction new file mode 100644 index 0000000000..6e955ec6fc --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction @@ -0,0 +1,37 @@ +# try to place the furniture_station +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall +# run from place/resolve_id + +# first perform checks to see if furniture fits where it was placed +scoreboard players set $valid_placement gm4_furniture_data 1 +execute unless block ~ ~1 ~ #gm4:replaceable run scoreboard players set $valid_placement gm4_furniture_data 0 +execute positioned ~ ~1 ~ align y if entity @e[type=interaction,tag=gm4_furniture,tag=!gm4_new_furniture,distance=..0.1] run scoreboard players set $valid_placement gm4_furniture_data 0 + +execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 + +# if placement is not valid cancel placement +execute if score $valid_placement gm4_furniture_data matches 0 run loot spawn ~ ~ ~ loot gm4_furniture:items/furniture_station +execute if score $valid_placement gm4_furniture_data matches 0 run setblock ~ ~ ~ air +execute if score $valid_placement gm4_furniture_data matches 0 run return 0 + +# spawn the furniture_station +execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.display","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station"',item:{id:"leather_horse_armor",Count:1,tag:{data:{loot_table:"gm4_furniture:items/furniture_station"},CustomModelData:3420150}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} +summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1.0002f,width:1.0002f,response:1b} +setblock ~ ~ ~ barrier + +# spawn trader and set ids +summon wandering_trader ~ ~1000 ~ {Team:"gm4_furniture_nocol",Tags:["gm4_furniture","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'{"text":"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA","font":"gm4_furniture","color":"white"}',NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",duration:-1,show_particles:0b},{id:"minecraft:resistance",amplifier:9,duration:-1,show_particles:0b}]} +tp @e[type=wandering_trader,tag=gm4_new_furniture,limit=1] ~ ~-0.4999 ~ +setblock ~ ~1 ~ flower_pot +execute store result score @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 +execute store result score @e[type=wandering_trader,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players get $next_id gm4_furniture_id + +# rotate furniture_station depending on rotation set by player (if rotation is 1 default rotation can be kept) +execute if score $rotation gm4_furniture_data matches 2 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ 90 0 +execute if score $rotation gm4_furniture_data matches 3 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ 180 0 +execute if score $rotation gm4_furniture_data matches 4 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ -90 0 + +# mark block as placed +playsound minecraft:block.barrel.close block @a[distance=..6] ~ ~ ~ 1 1.6 +tag @e[distance=..2] remove gm4_new_furniture diff --git a/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction index 537be3652e..1c3872c789 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction @@ -11,7 +11,6 @@ execute if score $wall_placement gm4_furniture_data matches 1 if block ~ ~ ~ pla execute if score $wall_placement gm4_furniture_data matches 1 if block ~ ~ ~ player_wall_head[facing=south] run scoreboard players set $rotation gm4_furniture_data 1 execute if score $wall_placement gm4_furniture_data matches 1 if block ~ ~ ~ player_wall_head[facing=west] run scoreboard players set $rotation gm4_furniture_data 2 -scoreboard players set $placed_block gm4_furniture_data 0 scoreboard players remove $player_head_count gm4_furniture_data 1 data modify storage gm4_furniture:temp command.function set from block ~ ~ ~ SkullOwner.Name diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/crafting/furniture_station.json b/gm4_furniture/data/gm4_furniture/loot_tables/crafting/furniture_station.json new file mode 100644 index 0000000000..3c954a0edf --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/loot_tables/crafting/furniture_station.json @@ -0,0 +1,29 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 8, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:air" + } + ] + }, + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "gm4_furniture:items/furniture_station", + "functions": [ + { + "function": "minecraft:set_count", + "count": 1 + } + ] + } + ] + } + ] +} diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json new file mode 100644 index 0000000000..9ce5b4f34b --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json @@ -0,0 +1,29 @@ +{ + "type": "block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "minecraft:player_head", + "functions": [ + { + "function": "set_nbt", + "tag": "{CustomModelData:3420150,gm4_furniture:{id:\"gm4.furniture_station\"},SkullOwner:{Id:[I;1862739911,-1668725896,-1286726243,-1817885533],Name:\"gm4_furniture:place/furniture/furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" + }, + { + "function": "minecraft:set_name", + "name": { + "translate": "item.gm4_furniture.furniture_station", + "fallback": "Furniture Station", + "color": "white", + "italic": false + } + } + ] + } + ] + } + ] +} diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction index 0df85dbf77..3e0421d3b4 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction @@ -35,7 +35,7 @@ scoreboard players set $dyable gm4_furniture_data {{ dyable }} scoreboard players set $table gm4_furniture_data {{ table }} # spawn the furniture -execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{loot_table:"gm4_furniture:furniture/{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} +execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{loot_table:"gm4_furniture:furniture/{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} setblock ~ ~ ~ {{ block_id }} @@ -55,7 +55,7 @@ execute if score $dyable gm4_furniture_data matches 1 run tag @e[type=interactio execute if score $sittable gm4_furniture_data matches 1.. run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.sittable scoreboard players set $sit_height gm4_furniture_data 50 execute if score $sittable gm4_furniture_data matches 1.. store result entity @e[type=item_display,tag=gm4_new_furniture,distance=..2,limit=1,sort=nearest] transformation.translation[1] float 0.01 run scoreboard players operation $sit_height gm4_furniture_data -= $sittable gm4_furniture_data -execute if score $sittable gm4_furniture_data matches 1.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ~ ~-4.999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.seat","gm4_furniture.sittable","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}_seat"',item:{id:"air",Count:1},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1f,1f,1f]}} +execute if score $sittable gm4_furniture_data matches 1.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.seat","gm4_furniture.sittable","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}_seat"',item:{id:"air",Count:1},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1f,1f,1f]}} # rotate furniture depending on rotation set by player (if rotation is 1 default rotation can be kept) execute if score $rotation gm4_furniture_data matches 2 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ 90 0 @@ -64,6 +64,5 @@ execute if score $rotation gm4_furniture_data matches 4 as @e[tag=gm4_new_furnit # mark block as placed playsound minecraft:block.barrel.close block @a[distance=..6] ~ ~ ~ 1 1.6 -scoreboard players set $placed_block gm4_furniture_data 1 tag @e[distance=..2] remove gm4_new_furniture kill @e[type=marker,tag=gm4_furniture.marked_block] diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py index fdc5407ac3..4c6c8b034d 100644 --- a/gm4_furniture/generate.py +++ b/gm4_furniture/generate.py @@ -2,7 +2,7 @@ class furnitures: - def __init__(self, technical_id, display_name, cmd, block_id="barrier", sittable=0, dyable=0, wall_only=0, length=1, depth=1, height=1, table=0): + def __init__(self, technical_id, display_name, cmd, block_id="barrier", sittable=0, dyable=0, wall_only=0, length=1, depth=1, heigth=1, table=0, scale=1): self.technical_id = technical_id self.display_name = display_name self.cmd = cmd @@ -12,8 +12,9 @@ def __init__(self, technical_id, display_name, cmd, block_id="barrier", sittable self.dyable = dyable self.length = length self.depth = depth - self.height = height + self.heigth = heigth self.table = table + self.scale = scale def beet_default(ctx: Context): @@ -71,9 +72,9 @@ def beet_default(ctx: Context): "dyable": furniture_data.dyable, "length": furniture_data.length, "depth": furniture_data.depth, - "height": furniture_data.height, + "heigth": furniture_data.heigth, "table": furniture_data.table, - + "scale": furniture_data.scale, } } From 3d61925e5982f28ad9e7048aeb98b4d02b8b4727 Mon Sep 17 00:00:00 2001 From: Thanathor Date: Wed, 30 Aug 2023 21:13:15 +0200 Subject: [PATCH 03/26] fix EVERYTHING --- .../advancements/hit_furniture.json | 7 +++- .../advancements/hit_furniture_station.json | 7 +++- .../advancements/interact_with_furniture.json | 7 +++- .../advancements/place_furniture.json | 27 +++++++++------ .../advancements/use_paintbrush_on_horse.json | 7 +++- .../functions/break/destroy.mcfunction | 10 ++++++ .../functions/break/detect_hit.mcfunction | 6 +++- .../functions/break/drop_item.mcfunction | 5 +++ .../functions/break/find_main.mcfunction | 8 ++++- .../functions/break/process_hit.mcfunction | 11 +++++- .../functions/break/remove_block.mcfunction | 6 +++- .../break/remove_furniture_station.mcfunction | 4 +++ .../functions/interact/detect.mcfunction | 18 ++++------ .../interact/paint/detect.mcfunction | 9 +++-- .../interact/paint/process.mcfunction | 10 ++++-- .../functions/interact/process.mcfunction | 19 +++++++++++ .../functions/interact/sit/detect.mcfunction | 4 --- .../functions/interact/sit/process.mcfunction | 10 +++++- .../place/check_size/depth_loop.mcfunction | 5 +-- .../place/check_size/depth_offset.mcfunction | 2 +- .../place/check_size/depth_prep.mcfunction | 5 +-- .../place/check_size/height_loop.mcfunction | 5 +-- .../place/check_size/height_offset.mcfunction | 2 +- .../place/check_size/height_prep.mcfunction | 3 +- .../place/check_size/length_loop.mcfunction | 2 +- .../place/check_size/length_offset.mcfunction | 2 +- .../place/check_size/length_prep.mcfunction | 4 +-- .../functions/place/resolve_id.mcfunction | 5 +++ .../furniture_station}/hit.mcfunction | 4 ++- .../paintbrush/remove_from_horse.mcfunction | 8 ++++- .../paintbrush/return_from_horse.mcfunction | 8 +++++ .../paintbrush/used_on_horse.mcfunction | 9 +++-- .../technical/drop_horse_paintbrush.json | 29 ++++++++++++++++ .../tags/blocks/furniture_blocks.json | 6 ++++ .../templates/functions/template.mcfunction | 15 +++++--- gm4_furniture/generate.py | 34 +++++++++++++++---- 36 files changed, 252 insertions(+), 71 deletions(-) create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction delete mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/sit/detect.mcfunction rename gm4_furniture/data/gm4_furniture/functions/{interact/sawmill => technical/furniture_station}/hit.mcfunction (55%) create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/return_from_horse.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/loot_tables/technical/drop_horse_paintbrush.json create mode 100644 gm4_furniture/data/gm4_furniture/tags/blocks/furniture_blocks.json diff --git a/gm4_furniture/data/gm4_furniture/advancements/hit_furniture.json b/gm4_furniture/data/gm4_furniture/advancements/hit_furniture.json index 3069fa9e28..3ee944c227 100644 --- a/gm4_furniture/data/gm4_furniture/advancements/hit_furniture.json +++ b/gm4_furniture/data/gm4_furniture/advancements/hit_furniture.json @@ -1,6 +1,6 @@ { "criteria": { - "requirement": { + "hit_furniture": { "trigger": "minecraft:player_hurt_entity", "conditions": { "player": [ @@ -31,6 +31,11 @@ } } }, + "requirements": [ + [ + "hit_furniture" + ] + ], "rewards": { "function": "gm4_furniture:break/detect_hit" } diff --git a/gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json b/gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json index 79082986d9..78384f632f 100644 --- a/gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json +++ b/gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json @@ -1,6 +1,6 @@ { "criteria": { - "requirement": { + "hit_furniture_station": { "trigger": "minecraft:player_hurt_entity", "conditions": { "player": [ @@ -31,6 +31,11 @@ } } }, + "requirements": [ + [ + "hit_furniture_station" + ] + ], "rewards": { "function": "gm4_furniture:interact/furniture_station/hit" } diff --git a/gm4_furniture/data/gm4_furniture/advancements/interact_with_furniture.json b/gm4_furniture/data/gm4_furniture/advancements/interact_with_furniture.json index f171a1b3de..6e4cb5a113 100644 --- a/gm4_furniture/data/gm4_furniture/advancements/interact_with_furniture.json +++ b/gm4_furniture/data/gm4_furniture/advancements/interact_with_furniture.json @@ -1,6 +1,6 @@ { "criteria": { - "requirement": { + "interact_with_furniture": { "trigger": "minecraft:player_interacted_with_entity", "conditions": { "player": [], @@ -17,6 +17,11 @@ } } }, + "requirements": [ + [ + "interact_with_furniture" + ] + ], "rewards": { "function": "gm4_furniture:interact/detect" } diff --git a/gm4_furniture/data/gm4_furniture/advancements/place_furniture.json b/gm4_furniture/data/gm4_furniture/advancements/place_furniture.json index ab8a39e6c8..9c9cfb9ad8 100644 --- a/gm4_furniture/data/gm4_furniture/advancements/place_furniture.json +++ b/gm4_furniture/data/gm4_furniture/advancements/place_furniture.json @@ -3,17 +3,6 @@ "placed_furniture": { "trigger": "minecraft:placed_block", "conditions": { - "location": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:player_head" - ], - "nbt": "{SkullOwner:{Properties:{textures:[{Signature:\"gm4_furniture\"}]}}}" - } - } - ], "player": [ { "condition": "minecraft:value_check", @@ -39,10 +28,26 @@ }, "range": 0 } + ], + "location": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:player_head" + ], + "nbt": "{SkullOwner:{Properties:{textures:[{Signature:\"gm4_furniture\"}]}}}" + } + } ] } } }, + "requirements": [ + [ + "placed_furniture" + ] + ], "rewards": { "function": "gm4_furniture:place/place_furniture" } diff --git a/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json b/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json index 907c746189..48e4d2417f 100644 --- a/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json +++ b/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json @@ -1,6 +1,6 @@ { "criteria": { - "requirement": { + "used_paintbrush": { "trigger": "minecraft:player_interacted_with_entity", "conditions": { "player": [], @@ -22,6 +22,11 @@ } } }, + "requirements": [ + [ + "used_paintbrush" + ] + ], "rewards": { "function": "gm4_furniture:technical/paintbrush/used_on_horse" } diff --git a/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction index 5e8dacea58..a30b1082d3 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction @@ -1,6 +1,16 @@ +# destroy this furniture +# @s = furniture main interaction entity +# at @s +# run from break/process_hit +# unless breaking player was in creative drop the item execute if score $creative gm4_furniture_data matches 0 positioned ~-0.4999 ~0.0001 ~-0.4999 as @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] run function gm4_furniture:break/drop_item with entity @s item.tag.data +# remove any furniture blocks that match the id execute as @e[type=interaction,tag=gm4_furniture,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s run function gm4_furniture:break/remove_block + +# if the broken furniture was a furniture station run some extra code execute if entity @s[tag=gm4_furniture.furniture_station] run function gm4_furniture:break/remove_furniture_station + +# destroy sound playsound minecraft:entity.armor_stand.break block @a[distance=..8] ~ ~ ~ 1 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction index b81602e0ce..bef75ea63a 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction @@ -1,6 +1,10 @@ - +# detect hitting a furniture +# @s = player punching furniture +# at @s advancement revoke @s only gm4_furniture:hit_furniture +# mark if the player is in creative mode execute store success score $creative gm4_furniture_data if entity @s[gamemode=creative] +# locate the hit furniture execute as @e[type=interaction,tag=gm4_furniture,distance=..8] if data entity @s attack at @s run function gm4_furniture:break/find_main diff --git a/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction index 1bc940ac4b..451d0698e8 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction @@ -1,2 +1,7 @@ +# drop destroyed furniture's item +# @s = furniture item display +# at @s +# run from break/destroy with @s item.tag.data +# $(loot_table) = loot table path for this furniture item $loot spawn ~.5 ~.25 ~.5 loot $(loot_table) diff --git a/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction index 66fda88303..d57294c941 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/find_main.mcfunction @@ -1,5 +1,11 @@ +# locate the main/central interaction for the hit furniture +# @s = furniture interaction that was hit +# at @s +# run from break/detect_hit -execute store result score $hit gm4_furniture_last_hit run time query gametime +# find a main furniture interaction entity matching the hit id scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id execute as @e[type=interaction,tag=gm4_furniture.main,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s run function gm4_furniture:break/process_hit + +# cleanup data remove entity @s attack diff --git a/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction index d0826bd81c..64acc9ca8c 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction @@ -1,10 +1,19 @@ +# process hit furniture +# @s = furniture main interaction entity +# at @s +# run from break/find_main +# check how much time has passed since the last hit (or ignore that if the player was in creative) +execute store result score $hit gm4_furniture_last_hit run time query gametime scoreboard players operation $check_break gm4_furniture_last_hit = $hit gm4_furniture_last_hit scoreboard players operation $check_break gm4_furniture_last_hit -= @s gm4_furniture_last_hit -execute if score $creative gm4_furniture_data matches 1 run scoreboard players set $check_break gm4_furniture_last_hit 0 +# if >=4 ticks have passed or player is in creative destroy furniture +execute if score $creative gm4_furniture_data matches 1 run scoreboard players set $check_break gm4_furniture_last_hit 0 execute if score $check_break gm4_furniture_last_hit matches ..4 run function gm4_furniture:break/destroy +# otherwise store this hit time in furniture's score for the next check execute unless score $check_break gm4_furniture_last_hit matches ..4 run scoreboard players operation @s gm4_furniture_last_hit = $hit gm4_furniture_last_hit +# hit sounds playsound minecraft:entity.armor_stand.hit block @a[distance=..8] ~ ~ ~ 1 1 playsound minecraft:entity.player.attack.strong block @a[distance=..8] ~ ~ ~ 1 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction index 5451e91190..b9cc28bbd9 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction @@ -1,4 +1,8 @@ +# remove this furniture block +# @s = furniture interaction entity +# at @s +# run from break/destroy -execute positioned ~0.0001 ~0.5001 ~0.0001 run setblock ~ ~ ~ air +execute positioned ~0.0001 ~0.5001 ~0.0001 run fill ~ ~ ~ ~ ~ ~ air replace #gm4_furniture:furniture_blocks execute positioned ~-0.4999 ~0.0001 ~-0.4999 run kill @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] kill @s diff --git a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction index 318b91d687..a3ee35e5d4 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction @@ -1,3 +1,7 @@ +# remove the flower pot and wandering trader when a furniture station is destroyed +# furniture station interaction entity +# at @s +# run from break/destroy setblock ~ ~2 ~ air execute as @e[type=wandering_trader,tag=gm4_furniture,distance=..4] if score @s gm4_furniture_id = $check_id gm4_furniture_id run tp @s ~ -100000 ~ diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/detect.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/detect.mcfunction index c004bf23d1..2da973538f 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/detect.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/detect.mcfunction @@ -1,13 +1,9 @@ - +# detect interacting (right-click) on furniture +# @s = player interacting with furniture +# at @s advancement revoke @s only gm4_furniture:interact_with_furniture -scoreboard players set $interaction_processed gm4_furniture_data 0 - -# check for painting -execute if predicate gm4_furniture:holding_paintbrush run function gm4_furniture:interact/paint/detect - -# check for sitting -execute if score $interaction_processed gm4_furniture_data matches 0 unless predicate gm4_furniture:holding_paintbrush run function gm4_furniture:interact/sit/detect - -# cleanup if nothing else triggered -execute if score $interaction_processed gm4_furniture_data matches 0 as @e[type=interaction,tag=gm4_furniture,distance=..8] if data entity @s interaction run data remove entity @s interaction +# find interaction entity that was interacted with +tag @s add gm4_furniture_target +execute as @e[type=interaction,tag=gm4_furniture,distance=..8] if data entity @s interaction at @s run function gm4_furniture:interact/process +tag @s remove gm4_furniture_target diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/paint/detect.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/paint/detect.mcfunction index 0d1e010da4..e97b82c11c 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/paint/detect.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/paint/detect.mcfunction @@ -1,4 +1,9 @@ +# detect interaction on paintable furniture by a player holding a paintbrush +# @s = furniture's interacted interaction entity +# at @s +# run from interact/process -data modify storage gm4_furniture:temp color set from entity @s SelectedItem.tag.display.color -execute if data storage gm4_furniture:temp color as @e[type=interaction,tag=gm4_furniture.dyable,distance=..8] if data entity @s interaction at @s run function gm4_furniture:interact/paint/process +# store color from paintbrush and process application if there is some +data modify storage gm4_furniture:temp color set from entity @p[tag=gm4_furniture_target] SelectedItem.tag.display.color +execute if data storage gm4_furniture:temp color run function gm4_furniture:interact/paint/process data remove storage gm4_furniture:temp color diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction index dff5b0ca93..3692d4a962 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction @@ -1,8 +1,12 @@ +# check if this furniture should be painted +# @s = furniture's interacted interaction entity +# at @s +# run from interact/paint/detect -scoreboard players set $interaction_processed gm4_furniture_data 1 - +# find this furniture's main interaction entity and try to paint its linked item display scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id execute as @e[type=interaction,tag=gm4_furniture.main,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s positioned ~-0.4999 ~0.0001 ~-0.4999 as @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] store success score $paint_changed gm4_furniture_data run data modify entity @s item.tag.display.color set from storage gm4_furniture:temp color -data remove entity @s interaction +# if furniture was painted mark interaction as resolved and play paint sound execute if score $paint_changed gm4_furniture_data matches 1 run playsound item.dye.use player @a[distance=..8] ~ ~ ~ 1 1 +execute if score $paint_changed gm4_furniture_data matches 1 run scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction new file mode 100644 index 0000000000..f48226a47f --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction @@ -0,0 +1,19 @@ +# process interacting (right-click) on furniture +# @s = furniture's interacted interaction entity +# at @s +# run from itneract/detect + +# first successful interaction will be used, any lower down this list will be ignored +scoreboard players set $interaction_processed gm4_furniture_data 0 + +# check for custom interactions +# TODO + +# check for painting +execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.dyable] if entity @p[tag=gm4_furniture_target,predicate=gm4_furniture:holding_paintbrush] run function gm4_furniture:interact/paint/detect + +# check for sitting +execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.sittable] positioned ~-0.4999 ~0.0001 ~-0.4999 run function gm4_furniture:interact/sit/process + +# cleanup +data remove entity @s interaction diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sit/detect.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/sit/detect.mcfunction deleted file mode 100644 index 5c08c1d110..0000000000 --- a/gm4_furniture/data/gm4_furniture/functions/interact/sit/detect.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ - -tag @s add gm4_furniture_target -execute as @e[type=interaction,tag=gm4_furniture.sittable,distance=..8] if data entity @s interaction at @s positioned ~-0.4999 ~0.0001 ~-0.4999 run function gm4_furniture:interact/sit/process -tag @s remove gm4_furniture_target diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction index 79357e0980..ac6d735ab5 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction @@ -1,4 +1,12 @@ +# get interacting player to sit at this furniture block +# @s = furniture's interacted interaction entity +# at @s +# run from interact/process +# make player ride the linked item_display (if this is not the main interaction entity item_display will be invisible) +# the item_display is offset from the ground to dictate sit height ride @p[tag=gm4_furniture_target] dismount ride @p[tag=gm4_furniture_target] mount @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] -data remove entity @s interaction + +# mark interaction as resolved +scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction index 970119114e..634337b879 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction @@ -9,5 +9,6 @@ execute if score $placement_blocked gm4_furniture_data matches 0 align y if enti execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} -scoreboard players remove $depth gm4_furniture_data 1 -execute if score $depth gm4_furniture_data matches 1.. positioned ^ ^ ^1 run function gm4_furniture:place/check_size/depth_loop +scoreboard players add $depth_done gm4_furniture_data 1 +execute if score $depth_done gm4_furniture_data = $depth gm4_furniture_data run scoreboard players reset $depth_done gm4_furniture_data +execute if score $depth_done gm4_furniture_data < $depth gm4_furniture_data positioned ^ ^ ^-1 run function gm4_furniture:place/check_size/depth_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction index f5208954db..4a1672d2c4 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction @@ -7,4 +7,4 @@ execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 0 align y if entity @e[type=interaction,tag=gm4_furniture,tag=!gm4_new_furniture,distance=..0.1] run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 -summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} +summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block","gm4_furniture.depth_marker"]} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction index 233b64594d..40c789043b 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction @@ -3,7 +3,8 @@ # at the center of the placed block rotated along axis to face towards player or away from the wall, or at any placed marker # run from any in place/furniture/ -execute if score $depth gm4_furniture_data matches 3.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^ ^-1 run function gm4_furniture:place/check_size/depth_offset +execute as @e[type=marker,tag=gm4_furniture.marked_block] run data modify entity @s Rotation set from storage gm4_furniture:data Rotation +execute if score $depth gm4_furniture_data matches 3.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^ ^1 run function gm4_furniture:place/check_size/depth_offset execute if score $depth gm4_furniture_data matches 3.. run scoreboard players remove $depth gm4_furniture_data 1 scoreboard players remove $depth gm4_furniture_data 1 -execute if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^ ^1 run function gm4_furniture:place/check_size/depth_loop +execute if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block,tag=!gm4_furniture.depth_marker] positioned ^ ^ ^-1 run function gm4_furniture:place/check_size/depth_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction index 3583e0d548..db332140a0 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction @@ -9,5 +9,6 @@ execute if score $placement_blocked gm4_furniture_data matches 0 align y if enti execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} -scoreboard players remove $height gm4_furniture_data 1 -execute if score $height gm4_furniture_data matches 1.. positioned ^ ^ ^1 run function gm4_furniture:place/check_size/height_loop +scoreboard players add $height_done gm4_furniture_data 1 +execute if score $height_done gm4_furniture_data = $height gm4_furniture_data run scoreboard players reset $height_done gm4_furniture_data +execute if score $height_done gm4_furniture_data < $height gm4_furniture_data positioned ^ ^1 ^ run function gm4_furniture:place/check_size/height_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction index 7abdf623e8..60508397b7 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction @@ -7,4 +7,4 @@ execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 0 align y if entity @e[type=interaction,tag=gm4_furniture,tag=!gm4_new_furniture,distance=..0.1] run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 -summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} +summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block","gm4_furniture.height_marker"]} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction index c0df450528..ef1961bf4a 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction @@ -4,7 +4,8 @@ # run from any in place/furniture/ # height is only offset down if this is a wall placed furniture (painting) +execute as @e[type=marker,tag=gm4_furniture.marked_block] run data modify entity @s Rotation set from storage gm4_furniture:data Rotation execute if score $height gm4_furniture_data matches 3.. if score $wall_only gm4_furniture_data matches 1 at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^-1 ^ run function gm4_furniture:place/check_size/height_offset execute if score $height gm4_furniture_data matches 3.. if score $wall_only gm4_furniture_data matches 1 run scoreboard players remove $height gm4_furniture_data 1 scoreboard players remove $height gm4_furniture_data 1 -execute if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^ ^1 run function gm4_furniture:place/check_size/height_loop +execute if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block,tag=!gm4_furniture.height_marker] positioned ^ ^1 ^ run function gm4_furniture:place/check_size/height_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction index 6c204395bd..a795f21f7d 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_loop.mcfunction @@ -10,4 +10,4 @@ execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} scoreboard players remove $length gm4_furniture_data 1 -execute if score $length gm4_furniture_data matches 1.. positioned ^-1 ^ ^ run function gm4_furniture:place/check_size/length_loop +execute if score $length gm4_furniture_data matches 1.. positioned ^1 ^ ^ run function gm4_furniture:place/check_size/length_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction index cfa6d0b0b6..88193d1a8a 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_offset.mcfunction @@ -7,5 +7,5 @@ execute unless block ~ ~ ~ #gm4:replaceable run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 0 align y if entity @e[type=interaction,tag=gm4_furniture,tag=!gm4_new_furniture,distance=..0.1] run scoreboard players set $placement_blocked gm4_furniture_data 1 execute if score $placement_blocked gm4_furniture_data matches 1 run return 0 -summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} +summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block","gm4_furniture.length_marker"]} scoreboard players remove $length gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_prep.mcfunction index 9b178395af..3743a392ab 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_prep.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/length_prep.mcfunction @@ -3,6 +3,6 @@ # at the center of the placed block rotated along axis to face towards player or away from the wall # run from any in place/furniture/ -execute if score $length gm4_furniture_data matches 3.. positioned ^1 ^ ^ run function gm4_furniture:place/check_size/length_offset +execute if score $length gm4_furniture_data matches 3.. positioned ^-1 ^ ^ run function gm4_furniture:place/check_size/length_offset scoreboard players remove $length gm4_furniture_data 1 -execute if score $placement_blocked gm4_furniture_data matches 0 positioned ^-1 ^ ^ run function gm4_furniture:place/check_size/length_loop +execute if score $placement_blocked gm4_furniture_data matches 0 positioned ^1 ^ ^ run function gm4_furniture:place/check_size/length_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction index 4b69b7f7f7..51bde6ff45 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction @@ -1,3 +1,8 @@ +# run the function belonging to the placed furniture +# @s = player that just placed a furniture player head +# at the center of the furniture player head that was placed +# run from place/prep_place +# $(function) = function path (gm4_furniture:place/furniture/) $execute if score $rotation gm4_furniture_data matches 1 rotated 0 0 run function $(function) $execute if score $rotation gm4_furniture_data matches 2 rotated 90 0 run function $(function) diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sawmill/hit.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/hit.mcfunction similarity index 55% rename from gm4_furniture/data/gm4_furniture/functions/interact/sawmill/hit.mcfunction rename to gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/hit.mcfunction index eff59e554b..52e4af20ab 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/sawmill/hit.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/hit.mcfunction @@ -1,4 +1,6 @@ - +# when a player punches the top block of a furniture station swap the category +# @s = player hitting the furniture station wandering trader +# at @s advancement revoke @s only gm4_furniture:hit_furniture_station execute as @e[type=wandering_trader,tag=gm4_furniture.furniture_station,distance=..8,nbt={HurtTime:10s}] at @s run say hit diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/remove_from_horse.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/remove_from_horse.mcfunction index 692f215e64..a479ed1b05 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/remove_from_horse.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/remove_from_horse.mcfunction @@ -1,3 +1,9 @@ +# remove paintbrush from horse if it is found +# @s = horse wearing a paintbrush as horse armor +# at unspecified +# run from main +data modify storage gm4_furniture:temp paintbrush_data set from entity @s ArmorItems[2].tag +loot spawn ~ ~1.6 ~ loot gm4_furniture:technical/drop_horse_paintbrush item replace entity @s horse.armor with air -loot spawn ~ ~1.6 ~ loot gm4_furniture:items/paintbrush +data remove storage gm4_furniture:temp paintbrush_data diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/return_from_horse.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/return_from_horse.mcfunction new file mode 100644 index 0000000000..cb2c9a7c24 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/return_from_horse.mcfunction @@ -0,0 +1,8 @@ +# return paintbrush from horse to player +# @s = horse equipped with paintbrush +# at @s +# run from technical/paintbrush/used_on_horse + +item replace entity @p[tag=gm4_furniture_target] weapon.mainhand with air +item replace entity @p[tag=gm4_furniture_target] weapon.mainhand from entity @s horse.armor +item replace entity @s horse.armor with air diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/used_on_horse.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/used_on_horse.mcfunction index 2b82b3c8d4..98f055b7ae 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/used_on_horse.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/paintbrush/used_on_horse.mcfunction @@ -1,9 +1,8 @@ - +# resolve paintbrush being equpped on a horse by right clicking +# @s = player that right clicked a horse with a paintbrush +# at @s advancement revoke @s only gm4_furniture:use_paintbrush_on_horse tag @s add gm4_furniture_target -execute as @e[type=horse,distance=..8] if data entity @s ArmorItems[2].tag{gm4_furniture:"paintbrush"} store success score $armor_replaced gm4_furniture_data run item replace entity @s horse.armor with air -execute if score $armor_replaced gm4_furniture_data matches 1 run item replace entity @s weapon.mainhand with air -execute if score $armor_replaced gm4_furniture_data matches 1 run loot replace entity @s weapon.mainhand loot gm4_furniture:items/paintbrush -scoreboard players reset $armor_replaced gm4_furniture_data +execute as @e[type=horse,distance=..8] if data entity @s ArmorItems[2].tag{gm4_furniture:"paintbrush"} run function gm4_furniture:technical/paintbrush/return_from_horse tag @s remove gm4_furniture_target diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/technical/drop_horse_paintbrush.json b/gm4_furniture/data/gm4_furniture/loot_tables/technical/drop_horse_paintbrush.json new file mode 100644 index 0000000000..210273d024 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/loot_tables/technical/drop_horse_paintbrush.json @@ -0,0 +1,29 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "gm4_furniture:items/paintbrush", + "functions": [ + { + "function": "minecraft:copy_nbt", + "source": { + "type": "minecraft:storage", + "source": "gm4_furniture:temp" + }, + "ops": [ + { + "source": "paintbrush_data", + "target": "{}", + "op": "merge" + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_furniture/data/gm4_furniture/tags/blocks/furniture_blocks.json b/gm4_furniture/data/gm4_furniture/tags/blocks/furniture_blocks.json new file mode 100644 index 0000000000..b9c4edb442 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/tags/blocks/furniture_blocks.json @@ -0,0 +1,6 @@ +{ + "values": [ + "minecraft:barrier", + "minecraft:light" + ] +} diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction index 3e0421d3b4..32b9245fdb 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction @@ -2,10 +2,17 @@ # @s = player who placed the furniture player head # at the center of the placed block rotated along axis to face towards player or away from the wall # run from place/resolve_id +# this function was generated by generate.py # first perform checks to see if furniture fits where it was placed scoreboard players set $valid_placement gm4_furniture_data 1 +# store rotation in storage +execute if score $rotation gm4_furniture_data matches 1 run data modify storage gm4_furniture:data Rotation set value [0F,0F] +execute if score $rotation gm4_furniture_data matches 2 run data modify storage gm4_furniture:data Rotation set value [90F,0F] +execute if score $rotation gm4_furniture_data matches 3 run data modify storage gm4_furniture:data Rotation set value [180F,0F] +execute if score $rotation gm4_furniture_data matches 4 run data modify storage gm4_furniture:data Rotation set value [-90F,0F] + # wall only furniture must be placed on a wall scoreboard players set $wall_only gm4_furniture_data {{ wall_only }} execute if score $wall_only gm4_furniture_data matches 1 unless score $wall_placement gm4_furniture_data matches 1 run scoreboard players set $valid_placement gm4_furniture_data 0 @@ -13,14 +20,14 @@ execute if score $wall_only gm4_furniture_data matches 1 unless score $wall_plac # wall placed furniture is not allowed to have depth, if any size is bigger than 1 check if there is space scoreboard players set $length gm4_furniture_data {{ length }} scoreboard players set $depth gm4_furniture_data {{ depth }} -scoreboard players set $heigth gm4_furniture_data {{ heigth }} +scoreboard players set $height gm4_furniture_data {{ height }} execute if score $wall_placement gm4_furniture_data matches 1 if score $depth gm4_furniture_data matches 2.. run scoreboard players set $valid_placement gm4_furniture_data 0 scoreboard players set $placement_blocked gm4_furniture_data 0 execute if score $valid_placement gm4_furniture_data matches 1 if score $length gm4_furniture_data matches 2.. run function gm4_furniture:place/check_size/length_prep summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block","gm4_furniture.middle"]} setblock ~ ~ ~ air execute if score $valid_placement gm4_furniture_data matches 1 if score $depth gm4_furniture_data matches 2.. run function gm4_furniture:place/check_size/depth_prep -execute if score $valid_placement gm4_furniture_data matches 1 if score $heigth gm4_furniture_data matches 2.. run function gm4_furniture:place/check_size/heigth_prep +execute if score $valid_placement gm4_furniture_data matches 1 if score $height gm4_furniture_data matches 2.. run function gm4_furniture:place/check_size/height_prep kill @e[type=marker,tag=gm4_furniture.middle,distance=..2,limit=1,sort=nearest] execute if score $placement_blocked gm4_furniture_data matches 1 run scoreboard players set $valid_placement gm4_furniture_data 0 execute if score $placement_blocked gm4_furniture_data matches 1 run kill @e[type=marker,tag=gm4_furniture.marked_block] @@ -58,9 +65,7 @@ execute if score $sittable gm4_furniture_data matches 1.. store result entity @e execute if score $sittable gm4_furniture_data matches 1.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.seat","gm4_furniture.sittable","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}_seat"',item:{id:"air",Count:1},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1f,1f,1f]}} # rotate furniture depending on rotation set by player (if rotation is 1 default rotation can be kept) -execute if score $rotation gm4_furniture_data matches 2 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ 90 0 -execute if score $rotation gm4_furniture_data matches 3 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ 180 0 -execute if score $rotation gm4_furniture_data matches 4 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ -90 0 +execute if score $rotation gm4_furniture_data matches 2.. as @e[tag=gm4_new_furniture,distance=..8] run data modify entity @s Rotation set from storage gm4_furniture:data Rotation # mark block as placed playsound minecraft:block.barrel.close block @a[distance=..6] ~ ~ ~ 1 1.6 diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py index 4c6c8b034d..5e663db1e1 100644 --- a/gm4_furniture/generate.py +++ b/gm4_furniture/generate.py @@ -2,7 +2,7 @@ class furnitures: - def __init__(self, technical_id, display_name, cmd, block_id="barrier", sittable=0, dyable=0, wall_only=0, length=1, depth=1, heigth=1, table=0, scale=1): + def __init__(self, technical_id, display_name, cmd, block_id="barrier", sittable=0, dyable=0, wall_only=0, length=1, depth=1, height=1, table=0, scale=1): self.technical_id = technical_id self.display_name = display_name self.cmd = cmd @@ -12,7 +12,7 @@ def __init__(self, technical_id, display_name, cmd, block_id="barrier", sittable self.dyable = dyable self.length = length self.depth = depth - self.heigth = heigth + self.height = height self.table = table self.scale = scale @@ -33,11 +33,11 @@ def beet_default(ctx: Context): furniture_list.append(furnitures( 'wooden_bench_2', 'Wooden Bench', 3420206, sittable=50, length=3)) furniture_list.append(furnitures( - 'dyable_armchair_1', 'Cloth Armchair', 3420207, sittable=1, dyable=1)) + 'dyable_armchair_1', 'Cloth Armchair', 3420207, sittable=50, dyable=1)) furniture_list.append(furnitures( - 'wooden_candelabra_1', 'Candelabra', 3420208, block_id="light[level=15]", dyable=1)) + 'wooden_3_candle_holder_1', 'Candelabra', 3420208, block_id="light[level=15]", dyable=1)) furniture_list.append(furnitures( - 'wooden_candelabra_2', 'Candelabra', 3420209, block_id="light[level=15]", dyable=1)) + 'wooden_5_candle_holder_1', 'Candelabra', 3420209, block_id="light[level=15]", dyable=1)) furniture_list.append(furnitures( 'dyable_stool_1', 'Ottoman', 3420210, sittable=50, dyable=1)) furniture_list.append(furnitures( @@ -46,6 +46,28 @@ def beet_default(ctx: Context): 'wooden_table_2', 'Wooden Table', 3420212, table=1)) furniture_list.append(furnitures( 'dyable_wooden_table_1', 'Wooden Table with Cloth', 3420213, dyable=1, table=1)) + furniture_list.append(furnitures( + 'dyable_wooden_sofa_1', 'Wooden Sofa with Cushions', 3420214, sittable=50, dyable=1, length=3)) + furniture_list.append(furnitures( + '2x1_log_seat_1', 'Log Bench', 3420215, sittable=50, length=2)) + furniture_list.append(furnitures( + '1x1_log_seat_1', 'Log Seat', 3420216, sittable=50)) + furniture_list.append(furnitures( + 'stone_frog_statue', 'Frog Statue', 3420217)) + furniture_list.append(furnitures( + 'wooden_wall_candle_holder_1', 'Wall Candle', 3420218, block_id="light[level=15]", dyable=1, wall_only=1)) + furniture_list.append(furnitures( + 'dyable_wooden_chair_1', 'Wooden Chair with Cushions', 3420219, sittable=50, dyable=1)) + furniture_list.append(furnitures( + 'gold_5_candle_holder_1', 'Gold Candelabra', 3420220, block_id="light[level=15]", dyable=1)) + furniture_list.append(furnitures( + 'gold_3_candle_holder_1', 'Gold Candelabra', 3420221, block_id="light[level=15]", dyable=1)) + furniture_list.append(furnitures( + 'iron_5_candle_holder_1', 'Iron Candelabra', 3420222, block_id="light[level=15]", dyable=1)) + furniture_list.append(furnitures( + 'iron_3_candle_holder_1', 'Iron Candelabra', 3420223, block_id="light[level=15]", dyable=1)) + furniture_list.append(furnitures( + '2x2_wooden_table_2', 'Wooden Table', 3420224, length=2, depth=2, table=1)) for furniture_data in furniture_list: @@ -72,7 +94,7 @@ def beet_default(ctx: Context): "dyable": furniture_data.dyable, "length": furniture_data.length, "depth": furniture_data.depth, - "heigth": furniture_data.heigth, + "height": furniture_data.height, "table": furniture_data.table, "scale": furniture_data.scale, } From 9466202eddf424a97ef1ea45d097b16f4fd7db55 Mon Sep 17 00:00:00 2001 From: Thanathor Date: Thu, 31 Aug 2023 23:54:36 +0200 Subject: [PATCH 04/26] add colourability --- gm4_furniture/beet.yaml | 2 + .../advancements/hit_furniture_station.json | 42 ------ .../functions/break/decimal_to_hex.mcfunction | 60 +++++++++ .../functions/break/destroy.mcfunction | 11 +- .../functions/break/drop_item.mcfunction | 5 +- .../break/lost_connection.mcfunction | 8 ++ .../break/remove_furniture_station.mcfunction | 1 + .../gm4_furniture/functions/init.mcfunction | 13 +- .../furniture/stone_frog_statue.mcfunction | 7 + .../interact/custom/process.mcfunction | 8 ++ .../custom/resolve_function.mcfunction | 7 + .../furniture_station/swap_tool.mcfunction | 12 ++ .../interact/paint/process.mcfunction | 1 + .../functions/interact/process.mcfunction | 7 +- .../gm4_furniture/functions/main.mcfunction | 4 + .../place/check_size/depth_loop.mcfunction | 3 +- .../place/check_size/depth_offset.mcfunction | 2 +- .../place/check_size/depth_prep.mcfunction | 7 +- .../place/check_size/height_loop.mcfunction | 5 +- .../place/check_size/height_offset.mcfunction | 2 +- .../place/check_size/height_prep.mcfunction | 7 +- .../furniture/furniture_station.mcfunction | 16 ++- .../place/place_furniture.mcfunction | 7 + .../functions/place/prep_place.mcfunction | 4 +- .../functions/place/resolve_id.mcfunction | 12 +- .../build_trades/build_trade.mcfunction | 20 +++ .../build_trades/get_trade_data.mcfunction | 10 ++ .../build_trades/prep.mcfunction | 34 +++++ .../build_trades/resolve_trade.mcfunction | 7 + .../furniture_station/hit.mcfunction | 6 - .../furniture/furniture_station.json | 13 ++ .../loot_tables/items/furniture_station.json | 2 +- .../predicates/chance/frog_statue_sound.json | 4 + .../gm4_furniture/predicates/is_sneaking.json | 9 ++ .../functions/crafting_template.mcfunction | 13 ++ ...on => furniture_place_template.mcfunction} | 19 ++- .../loot_tables/furniture_item_template.json | 125 ++++++++++++++++++ .../templates/loot_tables/template.json | 31 ----- gm4_furniture/generate.py | 73 +++++----- 39 files changed, 473 insertions(+), 146 deletions(-) delete mode 100644 gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json create mode 100644 gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/break/lost_connection.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_frog_statue.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/custom/process.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/custom/resolve_function.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/get_trade_data.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction delete mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/hit.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/loot_tables/furniture/furniture_station.json create mode 100644 gm4_furniture/data/gm4_furniture/predicates/chance/frog_statue_sound.json create mode 100644 gm4_furniture/data/gm4_furniture/predicates/is_sneaking.json create mode 100644 gm4_furniture/data/gm4_furniture/templates/functions/crafting_template.mcfunction rename gm4_furniture/data/gm4_furniture/templates/functions/{template.mcfunction => furniture_place_template.mcfunction} (83%) create mode 100644 gm4_furniture/data/gm4_furniture/templates/loot_tables/furniture_item_template.json delete mode 100644 gm4_furniture/data/gm4_furniture/templates/loot_tables/template.json diff --git a/gm4_furniture/beet.yaml b/gm4_furniture/beet.yaml index 1fff13d64b..cd588a5fed 100644 --- a/gm4_furniture/beet.yaml +++ b/gm4_furniture/beet.yaml @@ -9,11 +9,13 @@ pipeline: - gm4_furniture.generate - gm4.plugins.extend.module - gm4.plugins.include.lib_custom_crafters + - gm4.plugins.include.lib_forceload meta: gm4: versioning: required: + - lib_forceload: 1.1.0 - lib_custom_crafters: 3.0.0 schedule_loops: [main] website: diff --git a/gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json b/gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json deleted file mode 100644 index 78384f632f..0000000000 --- a/gm4_furniture/data/gm4_furniture/advancements/hit_furniture_station.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "criteria": { - "hit_furniture_station": { - "trigger": "minecraft:player_hurt_entity", - "conditions": { - "player": [ - { - "condition": "minecraft:inverted", - "term": { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "type_specific": { - "type": "player", - "gamemode": "adventure" - } - } - } - } - ], - "entity": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "type": "minecraft:wandering_trader", - "nbt": "{Tags:[\"gm4_furniture.furniture_station\"]}" - } - } - ] - } - } - }, - "requirements": [ - [ - "hit_furniture_station" - ] - ], - "rewards": { - "function": "gm4_furniture:interact/furniture_station/hit" - } -} diff --git a/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction new file mode 100644 index 0000000000..02e2cee720 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction @@ -0,0 +1,60 @@ + +data modify storage gm4_furniture:temp color_hex set value {} + +scoreboard players operation $red gm4_furniture_data = $furniture_color gm4_furniture_data +scoreboard players operation $red gm4_furniture_data /= #65536 gm4_furniture_data +scoreboard players operation $add_digit gm4_furniture_data = $red gm4_furniture_data +scoreboard players operation $add_digit gm4_furniture_data /= #16 gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.red_1 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.red_1 set value "B" +execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.red_1 set value "C" +execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.red_1 set value "D" +execute if score $add_digit gm4_furniture_data matches 14 run data modify storage gm4_furniture:temp color_hex.red_1 set value "E" +execute if score $add_digit gm4_furniture_data matches 15 run data modify storage gm4_furniture:temp color_hex.red_1 set value "F" +scoreboard players operation $add_digit gm4_furniture_data = $red gm4_furniture_data +scoreboard players operation $add_digit gm4_furniture_data %= #16 gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.red_2 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.red_2 set value "B" +execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.red_2 set value "C" +execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.red_2 set value "D" +execute if score $add_digit gm4_furniture_data matches 14 run data modify storage gm4_furniture:temp color_hex.red_2 set value "E" +execute if score $add_digit gm4_furniture_data matches 15 run data modify storage gm4_furniture:temp color_hex.red_2 set value "F" + +scoreboard players operation $green gm4_furniture_data = $furniture_color gm4_furniture_data +scoreboard players operation $green gm4_furniture_data /= #256 gm4_furniture_data +scoreboard players operation $green gm4_furniture_data %= #256 gm4_furniture_data +scoreboard players operation $add_digit gm4_furniture_data = $green gm4_furniture_data +scoreboard players operation $add_digit gm4_furniture_data /= #16 gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.green_1 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.green_1 set value "B" +execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.green_1 set value "C" +execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.green_1 set value "D" +execute if score $add_digit gm4_furniture_data matches 14 run data modify storage gm4_furniture:temp color_hex.green_1 set value "E" +execute if score $add_digit gm4_furniture_data matches 15 run data modify storage gm4_furniture:temp color_hex.green_1 set value "F" +scoreboard players operation $add_digit gm4_furniture_data = $green gm4_furniture_data +scoreboard players operation $add_digit gm4_furniture_data %= #16 gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.green_2 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.green_2 set value "B" +execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.green_2 set value "C" +execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.green_2 set value "D" +execute if score $add_digit gm4_furniture_data matches 14 run data modify storage gm4_furniture:temp color_hex.green_2 set value "E" +execute if score $add_digit gm4_furniture_data matches 15 run data modify storage gm4_furniture:temp color_hex.green_2 set value "F" + +scoreboard players operation $blue gm4_furniture_data = $furniture_color gm4_furniture_data +scoreboard players operation $blue gm4_furniture_data %= #256 gm4_furniture_data +scoreboard players operation $add_digit gm4_furniture_data = $blue gm4_furniture_data +scoreboard players operation $add_digit gm4_furniture_data /= #16 gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.blue_1 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.blue_1 set value "B" +execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.blue_1 set value "C" +execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.blue_1 set value "D" +execute if score $add_digit gm4_furniture_data matches 14 run data modify storage gm4_furniture:temp color_hex.blue_1 set value "E" +execute if score $add_digit gm4_furniture_data matches 15 run data modify storage gm4_furniture:temp color_hex.blue_1 set value "F" +scoreboard players operation $add_digit gm4_furniture_data = $blue gm4_furniture_data +scoreboard players operation $add_digit gm4_furniture_data %= #16 gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.blue_2 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.blue_2 set value "B" +execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.blue_2 set value "C" +execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.blue_2 set value "D" +execute if score $add_digit gm4_furniture_data matches 14 run data modify storage gm4_furniture:temp color_hex.blue_2 set value "E" +execute if score $add_digit gm4_furniture_data matches 15 run data modify storage gm4_furniture:temp color_hex.blue_2 set value "F" diff --git a/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction index a30b1082d3..8dadf0bedd 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction @@ -2,9 +2,15 @@ # @s = furniture main interaction entity # at @s # run from break/process_hit +# run from break/lost_connection + +# check if furniture had color data +execute store result score $furniture_color gm4_furniture_data positioned ~-0.4999 ~0.0001 ~-0.4999 run data get entity @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] item.tag.display.color +execute if score $furniture_color gm4_furniture_data matches 16383998 run scoreboard players reset $furniture_color gm4_furniture_data +execute if score $furniture_color gm4_furniture_data matches 1.. run function gm4_furniture:break/decimal_to_hex # unless breaking player was in creative drop the item -execute if score $creative gm4_furniture_data matches 0 positioned ~-0.4999 ~0.0001 ~-0.4999 as @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] run function gm4_furniture:break/drop_item with entity @s item.tag.data +execute unless score $creative gm4_furniture_data matches 1 positioned ~-0.4999 ~0.0001 ~-0.4999 as @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] run function gm4_furniture:break/drop_item with entity @s item.tag.data # remove any furniture blocks that match the id execute as @e[type=interaction,tag=gm4_furniture,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s run function gm4_furniture:break/remove_block @@ -14,3 +20,6 @@ execute if entity @s[tag=gm4_furniture.furniture_station] run function gm4_furni # destroy sound playsound minecraft:entity.armor_stand.break block @a[distance=..8] ~ ~ ~ 1 1 + +# cleanup +scoreboard players reset $furniture_color gm4_furniture_data diff --git a/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction index 451d0698e8..3a314fbdd1 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction @@ -2,6 +2,7 @@ # @s = furniture item display # at @s # run from break/destroy with @s item.tag.data -# $(loot_table) = loot table path for this furniture item +# $(technical_id) = furniture's technical_id -$loot spawn ~.5 ~.25 ~.5 loot $(loot_table) +$loot spawn ~.5 ~.25 ~.5 loot gm4_furniture:furniture/$(technical_id) +execute if score $furniture_color gm4_furniture_data matches 1.. positioned ~.5 ~.25 ~.5 store result entity @e[type=item,limit=1,sort=nearest] Item.tag.gm4_furniture.color int 1 run scoreboard players get $furniture_color gm4_furniture_data diff --git a/gm4_furniture/data/gm4_furniture/functions/break/lost_connection.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/lost_connection.mcfunction new file mode 100644 index 0000000000..a892acfa2b --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/break/lost_connection.mcfunction @@ -0,0 +1,8 @@ +# destroy furniture if it loses its required connection to the wall / ceiling +# @s = furniture's main interaction entity +# at @s +# run from main + +scoreboard players set $creative gm4_furniture_data 0 +scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id +function gm4_furniture:break/destroy diff --git a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction index a3ee35e5d4..9827ec0e9b 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction @@ -5,3 +5,4 @@ setblock ~ ~2 ~ air execute as @e[type=wandering_trader,tag=gm4_furniture,distance=..4] if score @s gm4_furniture_id = $check_id gm4_furniture_id run tp @s ~ -100000 ~ +execute positioned ~-0.4999 ~0.0001 ~-0.4999 run kill @e[type=item_display,tag=gm4_furniture.tool,dx=0,dy=0,dz=0] diff --git a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction index b613670272..ab4494f601 100644 --- a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction @@ -5,17 +5,22 @@ scoreboard players set furniture gm4_modules 1 scoreboard objectives add gm4_furniture_data dummy scoreboard objectives add gm4_furniture_last_hit dummy scoreboard objectives add gm4_furniture_id dummy +scoreboard objectives add gm4_furniture_index dummy scoreboard players set #2 gm4_furniture_data 2 +scoreboard players set #16 gm4_furniture_data 16 +scoreboard players set #256 gm4_furniture_data 256 +scoreboard players set #65536 gm4_furniture_data 65536 team add gm4_furniture_nocol team modify gm4_furniture_nocol collisionRule never -data modify storage gm4_furniture:furniture_station categories set value [] -data modify storage gm4_furniture:furniture_station categories append value {test:1} -data modify storage gm4_furniture:furniture_station categories append value {test:2} -data modify storage gm4_furniture:furniture_station categories append value {test:3} +# build furniture station trade data +data modify storage gm4_furniture:data furniture_station set value [] +function gm4_furniture:generate_trades function #gm4_furniture:add_categories +execute store result score $max_index gm4_furniture_index run data get storage gm4_furniture:data furniture_station +scoreboard players remove $max_index gm4_furniture_index 1 schedule function gm4_furniture:main 1t diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_frog_statue.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_frog_statue.mcfunction new file mode 100644 index 0000000000..ff538a11c5 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_frog_statue.mcfunction @@ -0,0 +1,7 @@ +# 2% chance to play a frog sound +# @s = furniture's interacted interaction entity +# at @s +# run from interact/custom/resolve_function + +execute if predicate gm4_furniture:chance/frog_statue_sound run playsound entity.frog.ambient block @a[distance=..16] ~ ~ ~ 1 0.95 +scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/custom/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/custom/process.mcfunction new file mode 100644 index 0000000000..d67caca0f1 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/custom/process.mcfunction @@ -0,0 +1,8 @@ +# process custom furniture interactions +# @s = furniture's interacted interaction entity +# at @s +# run from interact/process + +data modify storage gm4_furniture:temp technical_id set string entity @s CustomName 23 -2 +function gm4_furniture:interact/custom/resolve_function with storage gm4_furniture:temp +data remove storage gm4_furniture:temp technical_id diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/custom/resolve_function.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/custom/resolve_function.mcfunction new file mode 100644 index 0000000000..ca3e00203d --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/custom/resolve_function.mcfunction @@ -0,0 +1,7 @@ +# resolve which furniture was interacted with +# @s = furniture's interacted interaction entity +# at @s +# run from interact/custom/process with storage gm4_furniture:temp +# $(techical_id) = technical_id + +$function gm4_furniture:interact/custom/furniture/$(technical_id) diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction new file mode 100644 index 0000000000..fd15fcc753 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction @@ -0,0 +1,12 @@ +# get interacting player to sit at this furniture block +# @s = furniture's interacted interaction entity +# at @s +# run from interact/process + +# move index up/down +execute if entity @s[tag=gm4_furniture.next] align xyz run scoreboard players add @e[type=wandering_trader,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] gm4_furniture_index 1 +execute if entity @s[tag=gm4_furniture.prev] align xyz run scoreboard players remove @e[type=wandering_trader,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] gm4_furniture_index 1 +execute align xyz as @e[type=wandering_trader,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep + +# mark interaction as resolved +scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction index 3692d4a962..d0f9a66c1f 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction @@ -10,3 +10,4 @@ execute as @e[type=interaction,tag=gm4_furniture.main,distance=..8] if score @s # if furniture was painted mark interaction as resolved and play paint sound execute if score $paint_changed gm4_furniture_data matches 1 run playsound item.dye.use player @a[distance=..8] ~ ~ ~ 1 1 execute if score $paint_changed gm4_furniture_data matches 1 run scoreboard players set $interaction_processed gm4_furniture_data 1 +execute if score $paint_changed gm4_furniture_data matches 1 as @e[type=interaction,tag=gm4_furniture.main,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id run tag @s add gm4_furniture.painted diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction index f48226a47f..c9f519e5e9 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction @@ -6,14 +6,17 @@ # first successful interaction will be used, any lower down this list will be ignored scoreboard players set $interaction_processed gm4_furniture_data 0 +# check for furniture station interactions +execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.swap_tool] run function gm4_furniture:interact/furniture_station/swap_tool + # check for custom interactions -# TODO +execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.custom_interaction] run function gm4_furniture:interact/custom/process # check for painting execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.dyable] if entity @p[tag=gm4_furniture_target,predicate=gm4_furniture:holding_paintbrush] run function gm4_furniture:interact/paint/detect # check for sitting -execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.sittable] positioned ~-0.4999 ~0.0001 ~-0.4999 run function gm4_furniture:interact/sit/process +execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.sittable] if entity @p[tag=gm4_furniture_target,predicate=!gm4_furniture:is_sneaking] positioned ~-0.4999 ~0.0001 ~-0.4999 run function gm4_furniture:interact/sit/process # cleanup data remove entity @s interaction diff --git a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction index 2309a28baa..0014f1e3b5 100644 --- a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction @@ -2,3 +2,7 @@ schedule function gm4_furniture:main 8t # check horses, remove paintbrushes that have been equipped execute as @e[type=horse,nbt={ArmorItems:[{tag:{gm4_furniture:"paintbrush"}}]}] at @s run function gm4_furniture:technical/paintbrush/remove_from_horse + +# check furniture placements +execute as @e[type=interaction,tag=gm4_furniture.on_wall] at @s if block ^ ^0.5 ^-1 #gm4:replaceable run function gm4_furniture:break/lost_connection +execute as @e[type=interaction,tag=gm4_furniture.on_ceiling] at @s if block ^ ^1.5 ^ #gm4:replaceable run function gm4_furniture:break/lost_connection diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction index 634337b879..1bf10cf2cb 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_loop.mcfunction @@ -11,4 +11,5 @@ summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} scoreboard players add $depth_done gm4_furniture_data 1 execute if score $depth_done gm4_furniture_data = $depth gm4_furniture_data run scoreboard players reset $depth_done gm4_furniture_data -execute if score $depth_done gm4_furniture_data < $depth gm4_furniture_data positioned ^ ^ ^-1 run function gm4_furniture:place/check_size/depth_loop +execute if score $wall_only gm4_furniture_data matches 0 if score $depth_done gm4_furniture_data < $depth gm4_furniture_data positioned ^ ^ ^-1 run function gm4_furniture:place/check_size/depth_loop +execute if score $wall_only gm4_furniture_data matches 1 if score $depth_done gm4_furniture_data < $depth gm4_furniture_data positioned ^ ^ ^1 run function gm4_furniture:place/check_size/depth_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction index 4a1672d2c4..e4fc2ba2ae 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_offset.mcfunction @@ -1,6 +1,6 @@ # check if furniture fits here # @s = player who placed the furniture player head -# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^x ^ ^ +# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^ ^ ^x # run from place/check_size/depth_prep # run from here diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction index 40c789043b..b226ea3360 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/depth_prep.mcfunction @@ -4,7 +4,8 @@ # run from any in place/furniture/ execute as @e[type=marker,tag=gm4_furniture.marked_block] run data modify entity @s Rotation set from storage gm4_furniture:data Rotation -execute if score $depth gm4_furniture_data matches 3.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^ ^1 run function gm4_furniture:place/check_size/depth_offset -execute if score $depth gm4_furniture_data matches 3.. run scoreboard players remove $depth gm4_furniture_data 1 +execute if score $depth gm4_furniture_data matches 3.. if score $wall_only gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^ ^1 run function gm4_furniture:place/check_size/depth_offset +execute if score $depth gm4_furniture_data matches 3.. if score $wall_only gm4_furniture_data matches 0 run scoreboard players remove $depth gm4_furniture_data 1 scoreboard players remove $depth gm4_furniture_data 1 -execute if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block,tag=!gm4_furniture.depth_marker] positioned ^ ^ ^-1 run function gm4_furniture:place/check_size/depth_loop +execute if score $wall_only gm4_furniture_data matches 0 if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block,tag=!gm4_furniture.depth_marker] positioned ^ ^ ^-1 run function gm4_furniture:place/check_size/depth_loop +execute if score $wall_only gm4_furniture_data matches 1 if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block,tag=!gm4_furniture.depth_marker] positioned ^ ^ ^1 run function gm4_furniture:place/check_size/depth_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction index db332140a0..e10445d0e3 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_loop.mcfunction @@ -1,6 +1,6 @@ # check if furniture fits here # @s = player who placed the furniture player head -# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^ ^ ^x +# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^ ^x ^ # run from place/check_size/height_prep # run from here @@ -11,4 +11,5 @@ summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block"]} scoreboard players add $height_done gm4_furniture_data 1 execute if score $height_done gm4_furniture_data = $height gm4_furniture_data run scoreboard players reset $height_done gm4_furniture_data -execute if score $height_done gm4_furniture_data < $height gm4_furniture_data positioned ^ ^1 ^ run function gm4_furniture:place/check_size/height_loop +execute if score $ceiling_only gm4_furniture_data matches 0 if score $height_done gm4_furniture_data < $height gm4_furniture_data positioned ^ ^1 ^ run function gm4_furniture:place/check_size/height_loop +execute if score $ceiling_only gm4_furniture_data matches 1 if score $height_done gm4_furniture_data < $height gm4_furniture_data positioned ^ ^-1 ^ run function gm4_furniture:place/check_size/height_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction index 60508397b7..dfa23474b1 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_offset.mcfunction @@ -1,6 +1,6 @@ # check if furniture fits here # @s = player who placed the furniture player head -# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^x ^ ^ +# at the center of the placed block rotated along axis to face towards player or away from the wall, positioned ^ ^x ^ # run from place/check_size/height_prep # run from here diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction index ef1961bf4a..c32229bea4 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_size/height_prep.mcfunction @@ -5,7 +5,8 @@ # height is only offset down if this is a wall placed furniture (painting) execute as @e[type=marker,tag=gm4_furniture.marked_block] run data modify entity @s Rotation set from storage gm4_furniture:data Rotation -execute if score $height gm4_furniture_data matches 3.. if score $wall_only gm4_furniture_data matches 1 at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^-1 ^ run function gm4_furniture:place/check_size/height_offset -execute if score $height gm4_furniture_data matches 3.. if score $wall_only gm4_furniture_data matches 1 run scoreboard players remove $height gm4_furniture_data 1 +execute if score $height gm4_furniture_data matches 3.. if score $wall_only gm4_furniture_data matches 1 if score $ceiling_only gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block] positioned ^ ^-1 ^ run function gm4_furniture:place/check_size/height_offset +execute if score $height gm4_furniture_data matches 3.. if score $wall_only gm4_furniture_data matches 1 if score $ceiling_only gm4_furniture_data matches 0 run scoreboard players remove $height gm4_furniture_data 1 scoreboard players remove $height gm4_furniture_data 1 -execute if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block,tag=!gm4_furniture.height_marker] positioned ^ ^1 ^ run function gm4_furniture:place/check_size/height_loop +execute if score $ceiling_only gm4_furniture_data matches 0 if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block,tag=!gm4_furniture.height_marker] positioned ^ ^1 ^ run function gm4_furniture:place/check_size/height_loop +execute if score $ceiling_only gm4_furniture_data matches 1 if score $placement_blocked gm4_furniture_data matches 0 at @e[type=marker,tag=gm4_furniture.marked_block,tag=!gm4_furniture.height_marker] positioned ^ ^-1 ^ run function gm4_furniture:place/check_size/height_loop diff --git a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction index 6e955ec6fc..3c977298b6 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction @@ -16,14 +16,24 @@ execute if score $valid_placement gm4_furniture_data matches 0 run setblock ~ ~ execute if score $valid_placement gm4_furniture_data matches 0 run return 0 # spawn the furniture_station -execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.display","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station"',item:{id:"leather_horse_armor",Count:1,tag:{data:{loot_table:"gm4_furniture:items/furniture_station"},CustomModelData:3420150}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.display","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station"',item:{id:"leather_horse_armor",Count:1,tag:{data:{technical_id:"furniture_station"},CustomModelData:3420150}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1.0002f,width:1.0002f,response:1b} +summon interaction ^0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.next","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} +summon interaction ^-0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.prev","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,1f,0f],scale:[1f,1f,1f]}} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_next","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[1f,0f,0f,1f],right_rotation:[1f,0f,0f,1f],translation:[0.25f,1.45f,0.5f],scale:[0.25f,0.25f,0.25f]}} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_prev","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[1f,0f,0f,1f],right_rotation:[1f,0f,0f,1f],translation:[-0.25f,1.45f,0.5f],scale:[0.25f,0.25f,0.25f]}} +data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_main,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[0].cmd +data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_next,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[1].cmd +data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_prev,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[-1].cmd setblock ~ ~ ~ barrier # spawn trader and set ids -summon wandering_trader ~ ~1000 ~ {Team:"gm4_furniture_nocol",Tags:["gm4_furniture","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'{"text":"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA","font":"gm4_furniture","color":"white"}',NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",duration:-1,show_particles:0b},{id:"minecraft:resistance",amplifier:9,duration:-1,show_particles:0b}]} +summon wandering_trader ~ ~1000 ~ {Invulnerable:1b,Team:"gm4_furniture_nocol",Tags:["gm4_furniture","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.furniture_station","fallback":"Furniture Station"},[{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:offscreen"},{"translate":"gui.gm4.furniture_station","fallback":"","font":"gm4:container_gui","color":"white"},{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:furniture","color":"#404040"}]]}',NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",duration:-1,show_particles:0b},{id:"minecraft:resistance",amplifier:9,duration:-1,show_particles:0b}]} tp @e[type=wandering_trader,tag=gm4_new_furniture,limit=1] ~ ~-0.4999 ~ -setblock ~ ~1 ~ flower_pot +scoreboard players set @e[type=wandering_trader,tag=gm4_new_furniture,limit=1] gm4_furniture_index 0 +execute as @e[type=wandering_trader,tag=gm4_new_furniture,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep +setblock ~ ~1 ~ light[level=0] execute store result score @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 execute store result score @e[type=wandering_trader,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players get $next_id gm4_furniture_id diff --git a/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction index 7c75d161df..241764338e 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction @@ -3,6 +3,10 @@ # at @s advancement revoke @s only gm4_furniture:place_furniture +# get item data +execute store success score $mainhand gm4_furniture_data run data modify storage gm4_furniture:temp furniture_data set from entity @s SelectedItem.tag.gm4_furniture +execute if score $mainhand gm4_furniture_data matches 0 run data modify storage gm4_furniture:temp furniture_data set from entity @s Inventory[{Slot:-106b}].tag.gm4_furniture + # get rotation of player # key: direction of player # 1: north, 2: east, 3: south, 4: west @@ -27,3 +31,6 @@ execute if score $player_head_count gm4_furniture_data matches 1.. if score $rot execute if score $player_head_count gm4_furniture_data matches 1.. if score $rotation gm4_furniture_data matches 2 align xyz positioned ~0.5 ~0.5 ~0.5 rotated -90 0 positioned ^-4 ^-4 ^-1 run function gm4_furniture:place/check_layer execute if score $player_head_count gm4_furniture_data matches 1.. if score $rotation gm4_furniture_data matches 3 align xyz positioned ~0.5 ~0.5 ~0.5 rotated 0 0 positioned ^-4 ^-4 ^-1 run function gm4_furniture:place/check_layer execute if score $player_head_count gm4_furniture_data matches 1.. if score $rotation gm4_furniture_data matches 4 align xyz positioned ~0.5 ~0.5 ~0.5 rotated 90 0 positioned ^-4 ^-4 ^-1 run function gm4_furniture:place/check_layer + +# cleanup +data remove storage gm4_furniture:temp furniture_data diff --git a/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction index 1c3872c789..36e3dbe476 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/prep_place.mcfunction @@ -13,6 +13,4 @@ execute if score $wall_placement gm4_furniture_data matches 1 if block ~ ~ ~ pla scoreboard players remove $player_head_count gm4_furniture_data 1 -data modify storage gm4_furniture:temp command.function set from block ~ ~ ~ SkullOwner.Name -function gm4_furniture:place/resolve_id with storage gm4_furniture:temp command -data remove storage gm4_furniture:temp command +function gm4_furniture:place/resolve_id with storage gm4_furniture:temp furniture_data diff --git a/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction index 51bde6ff45..2903fe0f9a 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction @@ -1,10 +1,10 @@ # run the function belonging to the placed furniture # @s = player that just placed a furniture player head # at the center of the furniture player head that was placed -# run from place/prep_place -# $(function) = function path (gm4_furniture:place/furniture/) +# run from place/prep_place with storage gm4_furniture:temp furniture_data +# $(technical_id) = furniture's technical_id -$execute if score $rotation gm4_furniture_data matches 1 rotated 0 0 run function $(function) -$execute if score $rotation gm4_furniture_data matches 2 rotated 90 0 run function $(function) -$execute if score $rotation gm4_furniture_data matches 3 rotated 180 0 run function $(function) -$execute if score $rotation gm4_furniture_data matches 4 rotated -90 0 run function $(function) +$execute if score $rotation gm4_furniture_data matches 1 rotated 0 0 run function gm4_furniture:place/furniture/$(technical_id) +$execute if score $rotation gm4_furniture_data matches 2 rotated 90 0 run function gm4_furniture:place/furniture/$(technical_id) +$execute if score $rotation gm4_furniture_data matches 3 rotated 180 0 run function gm4_furniture:place/furniture/$(technical_id) +$execute if score $rotation gm4_furniture_data matches 4 rotated -90 0 run function gm4_furniture:place/furniture/$(technical_id) diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction new file mode 100644 index 0000000000..3094b1cc0c --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction @@ -0,0 +1,20 @@ +# build a trade from trade_data +# @s = furniture station wandering trader +# at @s +# run from technical/furniture_station/build_trades/prep +# run from here + +data modify storage gm4_furniture:temp new_trade set value {rewardExp:0b,maxUses:2147483647,uses:0,xp:0,buy:{id:"minecraft:barrier",Count:1b},buyB:{id:"minecraft:barrier",Count:1b},sell:{id:"minecraft:barrier",Count:1b}} +data modify storage gm4_furniture:temp new_trade.buy.id set from storage gm4_furniture:temp trade_data[0].cost[0].id +data modify storage gm4_furniture:temp new_trade.buy.Count set from storage gm4_furniture:temp trade_data[0].cost[0].Count +data modify storage gm4_furniture:temp new_trade.buyB.id set from storage gm4_furniture:temp trade_data[0].cost[1].id +data modify storage gm4_furniture:temp new_trade.buyB.Count set from storage gm4_furniture:temp trade_data[0].cost[1].Count + +function gm4_furniture:technical/furniture_station/build_trades/resolve_trade with storage gm4_furniture:temp trade_data[0] +data modify storage gm4_furniture:temp new_trade.sell set from block 29999998 1 7134 Items[{Slot:0b}] + +data modify storage gm4_furniture:temp trades append from storage gm4_furniture:temp new_trade +data remove storage gm4_furniture:temp new_trade + +data remove storage gm4_furniture:temp trade_data[0] +execute if data storage gm4_furniture:temp trade_data[0] run function gm4_furniture:technical/furniture_station/build_trades/build_trade diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/get_trade_data.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/get_trade_data.mcfunction new file mode 100644 index 0000000000..913ef025d1 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/get_trade_data.mcfunction @@ -0,0 +1,10 @@ +# loop through trade data to get the proper index in the frot +# @s = furniture station wandering trader +# at @s +# run from technical/furniture_station/build_trades/prep +# run from here + +data modify storage gm4_furniture:temp trade_data append from storage gm4_furniture:temp trade_data[0] +data remove storage gm4_furniture:temp trade_data[0] +scoreboard players remove $trade_index gm4_furniture_data 1 +execute if score $trade_index gm4_furniture_data matches 1.. run function gm4_furniture:technical/furniture_station/build_trades/get_trade_data diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction new file mode 100644 index 0000000000..61937def6e --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction @@ -0,0 +1,34 @@ +# change the trades of this furniture station +# @s = furniture station wandering trader +# at @s +# run from interact/furniture_station/swap_tool +# run from place/furniture/furniture_station + +# clamp index to min/max +execute if score @s gm4_furniture_index matches ..-1 run scoreboard players operation @s gm4_furniture_index = $max_index gm4_furniture_index +execute if score @s gm4_furniture_index > $max_index gm4_furniture_index run scoreboard players set @s gm4_furniture_index 0 + +# get the trade data that should be displayed in the first index +scoreboard players operation $trade_index gm4_furniture_data = @s gm4_furniture_index +data modify storage gm4_furniture:temp trade_data set from storage gm4_furniture:data furniture_station +execute if score $trade_index gm4_furniture_data matches 1.. run function gm4_furniture:technical/furniture_station/build_trades/get_trade_data + +# change the displayed tools cmd +execute align xyz run data modify entity @e[type=item_display,tag=gm4_furniture.tool_main,dx=0,dy=0,dz=0,limit=1] item.tag.CustomModelData set from storage gm4_furniture:temp trade_data[0].cmd +execute align xyz run data modify entity @e[type=item_display,tag=gm4_furniture.tool_next,dx=0,dy=0,dz=0,limit=1] item.tag.CustomModelData set from storage gm4_furniture:temp trade_data[1].cmd +execute align xyz run data modify entity @e[type=item_display,tag=gm4_furniture.tool_prev,dx=0,dy=0,dz=0,limit=1] item.tag.CustomModelData set from storage gm4_furniture:temp trade_data[-1].cmd + +# build the trades from trade_data +data modify storage gm4_furniture:temp trade_data set from storage gm4_furniture:temp trade_data[0].trades +data modify storage gm4_furniture:temp trades set value [] +function gm4_furniture:technical/furniture_station/build_trades/build_trade + +# change the trades +data modify entity @s Offers.Recipes set from storage gm4_furniture:temp trades + +# sounds +playsound ui.stonecutter.take_result block @a[distance=..16] ~ ~ ~ 1 0.45 + +# cleanup +data remove storage gm4_furniture:temp trades +data remove storage gm4_furniture:temp trade_data diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction new file mode 100644 index 0000000000..59adeedaea --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction @@ -0,0 +1,7 @@ +# put furniture item in forceloaded shulker box to read its data +# @s = furniture station wandering trader +# at @s +# run from technical/furniture_station/build_trades/build_trade with storage gm4_furniture:temp trade_data[0] +# $(technical_id) = furniture's technical_id + +$loot replace block 29999998 1 7134 container.0 loot gm4_furniture:furniture/$(technical_id) diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/hit.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/hit.mcfunction deleted file mode 100644 index 52e4af20ab..0000000000 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/hit.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -# when a player punches the top block of a furniture station swap the category -# @s = player hitting the furniture station wandering trader -# at @s -advancement revoke @s only gm4_furniture:hit_furniture_station - -execute as @e[type=wandering_trader,tag=gm4_furniture.furniture_station,distance=..8,nbt={HurtTime:10s}] at @s run say hit diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/furniture/furniture_station.json b/gm4_furniture/data/gm4_furniture/loot_tables/furniture/furniture_station.json new file mode 100644 index 0000000000..49a7ead502 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/loot_tables/furniture/furniture_station.json @@ -0,0 +1,13 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "gm4_furniture:items/furniture_station" + } + ] + } + ] +} diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json index 9ce5b4f34b..ba39610fc2 100644 --- a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json +++ b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json @@ -10,7 +10,7 @@ "functions": [ { "function": "set_nbt", - "tag": "{CustomModelData:3420150,gm4_furniture:{id:\"gm4.furniture_station\"},SkullOwner:{Id:[I;1862739911,-1668725896,-1286726243,-1817885533],Name:\"gm4_furniture:place/furniture/furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" + "tag": "{CustomModelData:3420150,gm4_furniture:{id:\"gm4.furniture_station\"},SkullOwner:{Id:[I;1862739911,-1668725896,-1286726243,-1817885533],Name:\"furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" }, { "function": "minecraft:set_name", diff --git a/gm4_furniture/data/gm4_furniture/predicates/chance/frog_statue_sound.json b/gm4_furniture/data/gm4_furniture/predicates/chance/frog_statue_sound.json new file mode 100644 index 0000000000..a32336e2f6 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/predicates/chance/frog_statue_sound.json @@ -0,0 +1,4 @@ +{ + "condition": "minecraft:random_chance", + "chance": 0.02 +} diff --git a/gm4_furniture/data/gm4_furniture/predicates/is_sneaking.json b/gm4_furniture/data/gm4_furniture/predicates/is_sneaking.json new file mode 100644 index 0000000000..3c8a7e1e95 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/predicates/is_sneaking.json @@ -0,0 +1,9 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "flags": { + "is_sneaking": true + } + } +} diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/crafting_template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/crafting_template.mcfunction new file mode 100644 index 0000000000..85e08e0b44 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/templates/functions/crafting_template.mcfunction @@ -0,0 +1,13 @@ +# this is a test + + +data modify storage gm4_furniture:temp new_trades.test1 set value {cmd:3420201,trades:[]} +data modify storage gm4_furniture:temp new_trades.test2 set value {cmd:3420202,trades:[]} +data modify storage gm4_furniture:temp new_trades.test3 set value {cmd:3420202,trades:[]} + +{{ furniture_list }} + +data modify storage gm4_furniture:data furniture_station append from storage gm4_furniture:temp new_trades.test1 +data modify storage gm4_furniture:data furniture_station append from storage gm4_furniture:temp new_trades.test2 +data modify storage gm4_furniture:data furniture_station append from storage gm4_furniture:temp new_trades.test3 +data remove storage gm4_furniture:temp new_trades diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction similarity index 83% rename from gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction rename to gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction index 32b9245fdb..487821ef7a 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction @@ -17,11 +17,14 @@ execute if score $rotation gm4_furniture_data matches 4 run data modify storage scoreboard players set $wall_only gm4_furniture_data {{ wall_only }} execute if score $wall_only gm4_furniture_data matches 1 unless score $wall_placement gm4_furniture_data matches 1 run scoreboard players set $valid_placement gm4_furniture_data 0 +# ceiling only furniture must be placed on a ceiling +scoreboard players set $ceiling_only gm4_furniture_data {{ ceiling_only }} +execute if score $ceiling_only gm4_furniture_data matches 1 if block ~ ~1 ~ #gm4:replaceable run scoreboard players set $valid_placement gm4_furniture_data 0 + # wall placed furniture is not allowed to have depth, if any size is bigger than 1 check if there is space scoreboard players set $length gm4_furniture_data {{ length }} scoreboard players set $depth gm4_furniture_data {{ depth }} scoreboard players set $height gm4_furniture_data {{ height }} -execute if score $wall_placement gm4_furniture_data matches 1 if score $depth gm4_furniture_data matches 2.. run scoreboard players set $valid_placement gm4_furniture_data 0 scoreboard players set $placement_blocked gm4_furniture_data 0 execute if score $valid_placement gm4_furniture_data matches 1 if score $length gm4_furniture_data matches 2.. run function gm4_furniture:place/check_size/length_prep summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block","gm4_furniture.middle"]} @@ -40,22 +43,30 @@ execute if score $valid_placement gm4_furniture_data matches 0 run return 0 scoreboard players set $sittable gm4_furniture_data {{ sittable }} scoreboard players set $dyable gm4_furniture_data {{ dyable }} scoreboard players set $table gm4_furniture_data {{ table }} +scoreboard players set $custom_interaction gm4_furniture_data {{ custom_interaction }} # spawn the furniture -execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{loot_table:"gm4_furniture:furniture/{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} +execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{technical_id:"{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} setblock ~ ~ ~ {{ block_id }} +# add placement tags +execute if score $wall_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.on_wall +execute if score $ceiling_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.on_ceiling + # spawn extensions if they exist and set id execute at @e[type=marker,tag=gm4_furniture.marked_block] run summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} execute at @e[type=marker,tag=gm4_furniture.marked_block] run setblock ~ ~ ~ {{ block_id }} execute store result score @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 +# add custom interaction tags +execute if score $custom_interaction gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.custom_interaction + # if furniture is a table reduce interaction height execute if score $table gm4_furniture_data matches 1 as @e[type=interaction,tag=gm4_new_furniture,distance=..8] run data modify entity @s height set value 1f # if furniture is dyable set to basic white -execute if score $dyable gm4_furniture_data matches 1 run data modify entity @e[type=item_display,distance=..2,tag=gm4_new_furniture,limit=1,sort=nearest] item.tag.display.color set value 16777215 +execute if score $dyable gm4_furniture_data matches 1 run data modify entity @e[type=item_display,distance=..2,tag=gm4_new_furniture,limit=1,sort=nearest] item.tag.display.color set from storage gm4_furniture:temp furniture_data.color execute if score $dyable gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.dyable # if furniture is sittable spawn sitting item_displays at appropiate locations and add tag @@ -70,4 +81,6 @@ execute if score $rotation gm4_furniture_data matches 2.. as @e[tag=gm4_new_furn # mark block as placed playsound minecraft:block.barrel.close block @a[distance=..6] ~ ~ ~ 1 1.6 tag @e[distance=..2] remove gm4_new_furniture + +# cleanup kill @e[type=marker,tag=gm4_furniture.marked_block] diff --git a/gm4_furniture/data/gm4_furniture/templates/loot_tables/furniture_item_template.json b/gm4_furniture/data/gm4_furniture/templates/loot_tables/furniture_item_template.json new file mode 100644 index 0000000000..95181bec93 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/templates/loot_tables/furniture_item_template.json @@ -0,0 +1,125 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "name": "gm4_furniture:furniture/base", + "functions": [ + { + "function": "minecraft:set_nbt", + "tag": "{CustomModelData:{{ cmd }},gm4_furniture:{technical_id:\"{{ technical_id }}\",color:16383998},SkullOwner:{Name:\"{{ technical_id }}\"}}" + }, + { + "function": "minecraft:set_name", + "name": [ + { + "translate": "block.gm4_furniture.gm4_{{ technical_id }}", + "fallback": "{{ display_name }}", + "color": "white", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4_furniture.paintbrush.color_lore", + "fallback": "Color: #", + "color": "gray", + "italic": false + }, + { + "nbt": "color_hex.red_1", + "storage": "gm4_furniture:temp" + }, + { + "nbt": "color_hex.red_2", + "storage": "gm4_furniture:temp" + }, + { + "nbt": "color_hex.green_1", + "storage": "gm4_furniture:temp" + }, + { + "nbt": "color_hex.green_2", + "storage": "gm4_furniture:temp" + }, + { + "nbt": "color_hex.blue_1", + "storage": "gm4_furniture:temp" + }, + { + "nbt": "color_hex.blue_2", + "storage": "gm4_furniture:temp" + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$furniture_color" + }, + "score": "gm4_furniture_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "function": "minecraft:set_lore", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4_furniture.paintbrush.color_lore", + "fallback": "Color: #", + "color": "gray", + "italic": false + }, + { + "text": "F9FFFE" + } + ] + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": {{ dyable }} + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$furniture_color" + }, + "score": "gm4_furniture_data" + }, + "range": { + "min": 1 + } + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_furniture/data/gm4_furniture/templates/loot_tables/template.json b/gm4_furniture/data/gm4_furniture/templates/loot_tables/template.json deleted file mode 100644 index d26b92b766..0000000000 --- a/gm4_furniture/data/gm4_furniture/templates/loot_tables/template.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:loot_table", - "name": "gm4_furniture:furniture/base", - "functions": [ - { - "function": "minecraft:set_nbt", - "tag": "{CustomModelData:{{ cmd }},gm4_furniture:{id:\"gm4.{{ technical_id }}\"},SkullOwner:{Name:\"gm4_furniture:place/furniture/{{ technical_id }}\"}}" - }, - { - "function": "minecraft:set_name", - "name": [ - { - "translate": "block.gm4_furniture.gm4_{{ technical_id }}", - "fallback": "{{ display_name }}", - "color": "white", - "italic": false - } - ] - } - ] - } - ] - } - ] -} diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py index 5e663db1e1..c37d53334f 100644 --- a/gm4_furniture/generate.py +++ b/gm4_furniture/generate.py @@ -2,81 +2,88 @@ class furnitures: - def __init__(self, technical_id, display_name, cmd, block_id="barrier", sittable=0, dyable=0, wall_only=0, length=1, depth=1, height=1, table=0, scale=1): + def __init__(self, technical_id, display_name, cmd, crafting, block_id="barrier", sittable=0, dyable=0, wall_only=0, ceiling_only=0, length=1, depth=1, height=1, table=0, scale=1, custom_interaction=0): self.technical_id = technical_id self.display_name = display_name self.cmd = cmd + self.crafting = crafting self.block_id = block_id self.sittable = sittable self.wall_only = wall_only + self.ceiling_only = ceiling_only self.dyable = dyable self.length = length self.depth = depth self.height = height self.table = table self.scale = scale + self.custom_interaction = custom_interaction def beet_default(ctx: Context): - furniture_list = [] + trades_list = [] furniture_list.append(furnitures( - 'wooden_stool_1', 'Wooden Stool', 3420201, sittable=50)) + 'wooden_stool_1', 'Wooden Stool', 3420201, ("test1","stick","3","iron_ingot","1"), sittable=50)) furniture_list.append(furnitures( - 'wooden_stool_2', 'Wooden Stool', 3420202, sittable=50)) + 'wooden_stool_2', 'Wooden Stool', 3420202, ("test1","stick","3","iron_ingot","1"), sittable=50)) furniture_list.append(furnitures( - 'wooden_chair_1', 'Wooden Chair', 3420203, sittable=50)) + 'wooden_chair_1', 'Wooden Chair', 3420203, ("test1","stick","3","iron_ingot","1"), sittable=50)) furniture_list.append(furnitures( - 'wooden_chair_2', 'Wooden Chair', 3420204, sittable=50)) + 'wooden_chair_2', 'Wooden Chair', 3420204, ("test1","stick","3","iron_ingot","1"), sittable=50)) furniture_list.append(furnitures( - 'wooden_bench_1', 'Wooden Bench', 3420205, sittable=50, length=3)) + 'wooden_bench_1', 'Wooden Bench', 3420205, ("test1","stick","3","iron_ingot","1"), sittable=50, length=3)) furniture_list.append(furnitures( - 'wooden_bench_2', 'Wooden Bench', 3420206, sittable=50, length=3)) + 'wooden_bench_2', 'Wooden Bench', 3420206, ("test1","stick","3","iron_ingot","1"), sittable=50, length=3)) furniture_list.append(furnitures( - 'dyable_armchair_1', 'Cloth Armchair', 3420207, sittable=50, dyable=1)) + 'dyable_armchair_1', 'Cloth Armchair', 3420207, ("test1","stick","3","iron_ingot","1"), sittable=50, dyable=1)) furniture_list.append(furnitures( - 'wooden_3_candle_holder_1', 'Candelabra', 3420208, block_id="light[level=15]", dyable=1)) + 'wooden_3_candle_holder_1', 'Candelabra', 3420208, ("test1","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) furniture_list.append(furnitures( - 'wooden_5_candle_holder_1', 'Candelabra', 3420209, block_id="light[level=15]", dyable=1)) + 'wooden_5_candle_holder_1', 'Candelabra', 3420209, ("test1","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) furniture_list.append(furnitures( - 'dyable_stool_1', 'Ottoman', 3420210, sittable=50, dyable=1)) + 'dyable_stool_1', 'Ottoman', 3420210, ("test1","stick","3","iron_ingot","1"), sittable=50, dyable=1)) furniture_list.append(furnitures( - 'wooden_table_1', 'Wooden Table', 3420211, table=1)) + 'wooden_table_1', 'Wooden Table', 3420211, ("test1","stick","3","iron_ingot","1"), table=1)) furniture_list.append(furnitures( - 'wooden_table_2', 'Wooden Table', 3420212, table=1)) + 'wooden_table_2', 'Wooden Table', 3420212, ("test1","stick","3","iron_ingot","1"), table=1)) furniture_list.append(furnitures( - 'dyable_wooden_table_1', 'Wooden Table with Cloth', 3420213, dyable=1, table=1)) + 'dyable_wooden_table_1', 'Wooden Table with Cloth', 3420213, ("test1","stick","3","iron_ingot","1"), dyable=1, table=1)) furniture_list.append(furnitures( - 'dyable_wooden_sofa_1', 'Wooden Sofa with Cushions', 3420214, sittable=50, dyable=1, length=3)) + 'dyable_wooden_sofa_1', 'Wooden Sofa with Cushions', 3420214, ("test1","stick","3","iron_ingot","1"), sittable=50, dyable=1, length=3)) furniture_list.append(furnitures( - '2x1_log_seat_1', 'Log Bench', 3420215, sittable=50, length=2)) + '2x1_log_seat_1', 'Log Bench', 3420215, ("test3","stick","3","iron_ingot","1"), sittable=50, length=2)) furniture_list.append(furnitures( - '1x1_log_seat_1', 'Log Seat', 3420216, sittable=50)) + '1x1_log_seat_1', 'Log Seat', 3420216, ("test3","stick","3","iron_ingot","1"), sittable=50)) furniture_list.append(furnitures( - 'stone_frog_statue', 'Frog Statue', 3420217)) + 'stone_frog_statue', 'Frog Statue', 3420217, ("test1","stick","3","iron_ingot","1"), custom_interaction=1)) furniture_list.append(furnitures( - 'wooden_wall_candle_holder_1', 'Wall Candle', 3420218, block_id="light[level=15]", dyable=1, wall_only=1)) + 'wooden_wall_candle_holder_1', 'Wall Candle', 3420218, ("test1","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1, wall_only=1)) furniture_list.append(furnitures( - 'dyable_wooden_chair_1', 'Wooden Chair with Cushions', 3420219, sittable=50, dyable=1)) + 'dyable_wooden_chair_1', 'Wooden Chair with Cushions', 3420219, ("test2","stick","3","iron_ingot","1"), sittable=50, dyable=1)) furniture_list.append(furnitures( - 'gold_5_candle_holder_1', 'Gold Candelabra', 3420220, block_id="light[level=15]", dyable=1)) + 'gold_5_candle_holder_1', 'Gold Candelabra', 3420220, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) furniture_list.append(furnitures( - 'gold_3_candle_holder_1', 'Gold Candelabra', 3420221, block_id="light[level=15]", dyable=1)) + 'gold_3_candle_holder_1', 'Gold Candelabra', 3420221, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) furniture_list.append(furnitures( - 'iron_5_candle_holder_1', 'Iron Candelabra', 3420222, block_id="light[level=15]", dyable=1)) + 'iron_5_candle_holder_1', 'Iron Candelabra', 3420222, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) furniture_list.append(furnitures( - 'iron_3_candle_holder_1', 'Iron Candelabra', 3420223, block_id="light[level=15]", dyable=1)) + 'iron_3_candle_holder_1', 'Iron Candelabra', 3420223, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) furniture_list.append(furnitures( - '2x2_wooden_table_2', 'Wooden Table', 3420224, length=2, depth=2, table=1)) - - + '2x2_wooden_table_2', 'Wooden Table', 3420224, ("test2","stick","3","iron_ingot","1"), length=2, depth=2, table=1)) + + for furniture_data in furniture_list: + trades_list.append("data modify storage gm4_furniture:temp new_trades." + furniture_data.crafting[0] + ".trades append value {cost:[{id:" + furniture_data.crafting[1] + ",Count:" + furniture_data.crafting[2] + "b},{id:" + furniture_data.crafting[3] + ",Count:" + furniture_data.crafting[4] + "b}],technical_id:\"" + furniture_data.technical_id + "\"}") + trades_list = '\n'.join(trades_list) + for furniture_data in furniture_list: subproject_config = { "data_pack": { "load": [ { - f"data/gm4_furniture/loot_tables/furniture/{furniture_data.technical_id}.json": "data/gm4_furniture/templates/loot_tables/template.json", - f"data/gm4_furniture/functions/place/furniture/{furniture_data.technical_id}.mcfunction": "data/gm4_furniture/templates/functions/template.mcfunction", + f"data/gm4_furniture/loot_tables/furniture/{furniture_data.technical_id}.json": "data/gm4_furniture/templates/loot_tables/furniture_item_template.json", + f"data/gm4_furniture/functions/place/furniture/{furniture_data.technical_id}.mcfunction": "data/gm4_furniture/templates/functions/furniture_place_template.mcfunction", + f"data/gm4_furniture/functions/generate_trades.mcfunction": "data/gm4_furniture/templates/functions/crafting_template.mcfunction", } ], "render": { @@ -88,15 +95,19 @@ def beet_default(ctx: Context): "technical_id": furniture_data.technical_id, "display_name": furniture_data.display_name, "cmd": furniture_data.cmd, + "crafting": furniture_data.crafting, "block_id": furniture_data.block_id, "sittable": furniture_data.sittable, "wall_only": furniture_data.wall_only, + "ceiling_only": furniture_data.ceiling_only, "dyable": furniture_data.dyable, "length": furniture_data.length, "depth": furniture_data.depth, "height": furniture_data.height, "table": furniture_data.table, - "scale": furniture_data.scale, + "scale": furniture_data.scale, + "custom_interaction": furniture_data.custom_interaction, + "furniture_list": trades_list, } } From 507a6677e1a92f6740dea2015c9d020f0a2cb42d Mon Sep 17 00:00:00 2001 From: Thanathor Date: Fri, 1 Sep 2023 16:53:09 +0200 Subject: [PATCH 05/26] small fixes --- .../advancements/place_furniture_water.json | 54 ++++++++++++ .../advancements/use_paintbrush_on_horse.json | 57 +++++++------ .../functions/check_recipes.mcfunction | 2 +- .../furniture/furniture_station.mcfunction | 8 +- .../place/place_furniture.mcfunction | 1 + .../place/place_furniture_water.mcfunction | 8 ++ .../loot_tables/items/furniture_station.json | 2 +- .../furniture_place_template.mcfunction | 6 +- gm4_furniture/generate.py | 82 ++++++++++++------- 9 files changed, 155 insertions(+), 65 deletions(-) create mode 100644 gm4_furniture/data/gm4_furniture/advancements/place_furniture_water.json create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/place_furniture_water.mcfunction diff --git a/gm4_furniture/data/gm4_furniture/advancements/place_furniture_water.json b/gm4_furniture/data/gm4_furniture/advancements/place_furniture_water.json new file mode 100644 index 0000000000..88b206358a --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/advancements/place_furniture_water.json @@ -0,0 +1,54 @@ +{ + "criteria": { + "placed_furniture": { + "trigger": "minecraft:placed_block", + "conditions": { + "player": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "gm4_furniture" + }, + "score": "load.status" + }, + "range": 1 + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "gm4_furniture_minor" + }, + "score": "load.status" + }, + "range": 0 + } + ], + "location": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:player_head" + ], + "nbt": "{SkullOwner:{Properties:{textures:[{Signature:\"gm4_furniture\"}]}}}" + } + } + ] + } + } + }, + "requirements": [ + [ + "placed_furniture" + ] + ], + "rewards": { + "function": "gm4_furniture:place/place_furniture_water" + } +} diff --git a/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json b/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json index 48e4d2417f..62927f151e 100644 --- a/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json +++ b/gm4_furniture/data/gm4_furniture/advancements/use_paintbrush_on_horse.json @@ -1,34 +1,33 @@ { - "criteria": { - "used_paintbrush": { - "trigger": "minecraft:player_interacted_with_entity", - "conditions": { - "player": [], - "item": { - "items": [ - "minecraft:leather_horse_armor" - ], - "nbt": "{gm4_furniture:paintbrush}" - }, - "entity": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "type": "minecraft:horse" - } + "criteria": { + "used_paintbrush": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "player": [], + "item": { + "items": [ + "minecraft:leather_horse_armor" + ], + "nbt": "{gm4_furniture:paintbrush}" + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:horse" } - ] - } + } + ] } - }, - "requirements": [ - [ - "used_paintbrush" - ] - ], - "rewards": { - "function": "gm4_furniture:technical/paintbrush/used_on_horse" } + }, + "requirements": [ + [ + "used_paintbrush" + ] + ], + "rewards": { + "function": "gm4_furniture:technical/paintbrush/used_on_horse" } - \ No newline at end of file +} diff --git a/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction b/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction index 58aa5a9e64..b36ef0452b 100644 --- a/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction @@ -2,4 +2,4 @@ # run from #gm4_custom_crafters:check_recipes execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 5 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:0b,id:"minecraft:string"},{Slot:1b,id:"minecraft:string"},{Slot:2b,id:"minecraft:string"},{Slot:4b,id:"minecraft:iron_ingot"},{Slot:7b,id:"minecraft:stick"}]} run loot replace block ~ ~ ~ container.0 loot gm4_furniture:crafting/paintbrush -execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 8 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:0b,id:"minecraft:oak_planks"},{Slot:1b,id:"minecraft:crafting_table"},{Slot:2b,id:"minecraft:oak_planks"},{Slot:4b,id:"minecraft:iron_ingot"},{Slot:5b,id:"minecraft:oak_planks"},{Slot:6b,id:"minecraft:oak_planks"},{Slot:8b,id:"minecraft:oak_planks"}]} run loot replace block ~ ~ ~ container.0 loot gm4_furniture:crafting/furniture_station +execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 8 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:0b,id:"minecraft:oak_planks"},{Slot:1b,id:"minecraft:crafting_table"},{Slot:2b,id:"minecraft:oak_planks"},{Slot:3b,id:"minecraft:oak_planks"},{Slot:4b,id:"minecraft:iron_ingot"},{Slot:5b,id:"minecraft:oak_planks"},{Slot:6b,id:"minecraft:oak_planks"},{Slot:8b,id:"minecraft:oak_planks"}]} run loot replace block ~ ~ ~ container.0 loot gm4_furniture:crafting/furniture_station diff --git a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction index 3c977298b6..6378541d13 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction @@ -16,7 +16,7 @@ execute if score $valid_placement gm4_furniture_data matches 0 run setblock ~ ~ execute if score $valid_placement gm4_furniture_data matches 0 run return 0 # spawn the furniture_station -summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.display","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station"',item:{id:"leather_horse_armor",Count:1,tag:{data:{technical_id:"furniture_station"},CustomModelData:3420150}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.display","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station"',item:{id:"leather_horse_armor",Count:1,tag:{data:{technical_id:"furniture_station"},CustomModelData:3420200}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1.0002f,width:1.0002f,response:1b} summon interaction ^0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.next","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} summon interaction ^-0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.prev","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} @@ -26,14 +26,16 @@ summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_main,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[0].cmd data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_next,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[1].cmd data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_prev,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[-1].cmd -setblock ~ ~ ~ barrier +execute unless score $waterlog gm4_furniture_data matches 1 run setblock ~ ~ ~ barrier +execute if score $waterlog gm4_furniture_data matches 1 run setblock ~ ~ ~ barrier[waterlogged=true] # spawn trader and set ids summon wandering_trader ~ ~1000 ~ {Invulnerable:1b,Team:"gm4_furniture_nocol",Tags:["gm4_furniture","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.furniture_station","fallback":"Furniture Station"},[{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:offscreen"},{"translate":"gui.gm4.furniture_station","fallback":"","font":"gm4:container_gui","color":"white"},{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:furniture","color":"#404040"}]]}',NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",duration:-1,show_particles:0b},{id:"minecraft:resistance",amplifier:9,duration:-1,show_particles:0b}]} tp @e[type=wandering_trader,tag=gm4_new_furniture,limit=1] ~ ~-0.4999 ~ scoreboard players set @e[type=wandering_trader,tag=gm4_new_furniture,limit=1] gm4_furniture_index 0 execute as @e[type=wandering_trader,tag=gm4_new_furniture,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep -setblock ~ ~1 ~ light[level=0] +execute unless block ~ ~1 ~ water[level=0] run setblock ~ ~1 ~ light[level=0] +execute if block ~ ~1 ~ water[level=0] run setblock ~ ~1 ~ light[level=0,waterlogged=true] execute store result score @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 execute store result score @e[type=wandering_trader,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players get $next_id gm4_furniture_id diff --git a/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction index 241764338e..012925e844 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/place_furniture.mcfunction @@ -2,6 +2,7 @@ # @s = player that just placed a furniture player head # at @s advancement revoke @s only gm4_furniture:place_furniture +# run from place/place_furniture_water # get item data execute store success score $mainhand gm4_furniture_data run data modify storage gm4_furniture:temp furniture_data set from entity @s SelectedItem.tag.gm4_furniture diff --git a/gm4_furniture/data/gm4_furniture/functions/place/place_furniture_water.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/place_furniture_water.mcfunction new file mode 100644 index 0000000000..a9fc7e8bb0 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/place_furniture_water.mcfunction @@ -0,0 +1,8 @@ +# finds the player head that was placed by the player in water +# @s = player that just placed a furniture player head +# at @s +advancement revoke @s only gm4_furniture:place_furniture_water +say water +scoreboard players set $waterlog gm4_furniture_data 1 +function gm4_furniture:place/place_furniture +scoreboard players reset $waterlog gm4_furniture_data diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json index ba39610fc2..5a854e3b37 100644 --- a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json +++ b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json @@ -10,7 +10,7 @@ "functions": [ { "function": "set_nbt", - "tag": "{CustomModelData:3420150,gm4_furniture:{id:\"gm4.furniture_station\"},SkullOwner:{Id:[I;1862739911,-1668725896,-1286726243,-1817885533],Name:\"furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" + "tag": "{CustomModelData:3420150,gm4_furniture:{technical_id:\"furniture_station\"},SkullOwner:{Id:[I;1862739911,-1668725896,-1286726243,-1817885533],Name:\"furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" }, { "function": "minecraft:set_name", diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction index 487821ef7a..8ae293fe2d 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction @@ -48,7 +48,8 @@ scoreboard players set $custom_interaction gm4_furniture_data {{ custom_interact # spawn the furniture execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{technical_id:"{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} -setblock ~ ~ ~ {{ block_id }} +execute unless score $waterlog gm4_furniture_data matches 1 run setblock ~ ~ ~ {{ block_id }}] +execute if score $waterlog gm4_furniture_data matches 1 run setblock ~ ~ ~ {{ block_id }}waterlogged=true] # add placement tags execute if score $wall_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.on_wall @@ -56,7 +57,8 @@ execute if score $ceiling_only gm4_furniture_data matches 1 run tag @e[type=inte # spawn extensions if they exist and set id execute at @e[type=marker,tag=gm4_furniture.marked_block] run summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} -execute at @e[type=marker,tag=gm4_furniture.marked_block] run setblock ~ ~ ~ {{ block_id }} +execute at @e[type=marker,tag=gm4_furniture.marked_block] unless block ~ ~ ~ water[level=0] run setblock ~ ~ ~ {{ block_id }}] +execute at @e[type=marker,tag=gm4_furniture.marked_block] if block ~ ~ ~ water[level=0] run setblock ~ ~ ~ {{ block_id }}waterlogged=true] execute store result score @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 # add custom interaction tags diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py index c37d53334f..a992d74470 100644 --- a/gm4_furniture/generate.py +++ b/gm4_furniture/generate.py @@ -1,8 +1,7 @@ from beet import Context, subproject - class furnitures: - def __init__(self, technical_id, display_name, cmd, crafting, block_id="barrier", sittable=0, dyable=0, wall_only=0, ceiling_only=0, length=1, depth=1, height=1, table=0, scale=1, custom_interaction=0): + def __init__(self, technical_id, display_name, cmd, crafting, block_id="barrier[", sittable=0, dyable=0, wall_only=0, ceiling_only=0, length=1, depth=1, height=1, table=0, scale=1, custom_interaction=0): self.technical_id = technical_id self.display_name = display_name self.cmd = cmd @@ -19,63 +18,63 @@ def __init__(self, technical_id, display_name, cmd, crafting, block_id="barrier" self.scale = scale self.custom_interaction = custom_interaction - +# Add new furniture here, technical_id, display_name, cmd, crafting are required in that order, then any other flags can be used to override the default +# crafting should be formatted as (category, item_1,count, item_2,count) +## allowed block_id = "light[level=0," or "light[level=15,", make sure it is formatted exactly like that !!! def beet_default(ctx: Context): furniture_list = [] trades_list = [] furniture_list.append(furnitures( - 'wooden_stool_1', 'Wooden Stool', 3420201, ("test1","stick","3","iron_ingot","1"), sittable=50)) + 'wooden_stool_1', 'Wooden Stool', 3420201, ("test1", "stick","3", "iron_ingot","1"), sittable=50)) furniture_list.append(furnitures( - 'wooden_stool_2', 'Wooden Stool', 3420202, ("test1","stick","3","iron_ingot","1"), sittable=50)) + 'wooden_stool_2', 'Wooden Stool', 3420202, ("test1", "stick","3", "iron_ingot","1"), sittable=50)) furniture_list.append(furnitures( - 'wooden_chair_1', 'Wooden Chair', 3420203, ("test1","stick","3","iron_ingot","1"), sittable=50)) + 'wooden_chair_1', 'Wooden Chair', 3420203, ("test1", "stick","3", "iron_ingot","1"), sittable=50)) furniture_list.append(furnitures( - 'wooden_chair_2', 'Wooden Chair', 3420204, ("test1","stick","3","iron_ingot","1"), sittable=50)) + 'wooden_chair_2', 'Wooden Chair', 3420204, ("test1", "stick","3", "iron_ingot","1"), sittable=50)) furniture_list.append(furnitures( - 'wooden_bench_1', 'Wooden Bench', 3420205, ("test1","stick","3","iron_ingot","1"), sittable=50, length=3)) + 'wooden_bench_1', 'Wooden Bench', 3420205, ("test1", "stick","3", "iron_ingot","1"), sittable=50, length=3)) furniture_list.append(furnitures( - 'wooden_bench_2', 'Wooden Bench', 3420206, ("test1","stick","3","iron_ingot","1"), sittable=50, length=3)) + 'wooden_bench_2', 'Wooden Bench', 3420206, ("test1", "stick","3", "iron_ingot","1"), sittable=50, length=3)) furniture_list.append(furnitures( - 'dyable_armchair_1', 'Cloth Armchair', 3420207, ("test1","stick","3","iron_ingot","1"), sittable=50, dyable=1)) + 'dyable_armchair_1', 'Cloth Armchair', 3420207, ("test1", "stick","3", "iron_ingot","1"), sittable=50, dyable=1)) furniture_list.append(furnitures( - 'wooden_3_candle_holder_1', 'Candelabra', 3420208, ("test1","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) + 'wooden_3_candle_holder_1', 'Candelabra', 3420208, ("test1", "stick","3", "iron_ingot","1"), block_id="light[level=15,", dyable=1)) furniture_list.append(furnitures( - 'wooden_5_candle_holder_1', 'Candelabra', 3420209, ("test1","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) + 'wooden_5_candle_holder_1', 'Candelabra', 3420209, ("test1", "stick","3", "iron_ingot","1"), block_id="light[level=15,", dyable=1)) furniture_list.append(furnitures( - 'dyable_stool_1', 'Ottoman', 3420210, ("test1","stick","3","iron_ingot","1"), sittable=50, dyable=1)) + 'dyable_stool_1', 'Ottoman', 3420210, ("test1", "stick","3", "iron_ingot","1"), sittable=50, dyable=1)) furniture_list.append(furnitures( - 'wooden_table_1', 'Wooden Table', 3420211, ("test1","stick","3","iron_ingot","1"), table=1)) + 'wooden_table_1', 'Wooden Table', 3420211, ("test1", "stick","3", "iron_ingot","1"), table=1)) furniture_list.append(furnitures( - 'wooden_table_2', 'Wooden Table', 3420212, ("test1","stick","3","iron_ingot","1"), table=1)) + 'wooden_table_2', 'Wooden Table', 3420212, ("test1", "stick","3", "iron_ingot","1"), table=1)) furniture_list.append(furnitures( - 'dyable_wooden_table_1', 'Wooden Table with Cloth', 3420213, ("test1","stick","3","iron_ingot","1"), dyable=1, table=1)) + 'dyable_wooden_table_1', 'Wooden Table with Cloth', 3420213, ("test1", "stick","3", "iron_ingot","1"), dyable=1, table=1)) furniture_list.append(furnitures( - 'dyable_wooden_sofa_1', 'Wooden Sofa with Cushions', 3420214, ("test1","stick","3","iron_ingot","1"), sittable=50, dyable=1, length=3)) + 'dyable_wooden_sofa_1', 'Wooden Sofa with Cushions', 3420214, ("test1", "stick","3", "iron_ingot","1"), sittable=50, dyable=1, length=3)) furniture_list.append(furnitures( '2x1_log_seat_1', 'Log Bench', 3420215, ("test3","stick","3","iron_ingot","1"), sittable=50, length=2)) furniture_list.append(furnitures( '1x1_log_seat_1', 'Log Seat', 3420216, ("test3","stick","3","iron_ingot","1"), sittable=50)) furniture_list.append(furnitures( - 'stone_frog_statue', 'Frog Statue', 3420217, ("test1","stick","3","iron_ingot","1"), custom_interaction=1)) + 'stone_frog_statue', 'Frog Statue', 3420217, ("test1", "stick","3", "iron_ingot","1"), custom_interaction=1)) furniture_list.append(furnitures( - 'wooden_wall_candle_holder_1', 'Wall Candle', 3420218, ("test1","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1, wall_only=1)) + 'wooden_wall_candle_holder_1', 'Wall Candle', 3420218, ("test1", "stick","3", "iron_ingot","1"), block_id="light[level=15,", dyable=1, wall_only=1)) furniture_list.append(furnitures( 'dyable_wooden_chair_1', 'Wooden Chair with Cushions', 3420219, ("test2","stick","3","iron_ingot","1"), sittable=50, dyable=1)) furniture_list.append(furnitures( - 'gold_5_candle_holder_1', 'Gold Candelabra', 3420220, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) + 'gold_5_candle_holder_1', 'Gold Candelabra', 3420220, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15,", dyable=1)) furniture_list.append(furnitures( - 'gold_3_candle_holder_1', 'Gold Candelabra', 3420221, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) + 'gold_3_candle_holder_1', 'Gold Candelabra', 3420221, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15,", dyable=1)) furniture_list.append(furnitures( - 'iron_5_candle_holder_1', 'Iron Candelabra', 3420222, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) + 'iron_5_candle_holder_1', 'Iron Candelabra', 3420222, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15,", dyable=1)) furniture_list.append(furnitures( - 'iron_3_candle_holder_1', 'Iron Candelabra', 3420223, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15]", dyable=1)) + 'iron_3_candle_holder_1', 'Iron Candelabra', 3420223, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15,", dyable=1)) furniture_list.append(furnitures( '2x2_wooden_table_2', 'Wooden Table', 3420224, ("test2","stick","3","iron_ingot","1"), length=2, depth=2, table=1)) - for furniture_data in furniture_list: - trades_list.append("data modify storage gm4_furniture:temp new_trades." + furniture_data.crafting[0] + ".trades append value {cost:[{id:" + furniture_data.crafting[1] + ",Count:" + furniture_data.crafting[2] + "b},{id:" + furniture_data.crafting[3] + ",Count:" + furniture_data.crafting[4] + "b}],technical_id:\"" + furniture_data.technical_id + "\"}") - trades_list = '\n'.join(trades_list) + # create furniture loot tables and placement functions for furniture_data in furniture_list: subproject_config = { "data_pack": { @@ -83,7 +82,6 @@ def beet_default(ctx: Context): { f"data/gm4_furniture/loot_tables/furniture/{furniture_data.technical_id}.json": "data/gm4_furniture/templates/loot_tables/furniture_item_template.json", f"data/gm4_furniture/functions/place/furniture/{furniture_data.technical_id}.mcfunction": "data/gm4_furniture/templates/functions/furniture_place_template.mcfunction", - f"data/gm4_furniture/functions/generate_trades.mcfunction": "data/gm4_furniture/templates/functions/crafting_template.mcfunction", } ], "render": { @@ -106,9 +104,35 @@ def beet_default(ctx: Context): "height": furniture_data.height, "table": furniture_data.table, "scale": furniture_data.scale, - "custom_interaction": furniture_data.custom_interaction, - "furniture_list": trades_list, + "custom_interaction": furniture_data.custom_interaction } } ctx.require(subproject(subproject_config)) + + + # create a list of all trade data + # any used trade category should be initiated with a cmd for the used tool, this is done in gm4_furnitures:generate_trades in this datapack + # for expansions #gm4_furniture:add_categories is called, this should lead to a similar function file. + for furniture_data in furniture_list: + trades_list.append("data modify storage gm4_furniture:temp new_trades." + furniture_data.crafting[0] + ".trades append value {cost:[{id:" + furniture_data.crafting[1] + ",Count:" + furniture_data.crafting[2] + "b},{id:" + furniture_data.crafting[3] + ",Count:" + furniture_data.crafting[4] + "b}],technical_id:\"" + furniture_data.technical_id + "\"}") + trades_list = '\n'.join(trades_list) + + # add a function to add trade data to a storage + subproject_config = { + "data_pack": { + "load": [ + { + f"data/gm4_furniture/functions/generate_trades.mcfunction": "data/gm4_furniture/templates/functions/crafting_template.mcfunction", + } + ], + "render": { + "functions": "*" + } + }, + "meta": { + "furniture_list": trades_list, + } + } + + ctx.require(subproject(subproject_config)) From f4bea4f515cb1fc87740ef61596eb8b6756c657e Mon Sep 17 00:00:00 2001 From: Thanathor Date: Sat, 2 Sep 2023 18:54:37 +0200 Subject: [PATCH 06/26] fix water placement --- .../advancements/place_furniture_water.json | 54 ------------------- .../functions/break/remove_block.mcfunction | 3 +- .../functions/interact/process.mcfunction | 3 ++ .../interact/waterlog/check.mcfunction | 3 ++ .../interact/waterlog/log.mcfunction | 7 +++ .../interact/waterlog/unlog.mcfunction | 7 +++ .../predicates/holding_bucket.json | 14 +++++ .../predicates/holding_empty_bucket.json | 13 +++++ .../predicates/holding_water_bucket.json | 13 +++++ 9 files changed, 62 insertions(+), 55 deletions(-) delete mode 100644 gm4_furniture/data/gm4_furniture/advancements/place_furniture_water.json create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/waterlog/check.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/waterlog/log.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/waterlog/unlog.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/predicates/holding_bucket.json create mode 100644 gm4_furniture/data/gm4_furniture/predicates/holding_empty_bucket.json create mode 100644 gm4_furniture/data/gm4_furniture/predicates/holding_water_bucket.json diff --git a/gm4_furniture/data/gm4_furniture/advancements/place_furniture_water.json b/gm4_furniture/data/gm4_furniture/advancements/place_furniture_water.json deleted file mode 100644 index 88b206358a..0000000000 --- a/gm4_furniture/data/gm4_furniture/advancements/place_furniture_water.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "criteria": { - "placed_furniture": { - "trigger": "minecraft:placed_block", - "conditions": { - "player": [ - { - "condition": "minecraft:value_check", - "value": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "gm4_furniture" - }, - "score": "load.status" - }, - "range": 1 - }, - { - "condition": "minecraft:value_check", - "value": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "gm4_furniture_minor" - }, - "score": "load.status" - }, - "range": 0 - } - ], - "location": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:player_head" - ], - "nbt": "{SkullOwner:{Properties:{textures:[{Signature:\"gm4_furniture\"}]}}}" - } - } - ] - } - } - }, - "requirements": [ - [ - "placed_furniture" - ] - ], - "rewards": { - "function": "gm4_furniture:place/place_furniture_water" - } -} diff --git a/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction index b9cc28bbd9..6d01fbb788 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/remove_block.mcfunction @@ -3,6 +3,7 @@ # at @s # run from break/destroy -execute positioned ~0.0001 ~0.5001 ~0.0001 run fill ~ ~ ~ ~ ~ ~ air replace #gm4_furniture:furniture_blocks +execute positioned ~0.0001 ~0.5001 ~0.0001 run fill ~ ~ ~ ~ ~ ~ air replace #gm4_furniture:furniture_blocks[waterlogged=false] +execute positioned ~0.0001 ~0.5001 ~0.0001 run fill ~ ~ ~ ~ ~ ~ water replace #gm4_furniture:furniture_blocks[waterlogged=true] execute positioned ~-0.4999 ~0.0001 ~-0.4999 run kill @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] kill @s diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction index c9f519e5e9..4354b56b57 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction @@ -6,6 +6,9 @@ # first successful interaction will be used, any lower down this list will be ignored scoreboard players set $interaction_processed gm4_furniture_data 0 +# check for waterlogging +execute if score $interaction_processed gm4_furniture_data matches 0 if entity @p[tag=gm4_furniture_target,predicate=gm4_furniture:holding_bucket] positioned ~ ~0.5 ~ run function gm4_furniture:interact/waterlog/check + # check for furniture station interactions execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.swap_tool] run function gm4_furniture:interact/furniture_station/swap_tool diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/check.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/check.mcfunction new file mode 100644 index 0000000000..3910028615 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/check.mcfunction @@ -0,0 +1,3 @@ + +execute if block ~ ~ ~ #gm4_furniture:furniture_blocks[waterlogged=true] if entity @p[tag=gm4_furniture_target,predicate=gm4_furniture:holding_empty_bucket] run function gm4_furniture:interact/waterlog/unlog +execute if score $interaction_processed gm4_furniture_data matches 0 if block ~ ~ ~ #gm4_furniture:furniture_blocks[waterlogged=false] if entity @p[tag=gm4_furniture_target,predicate=gm4_furniture:holding_water_bucket] run function gm4_furniture:interact/waterlog/log diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/log.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/log.mcfunction new file mode 100644 index 0000000000..1c3a06b9c6 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/log.mcfunction @@ -0,0 +1,7 @@ + +item replace entity @p[tag=gm4_furniture_target,gamemode=!creative] weapon.mainhand with bucket +fill ~ ~ ~ ~ ~ ~ light[level=0,waterlogged=true] replace light[level=0] +fill ~ ~ ~ ~ ~ ~ light[level=15,waterlogged=true] replace light[level=15] +fill ~ ~ ~ ~ ~ ~ barrier[waterlogged=true] replace barrier +playsound item.bucket.empty player @a[distance=..16] ~ ~ ~ 1 1 +scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/unlog.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/unlog.mcfunction new file mode 100644 index 0000000000..6989c9c7d9 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/unlog.mcfunction @@ -0,0 +1,7 @@ + +item replace entity @p[tag=gm4_furniture_target,gamemode=!creative] weapon.mainhand with water_bucket +fill ~ ~ ~ ~ ~ ~ light[level=0,waterlogged=false] replace light[level=0,waterlogged=true] +fill ~ ~ ~ ~ ~ ~ light[level=15,waterlogged=false] replace light[level=15,waterlogged=true] +fill ~ ~ ~ ~ ~ ~ barrier[waterlogged=false] replace barrier[waterlogged=true] +playsound item.bucket.fill player @a[distance=..16] ~ ~ ~ 1 1 +scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/predicates/holding_bucket.json b/gm4_furniture/data/gm4_furniture/predicates/holding_bucket.json new file mode 100644 index 0000000000..9ca538a0bd --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/predicates/holding_bucket.json @@ -0,0 +1,14 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": [ + "minecraft:bucket", + "minecraft:water_bucket" + ] + } + } + } +} diff --git a/gm4_furniture/data/gm4_furniture/predicates/holding_empty_bucket.json b/gm4_furniture/data/gm4_furniture/predicates/holding_empty_bucket.json new file mode 100644 index 0000000000..eb467d159a --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/predicates/holding_empty_bucket.json @@ -0,0 +1,13 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": [ + "minecraft:bucket" + ] + } + } + } +} diff --git a/gm4_furniture/data/gm4_furniture/predicates/holding_water_bucket.json b/gm4_furniture/data/gm4_furniture/predicates/holding_water_bucket.json new file mode 100644 index 0000000000..0cbf67e9a0 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/predicates/holding_water_bucket.json @@ -0,0 +1,13 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": [ + "minecraft:water_bucket" + ] + } + } + } +} From ded438ed39d791be260609a8630195f1727e591f Mon Sep 17 00:00:00 2001 From: Thanathor Date: Wed, 20 Sep 2023 17:40:36 +0200 Subject: [PATCH 07/26] rework python script --- .../gm4_furniture/functions/init.mcfunction | 1 - .../furniture/furniture_station.mcfunction | 2 +- .../functions/crafting_template.mcfunction | 17 +- .../furniture_place_template.mcfunction | 6 +- gm4_furniture/furniture_data.xlsx | Bin 0 -> 26957 bytes gm4_furniture/generate.py | 204 ++++++++---------- 6 files changed, 102 insertions(+), 128 deletions(-) create mode 100644 gm4_furniture/furniture_data.xlsx diff --git a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction index ab4494f601..c7878b6f52 100644 --- a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction @@ -18,7 +18,6 @@ team modify gm4_furniture_nocol collisionRule never # build furniture station trade data data modify storage gm4_furniture:data furniture_station set value [] function gm4_furniture:generate_trades -function #gm4_furniture:add_categories execute store result score $max_index gm4_furniture_index run data get storage gm4_furniture:data furniture_station scoreboard players remove $max_index gm4_furniture_index 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction index 6378541d13..5b7d825ccc 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction @@ -16,7 +16,7 @@ execute if score $valid_placement gm4_furniture_data matches 0 run setblock ~ ~ execute if score $valid_placement gm4_furniture_data matches 0 run return 0 # spawn the furniture_station -summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.display","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station"',item:{id:"leather_horse_armor",Count:1,tag:{data:{technical_id:"furniture_station"},CustomModelData:3420200}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.display","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station"',item:{id:"leather_horse_armor",Count:1,tag:{data:{technical_id:"furniture_station"},CustomModelData:3420150}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1.0002f,width:1.0002f,response:1b} summon interaction ^0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.next","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} summon interaction ^-0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.prev","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/crafting_template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/crafting_template.mcfunction index 85e08e0b44..771c3539a3 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/crafting_template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/crafting_template.mcfunction @@ -1,13 +1,12 @@ -# this is a test +# create storage to hold the trade data for furniture items in furniture station +# @s = unspecified +# at unspecified +# run from init +# this function was generated by generate.py +{{ trades_init }} -data modify storage gm4_furniture:temp new_trades.test1 set value {cmd:3420201,trades:[]} -data modify storage gm4_furniture:temp new_trades.test2 set value {cmd:3420202,trades:[]} -data modify storage gm4_furniture:temp new_trades.test3 set value {cmd:3420202,trades:[]} +{{ trades_list }} -{{ furniture_list }} - -data modify storage gm4_furniture:data furniture_station append from storage gm4_furniture:temp new_trades.test1 -data modify storage gm4_furniture:data furniture_station append from storage gm4_furniture:temp new_trades.test2 -data modify storage gm4_furniture:data furniture_station append from storage gm4_furniture:temp new_trades.test3 +{{ trades_append }} data remove storage gm4_furniture:temp new_trades diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction index 8ae293fe2d..487821ef7a 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction @@ -48,8 +48,7 @@ scoreboard players set $custom_interaction gm4_furniture_data {{ custom_interact # spawn the furniture execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{technical_id:"{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} -execute unless score $waterlog gm4_furniture_data matches 1 run setblock ~ ~ ~ {{ block_id }}] -execute if score $waterlog gm4_furniture_data matches 1 run setblock ~ ~ ~ {{ block_id }}waterlogged=true] +setblock ~ ~ ~ {{ block_id }} # add placement tags execute if score $wall_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.on_wall @@ -57,8 +56,7 @@ execute if score $ceiling_only gm4_furniture_data matches 1 run tag @e[type=inte # spawn extensions if they exist and set id execute at @e[type=marker,tag=gm4_furniture.marked_block] run summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} -execute at @e[type=marker,tag=gm4_furniture.marked_block] unless block ~ ~ ~ water[level=0] run setblock ~ ~ ~ {{ block_id }}] -execute at @e[type=marker,tag=gm4_furniture.marked_block] if block ~ ~ ~ water[level=0] run setblock ~ ~ ~ {{ block_id }}waterlogged=true] +execute at @e[type=marker,tag=gm4_furniture.marked_block] run setblock ~ ~ ~ {{ block_id }} execute store result score @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 # add custom interaction tags diff --git a/gm4_furniture/furniture_data.xlsx b/gm4_furniture/furniture_data.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..716f2a45c3df37ab734389c5beab113af242b360 GIT binary patch literal 26957 zcmeI51z1(vx9Dl4Q`mr%wA3af1ZfEg2^Em;4gu+Ilm=-8q(nrzOF~*eknZm8etT1L zJaPa3`|fw|yWeviz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cz4Q*C4aui(3{vLn>vhcZQCv)CIj#q2 z%9^O?1@9e}*moT29A|jAEeXT&WOErY6h|cHbGvwVnNFy9Oue_Z9+e0P>!U^L!eK+y7KmJeL5DO!fepG*b|&J$NuKNGNQGpWml( z^UDsv->31%>(_7B_}51}fr|Z&(dV6^|N7`dm_Lj@|M1|~(Klb>41QJf&&vj6C+OaP z_k!|Y1>Jm2?jHrIA^x49^EW{MD(L2WNdG8E7_=PxYmLs|vHPo_n{VL+KfLzyVgNC^ zDd^@)O#gK$b{Kyt@3OrZqFMWRV2x zyYrtHvBJ54Kke0jm2h(%3EpD;yy9M5NVwi`{W|pK`Ubqv{CRy>xpv3Zvh&x$Hz#-S z66oh;rFK5}!hwHU5dA9W=FACR3jDkZ)c>$B_;ujT8vaM$CuscTG%GC*{{9*W2prHq N3$PFnQd;2O{U1+^LoomV literal 0 HcmV?d00001 diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py index a992d74470..6852ed31c4 100644 --- a/gm4_furniture/generate.py +++ b/gm4_furniture/generate.py @@ -1,124 +1,41 @@ from beet import Context, subproject +import pandas as pd -class furnitures: - def __init__(self, technical_id, display_name, cmd, crafting, block_id="barrier[", sittable=0, dyable=0, wall_only=0, ceiling_only=0, length=1, depth=1, height=1, table=0, scale=1, custom_interaction=0): - self.technical_id = technical_id - self.display_name = display_name - self.cmd = cmd - self.crafting = crafting - self.block_id = block_id - self.sittable = sittable - self.wall_only = wall_only - self.ceiling_only = ceiling_only - self.dyable = dyable - self.length = length - self.depth = depth - self.height = height - self.table = table - self.scale = scale - self.custom_interaction = custom_interaction - -# Add new furniture here, technical_id, display_name, cmd, crafting are required in that order, then any other flags can be used to override the default -# crafting should be formatted as (category, item_1,count, item_2,count) -## allowed block_id = "light[level=0," or "light[level=15,", make sure it is formatted exactly like that !!! def beet_default(ctx: Context): - furniture_list = [] + + trades_init = [] trades_list = [] - furniture_list.append(furnitures( - 'wooden_stool_1', 'Wooden Stool', 3420201, ("test1", "stick","3", "iron_ingot","1"), sittable=50)) - furniture_list.append(furnitures( - 'wooden_stool_2', 'Wooden Stool', 3420202, ("test1", "stick","3", "iron_ingot","1"), sittable=50)) - furniture_list.append(furnitures( - 'wooden_chair_1', 'Wooden Chair', 3420203, ("test1", "stick","3", "iron_ingot","1"), sittable=50)) - furniture_list.append(furnitures( - 'wooden_chair_2', 'Wooden Chair', 3420204, ("test1", "stick","3", "iron_ingot","1"), sittable=50)) - furniture_list.append(furnitures( - 'wooden_bench_1', 'Wooden Bench', 3420205, ("test1", "stick","3", "iron_ingot","1"), sittable=50, length=3)) - furniture_list.append(furnitures( - 'wooden_bench_2', 'Wooden Bench', 3420206, ("test1", "stick","3", "iron_ingot","1"), sittable=50, length=3)) - furniture_list.append(furnitures( - 'dyable_armchair_1', 'Cloth Armchair', 3420207, ("test1", "stick","3", "iron_ingot","1"), sittable=50, dyable=1)) - furniture_list.append(furnitures( - 'wooden_3_candle_holder_1', 'Candelabra', 3420208, ("test1", "stick","3", "iron_ingot","1"), block_id="light[level=15,", dyable=1)) - furniture_list.append(furnitures( - 'wooden_5_candle_holder_1', 'Candelabra', 3420209, ("test1", "stick","3", "iron_ingot","1"), block_id="light[level=15,", dyable=1)) - furniture_list.append(furnitures( - 'dyable_stool_1', 'Ottoman', 3420210, ("test1", "stick","3", "iron_ingot","1"), sittable=50, dyable=1)) - furniture_list.append(furnitures( - 'wooden_table_1', 'Wooden Table', 3420211, ("test1", "stick","3", "iron_ingot","1"), table=1)) - furniture_list.append(furnitures( - 'wooden_table_2', 'Wooden Table', 3420212, ("test1", "stick","3", "iron_ingot","1"), table=1)) - furniture_list.append(furnitures( - 'dyable_wooden_table_1', 'Wooden Table with Cloth', 3420213, ("test1", "stick","3", "iron_ingot","1"), dyable=1, table=1)) - furniture_list.append(furnitures( - 'dyable_wooden_sofa_1', 'Wooden Sofa with Cushions', 3420214, ("test1", "stick","3", "iron_ingot","1"), sittable=50, dyable=1, length=3)) - furniture_list.append(furnitures( - '2x1_log_seat_1', 'Log Bench', 3420215, ("test3","stick","3","iron_ingot","1"), sittable=50, length=2)) - furniture_list.append(furnitures( - '1x1_log_seat_1', 'Log Seat', 3420216, ("test3","stick","3","iron_ingot","1"), sittable=50)) - furniture_list.append(furnitures( - 'stone_frog_statue', 'Frog Statue', 3420217, ("test1", "stick","3", "iron_ingot","1"), custom_interaction=1)) - furniture_list.append(furnitures( - 'wooden_wall_candle_holder_1', 'Wall Candle', 3420218, ("test1", "stick","3", "iron_ingot","1"), block_id="light[level=15,", dyable=1, wall_only=1)) - furniture_list.append(furnitures( - 'dyable_wooden_chair_1', 'Wooden Chair with Cushions', 3420219, ("test2","stick","3","iron_ingot","1"), sittable=50, dyable=1)) - furniture_list.append(furnitures( - 'gold_5_candle_holder_1', 'Gold Candelabra', 3420220, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15,", dyable=1)) - furniture_list.append(furnitures( - 'gold_3_candle_holder_1', 'Gold Candelabra', 3420221, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15,", dyable=1)) - furniture_list.append(furnitures( - 'iron_5_candle_holder_1', 'Iron Candelabra', 3420222, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15,", dyable=1)) - furniture_list.append(furnitures( - 'iron_3_candle_holder_1', 'Iron Candelabra', 3420223, ("test2","stick","3","iron_ingot","1"), block_id="light[level=15,", dyable=1)) - furniture_list.append(furnitures( - '2x2_wooden_table_2', 'Wooden Table', 3420224, ("test2","stick","3","iron_ingot","1"), length=2, depth=2, table=1)) - - - # create furniture loot tables and placement functions - for furniture_data in furniture_list: - subproject_config = { - "data_pack": { - "load": [ - { - f"data/gm4_furniture/loot_tables/furniture/{furniture_data.technical_id}.json": "data/gm4_furniture/templates/loot_tables/furniture_item_template.json", - f"data/gm4_furniture/functions/place/furniture/{furniture_data.technical_id}.mcfunction": "data/gm4_furniture/templates/functions/furniture_place_template.mcfunction", - } - ], - "render": { - "loot_tables": "*", - "functions": "*" - } - }, - "meta": { - "technical_id": furniture_data.technical_id, - "display_name": furniture_data.display_name, - "cmd": furniture_data.cmd, - "crafting": furniture_data.crafting, - "block_id": furniture_data.block_id, - "sittable": furniture_data.sittable, - "wall_only": furniture_data.wall_only, - "ceiling_only": furniture_data.ceiling_only, - "dyable": furniture_data.dyable, - "length": furniture_data.length, - "depth": furniture_data.depth, - "height": furniture_data.height, - "table": furniture_data.table, - "scale": furniture_data.scale, - "custom_interaction": furniture_data.custom_interaction - } - } + trades_append = [] - ctx.require(subproject(subproject_config)) + # read in the furniture data + xls = pd.ExcelFile(r'gm4_furniture/furniture_data.xlsx') + + for category in xls.sheet_names: + + # skip the sheet if it is the template (TODO: remove the template sheet) + if category == 'template_sheet': + continue + + # read trade data from this sheet + tool_cmd = pd.read_excel(xls, category).iloc[0,0] + trade_data = pd.read_excel(xls, category, skiprows=2, usecols="A:E") + new_trades_init,new_trades_list,new_trades_append = generate_trade_data(trade_data, tool_cmd, category) - # create a list of all trade data - # any used trade category should be initiated with a cmd for the used tool, this is done in gm4_furnitures:generate_trades in this datapack - # for expansions #gm4_furniture:add_categories is called, this should lead to a similar function file. - for furniture_data in furniture_list: - trades_list.append("data modify storage gm4_furniture:temp new_trades." + furniture_data.crafting[0] + ".trades append value {cost:[{id:" + furniture_data.crafting[1] + ",Count:" + furniture_data.crafting[2] + "b},{id:" + furniture_data.crafting[3] + ",Count:" + furniture_data.crafting[4] + "b}],technical_id:\"" + furniture_data.technical_id + "\"}") + trades_init.append(new_trades_init) + trades_list.append(new_trades_list) + trades_append.append(new_trades_append) + + # read furniture data from this sheet + furniture_data = pd.read_excel(xls, category, skiprows=2, usecols="E:R") + generate_furniture_data(ctx, furniture_data) + + + # build the trade data function + trades_init = '\n'.join(trades_init) trades_list = '\n'.join(trades_list) + trades_append = '\n'.join(trades_append) - # add a function to add trade data to a storage subproject_config = { "data_pack": { "load": [ @@ -131,8 +48,69 @@ def beet_default(ctx: Context): } }, "meta": { - "furniture_list": trades_list, + "trades_init": trades_init, + "trades_list": trades_list, + "trades_append": trades_append, } } ctx.require(subproject(subproject_config)) + + + +def generate_trade_data(trade_data, tool_cmd, category): + + # create a command to make an empty storage called new_trades that holds the category name and tool cmd + new_trades_init = "data modify storage gm4_furniture:temp new_trades." + category + " set value {cmd:" + tool_cmd + ",trades:[]}" + + # iterate over the rows in the spreadsheet and add the trade data to the storage + new_trades_list = [] + for row in trade_data.index: + new_trades_list.append("data modify storage gm4_furniture:temp new_trades." + category + ".trades append value {cost:[{id:" + str(trade_data['craft_item_1_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b},{id:" + str(trade_data['craft_item_2_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b}],technical_id:\"" + str(trade_data['technical_id'][row]) + "\"}") + new_trades_list = '\n'.join(new_trades_list) + + # add command to append the main furniture datastorage with the newly created one + new_trades_append = "data modify storage gm4_furniture:data furniture_station append from storage gm4_furniture:temp new_trades." + category + + # return the created commands + return(new_trades_init,new_trades_list,new_trades_append) + + + +def generate_furniture_data(ctx, furniture_data): + + # create furniture loot tables and placement functions for every furniture in this category + for row in furniture_data.index: + + subproject_config = { + "data_pack": { + "load": [ + { + f"data/gm4_furniture/loot_tables/furniture/{furniture_data['technical_id'][row]}.json": "data/gm4_furniture/templates/loot_tables/furniture_item_template.json", + f"data/gm4_furniture/functions/place/furniture/{furniture_data['technical_id'][row]}.mcfunction": "data/gm4_furniture/templates/functions/furniture_place_template.mcfunction", + } + ], + "render": { + "loot_tables": "*", + "functions": "*" + } + }, + "meta": { + "technical_id": furniture_data['technical_id'][row], + "display_name": furniture_data['display_name'][row], + "cmd": str(furniture_data['cmd'][row]), + "block_id": furniture_data['block_id'][row], + "sittable": str(furniture_data['sittable'][row]), + "wall_only": str(int(furniture_data['wall_only'][row])), + "ceiling_only": str(int(furniture_data['ceiling_only'][row])), + "dyable": str(int(furniture_data['dyable'][row])), + "length": str(furniture_data['length'][row]), + "depth": str(furniture_data['depth'][row]), + "height": str(furniture_data['height'][row]), + "table": str(int(furniture_data['table'][row])), + "scale": str(furniture_data['scale'][row]), + "custom_interaction": str(int(furniture_data['custom'][row])) + } + } + + ctx.require(subproject(subproject_config)) From 167bc4d13f9af66157a92f0b04df65052d1621de Mon Sep 17 00:00:00 2001 From: Thanathor Date: Thu, 21 Sep 2023 15:22:39 +0200 Subject: [PATCH 08/26] file format improvements --- .../functions/break/drop_item.mcfunction | 4 +-- .../interact/custom/process.mcfunction | 7 +++-- .../custom/resolve_function.mcfunction | 4 +-- .../interact/paint/process.mcfunction | 4 +-- .../furniture/furniture_station.mcfunction | 2 +- .../functions/place/resolve_id.mcfunction | 10 +++--- .../build_trades/resolve_trade.mcfunction | 4 +-- .../loot_tables/items/furniture_station.json | 2 +- .../furniture_place_template.mcfunction | 18 +++++------ .../loot_tables/furniture_item_template.json | 4 +-- gm4_furniture/generate.py | 31 +++++++++++-------- 11 files changed, 49 insertions(+), 41 deletions(-) diff --git a/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction index 3a314fbdd1..97eb239ecc 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/drop_item.mcfunction @@ -2,7 +2,7 @@ # @s = furniture item display # at @s # run from break/destroy with @s item.tag.data -# $(technical_id) = furniture's technical_id +# $(furniture_id) = furniture's id -$loot spawn ~.5 ~.25 ~.5 loot gm4_furniture:furniture/$(technical_id) +$loot spawn ~.5 ~.25 ~.5 loot gm4_furniture:furniture/$(furniture_id) execute if score $furniture_color gm4_furniture_data matches 1.. positioned ~.5 ~.25 ~.5 store result entity @e[type=item,limit=1,sort=nearest] Item.tag.gm4_furniture.color int 1 run scoreboard players get $furniture_color gm4_furniture_data diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/custom/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/custom/process.mcfunction index d67caca0f1..2ac2520901 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/custom/process.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/custom/process.mcfunction @@ -3,6 +3,9 @@ # at @s # run from interact/process -data modify storage gm4_furniture:temp technical_id set string entity @s CustomName 23 -2 +# find this furniture's item_display and store its furniture_id +scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id +execute as @e[type=item_display,tag=gm4_furniture.display,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id run data modify storage gm4_furniture:temp furniture_id set from entity @s item.tag.data.furniture_id +# resolve function call function gm4_furniture:interact/custom/resolve_function with storage gm4_furniture:temp -data remove storage gm4_furniture:temp technical_id +data remove storage gm4_furniture:temp furniture_id diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/custom/resolve_function.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/custom/resolve_function.mcfunction index ca3e00203d..18f7a830d7 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/custom/resolve_function.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/custom/resolve_function.mcfunction @@ -2,6 +2,6 @@ # @s = furniture's interacted interaction entity # at @s # run from interact/custom/process with storage gm4_furniture:temp -# $(techical_id) = technical_id +# $(furniture_id) = furniture_id -$function gm4_furniture:interact/custom/furniture/$(technical_id) +$function gm4_furniture:interact/custom/furniture/$(furniture_id) diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction index d0f9a66c1f..94e73b6d21 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction @@ -3,9 +3,9 @@ # at @s # run from interact/paint/detect -# find this furniture's main interaction entity and try to paint its linked item display +# find this furniture's item_display and try to paint it scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id -execute as @e[type=interaction,tag=gm4_furniture.main,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s positioned ~-0.4999 ~0.0001 ~-0.4999 as @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] store success score $paint_changed gm4_furniture_data run data modify entity @s item.tag.display.color set from storage gm4_furniture:temp color +execute as @e[type=item_display,tag=gm4_furniture.display,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id store success score $paint_changed gm4_furniture_data run data modify entity @s item.tag.display.color set from storage gm4_furniture:temp color # if furniture was painted mark interaction as resolved and play paint sound execute if score $paint_changed gm4_furniture_data matches 1 run playsound item.dye.use player @a[distance=..8] ~ ~ ~ 1 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction index 5b7d825ccc..b926f405cf 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction @@ -16,7 +16,7 @@ execute if score $valid_placement gm4_furniture_data matches 0 run setblock ~ ~ execute if score $valid_placement gm4_furniture_data matches 0 run return 0 # spawn the furniture_station -summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.display","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station"',item:{id:"leather_horse_armor",Count:1,tag:{data:{technical_id:"furniture_station"},CustomModelData:3420150}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.display","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station"',item:{id:"leather_horse_armor",Count:1,tag:{data:{furniture_id:"furniture_station"},CustomModelData:3420150}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1.0002f,width:1.0002f,response:1b} summon interaction ^0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.next","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} summon interaction ^-0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.prev","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction index 2903fe0f9a..d45636f329 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/resolve_id.mcfunction @@ -2,9 +2,9 @@ # @s = player that just placed a furniture player head # at the center of the furniture player head that was placed # run from place/prep_place with storage gm4_furniture:temp furniture_data -# $(technical_id) = furniture's technical_id +# $(furniture_id) = furniture's id -$execute if score $rotation gm4_furniture_data matches 1 rotated 0 0 run function gm4_furniture:place/furniture/$(technical_id) -$execute if score $rotation gm4_furniture_data matches 2 rotated 90 0 run function gm4_furniture:place/furniture/$(technical_id) -$execute if score $rotation gm4_furniture_data matches 3 rotated 180 0 run function gm4_furniture:place/furniture/$(technical_id) -$execute if score $rotation gm4_furniture_data matches 4 rotated -90 0 run function gm4_furniture:place/furniture/$(technical_id) +$execute if score $rotation gm4_furniture_data matches 1 rotated 0 0 run function gm4_furniture:place/furniture/$(furniture_id) +$execute if score $rotation gm4_furniture_data matches 2 rotated 90 0 run function gm4_furniture:place/furniture/$(furniture_id) +$execute if score $rotation gm4_furniture_data matches 3 rotated 180 0 run function gm4_furniture:place/furniture/$(furniture_id) +$execute if score $rotation gm4_furniture_data matches 4 rotated -90 0 run function gm4_furniture:place/furniture/$(furniture_id) diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction index 59adeedaea..c3efc8cb61 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction @@ -2,6 +2,6 @@ # @s = furniture station wandering trader # at @s # run from technical/furniture_station/build_trades/build_trade with storage gm4_furniture:temp trade_data[0] -# $(technical_id) = furniture's technical_id +# $(furniture_id) = furniture's id -$loot replace block 29999998 1 7134 container.0 loot gm4_furniture:furniture/$(technical_id) +$loot replace block 29999998 1 7134 container.0 loot gm4_furniture:furniture/$(furniture_id) diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json index 5a854e3b37..ea29463bc6 100644 --- a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json +++ b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json @@ -10,7 +10,7 @@ "functions": [ { "function": "set_nbt", - "tag": "{CustomModelData:3420150,gm4_furniture:{technical_id:\"furniture_station\"},SkullOwner:{Id:[I;1862739911,-1668725896,-1286726243,-1817885533],Name:\"furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" + "tag": "{CustomModelData:3420150,gm4_furniture:{furniture_id:\"furniture_station\"},SkullOwner:{Id:[I;1862739911,-1668725896,-1286726243,-1817885533],Name:\"furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" }, { "function": "minecraft:set_name", diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction index 487821ef7a..2ae11b4eb1 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction @@ -36,7 +36,7 @@ execute if score $placement_blocked gm4_furniture_data matches 1 run scoreboard execute if score $placement_blocked gm4_furniture_data matches 1 run kill @e[type=marker,tag=gm4_furniture.marked_block] # if placement is not valid cancel placement -execute if score $valid_placement gm4_furniture_data matches 0 run loot spawn ~ ~ ~ loot gm4_furniture:furniture/{{ technical_id }} +execute if score $valid_placement gm4_furniture_data matches 0 run loot spawn ~ ~ ~ loot gm4_furniture:furniture/{{ category }}/{{ technical_id }} execute if score $valid_placement gm4_furniture_data matches 0 run return 0 # set variables @@ -46,18 +46,17 @@ scoreboard players set $table gm4_furniture_data {{ table }} scoreboard players set $custom_interaction gm4_furniture_data {{ custom_interaction }} # spawn the furniture -execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{technical_id:"{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} -summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} +execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ category }}.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{furniture_id:"{{ category }}/{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} +summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ category }}.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} setblock ~ ~ ~ {{ block_id }} # add placement tags execute if score $wall_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.on_wall execute if score $ceiling_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.on_ceiling -# spawn extensions if they exist and set id -execute at @e[type=marker,tag=gm4_furniture.marked_block] run summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} +# spawn extensions if they exist +execute at @e[type=marker,tag=gm4_furniture.marked_block] run summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ category }}.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} execute at @e[type=marker,tag=gm4_furniture.marked_block] run setblock ~ ~ ~ {{ block_id }} -execute store result score @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 # add custom interaction tags execute if score $custom_interaction gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.custom_interaction @@ -73,14 +72,15 @@ execute if score $dyable gm4_furniture_data matches 1 run tag @e[type=interactio execute if score $sittable gm4_furniture_data matches 1.. run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.sittable scoreboard players set $sit_height gm4_furniture_data 50 execute if score $sittable gm4_furniture_data matches 1.. store result entity @e[type=item_display,tag=gm4_new_furniture,distance=..2,limit=1,sort=nearest] transformation.translation[1] float 0.01 run scoreboard players operation $sit_height gm4_furniture_data -= $sittable gm4_furniture_data -execute if score $sittable gm4_furniture_data matches 1.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.seat","gm4_furniture.sittable","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ technical_id }}_seat"',item:{id:"air",Count:1},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1f,1f,1f]}} +execute if score $sittable gm4_furniture_data matches 1.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.seat","gm4_furniture.sittable","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ category }}.{{ technical_id }}_seat"',item:{id:"air",Count:1},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1f,1f,1f]}} # rotate furniture depending on rotation set by player (if rotation is 1 default rotation can be kept) execute if score $rotation gm4_furniture_data matches 2.. as @e[tag=gm4_new_furniture,distance=..8] run data modify entity @s Rotation set from storage gm4_furniture:data Rotation -# mark block as placed +# mark block as placed and set id playsound minecraft:block.barrel.close block @a[distance=..6] ~ ~ ~ 1 1.6 -tag @e[distance=..2] remove gm4_new_furniture +execute store result score @e[tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 +tag @e[tag=gm4_new_furniture] remove gm4_new_furniture # cleanup kill @e[type=marker,tag=gm4_furniture.marked_block] diff --git a/gm4_furniture/data/gm4_furniture/templates/loot_tables/furniture_item_template.json b/gm4_furniture/data/gm4_furniture/templates/loot_tables/furniture_item_template.json index 95181bec93..7021f7db7c 100644 --- a/gm4_furniture/data/gm4_furniture/templates/loot_tables/furniture_item_template.json +++ b/gm4_furniture/data/gm4_furniture/templates/loot_tables/furniture_item_template.json @@ -10,13 +10,13 @@ "functions": [ { "function": "minecraft:set_nbt", - "tag": "{CustomModelData:{{ cmd }},gm4_furniture:{technical_id:\"{{ technical_id }}\",color:16383998},SkullOwner:{Name:\"{{ technical_id }}\"}}" + "tag": "{CustomModelData:{{ cmd }},gm4_furniture:{furniture_id:\"{{ category }}/{{ technical_id }}\",color:16383998},SkullOwner:{Name:\"{{ category }}.{{ technical_id }}\"}}" }, { "function": "minecraft:set_name", "name": [ { - "translate": "block.gm4_furniture.gm4_{{ technical_id }}", + "translate": "block.gm4_furniture.{{ category }}.{{ technical_id }}", "fallback": "{{ display_name }}", "color": "white", "italic": false diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py index 6852ed31c4..3e1ed87c9f 100644 --- a/gm4_furniture/generate.py +++ b/gm4_furniture/generate.py @@ -10,32 +10,36 @@ def beet_default(ctx: Context): # read in the furniture data xls = pd.ExcelFile(r'gm4_furniture/furniture_data.xlsx') + # loop through the different sheets, each sheet hold a different 'category' + # of furniture which need to be sorted in the furniture_station storage for category in xls.sheet_names: # skip the sheet if it is the template (TODO: remove the template sheet) if category == 'template_sheet': continue - # read trade data from this sheet + # read trade data from this sheet, this creates the villager trades used + # inside the furniture station tool_cmd = pd.read_excel(xls, category).iloc[0,0] trade_data = pd.read_excel(xls, category, skiprows=2, usecols="A:E") - + # call generate_trade_data to build the commands new_trades_init,new_trades_list,new_trades_append = generate_trade_data(trade_data, tool_cmd, category) - + # append the trade data to the total list trades_init.append(new_trades_init) trades_list.append(new_trades_list) trades_append.append(new_trades_append) - # read furniture data from this sheet + # read furniture data from this sheet, and then create the placement function + # and loot table for each furniture furniture_data = pd.read_excel(xls, category, skiprows=2, usecols="E:R") - generate_furniture_data(ctx, furniture_data) + generate_furniture_data(ctx, furniture_data, category) - # build the trade data function + # build the trade data commands trades_init = '\n'.join(trades_init) trades_list = '\n'.join(trades_list) trades_append = '\n'.join(trades_append) - + # build the trade data function from crafting_template subproject_config = { "data_pack": { "load": [ @@ -63,13 +67,13 @@ def generate_trade_data(trade_data, tool_cmd, category): # create a command to make an empty storage called new_trades that holds the category name and tool cmd new_trades_init = "data modify storage gm4_furniture:temp new_trades." + category + " set value {cmd:" + tool_cmd + ",trades:[]}" - # iterate over the rows in the spreadsheet and add the trade data to the storage + # iterate over the rows in the spreadsheet and add the trade data for each furniture to the storage new_trades_list = [] for row in trade_data.index: new_trades_list.append("data modify storage gm4_furniture:temp new_trades." + category + ".trades append value {cost:[{id:" + str(trade_data['craft_item_1_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b},{id:" + str(trade_data['craft_item_2_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b}],technical_id:\"" + str(trade_data['technical_id'][row]) + "\"}") new_trades_list = '\n'.join(new_trades_list) - # add command to append the main furniture datastorage with the newly created one + # add command to append the main furniture_station storage with the newly created new_trades new_trades_append = "data modify storage gm4_furniture:data furniture_station append from storage gm4_furniture:temp new_trades." + category # return the created commands @@ -77,17 +81,17 @@ def generate_trade_data(trade_data, tool_cmd, category): -def generate_furniture_data(ctx, furniture_data): +def generate_furniture_data(ctx, furniture_data, category): # create furniture loot tables and placement functions for every furniture in this category for row in furniture_data.index: - + # build placement function and loot table for furniture piece subproject_config = { "data_pack": { "load": [ { - f"data/gm4_furniture/loot_tables/furniture/{furniture_data['technical_id'][row]}.json": "data/gm4_furniture/templates/loot_tables/furniture_item_template.json", - f"data/gm4_furniture/functions/place/furniture/{furniture_data['technical_id'][row]}.mcfunction": "data/gm4_furniture/templates/functions/furniture_place_template.mcfunction", + f"data/gm4_furniture/loot_tables/furniture/{category}/{furniture_data['technical_id'][row]}.json": "data/gm4_furniture/templates/loot_tables/furniture_item_template.json", + f"data/gm4_furniture/functions/place/furniture/{category}/{furniture_data['technical_id'][row]}.mcfunction": "data/gm4_furniture/templates/functions/furniture_place_template.mcfunction", } ], "render": { @@ -96,6 +100,7 @@ def generate_furniture_data(ctx, furniture_data): } }, "meta": { + "category": category, "technical_id": furniture_data['technical_id'][row], "display_name": furniture_data['display_name'][row], "cmd": str(furniture_data['cmd'][row]), From d8f62b1edf903206b8e6847073fa6b785faef873 Mon Sep 17 00:00:00 2001 From: Thanathor <73304324+TheThanathor@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:21:06 +0200 Subject: [PATCH 09/26] fix player head textures --- .../data/gm4_furniture/loot_tables/furniture/base.json | 2 +- .../data/gm4_furniture/loot_tables/items/furniture_station.json | 2 +- gm4_furniture/generate.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json b/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json index 3578abd77b..af9eb81326 100644 --- a/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json +++ b/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json @@ -10,7 +10,7 @@ "functions": [ { "function": "set_nbt", - "tag": "{SkullOwner:{Id:[I;1862739911,-1668725896,-1286726243,-1817885533],Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" + "tag": "{SkullOwner:{Id:[I;1567268555,400377645,-2090593244,-1749540666],Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" } ] } diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json index ea29463bc6..5d0b0d208f 100644 --- a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json +++ b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json @@ -10,7 +10,7 @@ "functions": [ { "function": "set_nbt", - "tag": "{CustomModelData:3420150,gm4_furniture:{furniture_id:\"furniture_station\"},SkullOwner:{Id:[I;1862739911,-1668725896,-1286726243,-1817885533],Name:\"furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" + "tag": "{CustomModelData:3420150,gm4_furniture:{furniture_id:\"furniture_station\"},SkullOwner:{Id:[I;1567268555,400377645,-2090593244,-1749540666],Name:\"furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" }, { "function": "minecraft:set_name", diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py index 3e1ed87c9f..e0d78fdb7f 100644 --- a/gm4_furniture/generate.py +++ b/gm4_furniture/generate.py @@ -70,7 +70,7 @@ def generate_trade_data(trade_data, tool_cmd, category): # iterate over the rows in the spreadsheet and add the trade data for each furniture to the storage new_trades_list = [] for row in trade_data.index: - new_trades_list.append("data modify storage gm4_furniture:temp new_trades." + category + ".trades append value {cost:[{id:" + str(trade_data['craft_item_1_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b},{id:" + str(trade_data['craft_item_2_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b}],technical_id:\"" + str(trade_data['technical_id'][row]) + "\"}") + new_trades_list.append("data modify storage gm4_furniture:temp new_trades." + category + ".trades append value {cost:[{id:" + str(trade_data['craft_item_1_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b},{id:" + str(trade_data['craft_item_2_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b}],furniture_id:\"" + category + "/" + str(trade_data['technical_id'][row]) + "\"}") new_trades_list = '\n'.join(new_trades_list) # add command to append the main furniture_station storage with the newly created new_trades From 7d1ce6d968b5d5f69387dc87d041249921d076a1 Mon Sep 17 00:00:00 2001 From: Thanathor Date: Sat, 23 Sep 2023 12:56:47 +0200 Subject: [PATCH 10/26] clean up some old code, add sounds --- .../advancements/crafted_furniture.json | 21 ++++++++++++++++++ .../functions/break/decimal_to_hex.mcfunction | 6 +++++ .../gm4_furniture/functions/init.mcfunction | 1 + .../craft_furniture.mcfunction | 8 +++++++ .../furniture/furniture_station.mcfunction | 3 +-- .../place/place_furniture_water.mcfunction | 8 ------- .../loot_tables/furniture/base.json | 2 +- .../loot_tables/items/furniture_station.json | 2 +- gm4_furniture/furniture_data.xlsx | Bin 26957 -> 21080 bytes 9 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/craft_furniture.mcfunction delete mode 100644 gm4_furniture/data/gm4_furniture/functions/place/place_furniture_water.mcfunction diff --git a/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json b/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json new file mode 100644 index 0000000000..2764783b73 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json @@ -0,0 +1,21 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:villager_trade", + "conditions": { + "villager": [ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_furniture.furniture_station\"]}" + } + } + ] + } + } + }, + "rewards": { + "function": "gm4_furniture:interact/furniture_station/craft_furniture" + } + } + \ No newline at end of file diff --git a/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction index 02e2cee720..de269ea14b 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction @@ -6,6 +6,7 @@ scoreboard players operation $red gm4_furniture_data /= #65536 gm4_furniture_dat scoreboard players operation $add_digit gm4_furniture_data = $red gm4_furniture_data scoreboard players operation $add_digit gm4_furniture_data /= #16 gm4_furniture_data execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.red_1 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 10 run data modify storage gm4_furniture:temp color_hex.red_1 set value "A" execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.red_1 set value "B" execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.red_1 set value "C" execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.red_1 set value "D" @@ -14,6 +15,7 @@ execute if score $add_digit gm4_furniture_data matches 15 run data modify storag scoreboard players operation $add_digit gm4_furniture_data = $red gm4_furniture_data scoreboard players operation $add_digit gm4_furniture_data %= #16 gm4_furniture_data execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.red_2 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 10 run data modify storage gm4_furniture:temp color_hex.red_2 set value "A" execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.red_2 set value "B" execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.red_2 set value "C" execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.red_2 set value "D" @@ -26,6 +28,7 @@ scoreboard players operation $green gm4_furniture_data %= #256 gm4_furniture_dat scoreboard players operation $add_digit gm4_furniture_data = $green gm4_furniture_data scoreboard players operation $add_digit gm4_furniture_data /= #16 gm4_furniture_data execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.green_1 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 10 run data modify storage gm4_furniture:temp color_hex.green_1 set value "A" execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.green_1 set value "B" execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.green_1 set value "C" execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.green_1 set value "D" @@ -34,6 +37,7 @@ execute if score $add_digit gm4_furniture_data matches 15 run data modify storag scoreboard players operation $add_digit gm4_furniture_data = $green gm4_furniture_data scoreboard players operation $add_digit gm4_furniture_data %= #16 gm4_furniture_data execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.green_2 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 10 run data modify storage gm4_furniture:temp color_hex.green_2 set value "A" execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.green_2 set value "B" execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.green_2 set value "C" execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.green_2 set value "D" @@ -45,6 +49,7 @@ scoreboard players operation $blue gm4_furniture_data %= #256 gm4_furniture_data scoreboard players operation $add_digit gm4_furniture_data = $blue gm4_furniture_data scoreboard players operation $add_digit gm4_furniture_data /= #16 gm4_furniture_data execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.blue_1 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 10 run data modify storage gm4_furniture:temp color_hex.blue_1 set value "A" execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.blue_1 set value "B" execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.blue_1 set value "C" execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.blue_1 set value "D" @@ -53,6 +58,7 @@ execute if score $add_digit gm4_furniture_data matches 15 run data modify storag scoreboard players operation $add_digit gm4_furniture_data = $blue gm4_furniture_data scoreboard players operation $add_digit gm4_furniture_data %= #16 gm4_furniture_data execute if score $add_digit gm4_furniture_data matches 0..9 store result storage gm4_furniture:temp color_hex.blue_2 int 1 run scoreboard players get $add_digit gm4_furniture_data +execute if score $add_digit gm4_furniture_data matches 10 run data modify storage gm4_furniture:temp color_hex.blue_2 set value "A" execute if score $add_digit gm4_furniture_data matches 11 run data modify storage gm4_furniture:temp color_hex.blue_2 set value "B" execute if score $add_digit gm4_furniture_data matches 12 run data modify storage gm4_furniture:temp color_hex.blue_2 set value "C" execute if score $add_digit gm4_furniture_data matches 13 run data modify storage gm4_furniture:temp color_hex.blue_2 set value "D" diff --git a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction index c7878b6f52..e6cadcd595 100644 --- a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction @@ -6,6 +6,7 @@ scoreboard objectives add gm4_furniture_data dummy scoreboard objectives add gm4_furniture_last_hit dummy scoreboard objectives add gm4_furniture_id dummy scoreboard objectives add gm4_furniture_index dummy +scoreboard objectives add gm4_furniture_craft_sound_time dummy scoreboard players set #2 gm4_furniture_data 2 scoreboard players set #16 gm4_furniture_data 16 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/craft_furniture.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/craft_furniture.mcfunction new file mode 100644 index 0000000000..35579155d4 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/craft_furniture.mcfunction @@ -0,0 +1,8 @@ +# player furniture crafting sound +# @s = furniture's interacted interaction entity +# at @s +advancement revoke @s only gm4_furniture:crafted_furniture + +execute store result score $current_time gm4_furniture_data run time query gametime +execute as @a[distance=..16] unless score @s gm4_furniture_craft_sound_time = $current_time gm4_furniture_data run playsound minecraft:entity.villager.work_fletcher block @s ~ ~ ~ 1 1.25 +execute as @a[distance=..16] run scoreboard players operation @s gm4_furniture_craft_sound_time = $current_time gm4_furniture_data diff --git a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction index b926f405cf..48ea9f0b59 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction @@ -26,8 +26,7 @@ summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_main,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[0].cmd data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_next,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[1].cmd data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_prev,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[-1].cmd -execute unless score $waterlog gm4_furniture_data matches 1 run setblock ~ ~ ~ barrier -execute if score $waterlog gm4_furniture_data matches 1 run setblock ~ ~ ~ barrier[waterlogged=true] +setblock ~ ~ ~ barrier # spawn trader and set ids summon wandering_trader ~ ~1000 ~ {Invulnerable:1b,Team:"gm4_furniture_nocol",Tags:["gm4_furniture","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.furniture_station","fallback":"Furniture Station"},[{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:offscreen"},{"translate":"gui.gm4.furniture_station","fallback":"","font":"gm4:container_gui","color":"white"},{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:furniture","color":"#404040"}]]}',NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",duration:-1,show_particles:0b},{id:"minecraft:resistance",amplifier:9,duration:-1,show_particles:0b}]} diff --git a/gm4_furniture/data/gm4_furniture/functions/place/place_furniture_water.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/place_furniture_water.mcfunction deleted file mode 100644 index a9fc7e8bb0..0000000000 --- a/gm4_furniture/data/gm4_furniture/functions/place/place_furniture_water.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -# finds the player head that was placed by the player in water -# @s = player that just placed a furniture player head -# at @s -advancement revoke @s only gm4_furniture:place_furniture_water -say water -scoreboard players set $waterlog gm4_furniture_data 1 -function gm4_furniture:place/place_furniture -scoreboard players reset $waterlog gm4_furniture_data diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json b/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json index af9eb81326..7c610f0cee 100644 --- a/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json +++ b/gm4_furniture/data/gm4_furniture/loot_tables/furniture/base.json @@ -10,7 +10,7 @@ "functions": [ { "function": "set_nbt", - "tag": "{SkullOwner:{Id:[I;1567268555,400377645,-2090593244,-1749540666],Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" + "tag": "{SkullOwner:{Id:[I;-308545246,403555340,412409013,-705374452],Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" } ] } diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json index 5d0b0d208f..bac25597c2 100644 --- a/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json +++ b/gm4_furniture/data/gm4_furniture/loot_tables/items/furniture_station.json @@ -10,7 +10,7 @@ "functions": [ { "function": "set_nbt", - "tag": "{CustomModelData:3420150,gm4_furniture:{furniture_id:\"furniture_station\"},SkullOwner:{Id:[I;1567268555,400377645,-2090593244,-1749540666],Name:\"furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" + "tag": "{CustomModelData:3420150,gm4_furniture:{furniture_id:\"furniture_station\"},SkullOwner:{Id:[I;-308545246,403555340,412409013,-705374452],Name:\"furniture_station\",Properties:{textures:[{Signature:\"gm4_furniture\",Value:\"ewogICJ0aW1lc3RhbXAiIDogMTY5Mjg3NTg0Njc2OCwKICAicHJvZmlsZUlkIiA6ICJhNWZlYWViNDdhYjA0ZDZiYTk2ZjMyOGJjMDQ3MDZjMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJYeW5kcmEyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzMzMDU1YjMzMGVmZTY0ZTQxMmQxZDc4MTE5MTM5YzRkMTA3YjZlMDdkNmUyMGU5MTVkYWE5MjFlYTgzMDgwMiIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9\"}]}}}" }, { "function": "minecraft:set_name", diff --git a/gm4_furniture/furniture_data.xlsx b/gm4_furniture/furniture_data.xlsx index 716f2a45c3df37ab734389c5beab113af242b360..7798499abe3ec14c6b5275ec8ed3ef4397592dd8 100644 GIT binary patch literal 21080 zcmeIaby!tf*EUW_Dzzn)mXHpSZjkO432CHD1SCZo1VmElE-7j05)=vPM!Gu%HhgPK zsNi|t_q(3o^ZoI=o_*HAb9u%+=N#i6V~(}gx|wp4u-A~GAfL@-)`vg;^QKOskrCZni~Oq#*C>{dexVbFjwQ(s z^e6oxI`jK?ZWkZ!ilFK0;9zlk>sOx~Hkj>gF~55#Qy!_UquHy?&c5L?Ps`1+myO5x zh{^$%Jm2f)lYzC8VD2{&A!&ypl~Sg}<)0+?6H)yS~N(z5lifr>eKKG$AEmBMo z!|2yKbuk1txc$(O&_*}Kj~YZ2Dw`?W;ye^Z<&@09`*)2Uux}q9`b02PYxEJ(mkqd& za-E0cYRHg)aOhj=$=O(1{fgREGg!dP!R#WeR}CQJ00y>32IdAAW~b37{^3NP00#y2 z3=azG=I>@djqlMrn47IUlC~UXy>(3ExteoC-hr}+T|mI5{*F~_1eK=?L|2d|b0nTp0Rk{RK9bubc8H-L`Nyc6XZLO& z4n^8Q!ZpxDg$eQ-snw)VpdPi-TzJ425&2vKbSv5lLk~_G7MY z+!z*am*GY}6hlven1&)vQEx4hVO?HJe)8$%2`BxN>gjaofxWt}1Kg6{d4~p-AQt|B z{%2$A(K&|QG!rPtZO=3vt6X!w);#*IZn|%1S~$fbxv%2BM_W>YQ0$1bhPA)@v1(;3 zVVr(~g;JOKtr}1D<}@Y|?CjYx)ZHi2F zyx$Ml39tL#hj#GL*374hxI;t#aEI6h(EUk=y(<^73{=3qhsz9S@1Cl0f+ z=3Fu+g-U(oxXW=rTYLgvyzAlSMkJgo9z`P7$#8J|@j)vNc|sA4mh;Z^-V@o!&fr0! zaX$LGa4g=Wdm;1K9D;}3@R|=XqhW$OL<^)p)yue(@?+P^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001 From: Thanathor Date: Sat, 23 Sep 2023 12:57:10 +0200 Subject: [PATCH 11/26] this wasn't pushed? --- .../data/gm4_furniture/advancements/crafted_furniture.json | 1 + 1 file changed, 1 insertion(+) diff --git a/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json b/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json index 2764783b73..4e1d603d36 100644 --- a/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json +++ b/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json @@ -4,6 +4,7 @@ "trigger": "minecraft:villager_trade", "conditions": { "villager": [ + { "condition": "minecraft:entity_properties", "entity": "this", "predicate": { From 49513660a0be7f43fee4123f29970044a5d4eacf Mon Sep 17 00:00:00 2001 From: Misode Date: Tue, 31 Oct 2023 13:08:43 +0100 Subject: [PATCH 12/26] Fix formatting issue in beet.yaml --- gm4_furniture/beet.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gm4_furniture/beet.yaml b/gm4_furniture/beet.yaml index cd588a5fed..bcefa57325 100644 --- a/gm4_furniture/beet.yaml +++ b/gm4_furniture/beet.yaml @@ -15,8 +15,8 @@ meta: gm4: versioning: required: - - lib_forceload: 1.1.0 - - lib_custom_crafters: 3.0.0 + lib_forceload: 1.1.0 + lib_custom_crafters: 3.0.0 schedule_loops: [main] website: description: Furniture! From 5492e86d08231720c4d1ed6cfe8bb4535e76be67 Mon Sep 17 00:00:00 2001 From: Thanathor Date: Tue, 19 Dec 2023 15:20:15 +0100 Subject: [PATCH 13/26] add reworked furniture --- .../functions/break/detect_hit.mcfunction | 5 ++++ .../functions/break/get_color.mcfunction | 9 ++++++ .../functions/break/process_hit.mcfunction | 5 ++++ .../place/check_diagonal_placement.mcfunction | 26 ++++++++++++++++++ .../furniture/furniture_station.mcfunction | 6 ++-- .../build_trades/build_trade.mcfunction | 3 +- .../item_modifiers/get_color.json | 16 +++++++++++ .../loot_tables/items/paintbrush.json | 2 +- .../furniture_place_template.mcfunction | 24 ++++++++-------- gm4_furniture/furniture_data.xlsx | Bin 21080 -> 34613 bytes gm4_furniture/generate.py | 7 +++-- 11 files changed, 84 insertions(+), 19 deletions(-) create mode 100644 gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/place/check_diagonal_placement.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/item_modifiers/get_color.json diff --git a/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction index bef75ea63a..8e69fb24be 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/detect_hit.mcfunction @@ -6,5 +6,10 @@ advancement revoke @s only gm4_furniture:hit_furniture # mark if the player is in creative mode execute store success score $creative gm4_furniture_data if entity @s[gamemode=creative] +# mark if the player is holding a paintbrush in their mainhand +execute store success score $get_color gm4_furniture_data if entity @s[predicate=gm4_furniture:holding_paintbrush] + # locate the hit furniture +tag @s add gm4_furniture_target execute as @e[type=interaction,tag=gm4_furniture,distance=..8] if data entity @s attack at @s run function gm4_furniture:break/find_main +tag @s remove gm4_furniture_target diff --git a/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction new file mode 100644 index 0000000000..4e0f4c006b --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction @@ -0,0 +1,9 @@ + +# find this furniture's item_display and get its color +scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id +execute as @e[type=item_display,tag=gm4_furniture.display,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id store result storage gm4_furniture:temp color int 1 run data get entity @s item.tag.display.color + +item modify entity @p[tag=gm4_furniture_target] weapon.mainhand gm4_furniture:get_color +playsound item.dye.use player @a[distance=..8] ~ ~ ~ 1 1.15 + +scoreboard players set $color_picked gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction index 64acc9ca8c..7bc347b08d 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction @@ -3,6 +3,11 @@ # at @s # run from break/find_main +# if player is holding the paintbrush instead grab the color and stop this function +scoreboard players set $color_picked gm4_furniture_data 0 +execute if score $get_color gm4_furniture_data matches 1 if entity @s[tag=gm4_furniture.painted] run function gm4_furniture:break/get_color +execute if score $color_picked gm4_furniture_data matches 1 run return 0 + # check how much time has passed since the last hit (or ignore that if the player was in creative) execute store result score $hit gm4_furniture_last_hit run time query gametime scoreboard players operation $check_break gm4_furniture_last_hit = $hit gm4_furniture_last_hit diff --git a/gm4_furniture/data/gm4_furniture/functions/place/check_diagonal_placement.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/check_diagonal_placement.mcfunction new file mode 100644 index 0000000000..6d055ce5ce --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/place/check_diagonal_placement.mcfunction @@ -0,0 +1,26 @@ +# checks for placement of furniture that is allowed to be placed diagonally +# @s = player who placed the furniture player head +# at the center of the placed block rotated along axis to face towards player or away from the wall +# run from any in place/furniture/ + +scoreboard players set $diag_found gm4_furniture_data 0 +execute if block ~ ~ ~ player_head[rotation=1] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [-157.5F,0F] +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=2] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [-135F,0F] +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=3] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [-112.5F,0F] + +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=5] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [-67.5F,0F] +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=6] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [-45F,0F] +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=7] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [-22.5F,0F] + +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=9] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [22.5F,0F] +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=10] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [45F,0F] +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=11] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [67.5F,0F] + +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=13] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [112.5F,0F] +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=14] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [135F,0F] +execute if score $diag_found gm4_furniture_data matches 0 if block ~ ~ ~ player_head[rotation=15] store success score $diag_found gm4_furniture_data run data modify storage gm4_furniture:data Rotation set value [157.5F,0F] + +# if a diagonal rotation was found make sure rotation will be set, and limit length / height to 1 +execute if score $diag_found gm4_furniture_data matches 1 run scoreboard players set $rotation gm4_furniture_data 5 +execute if score $diag_found gm4_furniture_data matches 1 run scoreboard players set $length gm4_furniture_data 1 +execute if score $diag_found gm4_furniture_data matches 1 run scoreboard players set $depth gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction index 48ea9f0b59..ca9e7dc534 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction @@ -20,9 +20,9 @@ summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.display", summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1.0002f,width:1.0002f,response:1b} summon interaction ^0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.next","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} summon interaction ^-0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.prev","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} -summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,1f,0f],scale:[1f,1f,1f]}} -summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_next","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[1f,0f,0f,1f],right_rotation:[1f,0f,0f,1f],translation:[0.25f,1.45f,0.5f],scale:[0.25f,0.25f,0.25f]}} -summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_prev","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[1f,0f,0f,1f],right_rotation:[1f,0f,0f,1f],translation:[-0.25f,1.45f,0.5f],scale:[0.25f,0.25f,0.25f]}} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.6f,0f],scale:[1f,1f,1f]}} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_next","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0.28125f,-0.45312f,0.5f],scale:[1f,1f,1f]}} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_prev","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.28125f,-0.45312f,0.5f],scale:[1f,1f,1f]}} data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_main,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[0].cmd data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_next,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[1].cmd data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_prev,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[-1].cmd diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction index 3094b1cc0c..7d9a5d688d 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction @@ -10,8 +10,9 @@ data modify storage gm4_furniture:temp new_trade.buy.Count set from storage gm4_ data modify storage gm4_furniture:temp new_trade.buyB.id set from storage gm4_furniture:temp trade_data[0].cost[1].id data modify storage gm4_furniture:temp new_trade.buyB.Count set from storage gm4_furniture:temp trade_data[0].cost[1].Count -function gm4_furniture:technical/furniture_station/build_trades/resolve_trade with storage gm4_furniture:temp trade_data[0] +function gm4_furniture:technical/furniture_station/build_trades/resolve_trade with storage gm4_furniture:temp trade_data[0].result data modify storage gm4_furniture:temp new_trade.sell set from block 29999998 1 7134 Items[{Slot:0b}] +data modify storage gm4_furniture:temp new_trade.sell.Count set from storage gm4_furniture:temp trade_data[0].result.Count data modify storage gm4_furniture:temp trades append from storage gm4_furniture:temp new_trade data remove storage gm4_furniture:temp new_trade diff --git a/gm4_furniture/data/gm4_furniture/item_modifiers/get_color.json b/gm4_furniture/data/gm4_furniture/item_modifiers/get_color.json new file mode 100644 index 0000000000..d0ba3a4d5d --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/item_modifiers/get_color.json @@ -0,0 +1,16 @@ +[ + { + "function": "minecraft:copy_nbt", + "source": { + "type": "minecraft:storage", + "source": "gm4_furniture:temp" + }, + "ops": [ + { + "source": "color", + "target": "display.color", + "op": "replace" + } + ] + } +] diff --git a/gm4_furniture/data/gm4_furniture/loot_tables/items/paintbrush.json b/gm4_furniture/data/gm4_furniture/loot_tables/items/paintbrush.json index f5e5db18d7..ed382532a4 100644 --- a/gm4_furniture/data/gm4_furniture/loot_tables/items/paintbrush.json +++ b/gm4_furniture/data/gm4_furniture/loot_tables/items/paintbrush.json @@ -9,7 +9,7 @@ "functions": [ { "function": "minecraft:set_nbt", - "tag": "{CustomModelData:3420200,gm4_furniture:paintbrush}" + "tag": "{CustomModelData:3420151,gm4_furniture:paintbrush}" }, { "function": "minecraft:set_name", diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction index 2ae11b4eb1..3321365adb 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction @@ -7,8 +7,19 @@ # first perform checks to see if furniture fits where it was placed scoreboard players set $valid_placement gm4_furniture_data 1 -# store rotation in storage -execute if score $rotation gm4_furniture_data matches 1 run data modify storage gm4_furniture:data Rotation set value [0F,0F] +# set variables +scoreboard players set $sittable gm4_furniture_data {{ sittable }} +scoreboard players set $dyable gm4_furniture_data {{ dyable }} +scoreboard players set $table gm4_furniture_data {{ table }} +scoreboard players set $custom_interaction gm4_furniture_data {{ custom_interaction }} +scoreboard players set $length gm4_furniture_data {{ length }} +scoreboard players set $depth gm4_furniture_data {{ depth }} +scoreboard players set $height gm4_furniture_data {{ height }} +scoreboard players set $diagonal_placement_allowed gm4_furniture_data {{ allow_diagonal_placement }} + +# check for diagonal placement +execute if score $diagonal_placement_allowed gm4_furniture_data matches 1 if block ~ ~ ~ player_head run function gm4_furniture:place/check_diagonal_placement +# store rotation in storage if a non-standard rotation was used execute if score $rotation gm4_furniture_data matches 2 run data modify storage gm4_furniture:data Rotation set value [90F,0F] execute if score $rotation gm4_furniture_data matches 3 run data modify storage gm4_furniture:data Rotation set value [180F,0F] execute if score $rotation gm4_furniture_data matches 4 run data modify storage gm4_furniture:data Rotation set value [-90F,0F] @@ -22,9 +33,6 @@ scoreboard players set $ceiling_only gm4_furniture_data {{ ceiling_only }} execute if score $ceiling_only gm4_furniture_data matches 1 if block ~ ~1 ~ #gm4:replaceable run scoreboard players set $valid_placement gm4_furniture_data 0 # wall placed furniture is not allowed to have depth, if any size is bigger than 1 check if there is space -scoreboard players set $length gm4_furniture_data {{ length }} -scoreboard players set $depth gm4_furniture_data {{ depth }} -scoreboard players set $height gm4_furniture_data {{ height }} scoreboard players set $placement_blocked gm4_furniture_data 0 execute if score $valid_placement gm4_furniture_data matches 1 if score $length gm4_furniture_data matches 2.. run function gm4_furniture:place/check_size/length_prep summon marker ~ ~ ~ {Tags:["gm4_furniture","gm4_furniture.marked_block","gm4_furniture.middle"]} @@ -39,12 +47,6 @@ execute if score $placement_blocked gm4_furniture_data matches 1 run kill @e[typ execute if score $valid_placement gm4_furniture_data matches 0 run loot spawn ~ ~ ~ loot gm4_furniture:furniture/{{ category }}/{{ technical_id }} execute if score $valid_placement gm4_furniture_data matches 0 run return 0 -# set variables -scoreboard players set $sittable gm4_furniture_data {{ sittable }} -scoreboard players set $dyable gm4_furniture_data {{ dyable }} -scoreboard players set $table gm4_furniture_data {{ table }} -scoreboard players set $custom_interaction gm4_furniture_data {{ custom_interaction }} - # spawn the furniture execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ category }}.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{furniture_id:"{{ category }}/{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ category }}.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} diff --git a/gm4_furniture/furniture_data.xlsx b/gm4_furniture/furniture_data.xlsx index 7798499abe3ec14c6b5275ec8ed3ef4397592dd8..e19701ec0d1931505e0d0b9928aa72ccea5c9c20 100644 GIT binary patch literal 34613 zcmeFZ1yo$mw(g6&1PLw?+}(qOB)BKI6Wk@Z1W6NIg1bv_hhQO%ySo!KxI4ES0{`r@ z_df5Peb0FJo%eP|kC9$kT~%{_zprZ5q?*V|K*L}|ARr(>^qYn&LHzOO5$L_68Ka)1 zxw*cDoh>tiqq$jR#FWJp6AEAld6O7HE8Dsh5-3Zy-U85p{Z>I+2`@`Fi9-Dfae^cTU%5US@dAvQtZx}#_i+S5w+=@3k97Ac zCGi4tI5-=Ybi0qk)u+kXf(c(417p6j^W(%vu4kq;XSW!c1gUK+xl;soO&c43=Zu65a z+vHkl^lGAXHXdOrpE4%!v7LDS_{;D7Sl-e2o09F4d?N|#Q30O-aP?@ZCo z)-yjRYx%DQ_gQUprw4yDQ|Rl-^wQEK6J;hU+vrz?&r*CbYFEtpw0mL5sJUMwXwa~H zjHyD(L7_H!-iXw2=!vovffxij4!eyL^)XPz?1J-Hdu;eAliK9M<}eVlKFia(+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lDhtkhf)jOl?6GwM-bp3tG>dLG% zbqP$(3)-sV4z2q-8ci)^rMZIGrkE-p3w$X4=pChPZLR&@Tr9n|leZ z(X_yD6P}3XN={qoMt(;X>~Mc>?GHv&J;~;vd=lWyhFKA|Le7Q*ythbO5^XQ<9zPT` z6o5teEK>}dSamypB~CD1>;1NO`0jfvi%`C-!sx~2T+S7x-7bmx)>HxIh98A!HPb#M zMOvwQCcCh5lF%@iQ2%`58^8hZfpkU4=X_5+$DERO`2@IATgXqc3(U_=^G`uWFEHh-@D@?kdTXeg+a zE7)I0+x%L=sRNhw`oBhzBfh+XpQHR#?_VC}vb5{hD5lhZ9p$Ic>+&dRC-y!}QU{>TeBG2v@f1$7P_-C4Div3*q-^=Rq&C0Jy zJAa4$zCT{7vQrW-xAI@(9EhI=?s8-Q<-q9(mv`k~BUnpa5O{w3Bqs?6IVutg1pK3L O4GL-<_+1YusQ&}IOj;-a diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py index e0d78fdb7f..a457a9c2e5 100644 --- a/gm4_furniture/generate.py +++ b/gm4_furniture/generate.py @@ -21,7 +21,7 @@ def beet_default(ctx: Context): # read trade data from this sheet, this creates the villager trades used # inside the furniture station tool_cmd = pd.read_excel(xls, category).iloc[0,0] - trade_data = pd.read_excel(xls, category, skiprows=2, usecols="A:E") + trade_data = pd.read_excel(xls, category, skiprows=2, usecols="A:F") # call generate_trade_data to build the commands new_trades_init,new_trades_list,new_trades_append = generate_trade_data(trade_data, tool_cmd, category) # append the trade data to the total list @@ -31,7 +31,7 @@ def beet_default(ctx: Context): # read furniture data from this sheet, and then create the placement function # and loot table for each furniture - furniture_data = pd.read_excel(xls, category, skiprows=2, usecols="E:R") + furniture_data = pd.read_excel(xls, category, skiprows=2, usecols="F:T") generate_furniture_data(ctx, furniture_data, category) @@ -70,7 +70,7 @@ def generate_trade_data(trade_data, tool_cmd, category): # iterate over the rows in the spreadsheet and add the trade data for each furniture to the storage new_trades_list = [] for row in trade_data.index: - new_trades_list.append("data modify storage gm4_furniture:temp new_trades." + category + ".trades append value {cost:[{id:" + str(trade_data['craft_item_1_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b},{id:" + str(trade_data['craft_item_2_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b}],furniture_id:\"" + category + "/" + str(trade_data['technical_id'][row]) + "\"}") + new_trades_list.append("data modify storage gm4_furniture:temp new_trades." + category + ".trades append value {cost:[{id:" + str(trade_data['craft_item_1_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b},{id:" + str(trade_data['craft_item_2_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b}],result:{furniture_id:\"" + category + "/" + str(trade_data['technical_id'][row]) + "\",Count:" + str(trade_data['craft_result_count'][row]) + "}}") new_trades_list = '\n'.join(new_trades_list) # add command to append the main furniture_station storage with the newly created new_trades @@ -114,6 +114,7 @@ def generate_furniture_data(ctx, furniture_data, category): "height": str(furniture_data['height'][row]), "table": str(int(furniture_data['table'][row])), "scale": str(furniture_data['scale'][row]), + "allow_diagonal_placement": str(int(furniture_data['diag'][row])), "custom_interaction": str(int(furniture_data['custom'][row])) } } From e7439b7ecc54a1586449bb146e3f77168bacd3c5 Mon Sep 17 00:00:00 2001 From: Thanathor Date: Tue, 19 Dec 2023 20:01:14 +0100 Subject: [PATCH 14/26] fix furniture placing wrong when facing north --- .../templates/functions/furniture_place_template.mcfunction | 1 + 1 file changed, 1 insertion(+) diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction index 3321365adb..24594fda7b 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction @@ -20,6 +20,7 @@ scoreboard players set $diagonal_placement_allowed gm4_furniture_data {{ allow_d # check for diagonal placement execute if score $diagonal_placement_allowed gm4_furniture_data matches 1 if block ~ ~ ~ player_head run function gm4_furniture:place/check_diagonal_placement # store rotation in storage if a non-standard rotation was used +execute if score $rotation gm4_furniture_data matches 1 run data modify storage gm4_furniture:data Rotation set value [0.0f,0.0f] execute if score $rotation gm4_furniture_data matches 2 run data modify storage gm4_furniture:data Rotation set value [90F,0F] execute if score $rotation gm4_furniture_data matches 3 run data modify storage gm4_furniture:data Rotation set value [180F,0F] execute if score $rotation gm4_furniture_data matches 4 run data modify storage gm4_furniture:data Rotation set value [-90F,0F] From 262b342c201b71ad8ceaa63c4a9f5568013e65fd Mon Sep 17 00:00:00 2001 From: Thanathor Date: Sun, 21 Jan 2024 21:29:03 +0100 Subject: [PATCH 15/26] final update for PS --- gm4_furniture/beet.yaml | 4 ++-- .../functions/check_recipes.mcfunction | 2 +- .../stone_set/statues_allay.mcfunction | 7 +++++++ .../stone_set/statues_axolotl.mcfunction | 7 +++++++ .../statues_bee.mcfunction} | 4 ++-- .../stone_set/statues_frog.mcfunction | 7 +++++++ .../stone_set/statues_pufferfish.mcfunction | 7 +++++++ .../furniture/furniture_station.mcfunction | 6 +++--- .../build_trades/build_trade.mcfunction | 7 +++++-- ...ue_sound.json => animal_statue_sound.json} | 0 .../furniture_place_template.mcfunction | 4 ++-- gm4_furniture/furniture_data.xlsx | Bin 34613 -> 25924 bytes gm4_furniture/generate.py | 2 +- 13 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_allay.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_axolotl.mcfunction rename gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/{stone_frog_statue.mcfunction => stone_set/statues_bee.mcfunction} (50%) create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_frog.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_pufferfish.mcfunction rename gm4_furniture/data/gm4_furniture/predicates/chance/{frog_statue_sound.json => animal_statue_sound.json} (100%) diff --git a/gm4_furniture/beet.yaml b/gm4_furniture/beet.yaml index bcefa57325..1841267c1a 100644 --- a/gm4_furniture/beet.yaml +++ b/gm4_furniture/beet.yaml @@ -28,5 +28,5 @@ meta: credits: Creator: - Thanathor - Textures: - - kyrkis + Textures by: + - Kyrius diff --git a/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction b/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction index b36ef0452b..8189b9066e 100644 --- a/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/check_recipes.mcfunction @@ -2,4 +2,4 @@ # run from #gm4_custom_crafters:check_recipes execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 5 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:0b,id:"minecraft:string"},{Slot:1b,id:"minecraft:string"},{Slot:2b,id:"minecraft:string"},{Slot:4b,id:"minecraft:iron_ingot"},{Slot:7b,id:"minecraft:stick"}]} run loot replace block ~ ~ ~ container.0 loot gm4_furniture:crafting/paintbrush -execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 8 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:0b,id:"minecraft:oak_planks"},{Slot:1b,id:"minecraft:crafting_table"},{Slot:2b,id:"minecraft:oak_planks"},{Slot:3b,id:"minecraft:oak_planks"},{Slot:4b,id:"minecraft:iron_ingot"},{Slot:5b,id:"minecraft:oak_planks"},{Slot:6b,id:"minecraft:oak_planks"},{Slot:8b,id:"minecraft:oak_planks"}]} run loot replace block ~ ~ ~ container.0 loot gm4_furniture:crafting/furniture_station +execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 8 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:0b,item_tags:{minecraft:{planks:1b}}},{Slot:1b,id:"minecraft:crafting_table"},{Slot:2b,item_tags:{minecraft:{planks:1b}}},{Slot:3b,item_tags:{minecraft:{planks:1b}}},{Slot:4b,id:"minecraft:iron_ingot"},{Slot:5b,item_tags:{minecraft:{planks:1b}}},{Slot:6b,item_tags:{minecraft:{planks:1b}}},{Slot:8b,item_tags:{minecraft:{planks:1b}}}]} run loot replace block ~ ~ ~ container.0 loot gm4_furniture:crafting/furniture_station diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_allay.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_allay.mcfunction new file mode 100644 index 0000000000..504cf2eae2 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_allay.mcfunction @@ -0,0 +1,7 @@ +# 2% chance to play an animal sound +# @s = furniture's interacted interaction entity +# at @s +# run from interact/custom/resolve_function + +execute if predicate gm4_furniture:chance/animal_statue_sound run playsound entity.allay.ambient_without_item block @a[distance=..16] ~ ~ ~ 1 0.95 +scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_axolotl.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_axolotl.mcfunction new file mode 100644 index 0000000000..e72098445a --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_axolotl.mcfunction @@ -0,0 +1,7 @@ +# 2% chance to play an animal sound +# @s = furniture's interacted interaction entity +# at @s +# run from interact/custom/resolve_function + +execute if predicate gm4_furniture:chance/animal_statue_sound run playsound entity.axolotl.idle_water block @a[distance=..16] ~ ~ ~ 1 0.95 +scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_frog_statue.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_bee.mcfunction similarity index 50% rename from gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_frog_statue.mcfunction rename to gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_bee.mcfunction index ff538a11c5..58f945547e 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_frog_statue.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_bee.mcfunction @@ -1,7 +1,7 @@ -# 2% chance to play a frog sound +# 2% chance to play an animal sound # @s = furniture's interacted interaction entity # at @s # run from interact/custom/resolve_function -execute if predicate gm4_furniture:chance/frog_statue_sound run playsound entity.frog.ambient block @a[distance=..16] ~ ~ ~ 1 0.95 +execute if predicate gm4_furniture:chance/animal_statue_sound run playsound entity.bee.loop block @a[distance=..16] ~ ~ ~ 1 0.95 scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_frog.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_frog.mcfunction new file mode 100644 index 0000000000..89b0942fdb --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_frog.mcfunction @@ -0,0 +1,7 @@ +# 2% chance to play an animal sound +# @s = furniture's interacted interaction entity +# at @s +# run from interact/custom/resolve_function + +execute if predicate gm4_furniture:chance/animal_statue_sound run playsound entity.frog.ambient block @a[distance=..16] ~ ~ ~ 1 0.95 +scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_pufferfish.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_pufferfish.mcfunction new file mode 100644 index 0000000000..090e1247ea --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/custom/furniture/stone_set/statues_pufferfish.mcfunction @@ -0,0 +1,7 @@ +# 2% chance to play an animal sound +# @s = furniture's interacted interaction entity +# at @s +# run from interact/custom/resolve_function + +execute if predicate gm4_furniture:chance/animal_statue_sound run playsound entity.puffer_fish.ambient block @a[distance=..16] ~ ~ ~ 1 0.95 +scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction index ca9e7dc534..afa5669cf2 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction @@ -17,9 +17,9 @@ execute if score $valid_placement gm4_furniture_data matches 0 run return 0 # spawn the furniture_station summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.display","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station"',item:{id:"leather_horse_armor",Count:1,tag:{data:{furniture_id:"furniture_station"},CustomModelData:3420150}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[1f,1f,1f]}} -summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1.0002f,width:1.0002f,response:1b} -summon interaction ^0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.next","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} -summon interaction ^-0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.prev","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.furniture_station"',height:1f,width:0.5f,response:1b} +summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],height:1.0002f,width:1.0002f,response:1b} +summon interaction ^0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.next","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],height:1f,width:0.5f,response:1b} +summon interaction ^-0.25 ^-0.5 ^0.26 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.swap_tool","gm4_furniture.prev","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],height:1f,width:0.5f,response:1b} summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.6f,0f],scale:[1f,1f,1f]}} summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_next","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0.28125f,-0.45312f,0.5f],scale:[1f,1f,1f]}} summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.furniture_station","gm4_furniture.tool","gm4_furniture.tool_prev","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.furniture_station_tool"',item:{id:"command_block",Count:1,tag:{CustomModelData:3420201}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.28125f,-0.45312f,0.5f],scale:[1f,1f,1f]}} diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction index 7d9a5d688d..624c73a139 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction @@ -7,8 +7,11 @@ data modify storage gm4_furniture:temp new_trade set value {rewardExp:0b,maxUses:2147483647,uses:0,xp:0,buy:{id:"minecraft:barrier",Count:1b},buyB:{id:"minecraft:barrier",Count:1b},sell:{id:"minecraft:barrier",Count:1b}} data modify storage gm4_furniture:temp new_trade.buy.id set from storage gm4_furniture:temp trade_data[0].cost[0].id data modify storage gm4_furniture:temp new_trade.buy.Count set from storage gm4_furniture:temp trade_data[0].cost[0].Count -data modify storage gm4_furniture:temp new_trade.buyB.id set from storage gm4_furniture:temp trade_data[0].cost[1].id -data modify storage gm4_furniture:temp new_trade.buyB.Count set from storage gm4_furniture:temp trade_data[0].cost[1].Count + +execute store result score $second_trade_count gm4_furniture_data run data get storage gm4_furniture:temp trade_data[0].cost[1].Count +execute unless score $second_trade_count gm4_furniture_data matches 1.. run data remove storage gm4_furniture:temp new_trade.buyB +execute if score $second_trade_count gm4_furniture_data matches 1.. run data modify storage gm4_furniture:temp new_trade.buyB.id set from storage gm4_furniture:temp trade_data[0].cost[1].id +execute if score $second_trade_count gm4_furniture_data matches 1.. run data modify storage gm4_furniture:temp new_trade.buyB.Count set from storage gm4_furniture:temp trade_data[0].cost[1].Count function gm4_furniture:technical/furniture_station/build_trades/resolve_trade with storage gm4_furniture:temp trade_data[0].result data modify storage gm4_furniture:temp new_trade.sell set from block 29999998 1 7134 Items[{Slot:0b}] diff --git a/gm4_furniture/data/gm4_furniture/predicates/chance/frog_statue_sound.json b/gm4_furniture/data/gm4_furniture/predicates/chance/animal_statue_sound.json similarity index 100% rename from gm4_furniture/data/gm4_furniture/predicates/chance/frog_statue_sound.json rename to gm4_furniture/data/gm4_furniture/predicates/chance/animal_statue_sound.json diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction index 24594fda7b..38271a715e 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction @@ -50,7 +50,7 @@ execute if score $valid_placement gm4_furniture_data matches 0 run return 0 # spawn the furniture execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ category }}.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{furniture_id:"{{ category }}/{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} -summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ category }}.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} +summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],height:1.0002f,width:1.0002f,response:1b} setblock ~ ~ ~ {{ block_id }} # add placement tags @@ -58,7 +58,7 @@ execute if score $wall_only gm4_furniture_data matches 1 run tag @e[type=interac execute if score $ceiling_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.on_ceiling # spawn extensions if they exist -execute at @e[type=marker,tag=gm4_furniture.marked_block] run summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture.{{ category }}.{{ technical_id }}"',height:1.0002f,width:1.0002f,response:1b} +execute at @e[type=marker,tag=gm4_furniture.marked_block] run summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],height:1.0002f,width:1.0002f,response:1b} execute at @e[type=marker,tag=gm4_furniture.marked_block] run setblock ~ ~ ~ {{ block_id }} # add custom interaction tags diff --git a/gm4_furniture/furniture_data.xlsx b/gm4_furniture/furniture_data.xlsx index e19701ec0d1931505e0d0b9928aa72ccea5c9c20..e3d90b2e03b63dcdb57a396df4351ef34609a196 100644 GIT binary patch delta 9189 zcmZvC1z40@*ES3dL)XwCAs`?r-Q7q@cM4L{HA4#wIUwELozmS6qBN)=Eve*>ob!IK z=e+-O&2`PQ_OsT#@11MyXov>%jlg56DIy>ez@eg|!bzI*=+t0&0T6$`#9@)u6$0Y^ zD`+GAAt0mvEx;&980wrcJO0vplyq^%|B%%1C;pJ+h^GIR#As;ic**JDA2WmfmI5jM zl*TFllt9$~k+RKbVby_1b#+e$K##U{euA`rqda^AbFz89vF}e?a>l*kLto43TvX8P}417@iy~reBMg4S5=<%h07$q z%`@6hqXuyx*2xY?5EqS3lw-e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n2yzl@3 diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py index a457a9c2e5..dc6777f7e2 100644 --- a/gm4_furniture/generate.py +++ b/gm4_furniture/generate.py @@ -70,7 +70,7 @@ def generate_trade_data(trade_data, tool_cmd, category): # iterate over the rows in the spreadsheet and add the trade data for each furniture to the storage new_trades_list = [] for row in trade_data.index: - new_trades_list.append("data modify storage gm4_furniture:temp new_trades." + category + ".trades append value {cost:[{id:" + str(trade_data['craft_item_1_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b},{id:" + str(trade_data['craft_item_2_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b}],result:{furniture_id:\"" + category + "/" + str(trade_data['technical_id'][row]) + "\",Count:" + str(trade_data['craft_result_count'][row]) + "}}") + new_trades_list.append("data modify storage gm4_furniture:temp new_trades." + category + ".trades append value {cost:[{id:" + str(trade_data['craft_item_1_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b},{id:" + str(trade_data['craft_item_2_id'][row]) + ",Count:" + str(trade_data['craft_item_2_count'][row]) + "b}],result:{furniture_id:\"" + category + "/" + str(trade_data['technical_id'][row]) + "\",Count:" + str(trade_data['craft_result_count'][row]) + "}}") new_trades_list = '\n'.join(new_trades_list) # add command to append the main furniture_station storage with the newly created new_trades From 4e40f036cd854168a299ca9c246403d2f34b78a0 Mon Sep 17 00:00:00 2001 From: Thanathor Date: Mon, 22 Jan 2024 02:02:21 +0100 Subject: [PATCH 16/26] pandas have gone extinct --- .../advancements/crafted_furniture.json | 33 ++- gm4_furniture/furniture_data.xlsx | Bin 25924 -> 0 bytes gm4_furniture/generate.py | 193 ++++++++++++++---- .../raw_data/furniture_set/cloth_set.csv | 3 + .../raw_data/furniture_set/stone_set.csv | 6 + .../raw_data/furniture_set/wood_set.csv | 13 ++ gm4_furniture/raw_data/tool_cmds.csv | 4 + 7 files changed, 195 insertions(+), 57 deletions(-) delete mode 100644 gm4_furniture/furniture_data.xlsx create mode 100644 gm4_furniture/raw_data/furniture_set/cloth_set.csv create mode 100644 gm4_furniture/raw_data/furniture_set/stone_set.csv create mode 100644 gm4_furniture/raw_data/furniture_set/wood_set.csv create mode 100644 gm4_furniture/raw_data/tool_cmds.csv diff --git a/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json b/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json index 4e1d603d36..3845bae151 100644 --- a/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json +++ b/gm4_furniture/data/gm4_furniture/advancements/crafted_furniture.json @@ -1,22 +1,21 @@ { - "criteria": { - "requirement": { - "trigger": "minecraft:villager_trade", - "conditions": { - "villager": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "nbt": "{Tags:[\"gm4_furniture.furniture_station\"]}" - } + "criteria": { + "requirement": { + "trigger": "minecraft:villager_trade", + "conditions": { + "villager": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_furniture.furniture_station\"]}" } - ] - } + } + ] } - }, - "rewards": { - "function": "gm4_furniture:interact/furniture_station/craft_furniture" } + }, + "rewards": { + "function": "gm4_furniture:interact/furniture_station/craft_furniture" } - \ No newline at end of file +} diff --git a/gm4_furniture/furniture_data.xlsx b/gm4_furniture/furniture_data.xlsx deleted file mode 100644 index e3d90b2e03b63dcdb57a396df4351ef34609a196..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25924 zcmeFZ1yog0*Y``ebR0lRKtdX%rKL*{q*F>ty1To(Te`bB(k#J~jwp|BJkNLE z_kQEXxUb_3`hH#qUX%!7?6DT5qAjSH1jMfz=5)4KRSK2p&P1S)xgS<&0@a{@)g}YILk80 z10pLWCJ9wg-VwQd(^w#!1>=(3p(+VlcYX&ZEHTvWsP24!c6g-@PVphVLFv9G&VM)<^<^ zzp%2ktmzD#MXJq{vxMRc83E%9Uh`ll#r(+0_?p+LuW(mBk`-{bSjla!#ocVREg&VT z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*t4;)2Ds70gHE^*ccu?B%3C)Q`YysnTl zKl6=4Shm4w-Fx$xnnb-1Ro|$Z&i%vtU52bdqhv$4(LJf{tL|k#V=w;KyHa3^*rb0_ z6T=SI?m7QuereA-m*YRYO747J&TRb5p{7dw9G6+9Wz>bGe1Y;8)SlgIX`k-*`V&*$ z^51og+b{px-*7v5@8bKO8G0K|U6P+E9eU1e6aO|jX+Pd%7b z4Qf%TE9Tq&dz;lGdiv|megAULygIP_>ekF(;1hUE6(2j+0i&*r6BK=nOd<@3Bi@nE z-v%A=jtbBZd`H)fd>S&U?pk2m3Q0G3Qk{6+y1-EqB;DY_dg688Wk=Bs9y3ALjePzh z=#)hS=;Z?I#&xzRxLp2Ebv?k(BSp^&iLv{|-6s&0lw_Cmforc8} ztZ4?fDGtE;4vQ&R(+={QWz=x#28K7#6!ZnS;E^fxa6w+u3tEtZ0JXryE2ySGY7oRJ zFW|Za-9Y5EFR0F1Vv24cVqGx0DacDhP@Q$g4&4+aXCYS2pc{xhS%>PZ&-UmBf}Mpm z=8)&IP@T2O4c!zZXMxSa8d}JMv8c|v>5gt7*jZSU0`gcTs^e7Gf9|J+zR= zWIz=v0!;7&8;CyOiEaRL#}+hng8)AR!3JOqfDzzp2*d< None: + """ + Initialize a new CSVRow object using the supplied column names and data. CSVRow objects are read-only by design. + If no data and no column names are supplied the resulting CSVRow object will evaluate to false in boolean expressions. + + Access data within this CSVRow via the `get(key, default)` method or using `[]`. + """ + if not column_names: + column_names = [] + if not data: + data = [] + + if len(column_names) != len(data): + raise ValueError( + f"Could not build CSVRow from supplied column names and data; Number of supplied column names ({len(column_names)}) does not match number of supplied data entries ({len(data)}).") + + self._data = {column_names[column_index]: value for column_index, value in enumerate(data)} + + def __bool__(self): + """ + Allow for the use of CSVRow instances in if statements; If the CSVRow has no keys it is equivalent to `False`. + """ + return len(self._data.keys()) != 0 + + def __getitem__(self, key: str): + try: + return self._data[key] + except KeyError as ke: + raise ValueError( + f"Failed to select column named '{ke.args[0]}' from CSVRow with columns {[key for key in self._data]}.") + + def __repr__(self) -> str: + return str(self._data) + + def get(self, key: str, default: str | Any) -> str: + """ + Returns the value corrosponding to the key if it exists and is not the empty string. + Else returns the provided default. The provided default is cast to a string internally. + """ + value = self._data.get(key, str(default)) + if value: + return value + else: + return str(default) + + +class CSV(): + """ + List-of-Rows representation of a .csv file which can be iteraded over using for ... in. + Optimized for row-first access, i.e. select a row, then a column. + Also provides a `find_row` function for column-first, i.e. select a column, then a row, access. + However, the latter is is more expensive. + + All access methods return CSVRow objects which are dynamically created upon calling an access method. + """ + + def __init__(self, column_names: List[str], rows: List[List[str]]) -> None: + """ + Initialize a new CSV from a list of column names (headers) and a list of rows. + The latter contain actual data, whilst the former only holds names of columns. + """ + self._column_names = column_names + self._rows = rows + + def __iter__(self): + self.__current = 0 + self.__last = len(self._rows) + return self + + def __next__(self) -> CSVRow: + current = self.__current + self.__current += 1 + if current < self.__last: + return CSVRow(self._column_names, self._rows[current]) + raise StopIteration() + + def __getitem__(self, row_index: int): + return CSVRow(self._column_names, self._rows[row_index]) + + def __repr__(self): + return str([CSVRow(self._column_names, data) for data in self._rows]) + + def find_row(self, value: str, by_column: str | int = 0) -> CSVRow: + """ + Finds and returns the first row in this CSV which has `value` in column `by_column`. `by_column` can either be a str, in which case it is treated + as a column name and the header line is searched for a matching string, or an int n, in which case the nth column is selected. + `by_column` defaults to `0`. + Returns an empty `CSVRow` if no match was found. + """ + if isinstance(by_column, str): + by_column = self._column_names.index(by_column) + + for row in self._rows: + if row[by_column] == value: + return CSVRow(self._column_names, row) + return CSVRow() + +def read_csv(path: Path) -> CSV: + """ + Reads in a csv file and returns a list of rows. Each row consists of a dictionary which contains labeled values. + """ + with open(path, mode='r') as file: + csv_file = csv.reader(file) + header = next(csv_file) + + return CSV(column_names=header, rows=[[str(cell) for cell in row] for row in csv_file]) def beet_default(ctx: Context): @@ -7,23 +121,23 @@ def beet_default(ctx: Context): trades_list = [] trades_append = [] - # read in the furniture data - xls = pd.ExcelFile(r'gm4_furniture/furniture_data.xlsx') + furniture_sets = {} - # loop through the different sheets, each sheet hold a different 'category' - # of furniture which need to be sorted in the furniture_station storage - for category in xls.sheet_names: + for path in sorted(Path('gm4_furniture/raw_data/furniture_set').glob('*.csv')): + furniture_sets[path.stem] = read_csv(path) + + tool_cmds = read_csv(Path('gm4_furniture/raw_data/tool_cmds.csv')) - # skip the sheet if it is the template (TODO: remove the template sheet) - if category == 'template_sheet': - continue + # loop through the different sheets, each sheet hold a different 'set_name' + # of furniture which need to be sorted in the furniture_station storage + for set_name,furniture_set in furniture_sets.items(): # read trade data from this sheet, this creates the villager trades used # inside the furniture station - tool_cmd = pd.read_excel(xls, category).iloc[0,0] - trade_data = pd.read_excel(xls, category, skiprows=2, usecols="A:F") + tool_cmd = tool_cmds.find_row(set_name , 0)['tool_cmd'] + # call generate_trade_data to build the commands - new_trades_init,new_trades_list,new_trades_append = generate_trade_data(trade_data, tool_cmd, category) + new_trades_init,new_trades_list,new_trades_append = generate_trade_data(furniture_set, tool_cmd, set_name) # append the trade data to the total list trades_init.append(new_trades_init) trades_list.append(new_trades_list) @@ -31,8 +145,7 @@ def beet_default(ctx: Context): # read furniture data from this sheet, and then create the placement function # and loot table for each furniture - furniture_data = pd.read_excel(xls, category, skiprows=2, usecols="F:T") - generate_furniture_data(ctx, furniture_data, category) + generate_furniture_data(ctx, furniture_set, set_name) # build the trade data commands @@ -62,36 +175,36 @@ def beet_default(ctx: Context): -def generate_trade_data(trade_data, tool_cmd, category): +def generate_trade_data(furniture_set, tool_cmd, set_name): - # create a command to make an empty storage called new_trades that holds the category name and tool cmd - new_trades_init = "data modify storage gm4_furniture:temp new_trades." + category + " set value {cmd:" + tool_cmd + ",trades:[]}" + # create a command to make an empty storage called new_trades that holds the set_name name and tool cmd + new_trades_init = "data modify storage gm4_furniture:temp new_trades." + set_name + " set value {cmd:" + tool_cmd + ",trades:[]}" # iterate over the rows in the spreadsheet and add the trade data for each furniture to the storage new_trades_list = [] - for row in trade_data.index: - new_trades_list.append("data modify storage gm4_furniture:temp new_trades." + category + ".trades append value {cost:[{id:" + str(trade_data['craft_item_1_id'][row]) + ",Count:" + str(trade_data['craft_item_1_count'][row]) + "b},{id:" + str(trade_data['craft_item_2_id'][row]) + ",Count:" + str(trade_data['craft_item_2_count'][row]) + "b}],result:{furniture_id:\"" + category + "/" + str(trade_data['technical_id'][row]) + "\",Count:" + str(trade_data['craft_result_count'][row]) + "}}") + for row in furniture_set: + new_trades_list.append("data modify storage gm4_furniture:temp new_trades." + set_name + ".trades append value {cost:[{id:" + row['craft_item_1_id'] + ",Count:" + row['craft_item_1_count'] + "b},{id:" + row['craft_item_2_id'] + ",Count:" + row['craft_item_2_count'] + "b}],result:{furniture_id:\"" + set_name + "/" + row['technical_id'] + "\",Count:" + row['craft_result_count'] + "}}") new_trades_list = '\n'.join(new_trades_list) # add command to append the main furniture_station storage with the newly created new_trades - new_trades_append = "data modify storage gm4_furniture:data furniture_station append from storage gm4_furniture:temp new_trades." + category + new_trades_append = "data modify storage gm4_furniture:data furniture_station append from storage gm4_furniture:temp new_trades." + set_name # return the created commands return(new_trades_init,new_trades_list,new_trades_append) -def generate_furniture_data(ctx, furniture_data, category): +def generate_furniture_data(ctx, furniture_set, set_name): # create furniture loot tables and placement functions for every furniture in this category - for row in furniture_data.index: + for row in furniture_set: # build placement function and loot table for furniture piece subproject_config = { "data_pack": { "load": [ { - f"data/gm4_furniture/loot_tables/furniture/{category}/{furniture_data['technical_id'][row]}.json": "data/gm4_furniture/templates/loot_tables/furniture_item_template.json", - f"data/gm4_furniture/functions/place/furniture/{category}/{furniture_data['technical_id'][row]}.mcfunction": "data/gm4_furniture/templates/functions/furniture_place_template.mcfunction", + f"data/gm4_furniture/loot_tables/furniture/{set_name}/{row['technical_id']}.json": "data/gm4_furniture/templates/loot_tables/furniture_item_template.json", + f"data/gm4_furniture/functions/place/furniture/{set_name}/{row['technical_id']}.mcfunction": "data/gm4_furniture/templates/functions/furniture_place_template.mcfunction", } ], "render": { @@ -100,22 +213,22 @@ def generate_furniture_data(ctx, furniture_data, category): } }, "meta": { - "category": category, - "technical_id": furniture_data['technical_id'][row], - "display_name": furniture_data['display_name'][row], - "cmd": str(furniture_data['cmd'][row]), - "block_id": furniture_data['block_id'][row], - "sittable": str(furniture_data['sittable'][row]), - "wall_only": str(int(furniture_data['wall_only'][row])), - "ceiling_only": str(int(furniture_data['ceiling_only'][row])), - "dyable": str(int(furniture_data['dyable'][row])), - "length": str(furniture_data['length'][row]), - "depth": str(furniture_data['depth'][row]), - "height": str(furniture_data['height'][row]), - "table": str(int(furniture_data['table'][row])), - "scale": str(furniture_data['scale'][row]), - "allow_diagonal_placement": str(int(furniture_data['diag'][row])), - "custom_interaction": str(int(furniture_data['custom'][row])) + "category": set_name, + "technical_id": row['technical_id'], + "display_name": row['display_name'], + "cmd": row['cmd'], + "block_id": row['block_id'], + "sittable": row['sittable'], + "wall_only": str(int(row['wall_only'] == 'TRUE')), + "ceiling_only": str(int(row['ceiling_only'] == 'TRUE')), + "dyable": str(int(row['dyable'] == 'TRUE')), + "length": row['length'], + "depth": row['depth'], + "height": row['height'], + "table": str(int(row['table'] == 'TRUE')), + "scale": row['scale'], + "allow_diagonal_placement": str(int(row['diag'] == 'TRUE')), + "custom_interaction": str(int(row['custom'] == 'TRUE')) } } diff --git a/gm4_furniture/raw_data/furniture_set/cloth_set.csv b/gm4_furniture/raw_data/furniture_set/cloth_set.csv new file mode 100644 index 0000000000..fd3dd4cb0a --- /dev/null +++ b/gm4_furniture/raw_data/furniture_set/cloth_set.csv @@ -0,0 +1,3 @@ +craft_item_1_id,craft_item_1_count,craft_item_2_id,craft_item_2_count,craft_result_count,technical_id,display_name,cmd,block_id,length,depth,height,sittable,dyable,wall_only,ceiling_only,table,scale,diag,custom +candle,1,paper,4,1,paper_lantern_1,Paper Lantern,3420280,light[level=15],1,1,1,0,TRUE,FALSE,TRUE,FALSE,1,FALSE,FALSE +stick,1,white_wool,6,1,horizontal_flag_1,Long Flag,3420281,light[level=0],1,1,1,0,TRUE,FALSE,FALSE,FALSE,1,TRUE,FALSE diff --git a/gm4_furniture/raw_data/furniture_set/stone_set.csv b/gm4_furniture/raw_data/furniture_set/stone_set.csv new file mode 100644 index 0000000000..3bfad787fd --- /dev/null +++ b/gm4_furniture/raw_data/furniture_set/stone_set.csv @@ -0,0 +1,6 @@ +craft_item_1_id,craft_item_1_count,craft_item_2_id,craft_item_2_count,craft_result_count,technical_id,display_name,cmd,block_id,length,depth,height,sittable,dyable,wall_only,ceiling_only,table,scale,diag,custom +stone_bricks,8,tadpole_bucket,1,1,statues_frog,Stone Frog Statue,3420230,barrier,1,1,1,0,FALSE,FALSE,FALSE,FALSE,1,FALSE,TRUE +stone_bricks,8,bee_nest,1,1,statues_bee,Stone Bee Statue,3420231,barrier,1,1,1,0,FALSE,FALSE,FALSE,FALSE,1,FALSE,TRUE +stone_bricks,8,pufferfish_bucket,1,1,statues_pufferfish,Stone Pufferfish Statue,3420232,barrier,1,1,1,0,FALSE,FALSE,FALSE,FALSE,1,FALSE,TRUE +stone_bricks,8,axolotl_bucket,1,1,statues_axolotl,Stone Axolotl Statue,3420233,barrier,1,1,1,0,FALSE,FALSE,FALSE,FALSE,1,FALSE,TRUE +stone_bricks,8,jukebox,1,1,statues_allay,Stone Allay Statue,3420234,barrier,1,1,1,0,FALSE,FALSE,FALSE,FALSE,1,FALSE,TRUE diff --git a/gm4_furniture/raw_data/furniture_set/wood_set.csv b/gm4_furniture/raw_data/furniture_set/wood_set.csv new file mode 100644 index 0000000000..9483744d28 --- /dev/null +++ b/gm4_furniture/raw_data/furniture_set/wood_set.csv @@ -0,0 +1,13 @@ +craft_item_1_id,craft_item_1_count,craft_item_2_id,craft_item_2_count,craft_result_count,technical_id,display_name,cmd,block_id,length,depth,height,sittable,dyable,wall_only,ceiling_only,table,scale,diag,custom +oak_planks,4,air,0,1,plain_1x1_table_1,Small Oak Table,3420200,barrier,1,1,1,0,FALSE,FALSE,FALSE,TRUE,1,FALSE,FALSE +oak_planks,16,air,0,1,plain_2x2_table_1,Large Oak Table,3420201,barrier,2,2,1,0,FALSE,FALSE,FALSE,TRUE,1,FALSE,FALSE +oak_planks,12,air,0,1,plain_bench_1,Oak Bench,3420202,barrier,3,1,1,50,FALSE,FALSE,FALSE,FALSE,1,FALSE,FALSE +oak_planks,4,air,0,1,plain_chair_1,Oak Chair,3420203,barrier,1,1,1,50,FALSE,FALSE,FALSE,FALSE,1,FALSE,FALSE +oak_planks,4,air,0,1,plain_stool_1,Oak Stool,3420204,barrier,1,1,1,50,FALSE,FALSE,FALSE,FALSE,1,FALSE,FALSE +oak_planks,1,candle,1,1,plain_light_1,Oak Candle Holder,3420205,light[level=15],1,1,1,0,TRUE,FALSE,FALSE,FALSE,1,FALSE,FALSE +dark_oak_planks,4,white_wool,1,1,fancy_1x1_table_1,Small Dark Oak Table,3420210,barrier,1,1,1,0,TRUE,FALSE,FALSE,TRUE,1,FALSE,FALSE +dark_oak_planks,16,white_wool,4,1,fancy_2x2_table_1,Large Dark Oak Table,3420211,barrier,2,2,1,0,TRUE,FALSE,FALSE,TRUE,1,FALSE,FALSE +dark_oak_planks,12,white_wool,3,1,fancy_bench_1,Dark Oak Bench,3420212,barrier,3,1,1,50,TRUE,FALSE,FALSE,FALSE,1,FALSE,FALSE +dark_oak_planks,4,white_wool,1,1,fancy_chair_1,Dark Oak Chair,3420213,barrier,1,1,1,50,TRUE,FALSE,FALSE,FALSE,1,FALSE,FALSE +dark_oak_planks,4,white_wool,1,1,fancy_stool_1,Dark Oak Stool,3420214,barrier,1,1,1,50,TRUE,FALSE,FALSE,FALSE,1,FALSE,FALSE +dark_oak_planks,1,candle,1,1,fancy_light_1,Dark Oak Lamp Shade,3420215,light[level=12],1,1,1,0,TRUE,FALSE,FALSE,FALSE,1,FALSE,FALSE diff --git a/gm4_furniture/raw_data/tool_cmds.csv b/gm4_furniture/raw_data/tool_cmds.csv new file mode 100644 index 0000000000..fef01aa877 --- /dev/null +++ b/gm4_furniture/raw_data/tool_cmds.csv @@ -0,0 +1,4 @@ +set_name,tool_cmd +wood_set,3420200 +stone_set,3420201 +cloth_set,3420204 From b32825b43270fde168f7d450060264bb649a8e4c Mon Sep 17 00:00:00 2001 From: Thanathor Date: Mon, 22 Jan 2024 22:09:19 +0100 Subject: [PATCH 17/26] add metal set --- gm4_furniture/raw_data/furniture_set/metal_set.csv | 4 ++++ gm4_furniture/raw_data/tool_cmds.csv | 1 + 2 files changed, 5 insertions(+) create mode 100644 gm4_furniture/raw_data/furniture_set/metal_set.csv diff --git a/gm4_furniture/raw_data/furniture_set/metal_set.csv b/gm4_furniture/raw_data/furniture_set/metal_set.csv new file mode 100644 index 0000000000..afdfbb50b3 --- /dev/null +++ b/gm4_furniture/raw_data/furniture_set/metal_set.csv @@ -0,0 +1,4 @@ +craft_item_1_id,craft_item_1_count,craft_item_2_id,craft_item_2_count,craft_result_count,technical_id,display_name,cmd,block_id,length,depth,height,sittable,dyable,wall_only,ceiling_only,table,scale,diag,custom +gold_ingot,3,candle,3,1,iron_3_candle_holder_1,Iron Candelabra,3420240,light[level=13],1,1,1,0,TRUE,FALSE,FALSE,FALSE,1,FALSE,FALSE +gold_ingot,3,candle,3,1,gold_3_candle_holder_1,Golden Candelabra,3420250,light[level=13],1,1,1,0,TRUE,FALSE,FALSE,FALSE,1,FALSE,FALSE +gold_ingot,8,air,0,1,gold_skull_1,Golden Skull,3420251,light[level=0],1,1,1,0,FALSE,FALSE,FALSE,FALSE,1,TRUE,FALSE diff --git a/gm4_furniture/raw_data/tool_cmds.csv b/gm4_furniture/raw_data/tool_cmds.csv index fef01aa877..df79aef436 100644 --- a/gm4_furniture/raw_data/tool_cmds.csv +++ b/gm4_furniture/raw_data/tool_cmds.csv @@ -2,3 +2,4 @@ set_name,tool_cmd wood_set,3420200 stone_set,3420201 cloth_set,3420204 +metal_set,3420202 From 9a23e98a6796d8c27fc2ba91ce058406f15345ff Mon Sep 17 00:00:00 2001 From: Thanathor Date: Mon, 22 Jan 2024 22:23:59 +0100 Subject: [PATCH 18/26] fix some missing headers and waterlogging --- .../functions/break/decimal_to_hex.mcfunction | 4 +++ .../functions/break/get_color.mcfunction | 4 +++ .../interact/waterlog/check.mcfunction | 4 +++ .../interact/waterlog/log.mcfunction | 27 ++++++++++++++++--- .../interact/waterlog/unlog.mcfunction | 27 ++++++++++++++++--- 5 files changed, 60 insertions(+), 6 deletions(-) diff --git a/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction index de269ea14b..8f776c64df 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/decimal_to_hex.mcfunction @@ -1,3 +1,7 @@ +# transform color value from decimal to hex +# @s = furniture main interaction entity +# at @s +# run from break/destroy data modify storage gm4_furniture:temp color_hex set value {} diff --git a/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction index 4e0f4c006b..9c14ac5735 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction @@ -1,3 +1,7 @@ +# get the color of the broken furnitur +# @s = furniture main interaction entity +# at @s +# run from break/process_hit # find this furniture's item_display and get its color scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/check.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/check.mcfunction index 3910028615..b3cc27cc81 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/check.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/check.mcfunction @@ -1,3 +1,7 @@ +# check if the furniture should waterlog or water-unlog +# @s = furniture's interacted interaction entity +# at @s +# run from interact/process execute if block ~ ~ ~ #gm4_furniture:furniture_blocks[waterlogged=true] if entity @p[tag=gm4_furniture_target,predicate=gm4_furniture:holding_empty_bucket] run function gm4_furniture:interact/waterlog/unlog execute if score $interaction_processed gm4_furniture_data matches 0 if block ~ ~ ~ #gm4_furniture:furniture_blocks[waterlogged=false] if entity @p[tag=gm4_furniture_target,predicate=gm4_furniture:holding_water_bucket] run function gm4_furniture:interact/waterlog/log diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/log.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/log.mcfunction index 1c3a06b9c6..647f7052f5 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/log.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/log.mcfunction @@ -1,7 +1,28 @@ +# waterlog this part of the furniture +# @s = furniture's interacted interaction entity +# at @s +# run from interact/waterlog/check item replace entity @p[tag=gm4_furniture_target,gamemode=!creative] weapon.mainhand with bucket -fill ~ ~ ~ ~ ~ ~ light[level=0,waterlogged=true] replace light[level=0] -fill ~ ~ ~ ~ ~ ~ light[level=15,waterlogged=true] replace light[level=15] -fill ~ ~ ~ ~ ~ ~ barrier[waterlogged=true] replace barrier + +scoreboard players set $waterlog_completed gm4_furniture_data 0 +execute store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=0,waterlogged=true] replace light[level=0] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ barrier[waterlogged=true] replace barrier +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=15,waterlogged=true] replace light[level=15] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=14,waterlogged=true] replace light[level=14] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=13,waterlogged=true] replace light[level=13] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=12,waterlogged=true] replace light[level=12] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=11,waterlogged=true] replace light[level=11] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=10,waterlogged=true] replace light[level=10] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=9,waterlogged=true] replace light[level=9] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=8,waterlogged=true] replace light[level=8] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=7,waterlogged=true] replace light[level=7] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=6,waterlogged=true] replace light[level=6] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=5,waterlogged=true] replace light[level=5] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=4,waterlogged=true] replace light[level=4] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=3,waterlogged=true] replace light[level=3] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=2,waterlogged=true] replace light[level=2] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=1,waterlogged=true] replace light[level=1] + playsound item.bucket.empty player @a[distance=..16] ~ ~ ~ 1 1 scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/unlog.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/unlog.mcfunction index 6989c9c7d9..64b0f25b3d 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/unlog.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/waterlog/unlog.mcfunction @@ -1,7 +1,28 @@ +# water-unlog this part of the furniture +# @s = furniture's interacted interaction entity +# at @s +# run from interact/waterlog/check item replace entity @p[tag=gm4_furniture_target,gamemode=!creative] weapon.mainhand with water_bucket -fill ~ ~ ~ ~ ~ ~ light[level=0,waterlogged=false] replace light[level=0,waterlogged=true] -fill ~ ~ ~ ~ ~ ~ light[level=15,waterlogged=false] replace light[level=15,waterlogged=true] -fill ~ ~ ~ ~ ~ ~ barrier[waterlogged=false] replace barrier[waterlogged=true] + +scoreboard players set $waterlog_completed gm4_furniture_data 0 +execute store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=0,waterlogged=false] replace light[level=0,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ barrier[waterlogged=false] replace barrier[waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=15,waterlogged=false] replace light[level=15,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=14,waterlogged=false] replace light[level=14,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=13,waterlogged=false] replace light[level=13,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=12,waterlogged=false] replace light[level=12,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=11,waterlogged=false] replace light[level=11,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=10,waterlogged=false] replace light[level=10,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=9,waterlogged=false] replace light[level=9,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=8,waterlogged=false] replace light[level=8,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=7,waterlogged=false] replace light[level=7,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=6,waterlogged=false] replace light[level=6,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=5,waterlogged=false] replace light[level=5,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=4,waterlogged=false] replace light[level=4,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=3,waterlogged=false] replace light[level=3,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=2,waterlogged=false] replace light[level=2,waterlogged=true] +execute if score $waterlog_completed gm4_furniture_data matches 0 store success score $waterlog_completed gm4_furniture_data run fill ~ ~ ~ ~ ~ ~ light[level=1,waterlogged=false] replace light[level=1,waterlogged=true] + playsound item.bucket.fill player @a[distance=..16] ~ ~ ~ 1 1 scoreboard players set $interaction_processed gm4_furniture_data 1 From c2b32b4151db77d6e006db4fedaab3cb8dc4322e Mon Sep 17 00:00:00 2001 From: Thanathor Date: Tue, 23 Jan 2024 13:39:59 +0100 Subject: [PATCH 19/26] use new gm4.utils --- gm4_furniture/generate.py | 119 +------------------------------------- 1 file changed, 3 insertions(+), 116 deletions(-) diff --git a/gm4_furniture/generate.py b/gm4_furniture/generate.py index eef312ee5b..0b4cba268a 100644 --- a/gm4_furniture/generate.py +++ b/gm4_furniture/generate.py @@ -1,119 +1,6 @@ from beet import Context, subproject -from typing import List, Dict, Any from pathlib import Path -import csv - -class CSVRow(): - """ - Read-only dict wrapper which represents a row of data from a .csv file. - """ - - def __init__(self, column_names: List[str] | None = None, data: List[str] | None = None) -> None: - """ - Initialize a new CSVRow object using the supplied column names and data. CSVRow objects are read-only by design. - If no data and no column names are supplied the resulting CSVRow object will evaluate to false in boolean expressions. - - Access data within this CSVRow via the `get(key, default)` method or using `[]`. - """ - if not column_names: - column_names = [] - if not data: - data = [] - - if len(column_names) != len(data): - raise ValueError( - f"Could not build CSVRow from supplied column names and data; Number of supplied column names ({len(column_names)}) does not match number of supplied data entries ({len(data)}).") - - self._data = {column_names[column_index]: value for column_index, value in enumerate(data)} - - def __bool__(self): - """ - Allow for the use of CSVRow instances in if statements; If the CSVRow has no keys it is equivalent to `False`. - """ - return len(self._data.keys()) != 0 - - def __getitem__(self, key: str): - try: - return self._data[key] - except KeyError as ke: - raise ValueError( - f"Failed to select column named '{ke.args[0]}' from CSVRow with columns {[key for key in self._data]}.") - - def __repr__(self) -> str: - return str(self._data) - - def get(self, key: str, default: str | Any) -> str: - """ - Returns the value corrosponding to the key if it exists and is not the empty string. - Else returns the provided default. The provided default is cast to a string internally. - """ - value = self._data.get(key, str(default)) - if value: - return value - else: - return str(default) - - -class CSV(): - """ - List-of-Rows representation of a .csv file which can be iteraded over using for ... in. - Optimized for row-first access, i.e. select a row, then a column. - Also provides a `find_row` function for column-first, i.e. select a column, then a row, access. - However, the latter is is more expensive. - - All access methods return CSVRow objects which are dynamically created upon calling an access method. - """ - - def __init__(self, column_names: List[str], rows: List[List[str]]) -> None: - """ - Initialize a new CSV from a list of column names (headers) and a list of rows. - The latter contain actual data, whilst the former only holds names of columns. - """ - self._column_names = column_names - self._rows = rows - - def __iter__(self): - self.__current = 0 - self.__last = len(self._rows) - return self - - def __next__(self) -> CSVRow: - current = self.__current - self.__current += 1 - if current < self.__last: - return CSVRow(self._column_names, self._rows[current]) - raise StopIteration() - - def __getitem__(self, row_index: int): - return CSVRow(self._column_names, self._rows[row_index]) - - def __repr__(self): - return str([CSVRow(self._column_names, data) for data in self._rows]) - - def find_row(self, value: str, by_column: str | int = 0) -> CSVRow: - """ - Finds and returns the first row in this CSV which has `value` in column `by_column`. `by_column` can either be a str, in which case it is treated - as a column name and the header line is searched for a matching string, or an int n, in which case the nth column is selected. - `by_column` defaults to `0`. - Returns an empty `CSVRow` if no match was found. - """ - if isinstance(by_column, str): - by_column = self._column_names.index(by_column) - - for row in self._rows: - if row[by_column] == value: - return CSVRow(self._column_names, row) - return CSVRow() - -def read_csv(path: Path) -> CSV: - """ - Reads in a csv file and returns a list of rows. Each row consists of a dictionary which contains labeled values. - """ - with open(path, mode='r') as file: - csv_file = csv.reader(file) - header = next(csv_file) - - return CSV(column_names=header, rows=[[str(cell) for cell in row] for row in csv_file]) +from gm4.utils import CSV def beet_default(ctx: Context): @@ -124,9 +11,9 @@ def beet_default(ctx: Context): furniture_sets = {} for path in sorted(Path('gm4_furniture/raw_data/furniture_set').glob('*.csv')): - furniture_sets[path.stem] = read_csv(path) + furniture_sets[path.stem] = CSV.from_file(path) - tool_cmds = read_csv(Path('gm4_furniture/raw_data/tool_cmds.csv')) + tool_cmds = CSV.from_file(Path('gm4_furniture/raw_data/tool_cmds.csv')) # loop through the different sheets, each sheet hold a different 'set_name' # of furniture which need to be sorted in the furniture_station storage From 65c4443249c195cfa258052919eeee7fa64d5ead Mon Sep 17 00:00:00 2001 From: Thanathor <73304324+TheThanathor@users.noreply.github.com> Date: Thu, 25 Jan 2024 20:45:03 +0100 Subject: [PATCH 20/26] fix recipe --- gm4_furniture/raw_data/furniture_set/metal_set.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gm4_furniture/raw_data/furniture_set/metal_set.csv b/gm4_furniture/raw_data/furniture_set/metal_set.csv index afdfbb50b3..6665c7b86b 100644 --- a/gm4_furniture/raw_data/furniture_set/metal_set.csv +++ b/gm4_furniture/raw_data/furniture_set/metal_set.csv @@ -1,4 +1,4 @@ craft_item_1_id,craft_item_1_count,craft_item_2_id,craft_item_2_count,craft_result_count,technical_id,display_name,cmd,block_id,length,depth,height,sittable,dyable,wall_only,ceiling_only,table,scale,diag,custom -gold_ingot,3,candle,3,1,iron_3_candle_holder_1,Iron Candelabra,3420240,light[level=13],1,1,1,0,TRUE,FALSE,FALSE,FALSE,1,FALSE,FALSE +iron_ingot,3,candle,3,1,iron_3_candle_holder_1,Iron Candelabra,3420240,light[level=13],1,1,1,0,TRUE,FALSE,FALSE,FALSE,1,FALSE,FALSE gold_ingot,3,candle,3,1,gold_3_candle_holder_1,Golden Candelabra,3420250,light[level=13],1,1,1,0,TRUE,FALSE,FALSE,FALSE,1,FALSE,FALSE gold_ingot,8,air,0,1,gold_skull_1,Golden Skull,3420251,light[level=0],1,1,1,0,FALSE,FALSE,FALSE,FALSE,1,TRUE,FALSE From bd4dcbe05bb7a1abc0eae35ba3fcc3b3ef9c19c8 Mon Sep 17 00:00:00 2001 From: Thanathor <73304324+TheThanathor@users.noreply.github.com> Date: Sat, 27 Jan 2024 16:47:35 +0100 Subject: [PATCH 21/26] reapply invisibility since its lost on server restart --- gm4_furniture/data/gm4_furniture/functions/main.mcfunction | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction index 0014f1e3b5..876681e835 100644 --- a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction @@ -6,3 +6,6 @@ execute as @e[type=horse,nbt={ArmorItems:[{tag:{gm4_furniture:"paintbrush"}}]}] # check furniture placements execute as @e[type=interaction,tag=gm4_furniture.on_wall] at @s if block ^ ^0.5 ^-1 #gm4:replaceable run function gm4_furniture:break/lost_connection execute as @e[type=interaction,tag=gm4_furniture.on_ceiling] at @s if block ^ ^1.5 ^ #gm4:replaceable run function gm4_furniture:break/lost_connection + +# reapply invisibility to the wandering traders +effect give @e[type=wandering_trader,tag=gm4_furniture.furniture_station] invisibility infinite 0 true From 95bf07966cf255b0a0f8cc15b83b47d5b53df6c9 Mon Sep 17 00:00:00 2001 From: Thanathor Date: Tue, 30 Jan 2024 11:42:12 +0100 Subject: [PATCH 22/26] improve furniture breaking logic --- .../data/gm4_furniture/functions/break/destroy.mcfunction | 2 +- .../data/gm4_furniture/functions/break/get_color.mcfunction | 2 -- .../data/gm4_furniture/functions/break/process_hit.mcfunction | 3 +-- .../functions/break/remove_furniture_station.mcfunction | 4 ++-- .../gm4_furniture/functions/interact/paint/process.mcfunction | 1 + 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction index 8dadf0bedd..e4c73cad76 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/destroy.mcfunction @@ -10,7 +10,7 @@ execute if score $furniture_color gm4_furniture_data matches 16383998 run scoreb execute if score $furniture_color gm4_furniture_data matches 1.. run function gm4_furniture:break/decimal_to_hex # unless breaking player was in creative drop the item -execute unless score $creative gm4_furniture_data matches 1 positioned ~-0.4999 ~0.0001 ~-0.4999 as @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] run function gm4_furniture:break/drop_item with entity @s item.tag.data +execute unless score $creative gm4_furniture_data matches 1 positioned ~-0.4999 ~0.0001 ~-0.4999 as @e[type=item_display,tag=gm4_furniture.display,dx=0,dy=0,dz=0,limit=1] run function gm4_furniture:break/drop_item with entity @s item.tag.data # remove any furniture blocks that match the id execute as @e[type=interaction,tag=gm4_furniture,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id at @s run function gm4_furniture:break/remove_block diff --git a/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction index 9c14ac5735..a4814b477d 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/get_color.mcfunction @@ -9,5 +9,3 @@ execute as @e[type=item_display,tag=gm4_furniture.display,distance=..8] if score item modify entity @p[tag=gm4_furniture_target] weapon.mainhand gm4_furniture:get_color playsound item.dye.use player @a[distance=..8] ~ ~ ~ 1 1.15 - -scoreboard players set $color_picked gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction index 7bc347b08d..b58fed496d 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/process_hit.mcfunction @@ -4,9 +4,8 @@ # run from break/find_main # if player is holding the paintbrush instead grab the color and stop this function -scoreboard players set $color_picked gm4_furniture_data 0 execute if score $get_color gm4_furniture_data matches 1 if entity @s[tag=gm4_furniture.painted] run function gm4_furniture:break/get_color -execute if score $color_picked gm4_furniture_data matches 1 run return 0 +execute if score $get_color gm4_furniture_data matches 1 run return 0 # check how much time has passed since the last hit (or ignore that if the player was in creative) execute store result score $hit gm4_furniture_last_hit run time query gametime diff --git a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction index 9827ec0e9b..d27c579e4a 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction @@ -1,8 +1,8 @@ -# remove the flower pot and wandering trader when a furniture station is destroyed +# remove the wandering trader when a furniture station is destroyed # furniture station interaction entity # at @s # run from break/destroy -setblock ~ ~2 ~ air +setblock ~ ~1 ~ air execute as @e[type=wandering_trader,tag=gm4_furniture,distance=..4] if score @s gm4_furniture_id = $check_id gm4_furniture_id run tp @s ~ -100000 ~ execute positioned ~-0.4999 ~0.0001 ~-0.4999 run kill @e[type=item_display,tag=gm4_furniture.tool,dx=0,dy=0,dz=0] diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction index 94e73b6d21..03a3e27ace 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/paint/process.mcfunction @@ -5,6 +5,7 @@ # find this furniture's item_display and try to paint it scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id +scoreboard players set $paint_changed gm4_furniture_data 0 execute as @e[type=item_display,tag=gm4_furniture.display,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id store success score $paint_changed gm4_furniture_data run data modify entity @s item.tag.display.color set from storage gm4_furniture:temp color # if furniture was painted mark interaction as resolved and play paint sound From 20e69486287f64ddca80974de0d2fdbd2bf7fc64 Mon Sep 17 00:00:00 2001 From: Thanathor Date: Tue, 27 Feb 2024 16:57:46 +0100 Subject: [PATCH 23/26] replace wandering trader with villagers --- .../break/remove_furniture_station.mcfunction | 4 ++-- .../furniture_station/swap_tool.mcfunction | 6 +++--- .../data/gm4_furniture/functions/main.mcfunction | 7 +++++-- .../place/furniture/furniture_station.mcfunction | 12 ++++++------ .../build_trades/build_trade.mcfunction | 2 +- .../build_trades/get_trade_data.mcfunction | 2 +- .../build_trades/prep.mcfunction | 2 +- .../build_trades/resolve_trade.mcfunction | 2 +- .../functions/update/update_villager.mcfunction | 16 ++++++++++++++++ 9 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 gm4_furniture/data/gm4_furniture/functions/update/update_villager.mcfunction diff --git a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction index d27c579e4a..635f744a52 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction @@ -1,8 +1,8 @@ -# remove the wandering trader when a furniture station is destroyed +# remove the villager when a furniture station is destroyed # furniture station interaction entity # at @s # run from break/destroy setblock ~ ~1 ~ air -execute as @e[type=wandering_trader,tag=gm4_furniture,distance=..4] if score @s gm4_furniture_id = $check_id gm4_furniture_id run tp @s ~ -100000 ~ +execute as @e[type=villager,tag=gm4_furniture,distance=..4] if score @s gm4_furniture_id = $check_id gm4_furniture_id run tp @s ~ -100000 ~ execute positioned ~-0.4999 ~0.0001 ~-0.4999 run kill @e[type=item_display,tag=gm4_furniture.tool,dx=0,dy=0,dz=0] diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction index fd15fcc753..70f6169100 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction @@ -4,9 +4,9 @@ # run from interact/process # move index up/down -execute if entity @s[tag=gm4_furniture.next] align xyz run scoreboard players add @e[type=wandering_trader,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] gm4_furniture_index 1 -execute if entity @s[tag=gm4_furniture.prev] align xyz run scoreboard players remove @e[type=wandering_trader,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] gm4_furniture_index 1 -execute align xyz as @e[type=wandering_trader,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep +execute if entity @s[tag=gm4_furniture.next] align xyz run scoreboard players add @e[type=villager,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] gm4_furniture_index 1 +execute if entity @s[tag=gm4_furniture.prev] align xyz run scoreboard players remove @e[type=villager,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] gm4_furniture_index 1 +execute align xyz as @e[type=villager,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep # mark interaction as resolved scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction index 876681e835..55d4075c20 100644 --- a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction @@ -7,5 +7,8 @@ execute as @e[type=horse,nbt={ArmorItems:[{tag:{gm4_furniture:"paintbrush"}}]}] execute as @e[type=interaction,tag=gm4_furniture.on_wall] at @s if block ^ ^0.5 ^-1 #gm4:replaceable run function gm4_furniture:break/lost_connection execute as @e[type=interaction,tag=gm4_furniture.on_ceiling] at @s if block ^ ^1.5 ^ #gm4:replaceable run function gm4_furniture:break/lost_connection -# reapply invisibility to the wandering traders -effect give @e[type=wandering_trader,tag=gm4_furniture.furniture_station] invisibility infinite 0 true +# reapply invisibility to the villagers +effect give @e[type=villager,tag=gm4_furniture.furniture_station] invisibility infinite 0 true + +# TEMP: update wandering trader +execute as @e[type=wandering_trader,tag=gm4_furniture.furniture_station] at @s run function gm4_furniture:update/update_villager diff --git a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction index afa5669cf2..91c01ab3de 100644 --- a/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/place/furniture/furniture_station.mcfunction @@ -28,15 +28,15 @@ data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture. data modify entity @e[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.tool_prev,limit=1,distance=..2] item.tag.CustomModelData set from storage gm4_furniture:data furniture_station[-1].cmd setblock ~ ~ ~ barrier -# spawn trader and set ids -summon wandering_trader ~ ~1000 ~ {Invulnerable:1b,Team:"gm4_furniture_nocol",Tags:["gm4_furniture","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.furniture_station","fallback":"Furniture Station"},[{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:offscreen"},{"translate":"gui.gm4.furniture_station","fallback":"","font":"gm4:container_gui","color":"white"},{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:furniture","color":"#404040"}]]}',NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",duration:-1,show_particles:0b},{id:"minecraft:resistance",amplifier:9,duration:-1,show_particles:0b}]} -tp @e[type=wandering_trader,tag=gm4_new_furniture,limit=1] ~ ~-0.4999 ~ -scoreboard players set @e[type=wandering_trader,tag=gm4_new_furniture,limit=1] gm4_furniture_index 0 -execute as @e[type=wandering_trader,tag=gm4_new_furniture,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep +# spawn villager and set ids +summon villager ~ ~1000 ~ {VillagerData:{level:99},Invulnerable:1b,Team:"gm4_furniture_nocol",Tags:["gm4_furniture","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.furniture_station","fallback":"Furniture Station"},[{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:offscreen"},{"translate":"gui.gm4.furniture_station","fallback":"","font":"gm4:container_gui","color":"white"},{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:furniture","color":"#404040"}]]}',NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",duration:-1,show_particles:0b},{id:"minecraft:resistance",amplifier:9,duration:-1,show_particles:0b}]} +tp @e[type=villager,tag=gm4_new_furniture,limit=1] ~ ~-0.4999 ~ +scoreboard players set @e[type=villager,tag=gm4_new_furniture,limit=1] gm4_furniture_index 0 +execute as @e[type=villager,tag=gm4_new_furniture,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep execute unless block ~ ~1 ~ water[level=0] run setblock ~ ~1 ~ light[level=0] execute if block ~ ~1 ~ water[level=0] run setblock ~ ~1 ~ light[level=0,waterlogged=true] execute store result score @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 -execute store result score @e[type=wandering_trader,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players get $next_id gm4_furniture_id +execute store result score @e[type=villager,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players get $next_id gm4_furniture_id # rotate furniture_station depending on rotation set by player (if rotation is 1 default rotation can be kept) execute if score $rotation gm4_furniture_data matches 2 as @e[tag=gm4_new_furniture,distance=..8] at @s run tp @s ~ ~ ~ 90 0 diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction index 624c73a139..1fa8f45db2 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/build_trade.mcfunction @@ -1,5 +1,5 @@ # build a trade from trade_data -# @s = furniture station wandering trader +# @s = furniture station villager # at @s # run from technical/furniture_station/build_trades/prep # run from here diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/get_trade_data.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/get_trade_data.mcfunction index 913ef025d1..fc8425a0e7 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/get_trade_data.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/get_trade_data.mcfunction @@ -1,5 +1,5 @@ # loop through trade data to get the proper index in the frot -# @s = furniture station wandering trader +# @s = furniture station villager # at @s # run from technical/furniture_station/build_trades/prep # run from here diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction index 61937def6e..874ddabda1 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction @@ -1,5 +1,5 @@ # change the trades of this furniture station -# @s = furniture station wandering trader +# @s = furniture station villager # at @s # run from interact/furniture_station/swap_tool # run from place/furniture/furniture_station diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction index c3efc8cb61..71332d1ff1 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/resolve_trade.mcfunction @@ -1,5 +1,5 @@ # put furniture item in forceloaded shulker box to read its data -# @s = furniture station wandering trader +# @s = furniture station villager # at @s # run from technical/furniture_station/build_trades/build_trade with storage gm4_furniture:temp trade_data[0] # $(furniture_id) = furniture's id diff --git a/gm4_furniture/data/gm4_furniture/functions/update/update_villager.mcfunction b/gm4_furniture/data/gm4_furniture/functions/update/update_villager.mcfunction new file mode 100644 index 0000000000..b0f06ff574 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/update/update_villager.mcfunction @@ -0,0 +1,16 @@ + +# grab id +scoreboard players operation $furniture_id gm4_furniture_id = @s gm4_furniture_id + +# spawn villager and set ids +summon villager ~ ~1000 ~ {VillagerData:{level:99},Invulnerable:1b,Team:"gm4_furniture_nocol",Tags:["gm4_furniture","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.furniture_station","fallback":"Furniture Station"},[{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:offscreen"},{"translate":"gui.gm4.furniture_station","fallback":"","font":"gm4:container_gui","color":"white"},{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:furniture","color":"#404040"}]]}',NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",duration:-1,show_particles:0b},{id:"minecraft:resistance",amplifier:9,duration:-1,show_particles:0b}]} +execute align xyz positioned ~.5 ~.5 ~.5 run tp @e[type=villager,tag=gm4_new_furniture,limit=1] ~ ~-0.4999 ~ +scoreboard players set @e[type=villager,tag=gm4_new_furniture,limit=1] gm4_furniture_index 0 +execute as @e[type=villager,tag=gm4_new_furniture,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep +execute store result score @e[type=villager,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players get $furniture_id gm4_furniture_id + +tag @e[type=villager,tag=gm4_new_furniture] remove gm4_new_furniture + +# remove wandering trader +tp @s ~ ~-10000 ~ +kill @s From 7f50d3da222243f0a800938e428152c0d09e3387 Mon Sep 17 00:00:00 2001 From: Thanathor Date: Tue, 27 Feb 2024 21:01:27 +0100 Subject: [PATCH 24/26] allow turning off furniture station --- gm4_furniture/beet.yaml | 4 +++- .../gm4_furniture/advancements/lightning.json | 10 ++++++++++ .../break/remove_furniture_station.mcfunction | 1 + .../gm4_furniture/functions/init.mcfunction | 2 ++ .../furniture_station/swap_tool.mcfunction | 15 ++++++++++---- .../functions/interact/process.mcfunction | 7 +++++-- .../functions/interact/sit/check.mcfunction | 9 +++++++++ .../interact/sit/find_seat.mcfunction | 19 ++++++++++++++++++ .../interact/sit/init_seat.mcfunction | 7 +++++++ .../functions/interact/sit/process.mcfunction | 12 ----------- .../interact/sit/spawn_seat.mcfunction | 7 +++++++ .../gm4_furniture/functions/main.mcfunction | 3 --- .../functions/slow_clock.mcfunction | 7 +++++++ .../activation/process.mcfunction | 10 ++++++++++ .../activation/turn_active.mcfunction | 20 +++++++++++++++++++ .../activation/turn_inactive.mcfunction | 17 ++++++++++++++++ .../build_trades/prep.mcfunction | 3 +++ .../lightning/detect.mcfunction | 6 ++++++ .../lightning/get_scores.mcfunction | 3 +++ .../lightning/revive_villager.mcfunction | 18 +++++++++++++++++ .../furniture_place_template.mcfunction | 8 ++------ 21 files changed, 160 insertions(+), 28 deletions(-) create mode 100644 gm4_furniture/data/gm4_furniture/advancements/lightning.json create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/sit/check.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/sit/find_seat.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/sit/init_seat.mcfunction delete mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/interact/sit/spawn_seat.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/slow_clock.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/process.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/turn_active.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/turn_inactive.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/detect.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/get_scores.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/revive_villager.mcfunction diff --git a/gm4_furniture/beet.yaml b/gm4_furniture/beet.yaml index 1841267c1a..192709c4da 100644 --- a/gm4_furniture/beet.yaml +++ b/gm4_furniture/beet.yaml @@ -17,7 +17,9 @@ meta: required: lib_forceload: 1.1.0 lib_custom_crafters: 3.0.0 - schedule_loops: [main] + schedule_loops: + - main + - slow_clock website: description: Furniture! recommended: [] diff --git a/gm4_furniture/data/gm4_furniture/advancements/lightning.json b/gm4_furniture/data/gm4_furniture/advancements/lightning.json new file mode 100644 index 0000000000..9261906448 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/advancements/lightning.json @@ -0,0 +1,10 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:lightning_strike" + } + }, + "rewards": { + "function": "gm4_furniture:technical/furniture_station/lightning/detect" + } +} diff --git a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction index 635f744a52..f57da5b79e 100644 --- a/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/break/remove_furniture_station.mcfunction @@ -4,5 +4,6 @@ # run from break/destroy setblock ~ ~1 ~ air +fill ~ ~2 ~ ~ ~2 ~ air replace light[level=0] execute as @e[type=villager,tag=gm4_furniture,distance=..4] if score @s gm4_furniture_id = $check_id gm4_furniture_id run tp @s ~ -100000 ~ execute positioned ~-0.4999 ~0.0001 ~-0.4999 run kill @e[type=item_display,tag=gm4_furniture.tool,dx=0,dy=0,dz=0] diff --git a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction index e6cadcd595..f65d2cb816 100644 --- a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction @@ -7,6 +7,7 @@ scoreboard objectives add gm4_furniture_last_hit dummy scoreboard objectives add gm4_furniture_id dummy scoreboard objectives add gm4_furniture_index dummy scoreboard objectives add gm4_furniture_craft_sound_time dummy +scoreboard objectives add gm4_furniture_sit_height dummy scoreboard players set #2 gm4_furniture_data 2 scoreboard players set #16 gm4_furniture_data 16 @@ -23,5 +24,6 @@ execute store result score $max_index gm4_furniture_index run data get storage g scoreboard players remove $max_index gm4_furniture_index 1 schedule function gm4_furniture:main 1t +schedule function gm4_furniture:slow_clock 1t #$moduleUpdateList diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction index 70f6169100..337f6ccd25 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/furniture_station/swap_tool.mcfunction @@ -1,12 +1,19 @@ # get interacting player to sit at this furniture block # @s = furniture's interacted interaction entity -# at @s +# at @s align xyz # run from interact/process +# if furniture station was inactive activate first +execute as @e[type=interaction,tag=gm4_furniture.reactivate,dx=0,dy=0,dz=0] at @s run function gm4_furniture:technical/furniture_station/activation/turn_active + # move index up/down -execute if entity @s[tag=gm4_furniture.next] align xyz run scoreboard players add @e[type=villager,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] gm4_furniture_index 1 -execute if entity @s[tag=gm4_furniture.prev] align xyz run scoreboard players remove @e[type=villager,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] gm4_furniture_index 1 -execute align xyz as @e[type=villager,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep +execute if entity @s[tag=gm4_furniture.next] run scoreboard players add @e[type=villager,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] gm4_furniture_index 1 +execute if entity @s[tag=gm4_furniture.prev] run scoreboard players remove @e[type=villager,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] gm4_furniture_index 1 +execute as @e[type=villager,tag=gm4_furniture.furniture_station,dx=0,dy=0,dz=0,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep + +# store new index on main interaction entity +scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id +execute as @e[type=interaction,tag=gm4_furniture.main,distance=..8] if score @s gm4_furniture_id = $check_id gm4_furniture_id run scoreboard players operation @s gm4_furniture_index = $store_index gm4_furniture_data # mark interaction as resolved scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction index 4354b56b57..b1b89b9697 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction @@ -6,11 +6,14 @@ # first successful interaction will be used, any lower down this list will be ignored scoreboard players set $interaction_processed gm4_furniture_data 0 +# check for reactivating furniture tables +execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.reactivate] run function gm4_furniture:technical/furniture_station/activation/turn_active + # check for waterlogging execute if score $interaction_processed gm4_furniture_data matches 0 if entity @p[tag=gm4_furniture_target,predicate=gm4_furniture:holding_bucket] positioned ~ ~0.5 ~ run function gm4_furniture:interact/waterlog/check # check for furniture station interactions -execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.swap_tool] run function gm4_furniture:interact/furniture_station/swap_tool +execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.swap_tool] align xyz run function gm4_furniture:interact/furniture_station/swap_tool # check for custom interactions execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.custom_interaction] run function gm4_furniture:interact/custom/process @@ -19,7 +22,7 @@ execute if score $interaction_processed gm4_furniture_data matches 0 if entity @ execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.dyable] if entity @p[tag=gm4_furniture_target,predicate=gm4_furniture:holding_paintbrush] run function gm4_furniture:interact/paint/detect # check for sitting -execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.sittable] if entity @p[tag=gm4_furniture_target,predicate=!gm4_furniture:is_sneaking] positioned ~-0.4999 ~0.0001 ~-0.4999 run function gm4_furniture:interact/sit/process +execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[scores={gm4_furniture_sit_height=1..}] if entity @p[tag=gm4_furniture_target,predicate=!gm4_furniture:is_sneaking] positioned ~-0.4999 ~0.0001 ~-0.4999 run function gm4_furniture:interact/sit/find_seat # cleanup data remove entity @s interaction diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sit/check.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/sit/check.mcfunction new file mode 100644 index 0000000000..be6464dd80 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/sit/check.mcfunction @@ -0,0 +1,9 @@ +# check if this seat entity still has an occupant, if not remove it +# @s = furniture's seat item_display entity +# at unspecified +# run from interact/sit/find_seat +# run from slow_clock + +scoreboard players set $keep_seat gm4_furniture_data 0 +execute on passengers run scoreboard players set $keep_seat gm4_furniture_data 1 +execute if score $keep_seat gm4_furniture_data matches 0 run kill @s diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sit/find_seat.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/sit/find_seat.mcfunction new file mode 100644 index 0000000000..a25dfcc7de --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/sit/find_seat.mcfunction @@ -0,0 +1,19 @@ +# get interacting player to sit at this furniture block +# @s = furniture's interacted interaction entity +# at @s +# run from interact/process + +# check if a seat already exists, if so do not allow sitting +execute as @e[type=item_display,tag=gm4_furniture.seat,dx=0,dy=0,dz=0] run function gm4_furniture:interact/sit/check +execute if entity @e[type=item_display,tag=gm4_furniture.seat,dx=0,dy=0,dz=0] run return 0 + +# spawn a seat for the player to sit on +ride @p[tag=gm4_furniture_target] dismount +execute store result storage gm4_furniture:temp sit.height int 1 run scoreboard players get @s gm4_furniture_sit_height +function gm4_furniture:interact/sit/spawn_seat with storage gm4_furniture:temp sit + +# mark interaction as resolved +scoreboard players set $interaction_processed gm4_furniture_data 1 + +# cleanup +data remove storage gm4_furniture:temp sit diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sit/init_seat.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/sit/init_seat.mcfunction new file mode 100644 index 0000000000..67503580af --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/sit/init_seat.mcfunction @@ -0,0 +1,7 @@ +# init seat with data and make player ride it +# @s = furniture's seat item_display entity +# at @s +# run from interact/sit/spawn_seat + +data merge entity @s {Tags:["gm4_furniture","gm4_furniture.seat","smithed.entity","smithed.strict"],item:{id:"air",Count:1},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1f,1f,1f]}} +ride @p[tag=gm4_furniture_target] mount @s diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction deleted file mode 100644 index ac6d735ab5..0000000000 --- a/gm4_furniture/data/gm4_furniture/functions/interact/sit/process.mcfunction +++ /dev/null @@ -1,12 +0,0 @@ -# get interacting player to sit at this furniture block -# @s = furniture's interacted interaction entity -# at @s -# run from interact/process - -# make player ride the linked item_display (if this is not the main interaction entity item_display will be invisible) -# the item_display is offset from the ground to dictate sit height -ride @p[tag=gm4_furniture_target] dismount -ride @p[tag=gm4_furniture_target] mount @e[type=item_display,tag=gm4_furniture,dx=0,dy=0,dz=0,limit=1] - -# mark interaction as resolved -scoreboard players set $interaction_processed gm4_furniture_data 1 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/sit/spawn_seat.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/sit/spawn_seat.mcfunction new file mode 100644 index 0000000000..c1f80f0159 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/interact/sit/spawn_seat.mcfunction @@ -0,0 +1,7 @@ +# spawn the seat in the correct place +# @s = furniture's seat item_display entity +# at @s +# run from interact/sit/find_seat + +# the item_display is offset from the ground to dictate sit height +$execute positioned ~.5 ~.$(height) ~.5 summon item_display run function gm4_furniture:interact/sit/init_seat diff --git a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction index 55d4075c20..289d89aa38 100644 --- a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction @@ -7,8 +7,5 @@ execute as @e[type=horse,nbt={ArmorItems:[{tag:{gm4_furniture:"paintbrush"}}]}] execute as @e[type=interaction,tag=gm4_furniture.on_wall] at @s if block ^ ^0.5 ^-1 #gm4:replaceable run function gm4_furniture:break/lost_connection execute as @e[type=interaction,tag=gm4_furniture.on_ceiling] at @s if block ^ ^1.5 ^ #gm4:replaceable run function gm4_furniture:break/lost_connection -# reapply invisibility to the villagers -effect give @e[type=villager,tag=gm4_furniture.furniture_station] invisibility infinite 0 true - # TEMP: update wandering trader execute as @e[type=wandering_trader,tag=gm4_furniture.furniture_station] at @s run function gm4_furniture:update/update_villager diff --git a/gm4_furniture/data/gm4_furniture/functions/slow_clock.mcfunction b/gm4_furniture/data/gm4_furniture/functions/slow_clock.mcfunction new file mode 100644 index 0000000000..f22f8c6406 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/slow_clock.mcfunction @@ -0,0 +1,7 @@ +schedule function gm4_furniture:slow_clock 10s + +# check seats to see if they are empty +execute as @e[type=item_display,tag=gm4_furniture.seat] run function gm4_furniture:interact/sit/check + +# process furniture stations +execute as @e[type=villager,tag=gm4_furniture.furniture_station] at @s run function gm4_furniture:technical/furniture_station/activation/process diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/process.mcfunction new file mode 100644 index 0000000000..8f68655c3e --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/process.mcfunction @@ -0,0 +1,10 @@ +# process active furniture stations +# @s = furniture station villager +# at @s +# run from slow_clock + +# reapply invisibility in case it was lost +effect give @s invisibility infinite 0 true + +# check if there are still players close to actually trade +execute unless entity @a[distance=..12,gamemode=!spectator] run function gm4_furniture:technical/furniture_station/activation/turn_inactive diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/turn_active.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/turn_active.mcfunction new file mode 100644 index 0000000000..bbc97d6190 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/turn_active.mcfunction @@ -0,0 +1,20 @@ +# turn furniture station on if no player interacted with it +# @s = furniture reactivation interaction entity +# at @s +# run from technical/furniture_station/activation/process +# run frin interact/furniture_station/swap_tool + +# turn tool upright +execute align xyz run data merge entity @e[type=item_display,tag=gm4_furniture.tool_main,dx=0,dy=0,dz=0,limit=1] {interpolation_duration:5,start_interpolation:-1,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.6f,0f],scale:[1f,1f,1f]}} + +# spawn villager and set ids +summon villager ~ ~1000 ~ {VillagerData:{level:99},Invulnerable:1b,Team:"gm4_furniture_nocol",Tags:["gm4_furniture","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.furniture_station","fallback":"Furniture Station"},[{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:offscreen"},{"translate":"gui.gm4.furniture_station","fallback":"","font":"gm4:container_gui","color":"white"},{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:furniture","color":"#404040"}]]}',NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",duration:-1,show_particles:0b},{id:"minecraft:resistance",amplifier:9,duration:-1,show_particles:0b}]} +execute align xyz run tp @e[type=villager,tag=gm4_new_furniture,limit=1] ~.5 ~0.0001 ~.5 +scoreboard players operation @e[type=villager,tag=gm4_new_furniture,limit=1,distance=..4] gm4_furniture_id = @s gm4_furniture_id +scoreboard players operation @e[type=villager,tag=gm4_new_furniture,limit=1,distance=..4] gm4_furniture_index = @s gm4_furniture_index +execute as @e[type=villager,tag=gm4_new_furniture,limit=1,distance=..4] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep +tag @e[type=villager,tag=gm4_new_furniture,limit=1,distance=..4] remove gm4_new_furniture + +# mark interaction as complete and remove interaction entity +scoreboard players set $interaction_processed gm4_furniture_data 1 +kill @s diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/turn_inactive.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/turn_inactive.mcfunction new file mode 100644 index 0000000000..20f4c587bf --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/activation/turn_inactive.mcfunction @@ -0,0 +1,17 @@ +# turn furniture station off if no player is nearby +# @s = furniture station villager +# at @s +# run from technical/furniture_station/activation/process + +# lay down tool +execute align xyz run data merge entity @e[type=item_display,tag=gm4_furniture.tool_main,dx=0,dy=0,dz=0,limit=1] {interpolation_duration:5,start_interpolation:-1,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[-1f,0f,0f,1f],translation:[0f,1.125f,0.9375f],scale:[0.5f,0.5f,0.5f]}} + +# spawn interaction to turn furniture back on again, has villager data +execute positioned ~ ~1 ~ align xyz run summon interaction ~.5 ~-0.0001 ~.5 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.furniture_station","gm4_furniture.reactivate","smithed.entity","smithed.strict","gm4_new_furniture"],height:1.0002f,width:1.0002f,response:1b} +scoreboard players operation @e[type=interaction,tag=gm4_new_furniture,distance=..4,limit=1] gm4_furniture_id = @s gm4_furniture_id +scoreboard players operation @e[type=interaction,tag=gm4_new_furniture,distance=..4,limit=1] gm4_furniture_index = @s gm4_furniture_index +tag @e[type=interaction,tag=gm4_new_furniture,distance=..4] remove gm4_new_furniture + +# remove villager +tp @s ~ ~-10000 ~ +kill @s diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction index 874ddabda1..5c59321a9e 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction @@ -32,3 +32,6 @@ playsound ui.stonecutter.take_result block @a[distance=..16] ~ ~ ~ 1 0.45 # cleanup data remove storage gm4_furniture:temp trades data remove storage gm4_furniture:temp trade_data + +# store index for interaction entity +scoreboard players operation $store_index gm4_furniture_data = @s gm4_furniture_index diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/detect.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/detect.mcfunction new file mode 100644 index 0000000000..e42a9ef524 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/detect.mcfunction @@ -0,0 +1,6 @@ +# Target NoAI witch after lightning strike near player +# @s = player +# at @s +advancement revoke @s only gm4_furniture:lightning + +execute as @e[type=witch,nbt={NoAI:1b}] unless data entity @s Tags at @s if block ~ ~ ~ barrier run function gm4_furniture:technical/furniture_station/lightning/revive_villager diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/get_scores.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/get_scores.mcfunction new file mode 100644 index 0000000000..540ef54927 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/get_scores.mcfunction @@ -0,0 +1,3 @@ + +scoreboard players operation $restore_id gm4_furniture_id = @s gm4_furniture_id +scoreboard players operation $restore_index gm4_furniture_data = @s gm4_furniture_index diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/revive_villager.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/revive_villager.mcfunction new file mode 100644 index 0000000000..073002d382 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/revive_villager.mcfunction @@ -0,0 +1,18 @@ +# Replace witch with villager +# @s = witch that replaced the villager +# at @s +# runs from lightning/tag + +# grab id and index for the new villager +execute align xyz as @e[type=interaction,tag=gm4_furniture.furniture_station,tag=gm4_furniture.main,dx=0,dy=0,dz=0] run function gm4_furniture:technical/furniture_station/lightning/get_scores + +# spawn villager and set ids +summon villager ~ ~1000 ~ {VillagerData:{level:99},Invulnerable:1b,Team:"gm4_furniture_nocol",Tags:["gm4_furniture","gm4_furniture.furniture_station","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.furniture_station","fallback":"Furniture Station"},[{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:offscreen"},{"translate":"gui.gm4.furniture_station","fallback":"","font":"gm4:container_gui","color":"white"},{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:half_invert"},{"translate":"gui.gm4.furniture_station.offset","font":"gm4:container_gui"},{"translate":"container.gm4.furniture_station","fallback":"Furniture Station","font":"gm4:furniture","color":"#404040"}]]}',NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",duration:-1,show_particles:0b},{id:"minecraft:resistance",amplifier:9,duration:-1,show_particles:0b}]} +tp @e[type=villager,tag=gm4_new_furniture,limit=1] ~ ~ ~ +scoreboard players operation @e[type=villager,tag=gm4_new_furniture,limit=1] gm4_furniture_index = $restore_index gm4_furniture_data +execute as @e[type=villager,tag=gm4_new_furniture,limit=1] at @s run function gm4_furniture:technical/furniture_station/build_trades/prep +execute store result score @e[type=villager,tag=gm4_new_furniture] gm4_furniture_id run scoreboard players get $restore_id gm4_furniture_id + +# kill witch +tp @s ~ -10000 ~ +kill @s diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction index 38271a715e..1f54ae9208 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction @@ -8,7 +8,6 @@ scoreboard players set $valid_placement gm4_furniture_data 1 # set variables -scoreboard players set $sittable gm4_furniture_data {{ sittable }} scoreboard players set $dyable gm4_furniture_data {{ dyable }} scoreboard players set $table gm4_furniture_data {{ table }} scoreboard players set $custom_interaction gm4_furniture_data {{ custom_interaction }} @@ -49,7 +48,7 @@ execute if score $valid_placement gm4_furniture_data matches 0 run loot spawn ~ execute if score $valid_placement gm4_furniture_data matches 0 run return 0 # spawn the furniture -execute positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ category }}.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{furniture_id:"{{ category }}/{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} +summon item_display ~ ~-0.4999 ~ {Tags:["gm4_furniture","gm4_furniture.display","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ category }}.{{ technical_id }}"',item:{id:"leather_horse_armor",Count:1,tag:{data:{furniture_id:"{{ category }}/{{ technical_id }}"},CustomModelData:{{ cmd }}}},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.5f,0f],scale:[{{ scale }}f,{{ scale }}f,{{ scale }}f]}} summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.main","smithed.entity","smithed.strict","gm4_new_furniture"],height:1.0002f,width:1.0002f,response:1b} setblock ~ ~ ~ {{ block_id }} @@ -72,10 +71,7 @@ execute if score $dyable gm4_furniture_data matches 1 run data modify entity @e[ execute if score $dyable gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.dyable # if furniture is sittable spawn sitting item_displays at appropiate locations and add tag -execute if score $sittable gm4_furniture_data matches 1.. run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.sittable -scoreboard players set $sit_height gm4_furniture_data 50 -execute if score $sittable gm4_furniture_data matches 1.. store result entity @e[type=item_display,tag=gm4_new_furniture,distance=..2,limit=1,sort=nearest] transformation.translation[1] float 0.01 run scoreboard players operation $sit_height gm4_furniture_data -= $sittable gm4_furniture_data -execute if score $sittable gm4_furniture_data matches 1.. at @e[type=marker,tag=gm4_furniture.marked_block] positioned ~ ~-0.4999 ~ run summon item_display ~ ~0.{{ sittable }} ~ {Tags:["gm4_furniture","gm4_furniture.seat","gm4_furniture.sittable","smithed.entity","smithed.strict","gm4_new_furniture"],CustomName:'"gm4_furniture_display.{{ category }}.{{ technical_id }}_seat"',item:{id:"air",Count:1},item_display:head,Rotation:[0.0f,0.0f],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1f,1f,1f]}} +scoreboard players set @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_sit_height {{ sittable }} # rotate furniture depending on rotation set by player (if rotation is 1 default rotation can be kept) execute if score $rotation gm4_furniture_data matches 2.. as @e[tag=gm4_new_furniture,distance=..8] run data modify entity @s Rotation set from storage gm4_furniture:data Rotation From 782e15097ec970105f6187c88e383d074ef0641d Mon Sep 17 00:00:00 2001 From: Thanathor Date: Tue, 27 Feb 2024 21:04:37 +0100 Subject: [PATCH 25/26] fix missing headers --- .../technical/furniture_station/build_trades/prep.mcfunction | 2 ++ .../furniture_station/lightning/get_scores.mcfunction | 4 ++++ .../furniture_station/lightning/revive_villager.mcfunction | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction index 5c59321a9e..37bfd8f390 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/build_trades/prep.mcfunction @@ -3,6 +3,8 @@ # at @s # run from interact/furniture_station/swap_tool # run from place/furniture/furniture_station +# run from technical/furniture_station/activation/turn_active +# run from technical/furniture_station/lightning/revive_villager # clamp index to min/max execute if score @s gm4_furniture_index matches ..-1 run scoreboard players operation @s gm4_furniture_index = $max_index gm4_furniture_index diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/get_scores.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/get_scores.mcfunction index 540ef54927..a66f87c030 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/get_scores.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/get_scores.mcfunction @@ -1,3 +1,7 @@ +# get scores to restore villager +# @s = furniture main interaction entity +# at @s +# runs from lightning/revive_villager scoreboard players operation $restore_id gm4_furniture_id = @s gm4_furniture_id scoreboard players operation $restore_index gm4_furniture_data = @s gm4_furniture_index diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/revive_villager.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/revive_villager.mcfunction index 073002d382..de6d8fbb1f 100644 --- a/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/revive_villager.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/technical/furniture_station/lightning/revive_villager.mcfunction @@ -1,7 +1,7 @@ # Replace witch with villager # @s = witch that replaced the villager # at @s -# runs from lightning/tag +# runs from lightning/detect # grab id and index for the new villager execute align xyz as @e[type=interaction,tag=gm4_furniture.furniture_station,tag=gm4_furniture.main,dx=0,dy=0,dz=0] run function gm4_furniture:technical/furniture_station/lightning/get_scores From e505b7d0de33801c9248d9fbd9060d30c11539d9 Mon Sep 17 00:00:00 2001 From: Thanathor <73304324+TheThanathor@users.noreply.github.com> Date: Thu, 29 Feb 2024 13:04:25 +0100 Subject: [PATCH 26/26] add updated seating --- .../gm4_furniture/advancements/relog.json | 25 +++++++++++++++++++ .../gm4_furniture/functions/init.mcfunction | 1 + .../functions/interact/process.mcfunction | 6 ++--- .../gm4_furniture/functions/main.mcfunction | 3 --- .../functions/slow_clock.mcfunction | 5 ++++ .../functions/technical/relog.mcfunction | 10 ++++++++ .../functions/update/update_seat.mcfunction | 5 ++++ .../update/update_villager.mcfunction | 2 ++ .../furniture_place_template.mcfunction | 12 ++++----- 9 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 gm4_furniture/data/gm4_furniture/advancements/relog.json create mode 100644 gm4_furniture/data/gm4_furniture/functions/technical/relog.mcfunction create mode 100644 gm4_furniture/data/gm4_furniture/functions/update/update_seat.mcfunction diff --git a/gm4_furniture/data/gm4_furniture/advancements/relog.json b/gm4_furniture/data/gm4_furniture/advancements/relog.json new file mode 100644 index 0000000000..019862a51c --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/advancements/relog.json @@ -0,0 +1,25 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:location", + "conditions": { + "player": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": "this", + "score": "gm4_furniture_relog" + }, + "range": { + "min": 1 + } + } + ] + } + } + }, + "rewards": { + "function": "gm4_furniture:technical/relog" + } +} diff --git a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction index f65d2cb816..701d1085fa 100644 --- a/gm4_furniture/data/gm4_furniture/functions/init.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/init.mcfunction @@ -8,6 +8,7 @@ scoreboard objectives add gm4_furniture_id dummy scoreboard objectives add gm4_furniture_index dummy scoreboard objectives add gm4_furniture_craft_sound_time dummy scoreboard objectives add gm4_furniture_sit_height dummy +scoreboard objectives add gm4_furniture_relog custom:leave_game scoreboard players set #2 gm4_furniture_data 2 scoreboard players set #16 gm4_furniture_data 16 diff --git a/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction b/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction index b1b89b9697..d725e63068 100644 --- a/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/interact/process.mcfunction @@ -15,14 +15,14 @@ execute if score $interaction_processed gm4_furniture_data matches 0 if entity @ # check for furniture station interactions execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.swap_tool] align xyz run function gm4_furniture:interact/furniture_station/swap_tool -# check for custom interactions -execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.custom_interaction] run function gm4_furniture:interact/custom/process - # check for painting execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.dyable] if entity @p[tag=gm4_furniture_target,predicate=gm4_furniture:holding_paintbrush] run function gm4_furniture:interact/paint/detect # check for sitting execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[scores={gm4_furniture_sit_height=1..}] if entity @p[tag=gm4_furniture_target,predicate=!gm4_furniture:is_sneaking] positioned ~-0.4999 ~0.0001 ~-0.4999 run function gm4_furniture:interact/sit/find_seat +# check for custom interactions +execute if score $interaction_processed gm4_furniture_data matches 0 if entity @s[tag=gm4_furniture.custom_interaction] run function gm4_furniture:interact/custom/process + # cleanup data remove entity @s interaction diff --git a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction index 289d89aa38..0014f1e3b5 100644 --- a/gm4_furniture/data/gm4_furniture/functions/main.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/main.mcfunction @@ -6,6 +6,3 @@ execute as @e[type=horse,nbt={ArmorItems:[{tag:{gm4_furniture:"paintbrush"}}]}] # check furniture placements execute as @e[type=interaction,tag=gm4_furniture.on_wall] at @s if block ^ ^0.5 ^-1 #gm4:replaceable run function gm4_furniture:break/lost_connection execute as @e[type=interaction,tag=gm4_furniture.on_ceiling] at @s if block ^ ^1.5 ^ #gm4:replaceable run function gm4_furniture:break/lost_connection - -# TEMP: update wandering trader -execute as @e[type=wandering_trader,tag=gm4_furniture.furniture_station] at @s run function gm4_furniture:update/update_villager diff --git a/gm4_furniture/data/gm4_furniture/functions/slow_clock.mcfunction b/gm4_furniture/data/gm4_furniture/functions/slow_clock.mcfunction index f22f8c6406..83e46fdedd 100644 --- a/gm4_furniture/data/gm4_furniture/functions/slow_clock.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/slow_clock.mcfunction @@ -5,3 +5,8 @@ execute as @e[type=item_display,tag=gm4_furniture.seat] run function gm4_furnitu # process furniture stations execute as @e[type=villager,tag=gm4_furniture.furniture_station] at @s run function gm4_furniture:technical/furniture_station/activation/process + +# TEMP: update wandering trader +execute as @e[type=wandering_trader,tag=gm4_furniture.furniture_station] at @s run function gm4_furniture:update/update_villager +# TEMP: update sittable furniture +execute as @e[type=interaction,tag=gm4_furniture.sittable] run function gm4_furniture:update/update_seat diff --git a/gm4_furniture/data/gm4_furniture/functions/technical/relog.mcfunction b/gm4_furniture/data/gm4_furniture/functions/technical/relog.mcfunction new file mode 100644 index 0000000000..78883c8dbd --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/technical/relog.mcfunction @@ -0,0 +1,10 @@ +# dismount other players sitting on this furniture +# @s = player relogging +# at @s +advancement revoke @s only gm4_furniture:relog + +tag @s add gm4_furniture_target +scoreboard players set $on_seat gm4_furniture_data 0 +execute on vehicle if entity @s[tag=gm4_furniture.seat] run scoreboard players set $on_seat gm4_furniture_data 1 +execute if score $on_seat gm4_furniture_data matches 1 align xyz as @a[dx=0,dy=0,dz=0,gamemode=!spectator,tag=!gm4_furniture_target] run ride @s dismount +tag @s remove gm4_furniture_target diff --git a/gm4_furniture/data/gm4_furniture/functions/update/update_seat.mcfunction b/gm4_furniture/data/gm4_furniture/functions/update/update_seat.mcfunction new file mode 100644 index 0000000000..692f545823 --- /dev/null +++ b/gm4_furniture/data/gm4_furniture/functions/update/update_seat.mcfunction @@ -0,0 +1,5 @@ +# temp +# run from slow_clock + +tag @s remove gm4_furniture.sittable +scoreboard players set @s gm4_furniture_sit_height 50 diff --git a/gm4_furniture/data/gm4_furniture/functions/update/update_villager.mcfunction b/gm4_furniture/data/gm4_furniture/functions/update/update_villager.mcfunction index b0f06ff574..01624c36d2 100644 --- a/gm4_furniture/data/gm4_furniture/functions/update/update_villager.mcfunction +++ b/gm4_furniture/data/gm4_furniture/functions/update/update_villager.mcfunction @@ -1,3 +1,5 @@ +# temp +# run from slow_clock # grab id scoreboard players operation $furniture_id gm4_furniture_id = @s gm4_furniture_id diff --git a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction index 1f54ae9208..9eab22add6 100644 --- a/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction +++ b/gm4_furniture/data/gm4_furniture/templates/functions/furniture_place_template.mcfunction @@ -53,15 +53,15 @@ summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furnit setblock ~ ~ ~ {{ block_id }} # add placement tags -execute if score $wall_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.on_wall -execute if score $ceiling_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.on_ceiling +execute if score $wall_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.on_wall +execute if score $ceiling_only gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.on_ceiling # spawn extensions if they exist execute at @e[type=marker,tag=gm4_furniture.marked_block] run summon interaction ~-0.0001 ~-0.5001 ~-0.0001 {Tags:["gm4_furniture","gm4_furniture.interaction","gm4_furniture.additional","smithed.entity","smithed.strict","gm4_new_furniture"],height:1.0002f,width:1.0002f,response:1b} execute at @e[type=marker,tag=gm4_furniture.marked_block] run setblock ~ ~ ~ {{ block_id }} # add custom interaction tags -execute if score $custom_interaction gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture] add gm4_furniture.custom_interaction +execute if score $custom_interaction gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.custom_interaction # if furniture is a table reduce interaction height execute if score $table gm4_furniture_data matches 1 as @e[type=interaction,tag=gm4_new_furniture,distance=..8] run data modify entity @s height set value 1f @@ -71,15 +71,15 @@ execute if score $dyable gm4_furniture_data matches 1 run data modify entity @e[ execute if score $dyable gm4_furniture_data matches 1 run tag @e[type=interaction,tag=gm4_new_furniture,distance=..8] add gm4_furniture.dyable # if furniture is sittable spawn sitting item_displays at appropiate locations and add tag -scoreboard players set @e[type=interaction,tag=gm4_new_furniture] gm4_furniture_sit_height {{ sittable }} +scoreboard players set @e[type=interaction,tag=gm4_new_furniture,distance=..8] gm4_furniture_sit_height {{ sittable }} # rotate furniture depending on rotation set by player (if rotation is 1 default rotation can be kept) execute if score $rotation gm4_furniture_data matches 2.. as @e[tag=gm4_new_furniture,distance=..8] run data modify entity @s Rotation set from storage gm4_furniture:data Rotation # mark block as placed and set id playsound minecraft:block.barrel.close block @a[distance=..6] ~ ~ ~ 1 1.6 -execute store result score @e[tag=gm4_new_furniture] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 -tag @e[tag=gm4_new_furniture] remove gm4_new_furniture +execute store result score @e[tag=gm4_new_furniture,distance=..8] gm4_furniture_id run scoreboard players add $next_id gm4_furniture_id 1 +tag @e[tag=gm4_new_furniture,distance=..8] remove gm4_new_furniture # cleanup kill @e[type=marker,tag=gm4_furniture.marked_block]