Skip to content

Commit

Permalink
Add support for trapped hanging signs
Browse files Browse the repository at this point in the history
  • Loading branch information
misode committed Oct 31, 2023
1 parent 3c85f6e commit added43
Show file tree
Hide file tree
Showing 58 changed files with 215 additions and 1,384 deletions.
1 change: 1 addition & 0 deletions gm4_trapped_signs/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ data_pack:
load: .

pipeline:
- gm4_trapped_signs.generate_types
- gm4.plugins.extend.module
- gm4.plugins.include.lib_custom_crafters
- gm4.plugins.include.lib_machines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,18 @@ execute if block ~ ~ ~ #minecraft:wall_signs[facing=west] run fill ~1 ~-2 ~ ~1 ~
execute if block ~ ~ ~ #minecraft:wall_signs[facing=east] run fill ~-1 ~ ~1 ~-1 ~ ~-1 redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:wall_signs[facing=east] run fill ~-2 ~ ~ ~-2 ~ ~ redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:wall_signs[facing=east] run fill ~-1 ~-2 ~ ~-1 ~1 ~ redstone_wire[power=1] replace redstone_wire[power=0]

execute if block ~ ~ ~ #minecraft:ceiling_hanging_signs run fill ~-1 ~ ~ ~1 ~ ~ redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:ceiling_hanging_signs run fill ~ ~ ~-1 ~ ~ ~1 redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:ceiling_hanging_signs run fill ~ ~-1 ~ ~ ~2 ~ redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs run fill ~-1 ~ ~-1 ~1 ~ ~1 redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs run fill ~-1 ~1 ~ ~1 ~1 ~ redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs run fill ~ ~1 ~-1 ~ ~1 ~1 redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs run fill ~ ~2 ~ ~ ~2 ~ redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs[facing=north] run fill ~-2 ~ ~ ~2 ~ ~ redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs[facing=south] run fill ~-2 ~ ~ ~2 ~ ~ redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs[facing=east] run fill ~ ~ ~-2 ~ ~ ~2 redstone_wire[power=1] replace redstone_wire[power=0]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs[facing=west] run fill ~ ~ ~-2 ~ ~ ~2 redstone_wire[power=1] replace redstone_wire[power=0]

tag @s add gm4_trapped_signs_pulsed
tag @s remove gm4_trapped_signs_need_pulse
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# @s = trapped sign
# run from process
# run from process_uncompleted

execute if entity @s[tag=!gm4_secret_trapped_sign] run data modify block ~ ~ ~ front_text.messages[3] set value '{"text":"-*-","bold":false,"italic":false,"underlined":false,"color":"black","clickEvent":{"action":"run_command","value":"function gm4_trapped_signs:pulse"}}'
execute if entity @s[tag=gm4_secret_trapped_sign] run data modify block ~ ~ ~ front_text.messages[3] set value '{"text":"","bold":false,"italic":false,"underlined":false,"color":"black","clickEvent":{"action":"run_command","value":"function gm4_trapped_signs:pulse"}}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,17 @@ execute if block ~ ~ ~ #minecraft:wall_signs[facing=west] run fill ~2 ~ ~ ~2 ~ ~
execute if block ~ ~ ~ #minecraft:wall_signs[facing=east] run fill ~-1 ~-2 ~ ~-1 ~1 ~ redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:wall_signs[facing=east] run fill ~-2 ~ ~ ~-2 ~ ~ redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:wall_signs[facing=east] run fill ~-1 ~ ~1 ~-1 ~ ~-1 redstone_wire[power=0] replace redstone_wire[power=1]

execute if block ~ ~ ~ #minecraft:ceiling_hanging_signs run fill ~-1 ~ ~ ~1 ~ ~ redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:ceiling_hanging_signs run fill ~ ~ ~-1 ~ ~ ~1 redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:ceiling_hanging_signs run fill ~ ~-1 ~ ~ ~2 ~ redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs run fill ~-1 ~ ~-1 ~1 ~ ~1 redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs run fill ~-1 ~1 ~ ~1 ~1 ~ redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs run fill ~ ~1 ~-1 ~ ~1 ~1 redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs run fill ~ ~2 ~ ~ ~2 ~ redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs[facing=north] run fill ~-2 ~ ~ ~2 ~ ~ redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs[facing=south] run fill ~-2 ~ ~ ~2 ~ ~ redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs[facing=east] run fill ~ ~ ~-2 ~ ~ ~2 redstone_wire[power=0] replace redstone_wire[power=1]
execute if block ~ ~ ~ #minecraft:wall_hanging_signs[facing=west] run fill ~ ~ ~-2 ~ ~ ~2 redstone_wire[power=0] replace redstone_wire[power=1]

tag @s remove gm4_trapped_signs_pulsed

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Assigns a tag to the marker, used to drop the correct item after destroying the sign
# @s = raycast marker
# located at the center of the placed sign
# run from machine/create_secret_trapped_sign and machine/create_trapped_sign

# The order of the tag name is inconsistent, but it stays like this for backwards compatibility
execute if block ~ ~ ~ #gm4_trapped_signs:acacia_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_acacia_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:bamboo_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_bamboo_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:birch_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_birch_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:cherry_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_cherry_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:crimson_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_crimson_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:dark_oak_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_dark_oak_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:jungle_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_jungle_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:mangrove_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_mangrove_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:oak_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_oak_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:spruce_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_spruce_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:warped_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_warped_trapped_sign

execute if block ~ ~ ~ #gm4_trapped_signs:acacia_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_acacia_hanging_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:bamboo_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_bamboo_hanging_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:birch_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_birch_hanging_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:cherry_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_cherry_hanging_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:crimson_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_crimson_hanging_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:dark_oak_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_dark_oak_hanging_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:jungle_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_jungle_hanging_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:mangrove_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_mangrove_hanging_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:oak_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_oak_hanging_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:spruce_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_spruce_hanging_trapped_sign
execute if block ~ ~ ~ #gm4_trapped_signs:warped_hanging_signs run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_warped_hanging_trapped_sign
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,7 @@
summon marker ~ ~ ~ {Tags:["gm4_trapped_sign","gm4_secret_trapped_sign","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:'"gm4_secret_trapped_sign"'}
scoreboard players set @e[type=marker,tag=gm4_trapped_sign,tag=gm4_new_machine,distance=..0.1,limit=1] gm4_entity_version 1

execute if block ~ ~ ~ acacia_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_acacia_trapped_sign
execute if block ~ ~ ~ acacia_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_acacia_trapped_sign
execute if block ~ ~ ~ birch_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_birch_trapped_sign
execute if block ~ ~ ~ birch_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_birch_trapped_sign
execute if block ~ ~ ~ crimson_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_crimson_trapped_sign
execute if block ~ ~ ~ crimson_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_crimson_trapped_sign
execute if block ~ ~ ~ dark_oak_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_dark_oak_trapped_sign
execute if block ~ ~ ~ dark_oak_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_dark_oak_trapped_sign
execute if block ~ ~ ~ jungle_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_jungle_trapped_sign
execute if block ~ ~ ~ jungle_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_jungle_trapped_sign
execute if block ~ ~ ~ spruce_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_spruce_trapped_sign
execute if block ~ ~ ~ spruce_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_spruce_trapped_sign
execute if block ~ ~ ~ warped_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_warped_trapped_sign
execute if block ~ ~ ~ warped_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_warped_trapped_sign
function gm4_trapped_signs:machine/assign_tag

tag @e[type=marker,distance=..0.1] remove gm4_new_machine
kill @s
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,10 @@
# located at the center of the placed sign
# run from place_trapped_sign

summon marker ~ ~ ~ {Tags:["gm4_trapped_sign","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:'"gm4_secret_trapped_sign"'}
summon marker ~ ~ ~ {Tags:["gm4_trapped_sign","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:'"gm4_trapped_sign"'}
scoreboard players set @e[type=marker,tag=gm4_trapped_sign,tag=gm4_new_machine,distance=..0.1,limit=1] gm4_entity_version 1

execute if block ~ ~ ~ acacia_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_acacia_trapped_sign
execute if block ~ ~ ~ acacia_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_acacia_trapped_sign
execute if block ~ ~ ~ birch_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_birch_trapped_sign
execute if block ~ ~ ~ birch_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_birch_trapped_sign
execute if block ~ ~ ~ crimson_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_crimson_trapped_sign
execute if block ~ ~ ~ crimson_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_crimson_trapped_sign
execute if block ~ ~ ~ dark_oak_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_dark_oak_trapped_sign
execute if block ~ ~ ~ dark_oak_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_dark_oak_trapped_sign
execute if block ~ ~ ~ jungle_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_jungle_trapped_sign
execute if block ~ ~ ~ jungle_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_jungle_trapped_sign
execute if block ~ ~ ~ spruce_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_spruce_trapped_sign
execute if block ~ ~ ~ spruce_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_spruce_trapped_sign
execute if block ~ ~ ~ warped_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_warped_trapped_sign
execute if block ~ ~ ~ warped_wall_sign run tag @e[type=marker,tag=gm4_new_machine,limit=1,distance=..0.1] add gm4_warped_trapped_sign
function gm4_trapped_signs:machine/assign_tag

tag @e[type=marker,distance=..0.1] remove gm4_new_machine
kill @s
Loading

0 comments on commit added43

Please sign in to comment.