Skip to content

Commit

Permalink
Improve coke furnace
Browse files Browse the repository at this point in the history
  • Loading branch information
bill96012 committed Feb 4, 2021
1 parent 44d9382 commit 3f8cdeb
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
3 changes: 0 additions & 3 deletions data/galaxy/functions/block/coke_furnace/main.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ execute unless predicate galaxy:block/coke_furnace run function galaxy:block/cok
# block working
function galaxy:block/coke_furnace/work/main

# block states
function galaxy:block/coke_furnace/states/main

# gui function
execute if predicate minecraft:block_states/open run function galaxy:gui/coke_furnace/main

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
scoreboard players operation #1 calcu_temp = @s statesLit

scoreboard players set @s statesLit 0
function galaxy:block/coke_furnace/work/get-status
execute if score @s workStatus matches 1 run scoreboard players set @s statesLit 1

execute unless score @s statesLit = #1 calcu_temp run tag @s add setStateLit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function galaxy:block/coke_furnace/states/lit/check
execute if entity @s[tag=setStateLit] if score @s statesLit matches 0 positioned ~ ~1 ~ run data merge entity @e[tag=coke_furnace_fake_block,distance=..0.25,sort=nearest,limit=1] {Tags:["coke_furnace_fake_block"],Fire:-1s,ArmorItems:[{},{},{},{id:"minecraft:wooden_sword",Count:1b,tag:{CustomModelData:10200,fakeBlock:1}}]}
execute if entity @s[tag=setStateLit] if score @s statesLit matches 1 positioned ~ ~1 ~ run data merge entity @e[tag=coke_furnace_fake_block,distance=..0.25,sort=nearest,limit=1] {Tags:["coke_furnace_fake_block","illuminate"],Fire:32767s,ArmorItems:[{},{},{},{id:"minecraft:wooden_sword",Count:1b,tag:{CustomModelData:10201,fakeBlock:1}}]}
tag @s[tag=setStateLit] remove setStateLit
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
function galaxy:block/coke_furnace/states/check-lit
execute if entity @s[tag=setStateLit] run function galaxy:block/coke_furnace/states/lit
tag @s[tag=setStateLit] remove setStateLit
function galaxy:block/coke_furnace/states/lit/main
2 changes: 0 additions & 2 deletions data/galaxy/functions/block/coke_furnace/work/main.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ execute if entity @s[tag=workProcStatusUpdate] run function galaxy:gui/coke_furn
tag @s[tag=workProcStatusUpdate] remove workProcStatusUpdate

execute if predicate minecraft:block_states/open if score @s workProcStatus1 matches 1..9 run function galaxy:gui/coke_furnace/update-process

function galaxy:block/coke_furnace/work/get-status
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
function galaxy:block/coke_furnace/work/processor1/check-recipe

scoreboard players set #1 calcu_temp 0
execute unless score @s workProc1CanWork matches 1.. if score @s statesLit matches 1 run scoreboard players set #1 calcu_temp 1
execute if score @s workProc1CanWork matches 1.. if score @s statesLit matches 0 run scoreboard players set #1 calcu_temp 1
execute if score #1 calcu_temp matches 1 run function galaxy:block/coke_furnace/states/lit/main

execute unless score @s workProc1CanWork matches 1 if score @s workProc1 matches 1.. run scoreboard players set @s workProc1 0

execute if score @s workProc1CanWork matches 1 run scoreboard players add @s workProc1 1
Expand Down

0 comments on commit 3f8cdeb

Please sign in to comment.