Skip to content

Commit 8acafaa

Browse files
committed
Custom placement improvements
1 parent fdbf439 commit 8acafaa

5 files changed

Lines changed: 4 additions & 14 deletions

File tree

gm4_furniture/data/gm4_furniture/function/place/custom/furniture/metal_set/iron.spotlight.mcfunction

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# custom placement
22
# @s = player who placed the furniture player head
33
# at the center of the placed block rotated along axis to face towards player or away from the wall
4-
# run from place/custom/resolve_id
4+
# run from place/furniture/metal_set/iron.spotlight (generated)
55

66
# set main display to base
77
data modify entity @n[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.display,limit=1,distance=..1] item.components merge value {"minecraft:item_model":"gm4_furniture:metal_set/iron/spotlight/default/base","custom_data":{gm4_furniture:{lit:1}}}
@@ -17,5 +17,3 @@ execute if predicate gm4_furniture:is_sneaking run summon item_display ~ ~0.0625
1717
# rotate
1818
rotate @n[type=item_display,tag=gm4_furniture.display_2,tag=gm4_new_furniture,distance=..1] facing entity @s eyes
1919
rotate @n[type=item_display,tag=gm4_furniture.display_3,tag=gm4_new_furniture,distance=..1] facing entity @s eyes
20-
# assign ids to additional displays
21-
execute as @e[type=item_display,tag=gm4_furniture.additional_display,tag=gm4_new_furniture,distance=..1] store result score @s gm4_furniture_id run scoreboard players get @n[type=item_display,tag=gm4_new_furniture,tag=gm4_furniture.display,limit=1,distance=..1] gm4_furniture_id
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# custom placement
22
# @s = player who placed the furniture player head
33
# at the center of the placed block rotated along axis to face towards player or away from the wall
4-
# run from place/custom/resolve_id
4+
# run from place/furniture/stone_set/lantern_2 (generated)
55

66
setblock ~ ~ ~ barrier
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# custom placement
22
# @s = player who placed the furniture player head
33
# at the center of the placed block rotated along axis to face towards player or away from the wall
4-
# run from place/custom/resolve_id
4+
# run from place/furniture/stone_set/lantern_big_1 (generated)
55

66
setblock ~ ~ ~ barrier
77
setblock ~ ~1 ~ barrier

gm4_furniture/data/gm4_furniture/function/place/custom/resolve_id.mcfunction

Lines changed: 0 additions & 7 deletions
This file was deleted.

gm4_furniture/data/gm4_furniture/template/function/furniture_place_template.mcfunction

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ scoreboard players set @e[type=interaction,tag=gm4_new_furniture,distance=..8] g
8383
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
8484

8585
# custom placement
86-
execute if score $custom_placement gm4_furniture_data matches 1 run function gm4_furniture:place/custom/resolve_id {furniture_id:"{{ category }}/{{ technical_id }}"}
87-
86+
execute if score $custom_placement gm4_furniture_data matches 1 run function gm4_furniture:place/custom/furniture/{{ category }}/{{ technical_id }}
8887

8988
# mark block as placed and set id
9089
playsound minecraft:block.barrel.close block @a[distance=..6] ~ ~ ~ 1 1.6

0 commit comments

Comments
 (0)