diff --git a/gm4_smelteries/beet.yaml b/gm4_smelteries/beet.yaml index 626e49044a..7d377b98f2 100644 --- a/gm4_smelteries/beet.yaml +++ b/gm4_smelteries/beet.yaml @@ -40,6 +40,7 @@ meta: - Misode - SpecialBuilder32 - BPR + - runcows Textures By: - Kyrius Icon Design: diff --git a/gm4_smelteries/data/gm4_smelteries/function/furnace_lit.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/furnace_lit.mcfunction index fdd0af5ffc..d069fb4693 100644 --- a/gm4_smelteries/data/gm4_smelteries/function/furnace_lit.mcfunction +++ b/gm4_smelteries/data/gm4_smelteries/function/furnace_lit.mcfunction @@ -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 diff --git a/gm4_smelteries/data/gm4_smelteries/function/furnace_unlit.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/furnace_unlit.mcfunction index a766534dd0..7f2e587c04 100644 --- a/gm4_smelteries/data/gm4_smelteries/function/furnace_unlit.mcfunction +++ b/gm4_smelteries/data/gm4_smelteries/function/furnace_unlit.mcfunction @@ -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 diff --git a/gm4_smelteries/data/gm4_smelteries/function/init.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/init.mcfunction index 57ec5ce0b0..063892e576 100644 --- a/gm4_smelteries/data/gm4_smelteries/function/init.mcfunction +++ b/gm4_smelteries/data/gm4_smelteries/function/init.mcfunction @@ -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 diff --git a/gm4_smelteries/data/gm4_smelteries/function/machine/create.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/machine/create.mcfunction index b9b50ac119..622caee0c0 100644 --- a/gm4_smelteries/data/gm4_smelteries/function/machine/create.mcfunction +++ b/gm4_smelteries/data/gm4_smelteries/function/machine/create.mcfunction @@ -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 diff --git a/gm4_smelteries/data/gm4_smelteries/function/machine/destroy.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/machine/destroy.mcfunction index d5bbd54ad3..fc3b492488 100644 --- a/gm4_smelteries/data/gm4_smelteries/function/machine/destroy.mcfunction +++ b/gm4_smelteries/data/gm4_smelteries/function/machine/destroy.mcfunction @@ -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 diff --git a/gm4_smelteries/data/gm4_smelteries/function/machine/place_rotated.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/machine/place_rotated.mcfunction new file mode 100644 index 0000000000..489ef8b20d --- /dev/null +++ b/gm4_smelteries/data/gm4_smelteries/function/machine/place_rotated.mcfunction @@ -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)} diff --git a/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/east.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/east.mcfunction deleted file mode 100644 index 0b9020dd10..0000000000 --- a/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/east.mcfunction +++ /dev/null @@ -1,14 +0,0 @@ -# places the smeltery down based on rotation -# @s = player who placed the smeltery -# located at the center of the placed block -# run from gm4_smelteries:machine/create - -# place furnace -setblock ~ ~ ~ furnace[facing=east]{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 armor stand -summon armor_stand ~-1 ~-1.5 ~ {NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Silent:1b,DisabledSlots:4144959,Tags:["gm4_no_edit","gm4_smeltery_cauldron","gm4_machine_display","smithed.entity","smithed.strict","gm4_new_machine"],HasVisualFire:1b,CustomName:"gm4_smeltery_cauldron",Rotation:[-90.0f,0.0f]} - -# summon display armor stand and marker entity -summon armor_stand ~ ~-0.3 ~ {Small:1b,NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Silent:1b,DisabledSlots:4144959,Tags:["gm4_no_edit","gm4_smeltery_stand","gm4_machine_stand","smithed.entity","smithed.strict","gm4_new_machine"],HasVisualFire:1b,CustomName:"gm4_smeltery_stand",equipment:{head:{id:"minecraft:iron_block",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_smelteries:block/smeltery_unlit"]}}}},Rotation:[-90.0f,0.0f]} -summon marker ~ ~ ~ {Tags:["gm4_smeltery","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:"gm4_smeltery",Rotation:[-90.0f,0.0f]} diff --git a/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/north.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/north.mcfunction deleted file mode 100644 index ff349b42a7..0000000000 --- a/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/north.mcfunction +++ /dev/null @@ -1,14 +0,0 @@ -# places the smeltery down based on rotation -# @s = player who placed the smeltery -# located at the center of the placed block -# run from gm4_smelteries:machine/create - -# place furnace -setblock ~ ~ ~ furnace[facing=north]{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 armor stand -summon armor_stand ~ ~-1.5 ~1 {NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Silent:1b,DisabledSlots:4144959,Tags:["gm4_no_edit","gm4_smeltery_cauldron","gm4_machine_display","smithed.entity","smithed.strict","gm4_new_machine"],HasVisualFire:1b,CustomName:"gm4_smeltery_cauldron",Rotation:[180.0f,0.0f]} - -# summon display armor stand and marker entity -summon armor_stand ~ ~-0.3 ~ {Small:1b,NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Silent:1b,DisabledSlots:4144959,Tags:["gm4_no_edit","gm4_smeltery_stand","gm4_machine_stand","smithed.entity","smithed.strict","gm4_new_machine"],HasVisualFire:1b,CustomName:"gm4_smeltery_stand",equipment:{head:{id:"minecraft:iron_block",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_smelteries:block/smeltery_unlit"]}}}},Rotation:[180.0f,0.0f]} -summon marker ~ ~ ~ {Tags:["gm4_smeltery","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:"gm4_smeltery",Rotation:[180.0f,0.0f]} diff --git a/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/south.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/south.mcfunction deleted file mode 100644 index be24ceb6e6..0000000000 --- a/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/south.mcfunction +++ /dev/null @@ -1,14 +0,0 @@ -# places the smeltery down based on rotation -# @s = player who placed the smeltery -# located at the center of the placed block -# run from gm4_smelteries:machine/create - -# place furnace -setblock ~ ~ ~ furnace[facing=south]{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 armor stand -summon armor_stand ~ ~-1.5 ~-1 {NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Silent:1b,DisabledSlots:4144959,Tags:["gm4_no_edit","gm4_smeltery_cauldron","gm4_machine_display","smithed.entity","smithed.strict","gm4_new_machine"],HasVisualFire:1b,CustomName:"gm4_smeltery_cauldron",Rotation:[0.0f,0.0f]} - -# summon display armor stand and marker entity -summon armor_stand ~ ~-0.3 ~ {Small:1b,NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Silent:1b,DisabledSlots:4144959,Tags:["gm4_no_edit","gm4_smeltery_stand","gm4_machine_stand","smithed.entity","smithed.strict","gm4_new_machine"],HasVisualFire:1b,CustomName:"gm4_smeltery_stand",equipment:{head:{id:"minecraft:iron_block",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_smelteries:block/smeltery_unlit"]}}}},Rotation:[0.0f,0.0f]} -summon marker ~ ~ ~ {Tags:["gm4_smeltery","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:"gm4_smeltery",Rotation:[0.0f,0.0f]} diff --git a/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/west.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/west.mcfunction deleted file mode 100644 index d6d4771672..0000000000 --- a/gm4_smelteries/data/gm4_smelteries/function/machine/rotate/west.mcfunction +++ /dev/null @@ -1,14 +0,0 @@ -# places the smeltery down based on rotation -# @s = player who placed the smeltery -# located at the center of the placed block -# run from gm4_smelteries:machine/create - -# place furnace -setblock ~ ~ ~ furnace[facing=west]{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 armor stand -summon armor_stand ~1 ~-1.5 ~ {NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Silent:1b,DisabledSlots:4144959,Tags:["gm4_no_edit","gm4_smeltery_cauldron","gm4_machine_display","smithed.entity","smithed.strict","gm4_new_machine"],HasVisualFire:1b,CustomName:"gm4_smeltery_cauldron",Rotation:[90.0f,0.0f]} - -# summon display armor stand and marker entity -summon armor_stand ~ ~-0.3 ~ {Small:1b,NoGravity:1b,Marker:1b,Invulnerable:1b,Invisible:1b,Silent:1b,DisabledSlots:4144959,Tags:["gm4_no_edit","gm4_smeltery_stand","gm4_machine_stand","smithed.entity","smithed.strict","gm4_new_machine"],HasVisualFire:1b,CustomName:"gm4_smeltery_stand",equipment:{head:{id:"minecraft:iron_block",count:1,components:{"minecraft:custom_model_data":{"strings":["gm4_smelteries:block/smeltery_unlit"]}}}},Rotation:[90.0f,0.0f]} -summon marker ~ ~ ~ {Tags:["gm4_smeltery","gm4_machine_marker","smithed.block","smithed.entity","smithed.strict","gm4_new_machine"],CustomName:"gm4_smeltery",Rotation:[90.0f,0.0f]} diff --git a/gm4_smelteries/data/gm4_smelteries/function/main.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/main.mcfunction index 7b5e98cbb7..ff45cbca6d 100644 --- a/gm4_smelteries/data/gm4_smelteries/function/main.mcfunction +++ b/gm4_smelteries/data/gm4_smelteries/function/main.mcfunction @@ -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 diff --git a/gm4_smelteries/data/gm4_smelteries/function/process.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/process.mcfunction index af9d402411..dfa4bc57d1 100644 --- a/gm4_smelteries/data/gm4_smelteries/function/process.mcfunction +++ b/gm4_smelteries/data/gm4_smelteries/function/process.mcfunction @@ -1,5 +1,6 @@ # smeltery processes # @s = smeltery +# at @s # run from main # update smeltery state diff --git a/gm4_smelteries/data/gm4_smelteries/function/smelt/check_cook_time.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/smelt/check_cook_time.mcfunction index 6c21813291..06887951bd 100644 --- a/gm4_smelteries/data/gm4_smelteries/function/smelt/check_cook_time.mcfunction +++ b/gm4_smelteries/data/gm4_smelteries/function/smelt/check_cook_time.mcfunction @@ -1,5 +1,6 @@ # check furnace and store cooktime # @s = smeltery marker +# at @s # run from furnace_lit scoreboard players set $cook_time gm4_smelt_data -1 @@ -7,6 +8,5 @@ execute store result score $cook_time gm4_smelt_data run data get block ~ ~ ~ co # 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 diff --git a/gm4_smelteries/data/gm4_smelteries/function/smelt/smelting.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/smelt/smelting.mcfunction index c0e7ce1b08..84f5b944bb 100644 --- a/gm4_smelteries/data/gm4_smelteries/function/smelt/smelting.mcfunction +++ b/gm4_smelteries/data/gm4_smelteries/function/smelt/smelting.mcfunction @@ -4,23 +4,23 @@ # run from smelt/check_cook_time # check if the currently smeling item can be doubled -item replace entity @s armor.head with air +item replace entity @s contents with air execute unless items block ~ ~ ~ container.0 #gm4_smelteries:can_double run return run tag @e[type=marker,tag=gm4_smeltery_processing,limit=1,distance=..2] remove gm4_smeltery_smelting # update the cauldron block display -execute if items block ~ ~ ~ container.0 minecraft:gold_ore run item replace entity @s armor.head with minecraft:gold_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/gold_ore"]}] -execute if items block ~ ~ ~ container.0 minecraft:nether_gold_ore run item replace entity @s armor.head with minecraft:nether_gold_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/nether_gold_ore"]}] -execute if items block ~ ~ ~ container.0 minecraft:deepslate_gold_ore run item replace entity @s armor.head with minecraft:deepslate_gold_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/deepslate_gold_ore"]}] -execute if items block ~ ~ ~ container.0 minecraft:raw_gold run item replace entity @s armor.head with minecraft:raw_gold_block[custom_model_data={"strings":["gm4_smelteries:block/ore_display/raw_gold"]}] -execute if items block ~ ~ ~ container.0 minecraft:iron_ore run item replace entity @s armor.head with minecraft:iron_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/iron_ore"]}] -execute if items block ~ ~ ~ container.0 minecraft:deepslate_iron_ore run item replace entity @s armor.head with minecraft:deepslate_iron_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/deepslate_iron_ore"]}] -execute if items block ~ ~ ~ container.0 minecraft:raw_iron run item replace entity @s armor.head with minecraft:raw_iron_block[custom_model_data={"strings":["gm4_smelteries:block/ore_display/raw_iron"]}] -execute if items block ~ ~ ~ container.0 minecraft:copper_ore run item replace entity @s armor.head with minecraft:copper_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/copper_ore"]}] -execute if items block ~ ~ ~ container.0 minecraft:deepslate_copper_ore run item replace entity @s armor.head with minecraft:deepslate_copper_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/deepslate_copper_ore"]}] -execute if items block ~ ~ ~ container.0 minecraft:raw_copper run item replace entity @s armor.head with minecraft:raw_copper_block[custom_model_data={"strings":["gm4_smelteries:block/ore_display/raw_copper"]}] -execute if items block ~ ~ ~ container.0 minecraft:sand run item replace entity @s armor.head with minecraft:sand[custom_model_data={"strings":["gm4_smelteries:block/ore_display/sand"]}] -execute if items block ~ ~ ~ container.0 minecraft:red_sand run item replace entity @s armor.head with minecraft:red_sand[custom_model_data={"strings":["gm4_smelteries:block/ore_display/red_sand"]}] -execute if items block ~ ~ ~ container.0 minecraft:chorus_fruit run item replace entity @s armor.head with minecraft:chorus_flower[custom_model_data={"strings":["gm4_smelteries:block/ore_display/chorus_fruit"]}] +execute if items block ~ ~ ~ container.0 minecraft:gold_ore run item replace entity @s contents with minecraft:gold_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/gold_ore"]}] +execute if items block ~ ~ ~ container.0 minecraft:nether_gold_ore run item replace entity @s contents with minecraft:nether_gold_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/nether_gold_ore"]}] +execute if items block ~ ~ ~ container.0 minecraft:deepslate_gold_ore run item replace entity @s contents with minecraft:deepslate_gold_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/deepslate_gold_ore"]}] +execute if items block ~ ~ ~ container.0 minecraft:raw_gold run item replace entity @s contents with minecraft:raw_gold_block[custom_model_data={"strings":["gm4_smelteries:block/ore_display/raw_gold"]}] +execute if items block ~ ~ ~ container.0 minecraft:iron_ore run item replace entity @s contents with minecraft:iron_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/iron_ore"]}] +execute if items block ~ ~ ~ container.0 minecraft:deepslate_iron_ore run item replace entity @s contents with minecraft:deepslate_iron_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/deepslate_iron_ore"]}] +execute if items block ~ ~ ~ container.0 minecraft:raw_iron run item replace entity @s contents with minecraft:raw_iron_block[custom_model_data={"strings":["gm4_smelteries:block/ore_display/raw_iron"]}] +execute if items block ~ ~ ~ container.0 minecraft:copper_ore run item replace entity @s contents with minecraft:copper_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/copper_ore"]}] +execute if items block ~ ~ ~ container.0 minecraft:deepslate_copper_ore run item replace entity @s contents with minecraft:deepslate_copper_ore[custom_model_data={"strings":["gm4_smelteries:block/ore_display/deepslate_copper_ore"]}] +execute if items block ~ ~ ~ container.0 minecraft:raw_copper run item replace entity @s contents with minecraft:raw_copper_block[custom_model_data={"strings":["gm4_smelteries:block/ore_display/raw_copper"]}] +execute if items block ~ ~ ~ container.0 minecraft:sand run item replace entity @s contents with minecraft:sand[custom_model_data={"strings":["gm4_smelteries:block/ore_display/sand"]}] +execute if items block ~ ~ ~ container.0 minecraft:red_sand run item replace entity @s contents with minecraft:red_sand[custom_model_data={"strings":["gm4_smelteries:block/ore_display/red_sand"]}] +execute if items block ~ ~ ~ container.0 minecraft:chorus_fruit run item replace entity @s contents with minecraft:chorus_flower[custom_model_data={"strings":["gm4_smelteries:block/ore_display/chorus_fruit"]}] # check if the furnace is close to finish smelting execute if score $cook_time gm4_smelt_data matches 184..199 run function gm4_smelteries:smelt/prep_finish_smelt diff --git a/gm4_smelteries/data/gm4_smelteries/function/upgrade_paths/1.9.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/upgrade_paths/1.9.mcfunction new file mode 100644 index 0000000000..a74e1e72eb --- /dev/null +++ b/gm4_smelteries/data/gm4_smelteries/function/upgrade_paths/1.9.mcfunction @@ -0,0 +1,7 @@ +# run from main and via upgrade paths util + +execute as @e[type=minecraft:armor_stand,tag=gm4_smeltery_stand] at @s positioned ~ ~0.3 ~ \ + run function gm4_smelteries:upgrade_paths/1.9/smeltery_item_display + +execute as @e[type=minecraft:armor_stand,tag=gm4_smeltery_cauldron] at @s positioned ^ ^1.5 ^1 \ + run function gm4_smelteries:upgrade_paths/1.9/cauldron_item_display diff --git a/gm4_smelteries/data/gm4_smelteries/function/upgrade_paths/1.9/cauldron_item_display.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/upgrade_paths/1.9/cauldron_item_display.mcfunction new file mode 100644 index 0000000000..cfe642cf1f --- /dev/null +++ b/gm4_smelteries/data/gm4_smelteries/function/upgrade_paths/1.9/cauldron_item_display.mcfunction @@ -0,0 +1,19 @@ +# @s = gm4_smeltery_cauldron armor stand +# at center of smeltery +# run from upgrade_paths/1.9 + +# create item 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},\ + 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]}\ +} +# copy data from armor stand +execute rotated as @s run rotate @e[type=item_display,tag=gm4_smeltery_cauldron,limit=1,distance=..0.01] ~ ~ +item replace entity @e[type=item_display,tag=gm4_smeltery_cauldron,limit=1,distance=..0.01] contents from entity @s armor.head +# increment entity version +scoreboard players set @e[type=item_display,tag=gm4_smeltery_cauldron,limit=1,distance=..0.01] gm4_entity_version 2 + +kill @s diff --git a/gm4_smelteries/data/gm4_smelteries/function/upgrade_paths/1.9/smeltery_item_display.mcfunction b/gm4_smelteries/data/gm4_smelteries/function/upgrade_paths/1.9/smeltery_item_display.mcfunction new file mode 100644 index 0000000000..27fca0cd32 --- /dev/null +++ b/gm4_smelteries/data/gm4_smelteries/function/upgrade_paths/1.9/smeltery_item_display.mcfunction @@ -0,0 +1,22 @@ +# @s = gm4_smeltery_stand armor stand +# at center of smeltery +# run from upgrade_paths/1.9 + +# create item display +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:[0.0f,0.0f],\ + 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]}\ +} +# copy data from armor stand +execute rotated as @s run rotate @e[type=item_display,tag=gm4_smeltery_display,limit=1,distance=..0.01] ~ ~ +item replace entity @e[type=item_display,tag=gm4_smeltery_display,limit=1,distance=..0.01] contents from entity @s armor.head +# increment entity version (this function handles the marker as well) +scoreboard players set @e[type=item_display,tag=gm4_smeltery_display,limit=1,distance=..0.01] gm4_entity_version 2 +scoreboard players set @e[type=marker,tag=gm4_smeltery,limit=1,distance=..0.01] gm4_entity_version 2 + +kill @s