Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
29e40fc
ブタ要素が残っていたので消した
CKenJa Dec 12, 2023
b9d9441
当たり判定に勝った。風呂入ってくる。
CKenJa Dec 14, 2023
65569f7
コウモリが透明じゃなかったのを修正
CKenJa Dec 14, 2023
a998969
フックが足元から出てた
CKenJa Dec 15, 2023
0434e5c
草を踏んでるとそれにぶつかって動けなくなってた
CKenJa Dec 15, 2023
3caa046
雪を当たり判定無しブロックに追加
CKenJa Dec 15, 2023
de0c7ed
液体を当たり判定のないブロックに
CKenJa Dec 15, 2023
56d1bd6
当たり判定点を増やした
CKenJa Dec 15, 2023
f208a88
2回tpを使わないように
CKenJa Dec 15, 2023
28e6bb6
衝突処理周りのリファクタ
CKenJa Dec 15, 2023
3dc23f5
tp2個ねぇと動かねぇや
CKenJa Dec 15, 2023
b64546f
CustomModelDataが反映されないバグを修正
CKenJa Dec 15, 2023
efae727
パーティクルがあったほうが発射した感がある
CKenJa Dec 15, 2023
de0908e
吊り下げ看板を当たり判定のないブロックとして追加
CKenJa Dec 16, 2023
9dd2db1
objective_holder名に$を使うのをやめて、衝突点を正確に検知するように
CKenJa Dec 16, 2023
229dc42
1単位以内にマーカーがあればその座標になる処理をちょい変えてみた。だめなら修正しよう
CKenJa Dec 16, 2023
e908ba1
パス間違ってて草。そりゃいい感じに動かんわ
CKenJa Dec 16, 2023
119dd4e
腰に立体機動装置は欲しいよね
CKenJa Dec 17, 2023
0ed4397
下に下がらないように。オフハンドだと上がっちゃうけど
CKenJa Dec 17, 2023
480b8ce
グラップリングフックの見た目でフックを撃てるかどうか確認できるように
CKenJa Dec 17, 2023
be0481f
effectsの仕様変更に伴い、コウモリが透明じゃなくなってたり落下ダメージ無効が動かなくなっていたのを修正
CKenJa Dec 17, 2023
d2cc70e
音演出は大事。パート1
CKenJa Dec 17, 2023
943536a
音演出は大事。パート2
CKenJa Dec 18, 2023
a7ca472
衝突応答
CKenJa Dec 18, 2023
eb0a789
不可壊
CKenJa Dec 18, 2023
52a4537
衝突処理をより正確に
CKenJa Dec 20, 2023
f4458fc
前後検知が動いてなかったのを修正
CKenJa Dec 22, 2023
bf24129
jet残ってたので削除
CKenJa Dec 23, 2023
9fa81c4
衝突点処理を修正
CKenJa Dec 23, 2023
4ca4617
謎の壁抜けバグを修正
CKenJa Dec 24, 2023
78761bb
滑りの物理演算(拘束なし)
CKenJa Dec 24, 2023
101cd2b
リファクタ
CKenJa Dec 24, 2023
8381ecd
滑り時にも衝突判定を実装
CKenJa Dec 24, 2023
b184be1
降りたときに立体機動装置が残るバグを修正
CKenJa Dec 24, 2023
bd0bc33
クールダウン追加
CKenJa Dec 24, 2023
c6ff090
演出の削除、プレイヤーのMotionの影響を削除
CKenJa Dec 24, 2023
be13084
ジェット噴射実装
CKenJa Dec 24, 2023
6638c31
挙動の調整
CKenJa Dec 24, 2023
2e6b299
フックがエンティティに刺さるように
CKenJa Dec 25, 2023
f0e4132
Your name is 立体機動装置
CKenJa Dec 25, 2023
9843fd6
キー入力中も巻きとり音を
CKenJa Dec 25, 2023
553c81c
常にshotできるか表示
CKenJa Dec 25, 2023
f30bbb8
Delta古いコードが残ってたのを修正
CKenJa Dec 25, 2023
0d6add7
ジェットで重力軽減してるだろ多分
CKenJa Dec 25, 2023
51318f7
空気抵抗追加
CKenJa Dec 25, 2023
d6964d8
hook出来るエンティティをタグ指定できるように/ワイヤーの長さの単位を1mmに
CKenJa Dec 26, 2023
8991dff
tellrawのこってた
CKenJa Dec 26, 2023
dc86f26
タグ外し忘れ
CKenJa Dec 26, 2023
cd6b2c0
フックを刺せないブロックにフックを刺せていたのを修正
CKenJa Dec 26, 2023
d5d8ff0
エンティティにフックを付けるやつのリファクタ
CKenJa Dec 30, 2023
8b0558c
浮力
CKenJa Dec 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"values": [
"#ckenja.ghook.smart_motion:ignore_collision",
"grass",
"snow",
"powder_snow",
"frogspawn",
"sculk_vein",
"mangrove_sign",
Expand All @@ -27,6 +30,13 @@
"torchflower_crop",
"pitcher_plant",
"pitcher_crop",
"oak_hanging_sign",
"dark_oak_hanging_sign",
"acacia_hanging_sign",
"spruce_hanging_sign",
"jungle_hanging_sign",
"warped_hanging_sign",
"crimson_hanging_sign",
"minecraft:fern",
"minecraft:fire",
"minecraft:kelp",
Expand Down Expand Up @@ -130,7 +140,6 @@
"minecraft:detector_rail",
"minecraft:hanging_roots",
"minecraft:jungle_button",
"minecraft:lava_cauldron",
"minecraft:lightning_rod",
"minecraft:nether_portal",
"minecraft:oak_wall_sign",
Expand Down Expand Up @@ -165,7 +174,6 @@
"minecraft:structure_void",
"minecraft:tube_coral_fan",
"minecraft:twisting_vines",
"minecraft:water_cauldron",
"minecraft:birch_wall_sign",
"minecraft:brain_coral_fan",
"minecraft:dark_oak_button",
Expand Down
11 changes: 11 additions & 0 deletions data/ckenja.ghook/advancements/player.init.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"criteria": {
"requirement": {
"trigger": "minecraft:tick"
}
},
"rewards": {
"function": "ckenja.ghook:player/init"
}
}

5 changes: 4 additions & 1 deletion data/ckenja.ghook/advancements/using_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
"conditions": {
"item": {
"nbt": "{ctc:{id:\"ghook\",from:\"ckenja.ghook:\"}}"
},
"player": {
"flags": {"is_sneaking": false}
}
}
}
},
"rewards": {
"function": "ckenja.ghook:using_item"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#> ckenja.ghook:feature/reel
#> ckenja.ghook:feature/reel/_
#
#
#
# @within function ckenja.ghook:player/tick

#フック収納
execute as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:void_kill
execute as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:feature/reel/void_kill

ride @s dismount
execute as @e[type=item_display,tag=ckenja.ghook.vehicle,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:void_kill
execute as @e[type=item_display,tag=ckenja.ghook.vehicle,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run kill @s

#慣性をMotion代入
scoreboard players operation $x delta.api.launch = @s ckenja.ghook.x
Expand All @@ -22,3 +22,11 @@ data modify storage player_item_tuner: result.merge set value {tag:{CustomModelD
function #player_item_tuner:merge/inventory

scoreboard players set #flag.have_hook ckenja.ghook 0

playsound minecraft:block.ender_chest.close master @s ~ ~ ~ 0.25 2
playsound minecraft:block.iron_trapdoor.open master @s ~ ~ ~ 1 1.33
playsound minecraft:entity.fishing_bobber.retrieve master @s ~ ~ ~ 1 0.67

scoreboard players reset @s ckenja.ghook.hook.x
scoreboard players reset @s ckenja.ghook.hook.y
scoreboard players reset @s ckenja.ghook.hook.z
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> ckenja.ghook:feature/reel/kill_display
#
#
#
# @within function ckenja.ghook:feature/reel/_

execute on passengers run ride @s dismount
kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tag @s remove ckenja.ghook.target_entity
scoreboard players reset @s ckenja.ghook
9 changes: 9 additions & 0 deletions data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> ckenja.ghook:feature/reel/void_kill
#
#
#
# @within function ckenja.ghook:feature/reel

tp @s ~ ~-10000 ~
kill @s
execute as @e[type=#ckenja.ghook:hookable_entity,tag=ckenja.ghook.target_entity] if score @s ckenja.ghook = #temp.id ckenja.ghook run function ckenja.ghook:feature/reel/remove_from_target
19 changes: 9 additions & 10 deletions data/ckenja.ghook/functions/feature/shot/_.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
#
#
#
# @within function ckenja.ghook:player/using_item
# @within function ckenja.ghook:player/tick

scoreboard players set #feature.shot.detect_entity ckenja.ghook 0
scoreboard players set #feature.shot.using_item ckenja.ghook 0

execute unless score #flag.have_hook ckenja.ghook matches 1 if entity @s[tag=ckenja.ghook.player.using_item] if score @s ckenja.ghook.c matches 0 run scoreboard players set #feature.shot.using_item ckenja.ghook 1
#フック射出
data modify storage ckenja.ghook.__temp__: player.data.UUID set from entity @s UUID
#0.25m単位で十分だろう
#batの横の当たり判定が0.5だからギリ足りないのでは?
scoreboard players set @s ckenja.ghook.l -250
execute anchored eyes run function ckenja.ghook:feature/shot/loop
scoreboard players set #feature.shot.length ckenja.ghook 0
data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126001}}
execute anchored eyes positioned ^ ^ ^ run function ckenja.ghook:feature/shot/loop
data modify storage player_item_tuner: condition.if set value {tag:{ctc:{id:"ghook",from:"ckenja.ghook:"}}}

#アイテムの見た目変更
data modify storage player_item_tuner: condition.if set value {tag:{ctc:{id:"ghook",from:"ckenja.ghook:"}}}
data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126001}}
function #player_item_tuner:merge/inventory

tag @s add ckenja.ghook.feature.shot.player
execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 positioned ~ ~0.6 ~ summon item_display run function ckenja.ghook:feature/shot/vehicle
tag @s remove ckenja.ghook.feature.shot.player
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
scoreboard players set #feature.shot.loop ckenja.ghook 1
scoreboard players set #feature.shot.detect_entity ckenja.ghook 1

execute if score #feature.shot.using_item ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/detect_entity2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tag @s add ckenja.ghook.target_entity
scoreboard players operation @s ckenja.ghook = #temp.id ckenja.ghook

data modify storage ckenja.ghook.__temp__: feature.shot.detect_entity.Pos set from entity @s Pos
execute store result score #feature.shot.detect_entity.target_entity.x ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.shot.detect_entity.Pos[0] 10000
execute store result score #feature.shot.detect_entity.target_entity.y ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.shot.detect_entity.Pos[1] 10000
execute store result score #feature.shot.detect_entity.target_entity.z ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.shot.detect_entity.Pos[2] 10000
7 changes: 7 additions & 0 deletions data/ckenja.ghook/functions/feature/shot/get_pos.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

scoreboard players set @s ckenja.ghook.c 1

data modify storage ckenja.ghook.__temp__: feature.shot.detect_entity.Pos set from entity @s Pos
execute store result score #feature.shot.detect_entity.hook.x ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.shot.detect_entity.Pos[0] 10000
execute store result score #feature.shot.detect_entity.hook.y ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.shot.detect_entity.Pos[1] 10000
execute store result score #feature.shot.detect_entity.hook.z ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.shot.detect_entity.Pos[2] 10000
8 changes: 4 additions & 4 deletions data/ckenja.ghook/functions/feature/shot/hook.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#
#
#
# @within function ckenja.ghook:feature/shot/loop
# @within function ckenja.ghook:feature/shot/using_item

data merge entity @s {Silent:1b,Invulnerable:1b,DeathTime:19,DeathLootTable:"minecraft:empty",PersistenceRequired:1b,NoAI:1b,Tags:["ckenja.ghook.hook"],ActiveEffects:[{Id:14,Amplifier:0b,Duration:2147483647,ShowParticles:0b}]}
data merge entity @s {Silent:1b,Invulnerable:1b,DeathTime:19,DeathLootTable:"minecraft:empty",PersistenceRequired:1b,NoAI:1b,Tags:["ckenja.ghook.hook"],active_effects:[{id:"minecraft:invisibility",amplifier:0b,duration:2147483647,show_particles:0b}]}
data modify entity @s Leash.UUID set from storage ckenja.ghook.__temp__: player.data.UUID
scoreboard players operation @s ckenja.ghook = #temp.id ckenja.ghook
execute store success score #flag.have_hook ckenja.ghook run execute unless block ~ ~ ~ #ckenja.ghook:unable_hook
execute if score #flag.have_hook ckenja.ghook matches 0 run scoreboard players reset #flag.hook_shot_this_tick ckenja.ghook
scoreboard players reset #flag.hook_shot_this_tick ckenja.ghook
execute if score #feature.shot.detect_entity ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/get_pos
10 changes: 6 additions & 4 deletions data/ckenja.ghook/functions/feature/shot/loop.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#
# @within ckenja.ghook:feature/shot/**

scoreboard players add @s ckenja.ghook.l 250
execute store success score #flag.hook_shot_this_tick ckenja.ghook run execute unless block ^ ^ ^0.25 #ckenja.ghook:no_collision
execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 align xyz positioned ~0.5 ~0.5 ~0.5 summon bat run function ckenja.ghook:feature/shot/hook
scoreboard players add #feature.shot.length ckenja.ghook 250
execute store success score #feature.shot.loop ckenja.ghook unless block ~ ~ ~ #ckenja.ghook:no_collision
execute if score #feature.shot.loop ckenja.ghook matches 0 as @e[type=#ckenja.ghook:hookable_entity,dx=0,dy=0,dz=0] unless score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:feature/shot/detect_entity
execute if score #feature.shot.loop ckenja.ghook matches 1 unless block ~ ~ ~ #ckenja.ghook:unable_hook run function ckenja.ghook:feature/shot/success

execute if score #flag.hook_shot_this_tick ckenja.ghook matches 0 positioned ^ ^ ^0.25 if entity @s[distance=..104] run function ckenja.ghook:feature/shot/loop
execute if score #feature.shot.loop ckenja.ghook matches 0 positioned ^ ^ ^0.25 if entity @s[distance=..104] run function ckenja.ghook:feature/shot/loop
execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 run particle crit ~ ~ ~
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function ckenja.ghook:feature/shot/hook

scoreboard players operation #feature.shot.detect_entity.hook.x ckenja.ghook -= #feature.shot.detect_entity.target_entity.x ckenja.ghook
scoreboard players operation #feature.shot.detect_entity.hook.y ckenja.ghook -= #feature.shot.detect_entity.target_entity.y ckenja.ghook
scoreboard players operation #feature.shot.detect_entity.hook.z ckenja.ghook -= #feature.shot.detect_entity.target_entity.z ckenja.ghook

scoreboard players operation @s ckenja.ghook.hook.x = #feature.shot.detect_entity.hook.x ckenja.ghook
scoreboard players operation @s ckenja.ghook.hook.y = #feature.shot.detect_entity.hook.y ckenja.ghook
scoreboard players operation @s ckenja.ghook.hook.z = #feature.shot.detect_entity.hook.z ckenja.ghook
8 changes: 8 additions & 0 deletions data/ckenja.ghook/functions/feature/shot/success.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> ckenja.ghook:feature/shot/success
#
#
#
# @within function ckenja.ghook:feature/shot/loop

execute if score #feature.shot.using_item ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/using_item
data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126000}}
22 changes: 22 additions & 0 deletions data/ckenja.ghook/functions/feature/shot/using_item.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#> ckenja.ghook:feature/shot/using_item
#
#
#
# @within function ckenja.ghook:feature/shot/success

execute if score #feature.shot.detect_entity ckenja.ghook matches 0 align xyz positioned ~0.5 ~ ~0.5 summon bat run function ckenja.ghook:feature/shot/hook
execute if score #feature.shot.detect_entity ckenja.ghook matches 1 summon bat run function ckenja.ghook:feature/shot/setting_entity

#アイテムの見た目変更
tag @s add ckenja.ghook.feature.shot.player
execute at @s positioned ~ ~0.6 ~ summon item_display run function ckenja.ghook:feature/shot/vehicle
tag @s remove ckenja.ghook.feature.shot.player

scoreboard players set #flag.hook_shot_this_tick ckenja.ghook 1

execute positioned as @s run playsound minecraft:block.iron_trapdoor.open player @a ~ ~ ~ 0.75 1.5
execute positioned as @s run playsound minecraft:entity.blaze.hurt player @a ~ ~ ~ 0.5 1.33
execute positioned as @s run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.25 0.67

scoreboard players set @s ckenja.ghook.c 5
scoreboard players operation @s ckenja.ghook.l = #feature.shot.length ckenja.ghook
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# @within function ckenja.ghook:feature/shot/_

tag @s add ckenja.ghook.vehicle
data merge entity @s {teleport_duration:1}
data merge entity @s {teleport_duration:1,item:{id:"carved_pumpkin",tag:{CustomModelData:1},Count:1b},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,1f,0f],scale:[1f,1f,1f]}}
scoreboard players operation @s ckenja.ghook = #temp.id ckenja.ghook
execute positioned ~ ~-0.6 ~ run ride @a[tag=ckenja.ghook.feature.shot.player,distance=..1,limit=1] mount @s
70 changes: 26 additions & 44 deletions data/ckenja.ghook/functions/feature/swing/_.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,36 @@
#
# @within function ckenja.ghook:player/tick

scoreboard players operation #temp.long ckenja.ghook = @s ckenja.ghook.l

#アニメーションでずれるので移動前にパーティクルを出す
execute positioned as @s run particle cloud ~ ~ ~

#慣性。ないならMotionを参照する
#慣性を取得。ないならMotionを参照する
execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/motion
execute unless score #flag.hook_shot_this_tick ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/intertia.get

#追加のベクトル(重力とキー操作)
execute store result score $player.motion.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[0] 5000
execute store result score $player.motion.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[1] 5000
execute store result score $player.motion.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 5000

#の和
scoreboard players operation $intertia.x ckenja.ghook += $player.motion.x ckenja.ghook
scoreboard players operation $intertia.y ckenja.ghook += $player.motion.y ckenja.ghook
scoreboard players operation $intertia.z ckenja.ghook += $player.motion.z ckenja.ghook

#長押ししてたらジェットのベクトルも追加
execute if score #flag.jet ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/jet
execute store result storage ckenja.ghook.__temp__: feature.swing.get_sphere.plus double 0.001 run scoreboard players get @s ckenja.ghook.l
execute store result storage ckenja.ghook.__temp__: feature.swing.get_sphere.minus double -0.001 run scoreboard players get @s ckenja.ghook.l
data modify storage ckenja.ghook.__temp__: player.data.Motion set from entity @s Motion
data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity @s Rotation

#現在座標
execute store result score $player.pos.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Pos[0] 10000
execute store result score $player.pos.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Pos[1] 10000
execute store result score $player.pos.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Pos[2] 10000

#との和
scoreboard players operation $intertia.x ckenja.ghook += $player.pos.x ckenja.ghook
scoreboard players operation $intertia.y ckenja.ghook += $player.pos.y ckenja.ghook
scoreboard players operation $intertia.z ckenja.ghook += $player.pos.z ckenja.ghook

#その座標にマーカーを出し、フックからロープ距離分マーカー方向に進んで、その場所の座標を記憶
data modify storage ckenja.ghook.__temp__: marker.merge.Pos set value [0.0,0.0,0.0]
execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get $intertia.x ckenja.ghook
execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get $intertia.y ckenja.ghook
execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get $intertia.z ckenja.ghook
summon marker ~ ~ ~ {Tags:["ckenja.ghook.marker"]}
#マーカーで移動位置を計算
tag @s add ckenja.ghook.feature.swing.player
execute as @e[type=marker,tag=ckenja.ghook.marker] run function ckenja.ghook:feature/swing/marker
execute rotated as @s summon marker run function ckenja.ghook:feature/swing/marker
tag @s remove ckenja.ghook.feature.swing.player

#移動できるならPos代入して次tick用の慣性作成
#execute if score #flag.no_collision ckenja.ghook matches 1 run
function ckenja.ghook:feature/swing/intertia.make
#移動できなかったら慣性を半分にして二分探索的なアプローチで次tickに移動を託す
#execute unless score #flag.no_collision ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/intertia.half

#ロープが縮んだら反映
scoreboard players operation @s ckenja.ghook.l -= #temp.long ckenja.ghook
scoreboard players reset #temp.long ckenja.ghook
#次tick用の慣性作成
data modify storage ckenja.ghook.__temp__: player.feature.swing.Pos set from entity @s Pos
execute store result score @s ckenja.ghook.x run data get storage ckenja.ghook.__temp__: player.feature.swing.Pos[0] 10000
execute store result score @s ckenja.ghook.y run data get storage ckenja.ghook.__temp__: player.feature.swing.Pos[1] 10000
execute store result score @s ckenja.ghook.z run data get storage ckenja.ghook.__temp__: player.feature.swing.Pos[2] 10000
scoreboard players operation @s ckenja.ghook.x -= #player.pos.x ckenja.ghook
scoreboard players operation @s ckenja.ghook.y -= #player.pos.y ckenja.ghook
scoreboard players operation @s ckenja.ghook.z -= #player.pos.z ckenja.ghook
#scoreboard players operation @s ckenja.ghook.x *= #98 ckenja.ghook
#scoreboard players operation @s ckenja.ghook.y *= #98 ckenja.ghook
#scoreboard players operation @s ckenja.ghook.z *= #98 ckenja.ghook
#scoreboard players operation @s ckenja.ghook.x /= #100 ckenja.ghook
#scoreboard players operation @s ckenja.ghook.y /= #100 ckenja.ghook
#scoreboard players operation @s ckenja.ghook.z /= #100 ckenja.ghook

#演出
execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0
execute unless score @s ckenja.ghook.l = #feature.swing.temp.length ckenja.ghook run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.25 1
scoreboard players operation @s ckenja.ghook.l < #feature.swing.temp.length ckenja.ghook
Loading