diff --git a/data/energy/functions/v1.5/cable/break_2.mcfunction b/data/energy/functions/v1.5/cable/break_2.mcfunction deleted file mode 100644 index 312979e..0000000 --- a/data/energy/functions/v1.5/cable/break_2.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ - -#reroute to proper function -execute if entity @s[tag=energy.send] run function energy:v1.5/cable/break_machine -execute if entity @s[tag=energy.receive,tag=!energy.send] run function energy:v1.5/cable/break_machine -execute if entity @s[tag=energy.cable] run function energy:v1.5/cable/break_cable diff --git a/data/energy/functions/v1.5/cable/break_cable_2.mcfunction b/data/energy/functions/v1.5/cable/break_cable_2.mcfunction deleted file mode 100644 index e75487a..0000000 --- a/data/energy/functions/v1.5/cable/break_cable_2.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ - -scoreboard players operation @s energy.network_id = #cable.network_id energy.data - -execute align xyz positioned ~ ~01 ~ as @e[type=#energy:valid_block_entities,predicate=energy:v1.5/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_cable_2 -execute align xyz positioned ~ ~-1 ~ as @e[type=#energy:valid_block_entities,predicate=energy:v1.5/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_cable_2 -execute align xyz positioned ~ ~ ~-1 as @e[type=#energy:valid_block_entities,predicate=energy:v1.5/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_cable_2 -execute align xyz positioned ~ ~ ~01 as @e[type=#energy:valid_block_entities,predicate=energy:v1.5/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_cable_2 -execute align xyz positioned ~01 ~ ~ as @e[type=#energy:valid_block_entities,predicate=energy:v1.5/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_cable_2 -execute align xyz positioned ~-1 ~ ~ as @e[type=#energy:valid_block_entities,predicate=energy:v1.5/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_cable_2 diff --git a/data/energy/functions/v1.5/cable/update_2.mcfunction b/data/energy/functions/v1.5/cable/update_2.mcfunction deleted file mode 100644 index 9ebf307..0000000 --- a/data/energy/functions/v1.5/cable/update_2.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ - -#reroute to proper function -execute if entity @s[tag=energy.send] run function energy:v1.5/cable/update_machine -execute if entity @s[tag=energy.receive,tag=!energy.send] run function energy:v1.5/cable/update_machine -execute if entity @s[tag=energy.cable] run function energy:v1.5/cable/update_cable diff --git a/data/energy/functions/v1.5/resolve.mcfunction b/data/energy/functions/v1.5/resolve.mcfunction deleted file mode 100644 index a528731..0000000 --- a/data/energy/functions/v1.5/resolve.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ - -schedule clear energy:v1.5/init -schedule clear energy:v1.5/tick - -execute if predicate energy:v1.5/is_correct_version run function energy:v1.5/init diff --git a/data/energy/functions/v1.5/versioning/break_cable.mcfunction b/data/energy/functions/v1.5/versioning/break_cable.mcfunction deleted file mode 100644 index 01fb8b3..0000000 --- a/data/energy/functions/v1.5/versioning/break_cable.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ - -execute if predicate energy:v1.5/is_correct_version run function energy:v1.5/cable/break diff --git a/data/energy/functions/v1.5/versioning/break_machine.mcfunction b/data/energy/functions/v1.5/versioning/break_machine.mcfunction deleted file mode 100644 index 51b4b07..0000000 --- a/data/energy/functions/v1.5/versioning/break_machine.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ - -execute if predicate energy:v1.5/is_correct_version run function energy:v1.5/machine/break diff --git a/data/energy/functions/v1.5/versioning/init_cable.mcfunction b/data/energy/functions/v1.5/versioning/init_cable.mcfunction deleted file mode 100644 index ad04c83..0000000 --- a/data/energy/functions/v1.5/versioning/init_cable.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ - -execute if predicate energy:v1.5/is_correct_version run function energy:v1.5/cable/init diff --git a/data/energy/functions/v1.5/versioning/init_machine.mcfunction b/data/energy/functions/v1.5/versioning/init_machine.mcfunction deleted file mode 100644 index f27f666..0000000 --- a/data/energy/functions/v1.5/versioning/init_machine.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ - -execute if predicate energy:v1.5/is_correct_version run function energy:v1.5/machine/init diff --git a/data/energy/functions/v1.5/versioning/modify_player_energy.mcfunction b/data/energy/functions/v1.5/versioning/modify_player_energy.mcfunction deleted file mode 100644 index 2bea0fb..0000000 --- a/data/energy/functions/v1.5/versioning/modify_player_energy.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ - -execute if predicate energy:v1.5/is_correct_version if entity @s[type=minecraft:player] run function energy:v1.5/player/modify_energy diff --git a/data/energy/functions/v1.5/cable/break.mcfunction b/data/energy/functions/v1.6/cable/break.mcfunction similarity index 70% rename from data/energy/functions/v1.5/cable/break.mcfunction rename to data/energy/functions/v1.6/cable/break.mcfunction index 486489e..8791b4d 100644 --- a/data/energy/functions/v1.5/cable/break.mcfunction +++ b/data/energy/functions/v1.6/cable/break.mcfunction @@ -4,32 +4,32 @@ scoreboard players set @s energy.network_id 0 #up scoreboard players set #cable.direction energy.data 0 -execute align xyz positioned ~ ~1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_2 +execute align xyz positioned ~ ~1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_2 #down scoreboard players set #cable.direction energy.data 1 -execute align xyz positioned ~ ~-1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_2 +execute align xyz positioned ~ ~-1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_2 #north scoreboard players set #cable.direction energy.data 2 -execute align xyz positioned ~ ~ ~-1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_2 +execute align xyz positioned ~ ~ ~-1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_2 #south scoreboard players set #cable.direction energy.data 3 -execute align xyz positioned ~ ~ ~1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_2 +execute align xyz positioned ~ ~ ~1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_2 #east scoreboard players set #cable.direction energy.data 4 -execute align xyz positioned ~1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_2 +execute align xyz positioned ~1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_2 #west scoreboard players set #cable.direction energy.data 5 -execute align xyz positioned ~-1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/break_2 +execute align xyz positioned ~-1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_2 #update machine ids scoreboard players operation #predicate energy.data = #cable.temp energy.data -execute as @e[type=#energy:valid_block_entities,tag=!energy.cable,predicate=energy:v1.5/has_network_id] at @s run function energy:v1.5/cable/break_reconnect +execute as @e[type=#energy:valid_block_entities,tag=!energy.cable,predicate=energy:v1.6/has_network_id] at @s run function energy:v1.6/cable/break_reconnect #setup network transfer capacity scoreboard players set @e[type=#energy:valid_block_entities,tag=energy.cable] energy.transfer_capacity -1 -execute as @e[type=#energy:valid_block_entities,tag=energy.cable] at @s run function energy:v1.5/cable/setup_cable_network +execute as @e[type=#energy:valid_block_entities,tag=energy.cable] at @s run function energy:v1.6/cable/setup_cable_network diff --git a/data/energy/functions/v1.6/cable/break_2.mcfunction b/data/energy/functions/v1.6/cable/break_2.mcfunction new file mode 100644 index 0000000..fbf787a --- /dev/null +++ b/data/energy/functions/v1.6/cable/break_2.mcfunction @@ -0,0 +1,5 @@ + +#reroute to proper function +execute if entity @s[tag=energy.send] run function energy:v1.6/cable/break_machine +execute if entity @s[tag=energy.receive,tag=!energy.send] run function energy:v1.6/cable/break_machine +execute if entity @s[tag=energy.cable] run function energy:v1.6/cable/break_cable diff --git a/data/energy/functions/v1.5/cable/break_cable.mcfunction b/data/energy/functions/v1.6/cable/break_cable.mcfunction similarity index 95% rename from data/energy/functions/v1.5/cable/break_cable.mcfunction rename to data/energy/functions/v1.6/cable/break_cable.mcfunction index 0a0ec59..a1d1e0c 100644 --- a/data/energy/functions/v1.5/cable/break_cable.mcfunction +++ b/data/energy/functions/v1.6/cable/break_cable.mcfunction @@ -14,4 +14,4 @@ function #energy:v1/cable_update scoreboard players operation #predicate energy.data = @s energy.network_id scoreboard players add #global.incr_id energy.network_id 1 scoreboard players operation #cable.network_id energy.data = #global.incr_id energy.network_id -function energy:v1.5/cable/break_cable_2 +function energy:v1.6/cable/break_cable_2 diff --git a/data/energy/functions/v1.6/cable/break_cable_2.mcfunction b/data/energy/functions/v1.6/cable/break_cable_2.mcfunction new file mode 100644 index 0000000..1bc28d1 --- /dev/null +++ b/data/energy/functions/v1.6/cable/break_cable_2.mcfunction @@ -0,0 +1,9 @@ + +scoreboard players operation @s energy.network_id = #cable.network_id energy.data + +execute align xyz positioned ~ ~01 ~ as @e[type=#energy:valid_block_entities,predicate=energy:v1.6/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_cable_2 +execute align xyz positioned ~ ~-1 ~ as @e[type=#energy:valid_block_entities,predicate=energy:v1.6/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_cable_2 +execute align xyz positioned ~ ~ ~-1 as @e[type=#energy:valid_block_entities,predicate=energy:v1.6/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_cable_2 +execute align xyz positioned ~ ~ ~01 as @e[type=#energy:valid_block_entities,predicate=energy:v1.6/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_cable_2 +execute align xyz positioned ~01 ~ ~ as @e[type=#energy:valid_block_entities,predicate=energy:v1.6/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_cable_2 +execute align xyz positioned ~-1 ~ ~ as @e[type=#energy:valid_block_entities,predicate=energy:v1.6/equals_network_id,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/break_cable_2 diff --git a/data/energy/functions/v1.5/cable/break_machine.mcfunction b/data/energy/functions/v1.6/cable/break_machine.mcfunction similarity index 100% rename from data/energy/functions/v1.5/cable/break_machine.mcfunction rename to data/energy/functions/v1.6/cable/break_machine.mcfunction diff --git a/data/energy/functions/v1.5/cable/break_reconnect.mcfunction b/data/energy/functions/v1.6/cable/break_reconnect.mcfunction similarity index 100% rename from data/energy/functions/v1.5/cable/break_reconnect.mcfunction rename to data/energy/functions/v1.6/cable/break_reconnect.mcfunction diff --git a/data/energy/functions/v1.5/cable/init.mcfunction b/data/energy/functions/v1.6/cable/init.mcfunction similarity index 86% rename from data/energy/functions/v1.5/cable/init.mcfunction rename to data/energy/functions/v1.6/cable/init.mcfunction index 8558c6b..91203a0 100644 --- a/data/energy/functions/v1.5/cable/init.mcfunction +++ b/data/energy/functions/v1.6/cable/init.mcfunction @@ -5,20 +5,20 @@ scoreboard players add @s energy.network_id 0 #get network id scoreboard players set #cable.network_id energy.data 0 -execute align xyz positioned ~ ~1 ~ as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/init_2 -execute align xyz positioned ~ ~-1 ~ as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/init_2 -execute align xyz positioned ~ ~ ~-1 as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/init_2 -execute align xyz positioned ~ ~ ~1 as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/init_2 -execute align xyz positioned ~1 ~ ~ as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/init_2 -execute align xyz positioned ~-1 ~ ~ as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/init_2 +execute align xyz positioned ~ ~1 ~ as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/init_2 +execute align xyz positioned ~ ~-1 ~ as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/init_2 +execute align xyz positioned ~ ~ ~-1 as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/init_2 +execute align xyz positioned ~ ~ ~1 as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/init_2 +execute align xyz positioned ~1 ~ ~ as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/init_2 +execute align xyz positioned ~-1 ~ ~ as @e[type=#energy:valid_block_entities,tag=energy.cable,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/init_2 execute if score #cable.network_id energy.data matches 0 run scoreboard players add #global.incr_id energy.network_id 1 execute if score #cable.network_id energy.data matches 0 run scoreboard players operation #cable.network_id energy.data = #global.incr_id energy.network_id scoreboard players operation @s energy.network_id = #cable.network_id energy.data #call update function -function energy:v1.5/cable/update +function energy:v1.6/cable/update #setup network transfer capacity scoreboard players set @e[type=#energy:valid_block_entities,tag=energy.cable] energy.transfer_capacity -1 -execute as @e[type=#energy:valid_block_entities,tag=energy.cable] at @s run function energy:v1.5/cable/setup_cable_network +execute as @e[type=#energy:valid_block_entities,tag=energy.cable] at @s run function energy:v1.6/cable/setup_cable_network diff --git a/data/energy/functions/v1.5/cable/init_2.mcfunction b/data/energy/functions/v1.6/cable/init_2.mcfunction similarity index 74% rename from data/energy/functions/v1.5/cable/init_2.mcfunction rename to data/energy/functions/v1.6/cable/init_2.mcfunction index ff5afe6..e0b0c6a 100644 --- a/data/energy/functions/v1.5/cable/init_2.mcfunction +++ b/data/energy/functions/v1.6/cable/init_2.mcfunction @@ -1,11 +1,11 @@ #if id is assigned, cascade across the entire network execute if score #cable.network_id energy.data matches 1.. run scoreboard players operation #predicate energy.data = @s energy.network_id -execute if score #cable.network_id energy.data matches 1.. as @e[type=#energy:valid_block_entities,predicate=energy:v1.5/equals_network_id] run scoreboard players operation @s energy.network_id = #cable.network_id energy.data -execute if score #cable.network_id energy.data matches 1.. as @e[type=#energy:valid_block_entities,predicate=energy:v1.5/has_network_id] run function energy:v1.5/cable/init_machine +execute if score #cable.network_id energy.data matches 1.. as @e[type=#energy:valid_block_entities,predicate=energy:v1.6/equals_network_id] run scoreboard players operation @s energy.network_id = #cable.network_id energy.data +execute if score #cable.network_id energy.data matches 1.. as @e[type=#energy:valid_block_entities,predicate=energy:v1.6/has_network_id] run function energy:v1.6/cable/init_machine #if id is unassigned, assign to current value execute if score #cable.network_id energy.data matches 0 run scoreboard players operation #cable.network_id energy.data = @s energy.network_id #call update function -function energy:v1.5/cable/update +function energy:v1.6/cable/update diff --git a/data/energy/functions/v1.5/cable/init_machine.mcfunction b/data/energy/functions/v1.6/cable/init_machine.mcfunction similarity index 100% rename from data/energy/functions/v1.5/cable/init_machine.mcfunction rename to data/energy/functions/v1.6/cable/init_machine.mcfunction diff --git a/data/energy/functions/v1.5/cable/setup_cable_network.mcfunction b/data/energy/functions/v1.6/cable/setup_cable_network.mcfunction similarity index 89% rename from data/energy/functions/v1.5/cable/setup_cable_network.mcfunction rename to data/energy/functions/v1.6/cable/setup_cable_network.mcfunction index 8a416e8..0e42b02 100644 --- a/data/energy/functions/v1.5/cable/setup_cable_network.mcfunction +++ b/data/energy/functions/v1.6/cable/setup_cable_network.mcfunction @@ -2,4 +2,4 @@ #if defined transfer rate < current capacity, assign capacity as rate and cascade to entire network execute unless score @s energy.transfer_capacity matches 0.. run scoreboard players set @s energy.transfer_capacity 2147483647 execute if score @s energy.transfer_rate < @s energy.transfer_capacity run scoreboard players operation #predicate energy.data = @s energy.network_id -execute if score @s energy.transfer_rate < @s energy.transfer_capacity run scoreboard players operation @e[type=#energy:valid_block_entities,tag=energy.cable,predicate=energy:v1.5/equals_network_id] energy.transfer_capacity = @s energy.transfer_rate +execute if score @s energy.transfer_rate < @s energy.transfer_capacity run scoreboard players operation @e[type=#energy:valid_block_entities,tag=energy.cable,predicate=energy:v1.6/equals_network_id] energy.transfer_capacity = @s energy.transfer_rate diff --git a/data/energy/functions/v1.5/cable/update.mcfunction b/data/energy/functions/v1.6/cable/update.mcfunction similarity index 73% rename from data/energy/functions/v1.5/cable/update.mcfunction rename to data/energy/functions/v1.6/cable/update.mcfunction index 1f861a1..76ae25c 100644 --- a/data/energy/functions/v1.5/cable/update.mcfunction +++ b/data/energy/functions/v1.6/cable/update.mcfunction @@ -5,27 +5,27 @@ scoreboard players operation #cable.network_id energy.data = @s energy.network_i #up scoreboard players set #cable.direction energy.data 0 -execute align xyz positioned ~ ~1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/update_2 +execute align xyz positioned ~ ~1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/update_2 #down scoreboard players set #cable.direction energy.data 1 -execute align xyz positioned ~ ~-1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/update_2 +execute align xyz positioned ~ ~-1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/update_2 #north scoreboard players set #cable.direction energy.data 2 -execute align xyz positioned ~ ~ ~-1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/update_2 +execute align xyz positioned ~ ~ ~-1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/update_2 #south scoreboard players set #cable.direction energy.data 3 -execute align xyz positioned ~ ~ ~1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/update_2 +execute align xyz positioned ~ ~ ~1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/update_2 #east scoreboard players set #cable.direction energy.data 4 -execute align xyz positioned ~1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/update_2 +execute align xyz positioned ~1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/update_2 #west scoreboard players set #cable.direction energy.data 5 -execute align xyz positioned ~-1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/cable/update_2 +execute align xyz positioned ~-1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/cable/update_2 # store values scoreboard players operation @s energy.data = #cable.model_data energy.data diff --git a/data/energy/functions/v1.6/cable/update_2.mcfunction b/data/energy/functions/v1.6/cable/update_2.mcfunction new file mode 100644 index 0000000..80ab2b1 --- /dev/null +++ b/data/energy/functions/v1.6/cable/update_2.mcfunction @@ -0,0 +1,5 @@ + +#reroute to proper function +execute if entity @s[tag=energy.send] run function energy:v1.6/cable/update_machine +execute if entity @s[tag=energy.receive,tag=!energy.send] run function energy:v1.6/cable/update_machine +execute if entity @s[tag=energy.cable] run function energy:v1.6/cable/update_cable diff --git a/data/energy/functions/v1.5/cable/update_cable.mcfunction b/data/energy/functions/v1.6/cable/update_cable.mcfunction similarity index 100% rename from data/energy/functions/v1.5/cable/update_cable.mcfunction rename to data/energy/functions/v1.6/cable/update_cable.mcfunction diff --git a/data/energy/functions/v1.5/cable/update_machine.mcfunction b/data/energy/functions/v1.6/cable/update_machine.mcfunction similarity index 100% rename from data/energy/functions/v1.5/cable/update_machine.mcfunction rename to data/energy/functions/v1.6/cable/update_machine.mcfunction diff --git a/data/energy/functions/v1.5/energy/add_to_queue.mcfunction b/data/energy/functions/v1.6/energy/add_to_queue.mcfunction similarity index 100% rename from data/energy/functions/v1.5/energy/add_to_queue.mcfunction rename to data/energy/functions/v1.6/energy/add_to_queue.mcfunction diff --git a/data/energy/functions/v1.5/energy/change_rate.mcfunction b/data/energy/functions/v1.6/energy/change_rate.mcfunction similarity index 100% rename from data/energy/functions/v1.5/energy/change_rate.mcfunction rename to data/energy/functions/v1.6/energy/change_rate.mcfunction diff --git a/data/energy/functions/v1.5/energy/collect_energy.mcfunction b/data/energy/functions/v1.6/energy/collect_energy.mcfunction similarity index 77% rename from data/energy/functions/v1.5/energy/collect_energy.mcfunction rename to data/energy/functions/v1.6/energy/collect_energy.mcfunction index 238fa45..265a3da 100644 --- a/data/energy/functions/v1.5/energy/collect_energy.mcfunction +++ b/data/energy/functions/v1.6/energy/collect_energy.mcfunction @@ -2,9 +2,9 @@ #copy scores scoreboard players operation #predicate energy.data = #energy.network_id energy.data scoreboard players operation #energy.cable_rate energy.data = @s energy.transfer_rate -scoreboard players operation #energy.cable_rate energy.data = @e[type=#energy:valid_block_entities,tag=energy.cable,predicate=energy:v1.5/equals_network_id,limit=1] energy.transfer_capacity +scoreboard players operation #energy.cable_rate energy.data = @e[type=#energy:valid_block_entities,tag=energy.cable,predicate=energy:v1.6/equals_network_id,limit=1] energy.transfer_capacity #collect power scoreboard players set #energy.available energy.data 0 -execute as @e[type=#energy:valid_block_entities,tag=energy.send,predicate=energy:v1.5/has_network_id,scores={energy.storage=1..}] run function energy:v1.5/energy/collect_energy_2 +execute as @e[type=#energy:valid_block_entities,tag=energy.send,predicate=energy:v1.6/has_network_id,scores={energy.storage=1..}] run function energy:v1.6/energy/collect_energy_2 execute if score #energy.available energy.data > #energy.cable_rate energy.data run scoreboard players operation #energy.available energy.data = #energy.cable_rate energy.data diff --git a/data/energy/functions/v1.5/energy/collect_energy_2.mcfunction b/data/energy/functions/v1.6/energy/collect_energy_2.mcfunction similarity index 100% rename from data/energy/functions/v1.5/energy/collect_energy_2.mcfunction rename to data/energy/functions/v1.6/energy/collect_energy_2.mcfunction diff --git a/data/energy/functions/v1.5/energy/distribute_energy.mcfunction b/data/energy/functions/v1.6/energy/distribute_energy.mcfunction similarity index 66% rename from data/energy/functions/v1.5/energy/distribute_energy.mcfunction rename to data/energy/functions/v1.6/energy/distribute_energy.mcfunction index 1440fcf..2252112 100644 --- a/data/energy/functions/v1.5/energy/distribute_energy.mcfunction +++ b/data/energy/functions/v1.6/energy/distribute_energy.mcfunction @@ -4,6 +4,6 @@ scoreboard players operation #predicate energy.data = #energy.network_id energy. #collect power scoreboard players set #energy.spent energy.data 0 -execute if score #energy.spent energy.data < #energy.available energy.data if entity @s[tag=energy.receive] as @e[type=#energy:valid_block_entities,tag=energy.receive,tag=!energy.send,predicate=energy:v1.5/has_network_id] if score @s energy.storage < @s energy.max_storage run function energy:v1.5/energy/distribute_energy_2 -execute if score #energy.spent energy.data < #energy.available energy.data if entity @s[tag=!energy.receive] as @e[type=#energy:valid_block_entities,tag=energy.receive,tag=!energy.send,predicate=energy:v1.5/has_network_id] if score @s energy.storage < @s energy.max_storage run function energy:v1.5/energy/distribute_energy_2 -execute if score #energy.spent energy.data < #energy.available energy.data if entity @s[tag=!energy.receive] as @e[type=#energy:valid_block_entities,tag=energy.receive,tag=energy.send,predicate=energy:v1.5/has_network_id] if score @s energy.storage < @s energy.max_storage run function energy:v1.5/energy/distribute_energy_2 +execute if score #energy.spent energy.data < #energy.available energy.data if entity @s[tag=energy.receive] as @e[type=#energy:valid_block_entities,tag=energy.receive,tag=!energy.send,predicate=energy:v1.6/has_network_id] if score @s energy.storage < @s energy.max_storage run function energy:v1.6/energy/distribute_energy_2 +execute if score #energy.spent energy.data < #energy.available energy.data if entity @s[tag=!energy.receive] as @e[type=#energy:valid_block_entities,tag=energy.receive,tag=!energy.send,predicate=energy:v1.6/has_network_id] if score @s energy.storage < @s energy.max_storage run function energy:v1.6/energy/distribute_energy_2 +execute if score #energy.spent energy.data < #energy.available energy.data if entity @s[tag=!energy.receive] as @e[type=#energy:valid_block_entities,tag=energy.receive,tag=energy.send,predicate=energy:v1.6/has_network_id] if score @s energy.storage < @s energy.max_storage run function energy:v1.6/energy/distribute_energy_2 diff --git a/data/energy/functions/v1.5/energy/distribute_energy_2.mcfunction b/data/energy/functions/v1.6/energy/distribute_energy_2.mcfunction similarity index 100% rename from data/energy/functions/v1.5/energy/distribute_energy_2.mcfunction rename to data/energy/functions/v1.6/energy/distribute_energy_2.mcfunction diff --git a/data/energy/functions/v1.5/energy/process_networks.mcfunction b/data/energy/functions/v1.6/energy/process_networks.mcfunction similarity index 76% rename from data/energy/functions/v1.5/energy/process_networks.mcfunction rename to data/energy/functions/v1.6/energy/process_networks.mcfunction index 9dfed8c..7b7343a 100644 --- a/data/energy/functions/v1.5/energy/process_networks.mcfunction +++ b/data/energy/functions/v1.6/energy/process_networks.mcfunction @@ -1,36 +1,36 @@ #up scoreboard players operation #energy.network_id energy.data = @s energy.network_id_up -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.up] energy.storage matches 1.. run function energy:v1.5/energy/collect_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.up] energy.storage matches 1.. run function energy:v1.5/energy/distribute_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.up] energy.storage matches 1.. run function energy:v1.5/energy/spend_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.up] energy.storage matches 1.. run function energy:v1.6/energy/collect_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.up] energy.storage matches 1.. run function energy:v1.6/energy/distribute_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.up] energy.storage matches 1.. run function energy:v1.6/energy/spend_energy #down scoreboard players operation #energy.network_id energy.data = @s energy.network_id_down -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.down] energy.storage matches 1.. run function energy:v1.5/energy/collect_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.down] energy.storage matches 1.. run function energy:v1.5/energy/distribute_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.down] energy.storage matches 1.. run function energy:v1.5/energy/spend_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.down] energy.storage matches 1.. run function energy:v1.6/energy/collect_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.down] energy.storage matches 1.. run function energy:v1.6/energy/distribute_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.down] energy.storage matches 1.. run function energy:v1.6/energy/spend_energy #north scoreboard players operation #energy.network_id energy.data = @s energy.network_id_north -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.north] energy.storage matches 1.. run function energy:v1.5/energy/collect_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.north] energy.storage matches 1.. run function energy:v1.5/energy/distribute_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.north] energy.storage matches 1.. run function energy:v1.5/energy/spend_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.north] energy.storage matches 1.. run function energy:v1.6/energy/collect_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.north] energy.storage matches 1.. run function energy:v1.6/energy/distribute_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.north] energy.storage matches 1.. run function energy:v1.6/energy/spend_energy #south scoreboard players operation #energy.network_id energy.data = @s energy.network_id_south -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.south] energy.storage matches 1.. run function energy:v1.5/energy/collect_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.south] energy.storage matches 1.. run function energy:v1.5/energy/distribute_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.south] energy.storage matches 1.. run function energy:v1.5/energy/spend_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.south] energy.storage matches 1.. run function energy:v1.6/energy/collect_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.south] energy.storage matches 1.. run function energy:v1.6/energy/distribute_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.south] energy.storage matches 1.. run function energy:v1.6/energy/spend_energy #east scoreboard players operation #energy.network_id energy.data = @s energy.network_id_east -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.east] energy.storage matches 1.. run function energy:v1.5/energy/collect_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.east] energy.storage matches 1.. run function energy:v1.5/energy/distribute_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.east] energy.storage matches 1.. run function energy:v1.5/energy/spend_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.east] energy.storage matches 1.. run function energy:v1.6/energy/collect_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.east] energy.storage matches 1.. run function energy:v1.6/energy/distribute_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.east] energy.storage matches 1.. run function energy:v1.6/energy/spend_energy #west scoreboard players operation #energy.network_id energy.data = @s energy.network_id_west -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.west] energy.storage matches 1.. run function energy:v1.5/energy/collect_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.west] energy.storage matches 1.. run function energy:v1.5/energy/distribute_energy -execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.west] energy.storage matches 1.. run function energy:v1.5/energy/spend_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.west] energy.storage matches 1.. run function energy:v1.6/energy/collect_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.west] energy.storage matches 1.. run function energy:v1.6/energy/distribute_energy +execute unless score #energy.network_id energy.data matches 0 if score @s[tag=!energy.processed.west] energy.storage matches 1.. run function energy:v1.6/energy/spend_energy diff --git a/data/energy/functions/v1.5/energy/remove_tags.mcfunction b/data/energy/functions/v1.6/energy/remove_tags.mcfunction similarity index 100% rename from data/energy/functions/v1.5/energy/remove_tags.mcfunction rename to data/energy/functions/v1.6/energy/remove_tags.mcfunction diff --git a/data/energy/functions/v1.5/energy/setup_queue.mcfunction b/data/energy/functions/v1.6/energy/setup_queue.mcfunction similarity index 78% rename from data/energy/functions/v1.5/energy/setup_queue.mcfunction rename to data/energy/functions/v1.6/energy/setup_queue.mcfunction index c53d405..b67f28c 100644 --- a/data/energy/functions/v1.5/energy/setup_queue.mcfunction +++ b/data/energy/functions/v1.6/energy/setup_queue.mcfunction @@ -2,4 +2,4 @@ #trigger update for queue system scoreboard players set #progress energy.data 0 scoreboard players set #position energy.data 0 -execute as @e[type=#energy:valid_block_entities,scores={energy.storage=0..}] run function energy:v1.5/energy/update +execute as @e[type=#energy:valid_block_entities,scores={energy.storage=0..}] run function energy:v1.6/energy/update diff --git a/data/energy/functions/v1.5/energy/spend_energy.mcfunction b/data/energy/functions/v1.6/energy/spend_energy.mcfunction similarity index 61% rename from data/energy/functions/v1.5/energy/spend_energy.mcfunction rename to data/energy/functions/v1.6/energy/spend_energy.mcfunction index 5503103..d31c4f5 100644 --- a/data/energy/functions/v1.5/energy/spend_energy.mcfunction +++ b/data/energy/functions/v1.6/energy/spend_energy.mcfunction @@ -3,5 +3,5 @@ scoreboard players operation #predicate energy.data = #energy.network_id energy.data #spend power -execute if score #energy.spent energy.data matches 1.. as @e[type=#energy:valid_block_entities,tag=energy.send,tag=!energy.receive,predicate=energy:v1.5/has_network_id,scores={energy.storage=1..}] run function energy:v1.5/energy/spend_energy_2 -execute if score #energy.spent energy.data matches 1.. as @e[type=#energy:valid_block_entities,tag=energy.send,tag=energy.receive,predicate=energy:v1.5/has_network_id,scores={energy.storage=1..}] run function energy:v1.5/energy/spend_energy_2 +execute if score #energy.spent energy.data matches 1.. as @e[type=#energy:valid_block_entities,tag=energy.send,tag=!energy.receive,predicate=energy:v1.6/has_network_id,scores={energy.storage=1..}] run function energy:v1.6/energy/spend_energy_2 +execute if score #energy.spent energy.data matches 1.. as @e[type=#energy:valid_block_entities,tag=energy.send,tag=energy.receive,predicate=energy:v1.6/has_network_id,scores={energy.storage=1..}] run function energy:v1.6/energy/spend_energy_2 diff --git a/data/energy/functions/v1.5/energy/spend_energy_2.mcfunction b/data/energy/functions/v1.6/energy/spend_energy_2.mcfunction similarity index 100% rename from data/energy/functions/v1.5/energy/spend_energy_2.mcfunction rename to data/energy/functions/v1.6/energy/spend_energy_2.mcfunction diff --git a/data/energy/functions/v1.5/energy/update.mcfunction b/data/energy/functions/v1.6/energy/update.mcfunction similarity index 52% rename from data/energy/functions/v1.5/energy/update.mcfunction rename to data/energy/functions/v1.6/energy/update.mcfunction index 881777d..17394eb 100644 --- a/data/energy/functions/v1.5/energy/update.mcfunction +++ b/data/energy/functions/v1.6/energy/update.mcfunction @@ -1,4 +1,4 @@ -function energy:v1.5/energy/change_rate -execute if entity @s[scores={energy.storage=1..},tag=energy.send] run function energy:v1.5/energy/add_to_queue -execute if entity @s[tag=energy.processed] at @s run function energy:v1.5/energy/remove_tags +function energy:v1.6/energy/change_rate +execute if entity @s[scores={energy.storage=1..},tag=energy.send] run function energy:v1.6/energy/add_to_queue +execute if entity @s[tag=energy.processed] at @s run function energy:v1.6/energy/remove_tags diff --git a/data/energy/functions/v1.5/enumerate.mcfunction b/data/energy/functions/v1.6/enumerate.mcfunction similarity index 71% rename from data/energy/functions/v1.5/enumerate.mcfunction rename to data/energy/functions/v1.6/enumerate.mcfunction index 827c519..683a1ab 100644 --- a/data/energy/functions/v1.5/enumerate.mcfunction +++ b/data/energy/functions/v1.6/enumerate.mcfunction @@ -2,6 +2,6 @@ scoreboard players add #energy.major load.status 0 scoreboard players add #energy.minor load.status 0 -execute if score #energy.major load.status matches ..0 run scoreboard players set #energy.minor load.status 5 +execute if score #energy.major load.status matches ..0 run scoreboard players set #energy.minor load.status 6 execute if score #energy.major load.status matches ..0 run scoreboard players set #energy.major load.status 1 -execute if score #energy.major load.status matches 1 if score #energy.minor load.status matches ..5 run scoreboard players set #energy.minor load.status 5 +execute if score #energy.major load.status matches 1 if score #energy.minor load.status matches ..6 run scoreboard players set #energy.minor load.status 6 diff --git a/data/energy/functions/v1.5/init.mcfunction b/data/energy/functions/v1.6/init.mcfunction similarity index 94% rename from data/energy/functions/v1.5/init.mcfunction rename to data/energy/functions/v1.6/init.mcfunction index 5d94080..95546f5 100644 --- a/data/energy/functions/v1.5/init.mcfunction +++ b/data/energy/functions/v1.6/init.mcfunction @@ -18,4 +18,4 @@ scoreboard objectives add energy.update_queue dummy scoreboard players set #20 energy.data 20 -schedule function energy:v1.5/tick 3t replace +schedule function energy:v1.6/tick 3t replace diff --git a/data/energy/functions/v1.5/machine/break.mcfunction b/data/energy/functions/v1.6/machine/break.mcfunction similarity index 55% rename from data/energy/functions/v1.5/machine/break.mcfunction rename to data/energy/functions/v1.6/machine/break.mcfunction index c7f9d30..2dded70 100644 --- a/data/energy/functions/v1.5/machine/break.mcfunction +++ b/data/energy/functions/v1.6/machine/break.mcfunction @@ -2,4 +2,4 @@ tag @s remove energy.send tag @s remove energy.receive -function energy:v1.5/machine/update_adjacent +function energy:v1.6/machine/update_adjacent diff --git a/data/energy/functions/v1.5/machine/init.mcfunction b/data/energy/functions/v1.6/machine/init.mcfunction similarity index 92% rename from data/energy/functions/v1.5/machine/init.mcfunction rename to data/energy/functions/v1.6/machine/init.mcfunction index 161b91a..90c9693 100644 --- a/data/energy/functions/v1.5/machine/init.mcfunction +++ b/data/energy/functions/v1.6/machine/init.mcfunction @@ -13,4 +13,4 @@ scoreboard players add @s energy.network_id_east 0 scoreboard players add @s energy.network_id_west 0 #update adjacent cables -function energy:v1.5/machine/update_adjacent +function energy:v1.6/machine/update_adjacent diff --git a/data/energy/functions/v1.5/machine/update_adjacent.mcfunction b/data/energy/functions/v1.6/machine/update_adjacent.mcfunction similarity index 86% rename from data/energy/functions/v1.5/machine/update_adjacent.mcfunction rename to data/energy/functions/v1.6/machine/update_adjacent.mcfunction index 40ade39..5bb414a 100644 --- a/data/energy/functions/v1.5/machine/update_adjacent.mcfunction +++ b/data/energy/functions/v1.6/machine/update_adjacent.mcfunction @@ -9,30 +9,30 @@ execute if entity @s[tag=energy.receive,tag=energy.send] run scoreboard players #update adjacent devices scoreboard players set #machine.direction energy.data 0 scoreboard players set #machine.out energy.data 0 -execute align xyz positioned ~ ~1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/machine/update_adjacent_2 +execute align xyz positioned ~ ~1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/machine/update_adjacent_2 execute unless score #machine.out energy.data matches 0 run scoreboard players operation @s energy.network_id_up = #machine.out energy.data scoreboard players set #machine.direction energy.data 1 scoreboard players set #machine.out energy.data 0 -execute align xyz positioned ~ ~-1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/machine/update_adjacent_2 +execute align xyz positioned ~ ~-1 ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/machine/update_adjacent_2 execute unless score #machine.out energy.data matches 0 run scoreboard players operation @s energy.network_id_down = #machine.out energy.data scoreboard players set #machine.direction energy.data 2 scoreboard players set #machine.out energy.data 0 -execute align xyz positioned ~ ~ ~-1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/machine/update_adjacent_2 +execute align xyz positioned ~ ~ ~-1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/machine/update_adjacent_2 execute unless score #machine.out energy.data matches 0 run scoreboard players operation @s energy.network_id_south = #machine.out energy.data scoreboard players set #machine.direction energy.data 3 scoreboard players set #machine.out energy.data 0 -execute align xyz positioned ~ ~ ~1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/machine/update_adjacent_2 +execute align xyz positioned ~ ~ ~1 as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/machine/update_adjacent_2 execute unless score #machine.out energy.data matches 0 run scoreboard players operation @s energy.network_id_north = #machine.out energy.data scoreboard players set #machine.direction energy.data 4 scoreboard players set #machine.out energy.data 0 -execute align xyz positioned ~1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/machine/update_adjacent_2 +execute align xyz positioned ~1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/machine/update_adjacent_2 execute unless score #machine.out energy.data matches 0 run scoreboard players operation @s energy.network_id_west = #machine.out energy.data scoreboard players set #machine.direction energy.data 5 scoreboard players set #machine.out energy.data 0 -execute align xyz positioned ~-1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.5/machine/update_adjacent_2 +execute align xyz positioned ~-1 ~ ~ as @e[type=#energy:valid_block_entities,dx=0,dy=0,dz=0] at @s run function energy:v1.6/machine/update_adjacent_2 execute unless score #machine.out energy.data matches 0 run scoreboard players operation @s energy.network_id_east = #machine.out energy.data diff --git a/data/energy/functions/v1.5/machine/update_adjacent_2.mcfunction b/data/energy/functions/v1.6/machine/update_adjacent_2.mcfunction similarity index 54% rename from data/energy/functions/v1.5/machine/update_adjacent_2.mcfunction rename to data/energy/functions/v1.6/machine/update_adjacent_2.mcfunction index 9143ef0..db3eb1a 100644 --- a/data/energy/functions/v1.5/machine/update_adjacent_2.mcfunction +++ b/data/energy/functions/v1.6/machine/update_adjacent_2.mcfunction @@ -1,7 +1,7 @@ #reroute to proper function -execute if score #machine.type energy.data matches 1 if entity @s[tag=energy.receive] run function energy:v1.5/machine/update_adjacent_machine -execute if score #machine.type energy.data matches 2 if entity @s[tag=energy.send] run function energy:v1.5/machine/update_adjacent_machine -execute if score #machine.type energy.data matches 3 if entity @s[tag=energy.receive,tag=!energy.send] run function energy:v1.5/machine/update_adjacent_machine -execute if score #machine.type energy.data matches 3 if entity @s[tag=!energy.receive,tag=energy.send] run function energy:v1.5/machine/update_adjacent_machine -execute if entity @s[tag=energy.cable] run function energy:v1.5/cable/update +execute if score #machine.type energy.data matches 1 if entity @s[tag=energy.receive] run function energy:v1.6/machine/update_adjacent_machine +execute if score #machine.type energy.data matches 2 if entity @s[tag=energy.send] run function energy:v1.6/machine/update_adjacent_machine +execute if score #machine.type energy.data matches 3 if entity @s[tag=energy.receive,tag=!energy.send] run function energy:v1.6/machine/update_adjacent_machine +execute if score #machine.type energy.data matches 3 if entity @s[tag=!energy.receive,tag=energy.send] run function energy:v1.6/machine/update_adjacent_machine +execute if entity @s[tag=energy.cable] run function energy:v1.6/cable/update diff --git a/data/energy/functions/v1.5/machine/update_adjacent_machine.mcfunction b/data/energy/functions/v1.6/machine/update_adjacent_machine.mcfunction similarity index 100% rename from data/energy/functions/v1.5/machine/update_adjacent_machine.mcfunction rename to data/energy/functions/v1.6/machine/update_adjacent_machine.mcfunction diff --git a/data/energy/functions/v1.5/player/modify_energy.mcfunction b/data/energy/functions/v1.6/player/modify_energy.mcfunction similarity index 96% rename from data/energy/functions/v1.5/player/modify_energy.mcfunction rename to data/energy/functions/v1.6/player/modify_energy.mcfunction index ed74796..b1fce2e 100644 --- a/data/energy/functions/v1.5/player/modify_energy.mcfunction +++ b/data/energy/functions/v1.6/player/modify_energy.mcfunction @@ -12,5 +12,5 @@ data modify storage energy:temp list set value [] data modify storage energy:temp list append from entity @s Inventory[{Count:1b,tag:{energy:{}}}] #loop over inv -execute if data storage energy:temp list[0] run function energy:v1.5/player/modify_energy_2 +execute if data storage energy:temp list[0] run function energy:v1.6/player/modify_energy_2 execute if score #player.energy energy.data matches 0 run scoreboard players set #player.out energy.data 1 diff --git a/data/energy/functions/v1.5/player/modify_energy_2.mcfunction b/data/energy/functions/v1.6/player/modify_energy_2.mcfunction similarity index 55% rename from data/energy/functions/v1.5/player/modify_energy_2.mcfunction rename to data/energy/functions/v1.6/player/modify_energy_2.mcfunction index 1716864..02d5681 100644 --- a/data/energy/functions/v1.5/player/modify_energy_2.mcfunction +++ b/data/energy/functions/v1.6/player/modify_energy_2.mcfunction @@ -1,6 +1,6 @@ -function energy:v1.5/player/modify_energy_3 +function energy:v1.6/player/modify_energy_3 #loop over inv data remove storage energy:temp list[0] -execute unless score #player.energy energy.data matches 0 if data storage energy:temp list[0] run function energy:v1.5/player/modify_energy_2 +execute unless score #player.energy energy.data matches 0 if data storage energy:temp list[0] run function energy:v1.6/player/modify_energy_2 diff --git a/data/energy/functions/v1.5/player/modify_energy_3.mcfunction b/data/energy/functions/v1.6/player/modify_energy_3.mcfunction similarity index 97% rename from data/energy/functions/v1.5/player/modify_energy_3.mcfunction rename to data/energy/functions/v1.6/player/modify_energy_3.mcfunction index f268bba..09f34b0 100644 --- a/data/energy/functions/v1.5/player/modify_energy_3.mcfunction +++ b/data/energy/functions/v1.6/player/modify_energy_3.mcfunction @@ -25,4 +25,4 @@ execute unless score #player.delta energy.data matches 0 store result storage en execute unless score #player.delta energy.data matches 0 run function #energy:v1/update_energy_item #update item -execute unless score #player.delta energy.data matches 0 run function energy:v1.5/player/modify_energy_update +execute unless score #player.delta energy.data matches 0 run function energy:v1.6/player/modify_energy_update diff --git a/data/energy/functions/v1.5/player/modify_energy_update.mcfunction b/data/energy/functions/v1.6/player/modify_energy_update.mcfunction similarity index 53% rename from data/energy/functions/v1.5/player/modify_energy_update.mcfunction rename to data/energy/functions/v1.6/player/modify_energy_update.mcfunction index 4393f9a..a670e7b 100644 --- a/data/energy/functions/v1.5/player/modify_energy_update.mcfunction +++ b/data/energy/functions/v1.6/player/modify_energy_update.mcfunction @@ -1,46 +1,46 @@ -execute if score #player.slot energy.data matches 0 run item modify entity @s hotbar.0 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 1 run item modify entity @s hotbar.1 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 2 run item modify entity @s hotbar.2 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 3 run item modify entity @s hotbar.3 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 4 run item modify entity @s hotbar.4 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 5 run item modify entity @s hotbar.5 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 6 run item modify entity @s hotbar.6 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 7 run item modify entity @s hotbar.7 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 8 run item modify entity @s hotbar.8 energy:v1.5/apply_item_energy +execute if score #player.slot energy.data matches 0 run item modify entity @s hotbar.0 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 1 run item modify entity @s hotbar.1 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 2 run item modify entity @s hotbar.2 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 3 run item modify entity @s hotbar.3 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 4 run item modify entity @s hotbar.4 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 5 run item modify entity @s hotbar.5 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 6 run item modify entity @s hotbar.6 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 7 run item modify entity @s hotbar.7 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 8 run item modify entity @s hotbar.8 energy:v1.6/apply_item_energy -execute if score #player.slot energy.data matches 9 run item modify entity @s inventory.0 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 10 run item modify entity @s inventory.1 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 11 run item modify entity @s inventory.2 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 12 run item modify entity @s inventory.3 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 13 run item modify entity @s inventory.4 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 14 run item modify entity @s inventory.5 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 15 run item modify entity @s inventory.6 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 16 run item modify entity @s inventory.7 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 17 run item modify entity @s inventory.8 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 18 run item modify entity @s inventory.9 energy:v1.5/apply_item_energy +execute if score #player.slot energy.data matches 9 run item modify entity @s inventory.0 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 10 run item modify entity @s inventory.1 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 11 run item modify entity @s inventory.2 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 12 run item modify entity @s inventory.3 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 13 run item modify entity @s inventory.4 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 14 run item modify entity @s inventory.5 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 15 run item modify entity @s inventory.6 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 16 run item modify entity @s inventory.7 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 17 run item modify entity @s inventory.8 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 18 run item modify entity @s inventory.9 energy:v1.6/apply_item_energy -execute if score #player.slot energy.data matches 19 run item modify entity @s inventory.10 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 20 run item modify entity @s inventory.11 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 21 run item modify entity @s inventory.12 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 22 run item modify entity @s inventory.13 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 23 run item modify entity @s inventory.14 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 24 run item modify entity @s inventory.15 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 25 run item modify entity @s inventory.16 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 26 run item modify entity @s inventory.17 energy:v1.5/apply_item_energy +execute if score #player.slot energy.data matches 19 run item modify entity @s inventory.10 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 20 run item modify entity @s inventory.11 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 21 run item modify entity @s inventory.12 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 22 run item modify entity @s inventory.13 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 23 run item modify entity @s inventory.14 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 24 run item modify entity @s inventory.15 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 25 run item modify entity @s inventory.16 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 26 run item modify entity @s inventory.17 energy:v1.6/apply_item_energy -execute if score #player.slot energy.data matches 27 run item modify entity @s inventory.18 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 28 run item modify entity @s inventory.19 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 29 run item modify entity @s inventory.20 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 30 run item modify entity @s inventory.21 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 31 run item modify entity @s inventory.22 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 32 run item modify entity @s inventory.23 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 33 run item modify entity @s inventory.24 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 34 run item modify entity @s inventory.25 energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 35 run item modify entity @s inventory.26 energy:v1.5/apply_item_energy +execute if score #player.slot energy.data matches 27 run item modify entity @s inventory.18 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 28 run item modify entity @s inventory.19 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 29 run item modify entity @s inventory.20 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 30 run item modify entity @s inventory.21 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 31 run item modify entity @s inventory.22 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 32 run item modify entity @s inventory.23 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 33 run item modify entity @s inventory.24 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 34 run item modify entity @s inventory.25 energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 35 run item modify entity @s inventory.26 energy:v1.6/apply_item_energy -execute if score #player.slot energy.data matches 100 run item modify entity @s armor.feet energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 101 run item modify entity @s armor.legs energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 102 run item modify entity @s armor.chest energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches 103 run item modify entity @s armor.head energy:v1.5/apply_item_energy -execute if score #player.slot energy.data matches -106 run item modify entity @s weapon.offhand energy:v1.5/apply_item_energy +execute if score #player.slot energy.data matches 100 run item modify entity @s armor.feet energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 101 run item modify entity @s armor.legs energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 102 run item modify entity @s armor.chest energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches 103 run item modify entity @s armor.head energy:v1.6/apply_item_energy +execute if score #player.slot energy.data matches -106 run item modify entity @s weapon.offhand energy:v1.6/apply_item_energy diff --git a/data/energy/functions/v1.6/resolve.mcfunction b/data/energy/functions/v1.6/resolve.mcfunction new file mode 100644 index 0000000..96dbf96 --- /dev/null +++ b/data/energy/functions/v1.6/resolve.mcfunction @@ -0,0 +1,5 @@ + +schedule clear energy:v1.6/init +schedule clear energy:v1.6/tick + +execute if predicate energy:v1.6/is_correct_version run function energy:v1.6/init diff --git a/data/energy/functions/v1.5/tick.mcfunction b/data/energy/functions/v1.6/tick.mcfunction similarity index 50% rename from data/energy/functions/v1.5/tick.mcfunction rename to data/energy/functions/v1.6/tick.mcfunction index 1c6e569..5457e8d 100644 --- a/data/energy/functions/v1.5/tick.mcfunction +++ b/data/energy/functions/v1.6/tick.mcfunction @@ -1,7 +1,7 @@ -schedule function energy:v1.5/tick 1t replace +schedule function energy:v1.6/tick 1t replace scoreboard players add #progress energy.data 1 -execute if score #progress energy.data matches 20.. run function energy:v1.5/energy/setup_queue +execute if score #progress energy.data matches 20.. run function energy:v1.6/energy/setup_queue -execute as @e[type=#energy:valid_block_entities,tag=energy.send,predicate=energy:v1.5/equals_queue_progress] at @s run function energy:v1.5/energy/process_networks +execute as @e[type=#energy:valid_block_entities,tag=energy.send,predicate=energy:v1.6/equals_queue_progress] at @s run function energy:v1.6/energy/process_networks diff --git a/data/energy/functions/v1.6/versioning/break_cable.mcfunction b/data/energy/functions/v1.6/versioning/break_cable.mcfunction new file mode 100644 index 0000000..baa9ea9 --- /dev/null +++ b/data/energy/functions/v1.6/versioning/break_cable.mcfunction @@ -0,0 +1,2 @@ + +execute if predicate energy:v1.6/is_correct_version run function energy:v1.6/cable/break diff --git a/data/energy/functions/v1.6/versioning/break_machine.mcfunction b/data/energy/functions/v1.6/versioning/break_machine.mcfunction new file mode 100644 index 0000000..bb4b04e --- /dev/null +++ b/data/energy/functions/v1.6/versioning/break_machine.mcfunction @@ -0,0 +1,2 @@ + +execute if predicate energy:v1.6/is_correct_version run function energy:v1.6/machine/break diff --git a/data/energy/functions/v1.6/versioning/init_cable.mcfunction b/data/energy/functions/v1.6/versioning/init_cable.mcfunction new file mode 100644 index 0000000..4146c0e --- /dev/null +++ b/data/energy/functions/v1.6/versioning/init_cable.mcfunction @@ -0,0 +1,2 @@ + +execute if predicate energy:v1.6/is_correct_version run function energy:v1.6/cable/init diff --git a/data/energy/functions/v1.6/versioning/init_machine.mcfunction b/data/energy/functions/v1.6/versioning/init_machine.mcfunction new file mode 100644 index 0000000..aefcfb4 --- /dev/null +++ b/data/energy/functions/v1.6/versioning/init_machine.mcfunction @@ -0,0 +1,2 @@ + +execute if predicate energy:v1.6/is_correct_version run function energy:v1.6/machine/init diff --git a/data/energy/functions/v1.6/versioning/modify_player_energy.mcfunction b/data/energy/functions/v1.6/versioning/modify_player_energy.mcfunction new file mode 100644 index 0000000..a744372 --- /dev/null +++ b/data/energy/functions/v1.6/versioning/modify_player_energy.mcfunction @@ -0,0 +1,2 @@ + +execute if predicate energy:v1.6/is_correct_version if entity @s[type=minecraft:player] run function energy:v1.6/player/modify_energy diff --git a/data/energy/item_modifiers/v1.5/apply_item_energy.json b/data/energy/item_modifiers/v1.6/apply_item_energy.json similarity index 100% rename from data/energy/item_modifiers/v1.5/apply_item_energy.json rename to data/energy/item_modifiers/v1.6/apply_item_energy.json diff --git a/data/energy/predicates/v1.5/equals_network_id.json b/data/energy/predicates/v1.6/equals_network_id.json similarity index 100% rename from data/energy/predicates/v1.5/equals_network_id.json rename to data/energy/predicates/v1.6/equals_network_id.json diff --git a/data/energy/predicates/v1.5/equals_queue_progress.json b/data/energy/predicates/v1.6/equals_queue_progress.json similarity index 100% rename from data/energy/predicates/v1.5/equals_queue_progress.json rename to data/energy/predicates/v1.6/equals_queue_progress.json diff --git a/data/energy/predicates/v1.5/has_network_id.json b/data/energy/predicates/v1.6/has_network_id.json similarity index 100% rename from data/energy/predicates/v1.5/has_network_id.json rename to data/energy/predicates/v1.6/has_network_id.json diff --git a/data/energy/predicates/v1.5/is_correct_version.json b/data/energy/predicates/v1.6/is_correct_version.json similarity index 98% rename from data/energy/predicates/v1.5/is_correct_version.json rename to data/energy/predicates/v1.6/is_correct_version.json index aea4d69..716d6a1 100644 --- a/data/energy/predicates/v1.5/is_correct_version.json +++ b/data/energy/predicates/v1.6/is_correct_version.json @@ -25,7 +25,7 @@ }, { "condition": "minecraft:value_check", - "value": 5, + "value": 6, "range": { "min": { "type": "minecraft:score", diff --git a/data/energy/tags/functions/enumerate.json b/data/energy/tags/functions/enumerate.json index ef829ec..5b25c68 100644 --- a/data/energy/tags/functions/enumerate.json +++ b/data/energy/tags/functions/enumerate.json @@ -1,5 +1,5 @@ { "values": [ - "energy:v1.5/enumerate" + "energy:v1.6/enumerate" ] } diff --git a/data/energy/tags/functions/resolve.json b/data/energy/tags/functions/resolve.json index da32a6e..0aaf914 100644 --- a/data/energy/tags/functions/resolve.json +++ b/data/energy/tags/functions/resolve.json @@ -1,5 +1,5 @@ { "values": [ - "energy:v1.5/resolve" + "energy:v1.6/resolve" ] } diff --git a/data/energy/tags/functions/v1/internal/break_cable.json b/data/energy/tags/functions/v1/internal/break_cable.json index d43cc14..9faad4d 100644 --- a/data/energy/tags/functions/v1/internal/break_cable.json +++ b/data/energy/tags/functions/v1/internal/break_cable.json @@ -1,5 +1,5 @@ { "values": [ - "energy:v1.5/versioning/break_cable" + "energy:v1.6/versioning/break_cable" ] } \ No newline at end of file diff --git a/data/energy/tags/functions/v1/internal/break_machine.json b/data/energy/tags/functions/v1/internal/break_machine.json index a9f3fd9..7d9b1e0 100644 --- a/data/energy/tags/functions/v1/internal/break_machine.json +++ b/data/energy/tags/functions/v1/internal/break_machine.json @@ -1,5 +1,5 @@ { "values": [ - "energy:v1.5/versioning/break_machine" + "energy:v1.6/versioning/break_machine" ] } \ No newline at end of file diff --git a/data/energy/tags/functions/v1/internal/init_cable.json b/data/energy/tags/functions/v1/internal/init_cable.json index 9855005..d71da43 100644 --- a/data/energy/tags/functions/v1/internal/init_cable.json +++ b/data/energy/tags/functions/v1/internal/init_cable.json @@ -1,5 +1,5 @@ { "values": [ - "energy:v1.5/versioning/init_cable" + "energy:v1.6/versioning/init_cable" ] } \ No newline at end of file diff --git a/data/energy/tags/functions/v1/internal/init_machine.json b/data/energy/tags/functions/v1/internal/init_machine.json index 699fcfe..f65e20a 100644 --- a/data/energy/tags/functions/v1/internal/init_machine.json +++ b/data/energy/tags/functions/v1/internal/init_machine.json @@ -1,5 +1,5 @@ { "values": [ - "energy:v1.5/versioning/init_machine" + "energy:v1.6/versioning/init_machine" ] } \ No newline at end of file diff --git a/data/energy/tags/functions/v1/internal/modify_player_energy.json b/data/energy/tags/functions/v1/internal/modify_player_energy.json index 12271f4..ca43852 100644 --- a/data/energy/tags/functions/v1/internal/modify_player_energy.json +++ b/data/energy/tags/functions/v1/internal/modify_player_energy.json @@ -1,5 +1,5 @@ { "values": [ - "energy:v1.5/versioning/modify_player_energy" + "energy:v1.6/versioning/modify_player_energy" ] } \ No newline at end of file diff --git a/dependencies.json b/dependencies.json index 69e8709..1da499f 100644 --- a/dependencies.json +++ b/dependencies.json @@ -14,5 +14,5 @@ "value": "#energy:load" } ], - "version": "v1.5" + "version": "v1.6" } \ No newline at end of file