Skip to content
Open
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
1 change: 1 addition & 0 deletions gm4_smelteries/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ meta:
- Misode
- SpecialBuilder32
- BPR
- runcows
Textures By:
- Kyrius
Icon Design:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# run smeltery in lit state
# @s = smeltery marker
# at @s
# run from process

execute unless entity @s[tag=gm4_smeltery_lit] positioned ~ ~-0.3 ~ run item replace entity @e[type=armor_stand,tag=gm4_smeltery_stand,distance=..0.1,limit=1] armor.head with iron_block[custom_model_data={strings:["gm4_smelteries:block/smeltery_lit"]}]
execute unless entity @s[tag=gm4_smeltery_lit] run item replace entity @e[type=item_display,tag=gm4_smeltery_display,distance=..0.1,limit=1] contents with iron_block[custom_model_data={strings:["gm4_smelteries:block/smeltery_lit"]}]
tag @s add gm4_smeltery_lit

particle large_smoke ~ ~ ~ 0 0.3 0 0 5 normal @a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# set smeltery to unlit state
# @s = smeltery marker
# at @s
# run from process

execute positioned ~ ~-0.3 ~ run item replace entity @e[type=armor_stand,tag=gm4_smeltery_stand,distance=..0.1,limit=1] armor.head with iron_block[custom_model_data={strings:["gm4_smelteries:block/smeltery_unlit"]}]
execute positioned ^ ^-1.5 ^-1 run item replace entity @e[type=armor_stand,tag=gm4_smeltery_cauldron,distance=..0.1,limit=1] armor.head with air
item replace entity @e[type=item_display,tag=gm4_smeltery_display,distance=..0.1,limit=1] contents with iron_block[custom_model_data={strings:["gm4_smelteries:block/smeltery_unlit"]}]
item replace entity @e[type=item_display,tag=gm4_smeltery_cauldron,distance=..0.1,limit=1] contents with air
tag @s remove gm4_smeltery_lit
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
scoreboard objectives add gm4_smelt_data dummy
scoreboard objectives add gm4_smelt_id dummy

execute unless score smelteries gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Smelteries"}
execute unless score smelteries gm4_earliest_version < smelteries gm4_modules run scoreboard players operation smelteries gm4_earliest_version = smelteries gm4_modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
# run from gm4_smelteries:machine/verify_place_down

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

# link cauldron stand to smeltery marker
execute store result score $new gm4_smelt_id run data get entity @e[type=marker,distance=..0.1,tag=gm4_new_machine,limit=1] UUID[3]
scoreboard players operation @e[distance=..3,tag=gm4_new_machine] gm4_smelt_id = $new gm4_smelt_id
function gm4_smelteries:machine/place_rotated with storage gm4_smelteries:placement temp

data remove storage gm4_smelteries:placement temp

# mark block as placed
playsound block.anvil.use block @a[distance=..4] ~ ~ ~ 1 0.8
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=..3] remove gm4_new_machine
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
# located at @s
# run from gm4_smelteries:machine/verify_destroy

# kill entities related to machine block
# legacy cleanup - TODO: remove this when we stop supporting the upgrade path
execute positioned ~ ~-0.3 ~ run kill @e[type=armor_stand,tag=gm4_smeltery_stand,limit=1,distance=..0.01]
scoreboard players operation $current gm4_smelt_id = @s gm4_smelt_id
execute positioned ^ ^-1.5 ^-1 as @e[type=armor_stand,tag=gm4_smeltery_cauldron,distance=..0.01] if score @s gm4_smelt_id = $current gm4_smelt_id run kill @s

# kill entities related to machine block
kill @e[type=item_display,tag=gm4_smeltery_display,limit=1,distance=..0.01]
kill @e[type=item_display,tag=gm4_smeltery_cauldron,limit=1,distance=..0.01]
execute store result score $dropped_item gm4_machine_data run kill @e[type=item,distance=..1,nbt={Age:0s,Item:{id:"minecraft:furnace",count:1,components:{}}},limit=1,sort=nearest]
kill @s

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# places the smeltery down based on rotation
# @s = player who placed the smeltery
# located at the center of the placed block, rotated same cardinal direction as @s
# with {facing, rotation}
# run from gm4_smelteries:machine/create

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

# summon cauldron display
$summon item_display ~ ~ ~ {\
CustomName:"gm4_smeltery_cauldron",\
Tags:["gm4_no_edit","gm4_smeltery_cauldron","gm4_machine_display","smithed.entity","smithed.strict","gm4_new_machine"],\
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.1875f,-1.0f],scale:[0.625,0.625,0.625]}\
}

# summon display and marker entity
$summon item_display ~ ~ ~ {\
CustomName:"gm4_smeltery_display",\
Tags:["gm4_no_edit","gm4_smeltery_display","gm4_machine_display","smithed.entity","smithed.strict","gm4_new_machine"],\
item:{id:"minecraft:iron_block",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_smelteries:block/smeltery_unlit"]}}},\
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.601f,0f],scale:[0.438,0.438,0.438]}\
}
$summon marker ~ ~ ~ {Tags:["gm4_smeltery","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:"gm4_smeltery",Rotation:$(rotation)}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions gm4_smelteries/data/gm4_smelteries/function/main.mcfunction
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# upgrade path, needs run before process
function gm4_smelteries:upgrade_paths/1.9
# process machine
execute as @e[type=marker,tag=gm4_smeltery] at @s run function gm4_smelteries:process

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# smeltery processes
# @s = smeltery
# at @s
# run from main

# update smeltery state
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# check furnace and store cooktime
# @s = smeltery marker
# at @s
# run from furnace_lit

scoreboard players set $cook_time gm4_smelt_data -1
execute store result score $cook_time gm4_smelt_data run data get block ~ ~ ~ cooking_time_spent

# display ore
tag @s add gm4_smeltery_processing
scoreboard players operation $current gm4_smelt_id = @s gm4_smelt_id
execute if score $cook_time gm4_smelt_data matches 0.. positioned ^ ^-1.5 ^-1 as @e[type=armor_stand,tag=gm4_smeltery_cauldron,distance=..0.01] if score @s gm4_smelt_id = $current gm4_smelt_id positioned ^ ^1.5 ^1 run function gm4_smelteries:smelt/smelting
execute if score $cook_time gm4_smelt_data matches 0.. as @e[type=item_display,tag=gm4_smeltery_cauldron,limit=1,distance=..0.01] run function gm4_smelteries:smelt/smelting
tag @s remove gm4_smeltery_processing
Loading
Loading