Skip to content

Commit

Permalink
fix: not restricting servo to item frame
Browse files Browse the repository at this point in the history
  • Loading branch information
edayot committed Jul 13, 2024
1 parent b078a28 commit d5d9d3e
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions data/itemio/functions/impl/servo/calc_cable_model.mcfunction
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
scoreboard players operation #model_final_temp itemio.math = #model_final itemio.math
execute
if data entity @s {Facing:0b}

execute store result score #rotation_0 itemio.math run data get entity @s Rotation[0]
execute store result score #rotation_1 itemio.math run data get entity @s Rotation[1]

execute
if score #rotation_0 itemio.math matches 0
if score #rotation_1 itemio.math matches 90
run function ~/down:
scoreboard players operation #model_final_temp itemio.math %= #2 itemio.math
execute if score #model_final_temp itemio.math matches 0 run scoreboard players add #model_final itemio.math 1
execute
if data entity @s {Facing:1b}
if score #rotation_0 itemio.math matches 0
if score #rotation_1 itemio.math matches -90
run function ~/up:
scoreboard players operation #model_final_temp itemio.math /= #2 itemio.math
scoreboard players operation #model_final_temp itemio.math %= #2 itemio.math
execute if score #model_final_temp itemio.math matches 0 run scoreboard players add #model_final itemio.math 2
execute
if data entity @s {Facing:2b}
if score #rotation_0 itemio.math matches 180
if score #rotation_1 itemio.math matches 0
run function ~/north:
scoreboard players operation #model_final_temp itemio.math /= #8 itemio.math
scoreboard players operation #model_final_temp itemio.math %= #2 itemio.math
execute if score #model_final_temp itemio.math matches 0 run scoreboard players add #model_final itemio.math 8
execute
if data entity @s {Facing:3b}
if score #rotation_0 itemio.math matches 0
if score #rotation_1 itemio.math matches 0
run function ~/south:
scoreboard players operation #model_final_temp itemio.math /= #4 itemio.math
scoreboard players operation #model_final_temp itemio.math %= #2 itemio.math
execute if score #model_final_temp itemio.math matches 0 run scoreboard players add #model_final itemio.math 4

execute
if data entity @s {Facing:4b}
if score #rotation_0 itemio.math matches 90
if score #rotation_1 itemio.math matches 0
run function ~/west:
say west
scoreboard players operation #model_final_temp itemio.math /= #32 itemio.math
scoreboard players operation #model_final_temp itemio.math %= #2 itemio.math
execute if score #model_final_temp itemio.math matches 0 run scoreboard players add #model_final itemio.math 32
execute
if data entity @s {Facing:5b}
if score #rotation_0 itemio.math matches 270
if score #rotation_1 itemio.math matches 0
run function ~/east:
scoreboard players operation #model_final_temp itemio.math /= #16 itemio.math
scoreboard players operation #model_final_temp itemio.math %= #2 itemio.math
Expand Down

0 comments on commit d5d9d3e

Please sign in to comment.