Skip to content

Commit c2cca8e

Browse files
committed
♻️ TSB のコード規約に合わせてコード全体を修正
1 parent f3afc36 commit c2cca8e

21 files changed

Lines changed: 185 additions & 118 deletions
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
#> player_motion:api/launch_looking
2+
#
23
# Launches the player in the input direction
4+
#
5+
# @user
6+
# @api
7+
38
execute if entity @s[type=!player] run return fail
49
execute on vehicle run return fail
510

6-
scoreboard players set $function_called player_motion.internal.dummy 1
7-
tag @s add player_motion.launch
11+
scoreboard players set $function_called PlayerMotion.Internal.Dummy 1
12+
tag @s add PlayerMotion.Launch
813

9-
execute store result storage player_motion:math strength double 0.0001 run scoreboard players get $strength player_motion.api.launch
10-
execute as d4bd74a7-4e82-4a07-8850-dfc4d89f9e2f in minecraft:overworld positioned 0.0 0.0 0.0 run function player_motion:internal/math/looking_to_xyz with storage player_motion:math
14+
execute store result storage player_motion:math strength double 0.0001 run scoreboard players get $strength PlayerMotion.Api.Launch
15+
execute as 0-0-0-0-0 in minecraft:overworld positioned 0.0 0.0 0.0 run function player_motion:internal/math/looking_to_xyz with storage player_motion:math
1116

12-
execute store result score $out player_motion.internal.motion.x run data get storage player_motion:math motion[0] 10000
13-
execute store result score $out player_motion.internal.motion.y run data get storage player_motion:math motion[1] 10000
14-
execute store result score $out player_motion.internal.motion.z run data get storage player_motion:math motion[2] 10000
17+
execute store result score $out PlayerMotion.Internal.Motion.X run data get storage player_motion:math motion[0] 10000
18+
execute store result score $out PlayerMotion.Internal.Motion.Y run data get storage player_motion:math motion[1] 10000
19+
execute store result score $out PlayerMotion.Internal.Motion.Z run data get storage player_motion:math motion[2] 10000
1520

16-
scoreboard players operation @s player_motion.internal.motion.x += $out player_motion.internal.motion.x
17-
scoreboard players operation @s player_motion.internal.motion.y += $out player_motion.internal.motion.y
18-
scoreboard players operation @s player_motion.internal.motion.z += $out player_motion.internal.motion.z
21+
scoreboard players operation @s PlayerMotion.Internal.Motion.X += $out PlayerMotion.Internal.Motion.X
22+
scoreboard players operation @s PlayerMotion.Internal.Motion.Y += $out PlayerMotion.Internal.Motion.Y
23+
scoreboard players operation @s PlayerMotion.Internal.Motion.Z += $out PlayerMotion.Internal.Motion.Z
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
#> player_motion:api/launch_xyz
2+
#
23
# Launches the player in the input direction
4+
#
5+
# @user
6+
# @api
7+
38
execute if entity @s[type=!player] run return fail
49
execute on vehicle run return fail
510

6-
scoreboard players set $function_called player_motion.internal.dummy 1
7-
tag @s add player_motion.launch
11+
scoreboard players set $function_called PlayerMotion.Internal.Dummy 1
12+
tag @s add PlayerMotion.Launch
813

9-
scoreboard players operation @s player_motion.internal.motion.x += $x player_motion.api.launch
10-
scoreboard players operation @s player_motion.internal.motion.y += $y player_motion.api.launch
11-
scoreboard players operation @s player_motion.internal.motion.z += $z player_motion.api.launch
14+
scoreboard players operation @s PlayerMotion.Internal.Motion.X += $x PlayerMotion.Api.Launch
15+
scoreboard players operation @s PlayerMotion.Internal.Motion.Y += $y PlayerMotion.Api.Launch
16+
scoreboard players operation @s PlayerMotion.Internal.Motion.Z += $z PlayerMotion.Api.Launch
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
#> player_motion:internal/launch/exp_pos
2-
$tp d4bd74a7-4e82-4a07-8850-dfc4d89f9e2f ^ ^ ^$(d)
2+
# @private
3+
4+
$tp 0-0-0-0-0 ^ ^ ^$(d)
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#> player_motion:internal/launch/gamemode/get
2-
execute if entity @s[gamemode=survival] run return run scoreboard players set $mode player_motion.internal.gamemode 0
3-
execute if entity @s[gamemode=creative] run return run scoreboard players set $mode player_motion.internal.gamemode 1
4-
execute if entity @s[gamemode=adventure] run return run scoreboard players set $mode player_motion.internal.gamemode 2
5-
execute if entity @s[gamemode=spectator] run scoreboard players set $mode player_motion.internal.gamemode 3
2+
# @within function player_motion:internal/launch/main
3+
4+
execute if entity @s[gamemode=survival] run return run scoreboard players set $mode PlayerMotion.Internal.Gamemode 0
5+
execute if entity @s[gamemode=creative] run return run scoreboard players set $mode PlayerMotion.Internal.Gamemode 1
6+
execute if entity @s[gamemode=adventure] run return run scoreboard players set $mode PlayerMotion.Internal.Gamemode 2
7+
execute if entity @s[gamemode=spectator] run scoreboard players set $mode PlayerMotion.Internal.Gamemode 3
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#> player_motion:internal/launch/gamemode/restore
2-
execute if score $mode player_motion.internal.gamemode matches 0 run return run gamemode survival @s
3-
execute if score $mode player_motion.internal.gamemode matches 1 run return run gamemode creative @s
4-
execute if score $mode player_motion.internal.gamemode matches 2 run return run gamemode adventure @s
5-
execute if score $mode player_motion.internal.gamemode matches 3 run gamemode spectator @s
2+
# @within function player_motion:internal/launch/main
3+
4+
execute if score $mode PlayerMotion.Internal.Gamemode matches 0 run return run gamemode survival @s
5+
execute if score $mode PlayerMotion.Internal.Gamemode matches 1 run return run gamemode creative @s
6+
execute if score $mode PlayerMotion.Internal.Gamemode matches 2 run return run gamemode adventure @s
7+
execute if score $mode PlayerMotion.Internal.Gamemode matches 3 run gamemode spectator @s
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#> player_motion:internal/launch/main
2+
#
23
# Launches players in the input direction
4+
#
5+
# @within function player_motion:internal/technical/tick
36

4-
execute store result storage player_motion:math motion[0] double 0.0001 store result storage player_motion:math motion_x double 0.0001 run scoreboard players operation $motion_x player_motion.internal.math = @s player_motion.internal.motion.x
5-
execute store result storage player_motion:math motion[1] double 0.0001 store result storage player_motion:math motion_y double 0.0001 run scoreboard players operation $motion_y player_motion.internal.math = @s player_motion.internal.motion.y
6-
execute store result storage player_motion:math motion[2] double 0.0001 store result storage player_motion:math motion_z double 0.0001 run scoreboard players operation $motion_z player_motion.internal.math = @s player_motion.internal.motion.z
7+
execute store result storage player_motion:math motion[0] double 0.0001 store result storage player_motion:math motion_x double 0.0001 run scoreboard players operation $motion_x PlayerMotion.Internal.Math = @s PlayerMotion.Internal.Motion.X
8+
execute store result storage player_motion:math motion[1] double 0.0001 store result storage player_motion:math motion_y double 0.0001 run scoreboard players operation $motion_y PlayerMotion.Internal.Math = @s PlayerMotion.Internal.Motion.Y
9+
execute store result storage player_motion:math motion[2] double 0.0001 store result storage player_motion:math motion_z double 0.0001 run scoreboard players operation $motion_z PlayerMotion.Internal.Math = @s PlayerMotion.Internal.Motion.Z
710

811
execute in minecraft:overworld run function player_motion:internal/math/main
912
# attribute @s explosion_knockback_resistance modifier add player_motion:disable_knockback_resistance -1 add_multiplied_total
@@ -15,10 +18,10 @@ tp ~ ~ ~
1518
function player_motion:internal/launch/gamemode/restore
1619
# attribute @s explosion_knockback_resistance modifier remove player_motion:disable_knockback_resistance
1720

18-
scoreboard players set $function_called player_motion.internal.dummy 0
19-
tag @s remove player_motion.launch
21+
scoreboard players set $function_called PlayerMotion.Internal.Dummy 0
22+
tag @s remove PlayerMotion.Launch
2023

2124
# Reset scoreboards
22-
scoreboard players reset @s player_motion.internal.motion.x
23-
scoreboard players reset @s player_motion.internal.motion.y
24-
scoreboard players reset @s player_motion.internal.motion.z
25+
scoreboard players reset @s PlayerMotion.Internal.Motion.X
26+
scoreboard players reset @s PlayerMotion.Internal.Motion.Y
27+
scoreboard players reset @s PlayerMotion.Internal.Motion.Z
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#> player_motion:internal/math/eyelevel
2+
# @within function player_motion:internal/math/main
3+
24
# eyelevel=y(eyes)-y(player)
3-
execute anchored eyes positioned ^ ^ ^ if entity @s[distance=...41] run return run scoreboard players set $eyelevel player_motion.internal.math 40
5+
execute anchored eyes positioned ^ ^ ^ if entity @s[distance=...41] run return run scoreboard players set $eyelevel PlayerMotion.Internal.Math 40
46

5-
execute anchored eyes positioned ^ ^ ^ if entity @s[distance=..1.27] run return run scoreboard players set $eyelevel player_motion.internal.math 127
7+
execute anchored eyes positioned ^ ^ ^ if entity @s[distance=..1.27] run return run scoreboard players set $eyelevel PlayerMotion.Internal.Math 127
68

7-
scoreboard players set $eyelevel player_motion.internal.math 162
9+
scoreboard players set $eyelevel PlayerMotion.Internal.Math 162
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# > player_motion:internal/math/full_power/sine
2-
$execute store result score $n_full_exp player_motion.internal.math run data get storage player_motion:trig arr[$(angle)]
3-
scoreboard players operation $n_full_exp player_motion.internal.math *= $motion_y player_motion.internal.math
4-
execute store result score $sub_power player_motion.internal.math run scoreboard players operation $n_full_exp player_motion.internal.math /= #constant.1000 player_motion.internal.const
1+
#> player_motion:internal/math/full_power/sine
2+
# @within function player_motion:internal/math/full_power/trig
3+
4+
$execute store result score $n_full_exp PlayerMotion.Internal.Math run data get storage player_motion:trig arr[$(angle)]
5+
scoreboard players operation $n_full_exp PlayerMotion.Internal.Math *= $motion_y PlayerMotion.Internal.Math
6+
execute store result score $sub_power PlayerMotion.Internal.Math run scoreboard players operation $n_full_exp PlayerMotion.Internal.Math /= $1000 Const
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# > player_motion:internal/math/full_power/tp
2-
execute store result storage player_motion:math pos[0] double 0.1 run scoreboard players get $motion_x player_motion.internal.math
3-
execute store result storage player_motion:math pos[1] double 0.1 run scoreboard players get $motion_y player_motion.internal.math
4-
execute store result storage player_motion:math pos[2] double 0.1 run scoreboard players get $motion_z player_motion.internal.math
1+
#> player_motion:internal/math/full_power/tp
2+
# @within function player_motion:internal/math/full_power/trig
3+
4+
execute store result storage player_motion:math pos[0] double 0.1 run scoreboard players get $motion_x PlayerMotion.Internal.Math
5+
execute store result storage player_motion:math pos[1] double 0.1 run scoreboard players get $motion_y PlayerMotion.Internal.Math
6+
execute store result storage player_motion:math pos[2] double 0.1 run scoreboard players get $motion_z PlayerMotion.Internal.Math
57
data modify entity @s Pos set from storage player_motion:math pos
68
execute at @s facing 0.0 0.0 0.0 run tp @s 0 0 0 0 ~
7-
execute store result storage player_motion:math magnitude.angle int 1 run data get entity @s Rotation[1] 100
9+
function api:data_get/rotation
10+
execute store result storage player_motion:math magnitude.angle int 1 run data get storage api: Rotation[1] 100
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
# > player_motion:internal/math/full_power/trig
2-
execute as d4bd74a7-4e82-4a07-8850-dfc4d89f9e2f run function player_motion:internal/math/full_power/tp
3-
function player_motion:internal/math/full_power/sine with storage player_motion:math magnitude
1+
#> player_motion:internal/math/full_power/trig
2+
# @within function player_motion:internal/math/main
3+
4+
execute as 0-0-0-0-0 run function player_motion:internal/math/full_power/tp
5+
function player_motion:internal/math/full_power/sine with storage player_motion:math magnitude

0 commit comments

Comments
 (0)