Skip to content

Commit

Permalink
Fix electric lamp not removing light when broken
Browse files Browse the repository at this point in the history
  • Loading branch information
ICY105 committed Sep 21, 2023
1 parent 5a2454a commit 45e2151
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

function mechanization:machines/blocks/electric_lamp/turn_off

loot spawn ~ ~ ~ loot mechanization:machines/electric_lamp
function mechanization:base/utils/break_block/break_copy_data
function energy:v1/api/break_machine
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#main
# main
function mechanization:base/utils/redstone_active
execute if score @s energy.storage < #machines.cf.lamp.power mechanization.data run scoreboard players set #active mechanization.data 0

Expand All @@ -11,5 +11,6 @@ execute if score #active mechanization.data matches 1 run data modify entity @s

execute if score #active mechanization.data matches 1 run scoreboard players operation @s energy.storage -= #machines.cf.lamp.power mechanization.data

#cleanup
# cleanup
execute unless block ~ ~ ~ minecraft:barrier run function mechanization:machines/blocks/electric_lamp/turn_off
execute unless block ~ ~ ~ minecraft:barrier run function mechanization:base/utils/break_block/break_machine_t2

0 comments on commit 45e2151

Please sign in to comment.