Skip to content

Commit 00d9f9e

Browse files
authored
Teleportation Anchors: replace display armor stand with item display (#1269)
* Teleportation Anchors: replace display armor stand with item display * Shift item displays to center of block * Update destroy_anchor.mcfunction with TODO reminder * Update destroy_jammer.mcfunction with TODO reminder * yipee credit * revert version bump
1 parent 1d4d901 commit 00d9f9e

8 files changed

Lines changed: 78 additions & 9 deletions

File tree

gm4_teleportation_anchors/beet.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,7 @@ meta:
6464
credits:
6565
Creator:
6666
- BPR
67+
Updated By:
68+
- runcows
6769
Icon Design:
6870
- Hozz

gm4_teleportation_anchors/data/gm4_teleportation_anchors/function/machine/create_anchor.mcfunction

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,23 @@
33
# located at the center of the placed block
44
# run from gm4_teleportation_anchors:machine/verify_place_down
55

6-
# place dropper
6+
# place lodestone
77
setblock ~ ~ ~ lodestone
88

9-
# summon display armor stand and marker entity
10-
summon armor_stand ~ ~-0.4 ~ {Small:1b,NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,DisabledSlots:2039552,Tags:["gm4_no_edit","gm4_teleportation_anchor_stand","gm4_machine_stand","smithed.entity","smithed.strict","gm4_new_machine"],HasVisualFire:1b,CustomName:"gm4_teleportation_anchor_stand",equipment:{head:{id:"end_portal_frame",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_teleportation_anchors:block/teleportation_anchor"]}}}},Rotation:[0.0f,0.0f]}
9+
# summon display and marker entity
10+
summon minecraft:item_display ~ ~ ~ {\
11+
CustomName:"gm4_teleportation_anchor_display",\
12+
Tags:["gm4_no_edit","gm4_teleportation_anchor_display","gm4_machine_display","smithed.entity","smithed.strict","gm4_new_machine"],\
13+
item:{id:"end_portal_frame",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_teleportation_anchors:block/teleportation_anchor"]}}},\
14+
item_display:head,\
15+
brightness:{sky:15,block:15},\
16+
Rotation:[0.0f,0.0f],\
17+
transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.501f,0f],scale:[0.438,0.438,0.438]}\
18+
}
1119
summon marker ~ ~ ~ {Tags:["gm4_teleportation_anchor","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:"gm4_teleportation_anchor",Rotation:[0.0f,0.0f]}
1220

1321
# mark block as placed
1422
playsound minecraft:block.end_portal.spawn block @a[distance=..8] ~ ~ ~ 0.3 1.8
1523
scoreboard players set $placed_block gm4_machine_data 1
16-
scoreboard players set @e[distance=..2,tag=gm4_new_machine] gm4_entity_version 1
24+
scoreboard players set @e[distance=..2,tag=gm4_new_machine] gm4_entity_version 2
1725
tag @e[distance=..2] remove gm4_new_machine

gm4_teleportation_anchors/data/gm4_teleportation_anchors/function/machine/create_jammer.mcfunction

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@
66
# place dropper
77
setblock ~ ~ ~ dropper[facing=up]{CustomName:{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.teleportation_jammer","fallback":"Teleportation Jammer"},[{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.teleportation_jammer","fallback":"Teleportation Jammer","font":"gm4:half_invert"},{"translate":"container.gm4.teleportation_jammer","fallback":"Teleportation Jammer","font":"gm4:offscreen"},{"translate":"gui.gm4.teleportation_jammer","fallback":"","font":"gm4:container_gui","color":"white"},{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.teleportation_jammer","fallback":"Teleportation Jammer","font":"gm4:half_invert"},{"translate":"container.gm4.teleportation_jammer","fallback":"Teleportation Jammer","font":"gm4:default","color":"#404040"}]]}}
88

9-
# summon display armor stand and marker entity
10-
summon armor_stand ~ ~-0.4 ~ {Small:1b,NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,DisabledSlots:2039552,Tags:["gm4_no_edit","gm4_teleportation_jammer_stand","gm4_machine_stand","smithed.entity","smithed.strict","gm4_new_machine"],HasVisualFire:1b,CustomName:"gm4_teleportation_jammer_stand",equipment:{head:{id:"purpur_pillar",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_teleportation_anchors:block/teleportation_jammer"]}}}},Rotation:[0.0f,0.0f]}
9+
# summon display and marker entity
10+
summon minecraft:item_display ~ ~ ~ {\
11+
CustomName:"gm4_teleportation_jammer_display",\
12+
Tags:["gm4_no_edit","gm4_teleportation_jammer_display","gm4_machine_display","smithed.entity","smithed.strict","gm4_new_machine"],\
13+
item:{id:"purpur_pillar",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_teleportation_anchors:block/teleportation_jammer"]}}},\
14+
item_display:head,\
15+
brightness:{sky:15,block:15},\
16+
Rotation:[0.0f,0.0f],\
17+
transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.501f,0f],scale:[0.438,0.438,0.438]}\
18+
}
1119
summon marker ~ ~ ~ {Tags:["gm4_teleportation_jammer","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:"gm4_teleportation_jammer",Rotation:[0.0f,0.0f]}
1220

1321
# set id
@@ -17,5 +25,5 @@ execute store result score @e[type=marker,tag=gm4_new_machine,limit=1,distance=.
1725
playsound minecraft:block.chorus_flower.death block @a[distance=..8] ~ ~ ~ 100 1.3
1826
playsound minecraft:block.beacon.power_select block @a[distance=..8] ~ ~ ~ 0.3 0.3
1927
scoreboard players set $placed_block gm4_machine_data 1
20-
scoreboard players set @e[distance=..2,tag=gm4_new_machine] gm4_entity_version 1
28+
scoreboard players set @e[distance=..2,tag=gm4_new_machine] gm4_entity_version 2
2129
tag @e[distance=..2] remove gm4_new_machine

gm4_teleportation_anchors/data/gm4_teleportation_anchors/function/machine/destroy_anchor.mcfunction

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
# located at @s
44
# run from gm4_teleportation_anchors:machine/verify_destroy
55

6-
# kill entities related to machine block
6+
# legacy armor stand clean up - TODO: remove this when we stop supporting the upgrade path
77
execute positioned ~ ~-0.4 ~ run kill @e[type=armor_stand,tag=gm4_teleportation_anchor_stand,limit=1,distance=..0.01]
8+
# kill entities related to machine block
9+
kill @e[type=item_display,tag=gm4_teleportation_anchor_display,limit=1,distance=..0.01]
810
execute store result score $dropped_item gm4_machine_data run kill @e[type=item,distance=..1,nbt={Age:0s,Item:{id:"minecraft:lodestone",count:1}},nbt=!{Item:{components:{}}},limit=1,sort=nearest]
911
kill @s
1012

gm4_teleportation_anchors/data/gm4_teleportation_anchors/function/machine/destroy_jammer.mcfunction

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
# located at @s
44
# run from gm4_teleportation_anchors:machine/verify_destroy
55

6-
# kill entities related to machine block
6+
# legacy armor stand cleanup - TODO: remove this when we stop supporting the upgrade path
77
execute positioned ~ ~-0.4 ~ run kill @e[type=armor_stand,tag=gm4_teleportation_jammer_stand,limit=1,distance=..0.01]
8+
# kill entities related to machine block
9+
kill @e[type=item_display,tag=gm4_teleportation_jammer_display,limit=1,distance=..0.01]
810
execute store result score $dropped_item gm4_machine_data run kill @e[type=item,distance=..1,nbt={Age:0s,Item:{id:"minecraft:dropper",count:1,components:{}}},limit=1,sort=nearest]
911
kill @s
1012

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# @s = player
2+
# at @s
3+
# run via upgrade paths util
4+
5+
execute as @e[type=minecraft:armor_stand,tag=gm4_teleportation_anchor_stand] at @s positioned ~ ~0.4 ~ \
6+
run function gm4_teleportation_anchors:upgrade_paths/1.7/create_item_display_anchor
7+
8+
execute as @e[type=minecraft:armor_stand,tag=gm4_teleportation_jammer_stand] at @s positioned ~ ~0.4 ~ \
9+
run function gm4_teleportation_anchors:upgrade_paths/1.7/create_item_display_jammer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# @s = gm4_teleportation_anchor_stand armor stand
2+
# at center of block
3+
# run from upgrade_paths/1.7
4+
5+
summon minecraft:item_display ~ ~ ~ {\
6+
CustomName:"gm4_teleportation_anchor_display",\
7+
Tags:["gm4_no_edit","gm4_teleportation_anchor_display","gm4_machine_display","smithed.entity","smithed.strict"],\
8+
item:{id:"end_portal_frame",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_teleportation_anchors:block/teleportation_anchor"]}}},\
9+
item_display:head,\
10+
brightness:{sky:15,block:15},\
11+
Rotation:[0.0f,0.0f],\
12+
transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.501f,0f],scale:[0.438,0.438,0.438]}\
13+
}
14+
15+
# entity version
16+
scoreboard players set @e[type=item_display,tag=gm4_teleportation_anchor_display,distance=..0.01,limit=1] gm4_entity_version 2
17+
scoreboard players set @e[type=marker,tag=gm4_teleportation_anchor,distance=..0.01,limit=1] gm4_entity_version 2
18+
19+
kill @s
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# @s = gm4_teleportation_jammer_stand armor stand
2+
# at center of block
3+
# run from upgrade_paths/1.7
4+
5+
summon minecraft:item_display ~ ~ ~ {\
6+
CustomName:"gm4_teleportation_jammer_display",\
7+
Tags:["gm4_no_edit","gm4_teleportation_jammer_display","gm4_machine_display","smithed.entity","smithed.strict"],\
8+
item:{id:"purpur_pillar",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_teleportation_anchors:block/teleportation_jammer"]}}},\
9+
item_display:head,\
10+
brightness:{sky:15,block:15},\
11+
Rotation:[0.0f,0.0f],\
12+
transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.501f,0f],scale:[0.438,0.438,0.438]}\
13+
}
14+
15+
# entity version
16+
scoreboard players set @e[type=item_display,tag=gm4_teleportation_jammer_display,distance=..0.01,limit=1] gm4_entity_version 2
17+
scoreboard players set @e[type=marker,tag=gm4_teleportation_jammer,distance=..0.01,limit=1] gm4_entity_version 2
18+
19+
kill @s

0 commit comments

Comments
 (0)