Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gm4_disassemblers/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ meta:
versioning:
required:
lib_machines: 1.4.0
lib_forceload: 1.5.0
schedule_loops: [main]
model_data:
- item: player_head
Expand Down Expand Up @@ -77,6 +78,7 @@ meta:
Updated by:
- Federick90
- BPR
- runcows
Textures by:
- Kyrius
Icon Design:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# processes each item
# @s = armor stand display (we need the hand) [tag=gm4_disassembler_stand]
# @s = force load chunk armor stand (we need the hand)
# located at the disassembler block
# run from gm4_disassemblers:check_item (#gm4_disassemblers:during_base)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# processes each item
# @s = armor stand display (we need the hand) [tag=gm4_disassembler_stand]
# @s = force load chunk armor stand (we need the hand)
# located at the disassembler block
# run from process

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
# run from gm4_disassemblers:machine/verify_place_down

# place block depending on rotation
execute if score $rotation gm4_machine_data matches 1 run function gm4_disassemblers:machine/rotate/down
execute if score $rotation gm4_machine_data matches 2 run function gm4_disassemblers:machine/rotate/up
execute if score $rotation gm4_machine_data matches 3 run function gm4_disassemblers:machine/rotate/south
execute if score $rotation gm4_machine_data matches 4 run function gm4_disassemblers:machine/rotate/west
execute if score $rotation gm4_machine_data matches 5 run function gm4_disassemblers:machine/rotate/north
execute if score $rotation gm4_machine_data matches 6 run function gm4_disassemblers:machine/rotate/east
execute if score $rotation gm4_machine_data matches 1 run data modify storage gm4_disassemblers:temp placement set value {facing:"down",rotation:[180.0f,0.0f],model:"gm4_disassemblers:block/disassembler_down"}
execute if score $rotation gm4_machine_data matches 2 run data modify storage gm4_disassemblers:temp placement set value {facing:"up",rotation:[0.0f,0.0f],model:"gm4_disassemblers:block/disassembler"}
execute if score $rotation gm4_machine_data matches 3 run data modify storage gm4_disassemblers:temp placement set value {facing:"south",rotation:[0.0f,0.0f],model:"gm4_disassemblers:block/disassembler_side"}
execute if score $rotation gm4_machine_data matches 4 run data modify storage gm4_disassemblers:temp placement set value {facing:"west",rotation:[90.0f,0.0f],model:"gm4_disassemblers:block/disassembler_side"}
execute if score $rotation gm4_machine_data matches 5 run data modify storage gm4_disassemblers:temp placement set value {facing:"north",rotation:[180.0f,0.0f],model:"gm4_disassemblers:block/disassembler_side"}
execute if score $rotation gm4_machine_data matches 6 run data modify storage gm4_disassemblers:temp placement set value {facing:"east",rotation:[-90.0f,0.0f],model:"gm4_disassemblers:block/disassembler_side"}

function gm4_disassemblers:machine/place_rotated with storage gm4_disassemblers:temp placement

data remove storage gm4_disassemblers:temp placement

# mark block as placed
playsound minecraft:block.anvil.place master @a ~ ~ ~ 0.9 0.1
scoreboard players set $placed_block gm4_machine_data 1
scoreboard players set @e[distance=..2,tag=gm4_new_machine] gm4_entity_version 1
scoreboard players set @e[distance=..2,tag=gm4_new_machine] gm4_entity_version 2
tag @e[distance=..2] remove gm4_new_machine
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
# located at @s
# run from gm4_disassemblers:machine/verify_destroy

# kill entities related to machine block
# kill legacy armor stand - TODO: remove this when we no longer support the upgrade path
execute positioned ~ ~-0.4 ~ run kill @e[type=armor_stand,tag=gm4_disassembler_stand,limit=1,distance=..0.01]
# kill entities related to machine block
kill @e[type=item_display,tag=gm4_disassembler_display,limit=1,distance=..0.01]
Comment thread
runcows marked this conversation as resolved.
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]
kill @s

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# places the disassembler down based on rotation
# @s = player who placed the disassembler
# located at the center of the placed block
# with {facing, rotation, model}
# run from gm4_disassemblers:machine/create

# place dropper
$setblock ~ ~ ~ dropper[facing=$(facing)]
data merge block ~ ~ ~ {CustomName:{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.disassembler","fallback":"Disassembler"},[{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.disassembler","fallback":"Disassembler","font":"gm4:half_invert"},{"translate":"container.gm4.disassembler","fallback":"Disassembler","font":"gm4:offscreen"},{"translate":"gui.gm4.disassembler","fallback":"","font":"gm4:container_gui","color":"white"},{"text":" ","font":"gm4:half_invert"},{"translate":"container.gm4.disassembler","fallback":"Disassembler","font":"gm4:half_invert"},{"translate":"container.gm4.disassembler","fallback":"Disassembler","font":"gm4:default","color":"#404040"}]]}}

# summon display and marker entity
$summon item_display ~ ~ ~ {\
CustomName:"gm4_disassembler_display",\
Tags:["gm4_no_edit","gm4_disassembler_display","gm4_machine_display","smithed.entity","smithed.strict","gm4_new_machine"],\
item:{id:"minecraft:tnt",count:1,components:{"minecraft:custom_model_data":{"strings":["$(model)"]}}},\
item_display:head,\
brightness:{sky:15,block:15},\
Rotation:$(rotation),\
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]}\
}

$summon marker ~ ~ ~ {Tags:["gm4_disassembler","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:"gm4_disassembler",Rotation:$(rotation)}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# run from main

data modify storage gm4_disassemblers:temp Items set from block ~ ~ ~ Items
execute if data storage gm4_disassemblers:temp Items[0] unless data storage gm4_disassemblers:temp Items[1] positioned ~ ~-0.4 ~ as @e[type=armor_stand,tag=gm4_disassembler_stand,limit=1,distance=..0.01] positioned ~ ~0.4 ~ run function gm4_disassemblers:check_item
execute if data storage gm4_disassemblers:temp Items[0] unless data storage gm4_disassemblers:temp Items[1] as 344d47-4-4-4-f04ce104d run function gm4_disassemblers:check_item
Comment thread
misode marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# @s = player
# at @s
# run via upgrade paths util

execute as @e[type=armor_stand,tag=gm4_disassembler_stand] at @s positioned ~ ~0.4 ~ \
run function gm4_disassemblers:upgrade_paths/2.6/item_display
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should start adding random line continuations like these. Mcfunctions always have had very long lines so your editor should already be wrapping lines imo.

Copy link
Copy Markdown
Contributor Author

@runcows runcows Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have bad news for you. I've done this in many places that are already merged 😅

It's also not entirely random, I mainly use it to separate out the execute sub commands from the command that gets run at the end

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# @s = gm4_disassembler_stand armor stand
# at center of disassembler
# run from upgrade_paths/2.6

summon item_display ~ ~ ~ {\
CustomName:"gm4_disassembler_display",\
Tags:["gm4_no_edit","gm4_disassembler_display","gm4_machine_display","smithed.entity","smithed.strict"],\
item:{id:"minecraft:tnt",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_disassemblers:block/disassembler_down"]}}},\
item_display:head,\
brightness:{sky:15,block:15},\
Rotation:[0.0f,0.0f],\
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]}\
}
# transfer data, increment entity version number
data modify entity @e[type=item_display,tag=gm4_disassembler_display,limit=1,distance=..0.01] item.components."minecraft:custom_model_data" set from entity @s equipment.head.components."minecraft:custom_model_data"
data modify entity @e[type=item_display,tag=gm4_disassembler_display,limit=1,distance=..0.01] Rotation set from entity @s Rotation
scoreboard players set @e[type=item_display,tag=gm4_disassembler_display,limit=1,distance=..0.01] gm4_entity_version 2
scoreboard players set @e[type=marker,tag=gm4_disassembler,limit=1,distance=..0.01] gm4_entity_version 2

kill @s
Loading