From 29e40fcd51d1ecf09407851054e3641fae4c882d Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Tue, 12 Dec 2023 23:23:31 +0900 Subject: [PATCH 01/51] =?UTF-8?q?=E3=83=96=E3=82=BF=E8=A6=81=E7=B4=A0?= =?UTF-8?q?=E3=81=8C=E6=AE=8B=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E6=B6=88=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/loot_tables/ghook.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/ckenja.ghook/loot_tables/ghook.json b/data/ckenja.ghook/loot_tables/ghook.json index ae7c322..10025b7 100644 --- a/data/ckenja.ghook/loot_tables/ghook.json +++ b/data/ckenja.ghook/loot_tables/ghook.json @@ -22,7 +22,7 @@ "function": "minecraft:set_lore", "lore": [ { - "text": "ブタさんの飛ぶ頃に", + "text": "立体機動装置を模して開発されたグラップリングフック", "italic": false } ] From b9d94418d48f6bcef5873c1a9798d7007639b75b Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Thu, 14 Dec 2023 23:33:58 +0900 Subject: [PATCH 02/51] =?UTF-8?q?=E5=BD=93=E3=81=9F=E3=82=8A=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E3=81=AB=E5=8B=9D=E3=81=A3=E3=81=9F=E3=80=82=E9=A2=A8?= =?UTF-8?q?=E5=91=82=E5=85=A5=E3=81=A3=E3=81=A6=E3=81=8F=E3=82=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/swing/_.mcfunction | 12 ++++++------ .../functions/feature/swing/collision.mcfunction | 14 ++++++++++++++ .../feature/swing/intertia.half.mcfunction | 11 ----------- .../functions/feature/swing/loop.mcfunction | 15 +++++++-------- .../functions/feature/swing/marker.mcfunction | 3 +++ .../functions/feature/swing/near.mcfunction | 8 ++++++++ .../feature/swing/no_collision.mcfunction | 11 ----------- .../ckenja.ghook/functions/player/tick.mcfunction | 1 - 8 files changed, 38 insertions(+), 37 deletions(-) create mode 100644 data/ckenja.ghook/functions/feature/swing/collision.mcfunction delete mode 100644 data/ckenja.ghook/functions/feature/swing/intertia.half.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/near.mcfunction delete mode 100644 data/ckenja.ghook/functions/feature/swing/no_collision.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 0fe3fa0..e320bb5 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -4,7 +4,7 @@ # # @within function ckenja.ghook:player/tick -scoreboard players operation #temp.long ckenja.ghook = @s ckenja.ghook.l +scoreboard players operation #temp.feature.swing.loop ckenja.ghook = @s ckenja.ghook.l #アニメーションでずれるので移動前にパーティクルを出す execute positioned as @s run particle cloud ~ ~ ~ @@ -24,7 +24,7 @@ scoreboard players operation #temp.long ckenja.ghook = @s ckenja.ghook.l 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 if score #flag.jet ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/jet #現在座標 execute store result score $player.pos.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Pos[0] 10000 @@ -47,11 +47,11 @@ scoreboard players operation #temp.long ckenja.ghook = @s ckenja.ghook.l 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 +scoreboard players operation @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook +scoreboard players reset #temp.feature.swing.updated_length ckenja.ghook + diff --git a/data/ckenja.ghook/functions/feature/swing/collision.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision.mcfunction new file mode 100644 index 0000000..7e0d04e --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision.mcfunction @@ -0,0 +1,14 @@ +#> ckenja.ghook:feature/swing/collision +# +# +# +# @within function ckenja.ghook:feature/swing/marker + +execute store success score #feature.swing.collision ckenja.ghook positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision + +execute if score #feature.swing.collision ckenja.ghook matches 0 as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ + +execute if entity @s[distance=..0.125] run function ckenja.ghook:feature/swing/near + +execute if score #feature.swing.collision ckenja.ghook matches 1 unless entity @s[distance=..0.125] positioned ^ ^ ^0.125 run function ckenja.ghook:feature/swing/collision + diff --git a/data/ckenja.ghook/functions/feature/swing/intertia.half.mcfunction b/data/ckenja.ghook/functions/feature/swing/intertia.half.mcfunction deleted file mode 100644 index fea510f..0000000 --- a/data/ckenja.ghook/functions/feature/swing/intertia.half.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -#> ckenja.ghook:feature/swing/intertia.half -# -# -# -# @within function ckenja.ghook:feature/swing/_ - -#scoreboard players operation @s ckenja.ghook.x /= #2 ckenja.ghook -#scoreboard players operation @s ckenja.ghook.y /= #2 ckenja.ghook -#scoreboard players operation @s ckenja.ghook.z /= #2 ckenja.ghook -#say half -tp @s ~ ~ ~ diff --git a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction b/data/ckenja.ghook/functions/feature/swing/loop.mcfunction index 2e123b8..c08a554 100644 --- a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/loop.mcfunction @@ -10,18 +10,17 @@ scoreboard players reset #flag.unmoveable ckenja.ghook -scoreboard players remove #temp.long ckenja.ghook 125 +scoreboard players remove #temp.feature.swing.loop ckenja.ghook 125 + +#次のtickのロープの長さを決める +scoreboard players add #temp.feature.swing.updated_length ckenja.ghook 125 #ロープの長さより長く距離をとろうとするとunmoveableフラグを建てる -execute if score #temp.long ckenja.ghook matches ..0 run scoreboard players set #flag.unmoveable ckenja.ghook 1 +execute if score #temp.feature.swing.loop ckenja.ghook matches ..0 run scoreboard players set #flag.unmoveable ckenja.ghook 1 #ジェットモードの場合、1単位以内にマーカーがあればその座標になる。 execute if score #flag.have_hook ckenja.ghook matches 1 if entity @s[distance=..0.125] run scoreboard players set #flag.unmoveable ckenja.ghook 1 -#unmoveableフラグは、その地点に移動できない場合に建てる。 +#unmoveableフラグは、次の地点に移動できない場合に建てる。 +execute if score #flag.unmoveable ckenja.ghook matches 1 run tp @s ~ ~ ~ execute unless score #flag.unmoveable ckenja.ghook matches 1 positioned ^ ^ ^-0.125 run function ckenja.ghook:feature/swing/loop - -#ブタ座標側から衝突判定を取る -#既に位置を決定していたら何もしない -execute unless score #flag.no_collision ckenja.ghook matches 1 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/no_collision -execute unless score #flag.no_collision ckenja.ghook matches 1 run scoreboard players add #temp.long ckenja.ghook 125 diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index 3fba4ec..31c3322 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -9,4 +9,7 @@ data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.P #ループでマーカーの方向に移動して球上の位置を出す execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s positioned ^ ^ ^-0.125 as @e[type=marker,tag=ckenja.ghook.marker,distance=..120] run function ckenja.ghook:feature/swing/loop +#衝突判定を取る +#execute at @s as @a on vehicle run tp @s ~ ~ ~ +execute facing entity @s feet positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision kill @s diff --git a/data/ckenja.ghook/functions/feature/swing/near.mcfunction b/data/ckenja.ghook/functions/feature/swing/near.mcfunction new file mode 100644 index 0000000..2a8497e --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/near.mcfunction @@ -0,0 +1,8 @@ +#> ckenja.ghook:feature/swing/near +# +# +# +# @within function ckenja.ghook:feature/swing/collision + +execute at @s if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ +scoreboard players set #feature.swing.collision ckenja.ghook 0 diff --git a/data/ckenja.ghook/functions/feature/swing/no_collision.mcfunction b/data/ckenja.ghook/functions/feature/swing/no_collision.mcfunction deleted file mode 100644 index dc77166..0000000 --- a/data/ckenja.ghook/functions/feature/swing/no_collision.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -#> ckenja.ghook:feature/swing/no_collision -# -# -# -# @within function ckenja.ghook:feature/swing/loop - -scoreboard players set #flag.no_collision ckenja.ghook 1 - -#debug -execute as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ - diff --git a/data/ckenja.ghook/functions/player/tick.mcfunction b/data/ckenja.ghook/functions/player/tick.mcfunction index 6f87676..d3b5d9f 100644 --- a/data/ckenja.ghook/functions/player/tick.mcfunction +++ b/data/ckenja.ghook/functions/player/tick.mcfunction @@ -34,6 +34,5 @@ execute if score #flag.hook.kill ckenja.ghook matches 1 run function ckenja.ghoo scoreboard players reset #flag.hook_shot_this_tick ckenja.ghook scoreboard players reset #flag.have_hook ckenja.ghook scoreboard players reset #flag.jet ckenja.ghook - scoreboard players reset #flag.no_collision ckenja.ghook scoreboard players reset #flag.hook.kill ckenja.ghook From 65569f755e7b049a578c13718050838262211aeb Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Thu, 14 Dec 2023 23:51:50 +0900 Subject: [PATCH 03/51] =?UTF-8?q?=E3=82=B3=E3=82=A6=E3=83=A2=E3=83=AA?= =?UTF-8?q?=E3=81=8C=E9=80=8F=E6=98=8E=E3=81=98=E3=82=83=E3=81=AA=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/shot/hook.mcfunction | 2 +- data/ckenja.ghook/functions/feature/shot/loop.mcfunction | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction index a183686..127a5ee 100644 --- a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction @@ -4,7 +4,7 @@ # # @within function ckenja.ghook:feature/shot/loop -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:14,Amplifier:0b,Duration:2147483647,ShowParticles: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 diff --git a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction index 76d1a5b..d68b70c 100644 --- a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction @@ -5,7 +5,7 @@ # @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 +execute store success score #flag.hook_shot_this_tick ckenja.ghook unless block ~ ~ ~ #ckenja.ghook:no_collision +execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 align xyz positioned ~0.5 ~ ~0.5 summon bat run function ckenja.ghook:feature/shot/hook 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 From a998969f5f1afdc025f1d3f13faf3f8e675a4027 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:44:36 +0900 Subject: [PATCH 04/51] =?UTF-8?q?=E3=83=95=E3=83=83=E3=82=AF=E3=81=8C?= =?UTF-8?q?=E8=B6=B3=E5=85=83=E3=81=8B=E3=82=89=E5=87=BA=E3=81=A6=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/shot/_.mcfunction | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/ckenja.ghook/functions/feature/shot/_.mcfunction b/data/ckenja.ghook/functions/feature/shot/_.mcfunction index 5ddf069..757255f 100644 --- a/data/ckenja.ghook/functions/feature/shot/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/_.mcfunction @@ -9,7 +9,7 @@ #0.25m単位で十分だろう #batの横の当たり判定が0.5だからギリ足りないのでは? scoreboard players set @s ckenja.ghook.l -250 - execute anchored eyes run function ckenja.ghook:feature/shot/loop + 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:"}}} From 0434e5c63465e3873dfe7095c27acd364ea4ceca Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:44:51 +0900 Subject: [PATCH 05/51] =?UTF-8?q?=E8=8D=89=E3=82=92=E8=B8=8F=E3=82=93?= =?UTF-8?q?=E3=81=A7=E3=82=8B=E3=81=A8=E3=81=9D=E3=82=8C=E3=81=AB=E3=81=B6?= =?UTF-8?q?=E3=81=A4=E3=81=8B=E3=81=A3=E3=81=A6=E5=8B=95=E3=81=91=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json | 1 + 1 file changed, 1 insertion(+) diff --git a/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json b/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json index 7112103..f7a1811 100644 --- a/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json +++ b/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json @@ -1,6 +1,7 @@ { "values": [ "#ckenja.ghook.smart_motion:ignore_collision", + "grass", "frogspawn", "sculk_vein", "mangrove_sign", From 3caa046cc3fcc3696417874788e4f4089d638354 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:49:12 +0900 Subject: [PATCH 06/51] =?UTF-8?q?=E9=9B=AA=E3=82=92=E5=BD=93=E3=81=9F?= =?UTF-8?q?=E3=82=8A=E5=88=A4=E5=AE=9A=E7=84=A1=E3=81=97=E3=83=96=E3=83=AD?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json b/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json index f7a1811..654955b 100644 --- a/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json +++ b/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json @@ -2,6 +2,8 @@ "values": [ "#ckenja.ghook.smart_motion:ignore_collision", "grass", + "snow", + "powder_snow", "frogspawn", "sculk_vein", "mangrove_sign", @@ -131,7 +133,6 @@ "minecraft:detector_rail", "minecraft:hanging_roots", "minecraft:jungle_button", - "minecraft:lava_cauldron", "minecraft:lightning_rod", "minecraft:nether_portal", "minecraft:oak_wall_sign", @@ -166,7 +167,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", From de0c7ed08b2884d7ccf30f49b962c3e152a3123f Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:50:39 +0900 Subject: [PATCH 07/51] =?UTF-8?q?=E6=B6=B2=E4=BD=93=E3=82=92=E5=BD=93?= =?UTF-8?q?=E3=81=9F=E3=82=8A=E5=88=A4=E5=AE=9A=E3=81=AE=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/tags/blocks/no_collision.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/ckenja.ghook/tags/blocks/no_collision.json b/data/ckenja.ghook/tags/blocks/no_collision.json index a3ad4a4..12c61d2 100644 --- a/data/ckenja.ghook/tags/blocks/no_collision.json +++ b/data/ckenja.ghook/tags/blocks/no_collision.json @@ -6,6 +6,8 @@ "minecraft:moss_carpet", "minecraft:ladder", "#minecraft:trapdoors", - "#minecraft:doors" + "#minecraft:doors", + "water", + "lava" ] -} \ No newline at end of file +} From 56d1bd67a15519ccf5b0405d7bd735461c31afd8 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 15 Dec 2023 12:48:32 +0900 Subject: [PATCH 08/51] =?UTF-8?q?=E5=BD=93=E3=81=9F=E3=82=8A=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E7=82=B9=E3=82=92=E5=A2=97=E3=82=84=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/swing/collision.mcfunction | 3 +-- data/ckenja.ghook/functions/feature/swing/near.mcfunction | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/swing/collision.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision.mcfunction index 7e0d04e..594d29f 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision.mcfunction @@ -4,11 +4,10 @@ # # @within function ckenja.ghook:feature/swing/marker -execute store success score #feature.swing.collision ckenja.ghook positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision +execute store success score #feature.swing.collision ckenja.ghook positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision execute if score #feature.swing.collision ckenja.ghook matches 0 as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ execute if entity @s[distance=..0.125] run function ckenja.ghook:feature/swing/near execute if score #feature.swing.collision ckenja.ghook matches 1 unless entity @s[distance=..0.125] positioned ^ ^ ^0.125 run function ckenja.ghook:feature/swing/collision - diff --git a/data/ckenja.ghook/functions/feature/swing/near.mcfunction b/data/ckenja.ghook/functions/feature/swing/near.mcfunction index 2a8497e..8f1976d 100644 --- a/data/ckenja.ghook/functions/feature/swing/near.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/near.mcfunction @@ -4,5 +4,5 @@ # # @within function ckenja.ghook:feature/swing/collision -execute at @s if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ +execute at @s if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ scoreboard players set #feature.swing.collision ckenja.ghook 0 From f208a883227157519f3cc59ea18580eee7cda7bc Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 15 Dec 2023 12:58:02 +0900 Subject: [PATCH 09/51] =?UTF-8?q?2=E5=9B=9Etp=E3=82=92=E4=BD=BF=E3=82=8F?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ckenja.ghook/functions/feature/swing/collision.mcfunction | 4 ++-- data/ckenja.ghook/functions/feature/swing/marker.mcfunction | 1 + data/ckenja.ghook/functions/feature/swing/near.mcfunction | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/swing/collision.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision.mcfunction index 594d29f..97c137a 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision.mcfunction @@ -6,8 +6,8 @@ execute store success score #feature.swing.collision ckenja.ghook positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision -execute if score #feature.swing.collision ckenja.ghook matches 0 as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ - execute if entity @s[distance=..0.125] run function ckenja.ghook:feature/swing/near +execute if score #feature.swing.collision ckenja.ghook matches 0 unless score #feature.swing.collision.neared ckenja.ghook matches 1 as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ + execute if score #feature.swing.collision ckenja.ghook matches 1 unless entity @s[distance=..0.125] positioned ^ ^ ^0.125 run function ckenja.ghook:feature/swing/collision diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index 31c3322..bde62a7 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -12,4 +12,5 @@ data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.P #衝突判定を取る #execute at @s as @a on vehicle run tp @s ~ ~ ~ execute facing entity @s feet positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision +scoreboard players reset #feature.swing.collision.neared ckenja.ghook kill @s diff --git a/data/ckenja.ghook/functions/feature/swing/near.mcfunction b/data/ckenja.ghook/functions/feature/swing/near.mcfunction index 8f1976d..af87e96 100644 --- a/data/ckenja.ghook/functions/feature/swing/near.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/near.mcfunction @@ -6,3 +6,4 @@ execute at @s if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ scoreboard players set #feature.swing.collision ckenja.ghook 0 +scoreboard players set #feature.swing.collision.neared ckenja.ghook 0 From 28e6bb60c11ed3051fc74a7e21c567d2fc9e23ee Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 15 Dec 2023 13:15:41 +0900 Subject: [PATCH 10/51] =?UTF-8?q?=E8=A1=9D=E7=AA=81=E5=87=A6=E7=90=86?= =?UTF-8?q?=E5=91=A8=E3=82=8A=E3=81=AE=E3=83=AA=E3=83=95=E3=82=A1=E3=82=AF?= =?UTF-8?q?=E3=82=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cfunction => collision_detection.mcfunction} | 10 ++++------ .../feature/swing/collision_responce.mcfunction | 17 +++++++++++++++++ .../functions/feature/swing/marker.mcfunction | 6 +++--- .../functions/feature/swing/near.mcfunction | 4 ++-- 4 files changed, 26 insertions(+), 11 deletions(-) rename data/ckenja.ghook/functions/feature/swing/{collision.mcfunction => collision_detection.mcfunction} (79%) create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/collision.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction similarity index 79% rename from data/ckenja.ghook/functions/feature/swing/collision.mcfunction rename to data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction index 97c137a..8e10c83 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction @@ -1,13 +1,11 @@ -#> ckenja.ghook:feature/swing/collision +#> ckenja.ghook:feature/swing/collision_detection # # # # @within function ckenja.ghook:feature/swing/marker execute store success score #feature.swing.collision ckenja.ghook positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision +execute if entity @s[distance=..0.125] at @s run function ckenja.ghook:feature/swing/near -execute if entity @s[distance=..0.125] run function ckenja.ghook:feature/swing/near - -execute if score #feature.swing.collision ckenja.ghook matches 0 unless score #feature.swing.collision.neared ckenja.ghook matches 1 as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ - -execute if score #feature.swing.collision ckenja.ghook matches 1 unless entity @s[distance=..0.125] positioned ^ ^ ^0.125 run function ckenja.ghook:feature/swing/collision +execute if score #feature.swing.collision ckenja.ghook matches 0 unless score #feature.swing.collision.neared ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce +execute if score #feature.swing.collision ckenja.ghook matches 1 unless entity @s[distance=..0.125] positioned ^ ^ ^0.125 run function ckenja.ghook:feature/swing/collision_detection diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce.mcfunction new file mode 100644 index 0000000..3ea726e --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce.mcfunction @@ -0,0 +1,17 @@ +#> ckenja.ghook:feature/swing/collision_responce +# +# +# +# @within function ckenja.ghook:feature/swing/collision_detection + + +#looking_at_functionで各点がどの面に衝突しうるか調べる + +#その面と移動ベクトルの交点を求める + +#もっとも近い交点に位置を変更する + +#本来の移動距離と実際の移動距離の差から衝突時間を求める + +#衝突向きのベクトルを消したうえで力を再計算する。 +execute as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index bde62a7..1db8b47 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -10,7 +10,7 @@ data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.P execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s positioned ^ ^ ^-0.125 as @e[type=marker,tag=ckenja.ghook.marker,distance=..120] run function ckenja.ghook:feature/swing/loop #衝突判定を取る -#execute at @s as @a on vehicle run tp @s ~ ~ ~ -execute facing entity @s feet positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision -scoreboard players reset #feature.swing.collision.neared ckenja.ghook + execute facing entity @s feet positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_detection + scoreboard players reset #feature.swing.collision.neared ckenja.ghook + kill @s diff --git a/data/ckenja.ghook/functions/feature/swing/near.mcfunction b/data/ckenja.ghook/functions/feature/swing/near.mcfunction index af87e96..41aa439 100644 --- a/data/ckenja.ghook/functions/feature/swing/near.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/near.mcfunction @@ -2,8 +2,8 @@ # # # -# @within function ckenja.ghook:feature/swing/collision +# @within function ckenja.ghook:feature/swing/collision_detection -execute at @s if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ +execute if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ scoreboard players set #feature.swing.collision ckenja.ghook 0 scoreboard players set #feature.swing.collision.neared ckenja.ghook 0 From 3dc23f561f171a57a8d1c4885ffeeb93a8be6a36 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 15 Dec 2023 20:29:40 +0900 Subject: [PATCH 11/51] =?UTF-8?q?tp2=E5=80=8B=E3=81=AD=E3=81=87=E3=81=A8?= =?UTF-8?q?=E5=8B=95=E3=81=8B=E3=81=AD=E3=81=87=E3=82=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/swing/collision_detection.mcfunction | 3 ++- data/ckenja.ghook/functions/feature/swing/marker.mcfunction | 2 +- data/ckenja.ghook/functions/feature/swing/near.mcfunction | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction index 8e10c83..2567d63 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction @@ -5,7 +5,8 @@ # @within function ckenja.ghook:feature/swing/marker execute store success score #feature.swing.collision ckenja.ghook positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision + +execute if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_responce execute if entity @s[distance=..0.125] at @s run function ckenja.ghook:feature/swing/near -execute if score #feature.swing.collision ckenja.ghook matches 0 unless score #feature.swing.collision.neared ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce execute if score #feature.swing.collision ckenja.ghook matches 1 unless entity @s[distance=..0.125] positioned ^ ^ ^0.125 run function ckenja.ghook:feature/swing/collision_detection diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index 1db8b47..42ec78a 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -10,7 +10,7 @@ data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.P execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s positioned ^ ^ ^-0.125 as @e[type=marker,tag=ckenja.ghook.marker,distance=..120] run function ckenja.ghook:feature/swing/loop #衝突判定を取る - execute facing entity @s feet positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_detection scoreboard players reset #feature.swing.collision.neared ckenja.ghook + execute facing entity @s feet positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_detection kill @s diff --git a/data/ckenja.ghook/functions/feature/swing/near.mcfunction b/data/ckenja.ghook/functions/feature/swing/near.mcfunction index 41aa439..8793be4 100644 --- a/data/ckenja.ghook/functions/feature/swing/near.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/near.mcfunction @@ -5,5 +5,5 @@ # @within function ckenja.ghook:feature/swing/collision_detection execute if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ + scoreboard players set #feature.swing.collision ckenja.ghook 0 -scoreboard players set #feature.swing.collision.neared ckenja.ghook 0 From b64546f3bae8a27e975711e27745712ae4c1d5ed Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 15 Dec 2023 22:50:03 +0900 Subject: [PATCH 12/51] =?UTF-8?q?CustomModelData=E3=81=8C=E5=8F=8D?= =?UTF-8?q?=E6=98=A0=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/loot_tables/ghook.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/ckenja.ghook/loot_tables/ghook.json b/data/ckenja.ghook/loot_tables/ghook.json index 10025b7..5d60590 100644 --- a/data/ckenja.ghook/loot_tables/ghook.json +++ b/data/ckenja.ghook/loot_tables/ghook.json @@ -9,7 +9,7 @@ "functions": [ { "function": "minecraft:set_nbt", - "tag": "{CustomModelData:1260000,Unbreakable:true,ctc:{id:\"ghook\",from:\"ckenja.ghook:\"}}" + "tag": "{CustomModelData:126000,Unbreakable:true,ctc:{id:\"ghook\",from:\"ckenja.ghook:\"}}" }, { "function": "minecraft:set_name", From efae7278459aecb8c5ceeab2a082adb4b86748ae Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 15 Dec 2023 22:50:17 +0900 Subject: [PATCH 13/51] =?UTF-8?q?=E3=83=91=E3=83=BC=E3=83=86=E3=82=A3?= =?UTF-8?q?=E3=82=AF=E3=83=AB=E3=81=8C=E3=81=82=E3=81=A3=E3=81=9F=E3=81=BB?= =?UTF-8?q?=E3=81=86=E3=81=8C=E7=99=BA=E5=B0=84=E3=81=97=E3=81=9F=E6=84=9F?= =?UTF-8?q?=E3=81=8C=E3=81=82=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/shot/loop.mcfunction | 1 + 1 file changed, 1 insertion(+) diff --git a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction index d68b70c..17fe2f7 100644 --- a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction @@ -9,3 +9,4 @@ execute store success score #flag.hook_shot_this_tick ckenja.ghook unless block execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 align xyz positioned ~0.5 ~ ~0.5 summon bat run function ckenja.ghook:feature/shot/hook 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 #flag.hook_shot_this_tick ckenja.ghook matches 1 run particle crit ~ ~ ~ From de0908e056e6538fef536d83c727c7483031ec19 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sat, 16 Dec 2023 14:10:58 +0900 Subject: [PATCH 14/51] =?UTF-8?q?=E5=90=8A=E3=82=8A=E4=B8=8B=E3=81=92?= =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E3=82=92=E5=BD=93=E3=81=9F=E3=82=8A=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E3=81=AE=E3=81=AA=E3=81=84=E3=83=96=E3=83=AD=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=81=A8=E3=81=97=E3=81=A6=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tags/blocks/no_collision.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json b/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json index 654955b..2a0e592 100644 --- a/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json +++ b/data/ckenja.ghook.smart_motion/tags/blocks/no_collision.json @@ -30,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", From 9dd2db1aa782d19cec09ca1c7257acba5ec1a810 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sat, 16 Dec 2023 14:11:43 +0900 Subject: [PATCH 15/51] =?UTF-8?q?objective=5Fholder=E5=90=8D=E3=81=AB$?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E3=81=86=E3=81=AE=E3=82=92=E3=82=84=E3=82=81?= =?UTF-8?q?=E3=81=A6=E3=80=81=E8=A1=9D=E7=AA=81=E7=82=B9=E3=82=92=E6=AD=A3?= =?UTF-8?q?=E7=A2=BA=E3=81=AB=E6=A4=9C=E7=9F=A5=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/swing/_.mcfunction | 45 ++++---- .../swing/collision_detection.mcfunction | 2 +- .../swing/collision_responce.mcfunction | 17 --- .../swing/collision_responce/_.mcfunction | 101 ++++++++++++++++++ .../collision_responce/calc_range.mcfunction | 22 ++++ .../intersection_with_x.mcfunction | 24 +++++ .../intersection_with_y.mcfunction | 24 +++++ .../intersection_with_z.mcfunction | 26 +++++ .../looking_at_function.mcfunction | 6 ++ .../looking_at_function2.mcfunction | 14 +++ .../update_nearest.mcfunction | 5 + .../feature/swing/intertia.get.mcfunction | 18 ++-- .../feature/swing/intertia.make.mcfunction | 13 --- .../functions/feature/swing/jet.mcfunction | 12 +-- .../functions/feature/swing/motion.mcfunction | 6 +- data/ckenja.ghook/functions/load.mcfunction | 1 + 16 files changed, 269 insertions(+), 67 deletions(-) delete mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction delete mode 100644 data/ckenja.ghook/functions/feature/swing/intertia.make.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index e320bb5..2d981f3 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -14,40 +14,49 @@ scoreboard players operation #temp.feature.swing.loop ckenja.ghook = @s ckenja.g 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 + 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 + 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 + +#運動方向のベクトルとして保存 + scoreboard players operation #moving_vector.x ckenja.ghook = #intertia.x ckenja.ghook + scoreboard players operation #moving_vector.y ckenja.ghook = #intertia.y ckenja.ghook + scoreboard players operation #moving_vector.z ckenja.ghook = #intertia.z ckenja.ghook -#長押ししてたらジェットのベクトルも追加 - #execute if score #flag.jet ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/jet #現在座標 - 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 + 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 + 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 + 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 tag @s remove ckenja.ghook.feature.swing.player #移動できるならPos代入して次tick用の慣性作成 -function ckenja.ghook:feature/swing/intertia.make +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 #移動できなかったら当たり判定処理 #execute unless score #flag.no_collision ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/intertia.half diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction index 2567d63..23928fa 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction @@ -6,7 +6,7 @@ execute store success score #feature.swing.collision ckenja.ghook positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision -execute if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_responce +execute if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_responce/_ execute if entity @s[distance=..0.125] at @s run function ckenja.ghook:feature/swing/near execute if score #feature.swing.collision ckenja.ghook matches 1 unless entity @s[distance=..0.125] positioned ^ ^ ^0.125 run function ckenja.ghook:feature/swing/collision_detection diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce.mcfunction deleted file mode 100644 index 3ea726e..0000000 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce.mcfunction +++ /dev/null @@ -1,17 +0,0 @@ -#> ckenja.ghook:feature/swing/collision_responce -# -# -# -# @within function ckenja.ghook:feature/swing/collision_detection - - -#looking_at_functionで各点がどの面に衝突しうるか調べる - -#その面と移動ベクトルの交点を求める - -#もっとも近い交点に位置を変更する - -#本来の移動距離と実際の移動距離の差から衝突時間を求める - -#衝突向きのベクトルを消したうえで力を再計算する。 -execute as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction new file mode 100644 index 0000000..e4a11d4 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction @@ -0,0 +1,101 @@ +#> ckenja.ghook:feature/swing/collision_responce/_ +# +# +# +# @within function ckenja.ghook:feature/swing/collision_detection + +scoreboard players set #feature.swing.nearest.range ckenja.ghook 2147483647 + +#looking_at_functionで各点がどの面に衝突しうるか調べ、その面と移動ベクトルの交点を求める +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~0.3 ~ ~0.3 run function ckenja.looking_at_function:run +scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~-0.3 ~ ~0.3 run function ckenja.looking_at_function:run +scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~0.3 ~ ~-0.3 run function ckenja.looking_at_function:run +scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~-0.3 ~ ~-0.3 run function ckenja.looking_at_function:run +scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~0.3 ~0.9 ~0.3 run function ckenja.looking_at_function:run +scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 9000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~-0.3 ~0.9 ~0.3 run function ckenja.looking_at_function:run +scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 9000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~0.3 ~0.9 ~-0.3 run function ckenja.looking_at_function:run +scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 9000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~-0.3 ~0.9 ~-0.3 run function ckenja.looking_at_function:run +scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 9000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~0.3 ~1.8 ~0.3 run function ckenja.looking_at_function:run +scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 18000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~-0.3 ~1.8 ~0.3 run function ckenja.looking_at_function:run +scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 18000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~0.3 ~1.8 ~-0.3 run function ckenja.looking_at_function:run +scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 18000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" +execute positioned ~-0.3 ~1.8 ~-0.3 run function ckenja.looking_at_function:run +scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 +scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 +scoreboard players remove #feature.swing.intersection.z ckenja.ghook 18000 +function ckenja.ghook:feature/swing/collision_responce/calc_range + +#もっとも近い交点に位置を変更する + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.intersection.x ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.intersection.y ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.intersection.z ckenja.ghook + data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos + +#本来の移動距離と実際の移動距離の差から衝突時間を求める + +#衝突向きのベクトルを消したうえで力を再計算する。 +execute as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction new file mode 100644 index 0000000..db443c7 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction @@ -0,0 +1,22 @@ +#現在の座標との距離を求める +scoreboard players operation #feature.swing.temp.x ckenja.ghook = #feature.swing.intersection.x ckenja.ghook +scoreboard players operation #feature.swing.temp.x ckenja.ghook -= #player.pos.x ckenja.ghook +scoreboard players operation #feature.swing.temp.x ckenja.ghook *= #feature.swing.temp.x ckenja.ghook +scoreboard players operation #feature.swing.temp.x ckenja.ghook /= #10000 ckenja.ghook + +scoreboard players operation #feature.swing.temp.y ckenja.ghook = #feature.swing.intersection.y ckenja.ghook +scoreboard players operation #feature.swing.temp.y ckenja.ghook -= #player.pos.y ckenja.ghook +scoreboard players operation #feature.swing.temp.y ckenja.ghook *= #feature.swing.temp.y ckenja.ghook +scoreboard players operation #feature.swing.temp.y ckenja.ghook /= #10000 ckenja.ghook + +scoreboard players operation #feature.swing.temp.z ckenja.ghook = #feature.swing.intersection.z ckenja.ghook +scoreboard players operation #feature.swing.temp.z ckenja.ghook -= #player.pos.z ckenja.ghook +scoreboard players operation #feature.swing.temp.z ckenja.ghook *= #feature.swing.temp.z ckenja.ghook +scoreboard players operation #feature.swing.temp.z ckenja.ghook /= #10000 ckenja.ghook + +scoreboard players operation #feature.swing.temp.range ckenja.ghook = #feature.swing.temp.x ckenja.ghook +scoreboard players operation #feature.swing.temp.range ckenja.ghook += #feature.swing.temp.y ckenja.ghook +scoreboard players operation #feature.swing.temp.range ckenja.ghook += #feature.swing.temp.z ckenja.ghook + +#比較してより近かったら上書き +execute if score #feature.swing.temp.range ckenja.ghook < #feature.swing.nearest.range ckenja.ghook run function ckenja.ghook:feature/swing/collision_responce/update_nearest diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction new file mode 100644 index 0000000..029ad05 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction @@ -0,0 +1,24 @@ +#> ckenja.ghook:feature/swing/collision_responce/looking_at_function2 +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/intersection_with_x +tp @s ~ ~ ~ +execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[0] 10000 + +scoreboard players operation #feature.swing.k ckenja.ghook = #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook -= #player.pos.x ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook *= #10000 ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook /= #moving_vector.x ckenja.ghook + +scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #feature.swing.k ckenja.ghook + +scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #player.pos.y ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook -= #moving_vector.y ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook *= #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook + +scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #player.pos.z ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook -= #moving_vector.z ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook *= #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction new file mode 100644 index 0000000..27b2586 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction @@ -0,0 +1,24 @@ +#> ckenja.ghook:feature/swing/collision_responce/looking_at_function2 +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/intersection_with_y +tp @s ~ ~ ~ +execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[0] 10000 + +scoreboard players operation #feature.swing.k ckenja.ghook = #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook -= #player.pos.y ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook *= #10000 ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook /= #moving_vector.y ckenja.ghook + +scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #player.pos.x ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook -= #moving_vector.x ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook *= #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook + +scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #feature.swing.k ckenja.ghook + +scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #player.pos.z ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook -= #moving_vector.z ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook *= #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction new file mode 100644 index 0000000..926a929 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction @@ -0,0 +1,26 @@ +#> ckenja.ghook:feature/swing/collision_responce/looking_at_function2 +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/intersection_with_z + +tp @s ~ ~ ~ +execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[0] 10000 + +scoreboard players operation #feature.swing.k ckenja.ghook = #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook -= #player.pos.z ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook *= #10000 ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook /= #moving_vector.z ckenja.ghook + +scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #player.pos.x ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook -= #moving_vector.x ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook *= #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook + +scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #player.pos.y ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook -= #moving_vector.y ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook *= #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook + +scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #feature.swing.k ckenja.ghook + diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function.mcfunction new file mode 100644 index 0000000..642a5df --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function.mcfunction @@ -0,0 +1,6 @@ +#> ckenja.ghook:feature/swing/collision_responce/looking_at_function +# +# +# +# @within function ckenja.looking_at_function:loop.end +execute unless block ~ ~ ~ #ckenja.ghook.smart_motion:no_collision run function ckenja.ghook:feature/swing/collision_responce/looking_at_function2 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction new file mode 100644 index 0000000..4e60571 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction @@ -0,0 +1,14 @@ +#> ckenja.ghook:feature/swing/collision_responce/looking_at_function2 +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/looking_at_function + +data modify storage ckenja.ghook.__temp__: swing.collision_responce.direction set from storage ckenja.looking_at_function:_ directionList[-1].value + +execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-X"} align x positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x +execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+X"} align x positioned ~1 ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x +execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Z"} align z positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z +execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Z"} align z positioned ~ ~ ~1 run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z +execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Y"} align y positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y +execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Y"} align y positioned ~ ~1 ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction new file mode 100644 index 0000000..33ffdce --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction @@ -0,0 +1,5 @@ + +scoreboard players operation #feature.swing.nearest.x ckenja.ghook = #feature.swing.intersection.x ckenja.ghook +scoreboard players operation #feature.swing.nearest.y ckenja.ghook = #feature.swing.intersection.y ckenja.ghook +scoreboard players operation #feature.swing.nearest.z ckenja.ghook = #feature.swing.intersection.z ckenja.ghook +scoreboard players operation #feature.swing.nearest.range ckenja.ghook = #feature.swing.temp.range ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/intertia.get.mcfunction b/data/ckenja.ghook/functions/feature/swing/intertia.get.mcfunction index 20905b0..0b19c5d 100644 --- a/data/ckenja.ghook/functions/feature/swing/intertia.get.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/intertia.get.mcfunction @@ -4,13 +4,13 @@ # # @within function ckenja.ghook:feature/swing/_ -scoreboard players operation $intertia.x ckenja.ghook = @s ckenja.ghook.x -scoreboard players operation $intertia.y ckenja.ghook = @s ckenja.ghook.y -scoreboard players operation $intertia.z ckenja.ghook = @s ckenja.ghook.z +scoreboard players operation #intertia.x ckenja.ghook = @s ckenja.ghook.x +scoreboard players operation #intertia.y ckenja.ghook = @s ckenja.ghook.y +scoreboard players operation #intertia.z ckenja.ghook = @s ckenja.ghook.z #空気抵抗 -scoreboard players operation $intertia.x ckenja.ghook *= #98 ckenja.ghook -scoreboard players operation $intertia.y ckenja.ghook *= #98 ckenja.ghook -scoreboard players operation $intertia.z ckenja.ghook *= #98 ckenja.ghook -scoreboard players operation $intertia.x ckenja.ghook /= #100 ckenja.ghook -scoreboard players operation $intertia.y ckenja.ghook /= #100 ckenja.ghook -scoreboard players operation $intertia.z ckenja.ghook /= #100 ckenja.ghook +scoreboard players operation #intertia.x ckenja.ghook *= #98 ckenja.ghook +scoreboard players operation #intertia.y ckenja.ghook *= #98 ckenja.ghook +scoreboard players operation #intertia.z ckenja.ghook *= #98 ckenja.ghook +scoreboard players operation #intertia.x ckenja.ghook /= #100 ckenja.ghook +scoreboard players operation #intertia.y ckenja.ghook /= #100 ckenja.ghook +scoreboard players operation #intertia.z ckenja.ghook /= #100 ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/intertia.make.mcfunction b/data/ckenja.ghook/functions/feature/swing/intertia.make.mcfunction deleted file mode 100644 index e17fcd0..0000000 --- a/data/ckenja.ghook/functions/feature/swing/intertia.make.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -#> ckenja.ghook:feature/swing/intertia.make -# -# -# -# @within function ckenja.ghook:feature/swing/_ - -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 diff --git a/data/ckenja.ghook/functions/feature/swing/jet.mcfunction b/data/ckenja.ghook/functions/feature/swing/jet.mcfunction index 2c31107..07d4b29 100644 --- a/data/ckenja.ghook/functions/feature/swing/jet.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/jet.mcfunction @@ -8,10 +8,10 @@ execute positioned 0.0 0.0 0.0 in minecraft:overworld store success score #temp. execute rotated as @s positioned 0.0 0.0 0.0 in minecraft:overworld run summon marker ^ ^ ^0.05 {Tags:["ckenja.ghook.marker"]} execute as @e[type=marker,tag=ckenja.ghook.marker] run function ckenja.ghook:feature/swing/jet.marker execute positioned 0.0 0.0 0.0 in minecraft:overworld if score #temp.query ckenja.ghook matches 1 run forceload remove ~ ~ -execute store result score $jet.x ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[0] 1000 -execute store result score $jet.y ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[1] 1000 -execute store result score $jet.z ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[2] 1000 -scoreboard players operation $intertia.x ckenja.ghook += $jet.x ckenja.ghook -scoreboard players operation $intertia.y ckenja.ghook += $jet.y ckenja.ghook -scoreboard players operation $intertia.z ckenja.ghook += $jet.z ckenja.ghook +execute store result score #jet.x ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[0] 1000 +execute store result score #jet.y ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[1] 1000 +execute store result score #jet.z ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[2] 1000 +scoreboard players operation #intertia.x ckenja.ghook += #jet.x ckenja.ghook +scoreboard players operation #intertia.y ckenja.ghook += #jet.y ckenja.ghook +scoreboard players operation #intertia.z ckenja.ghook += #jet.z ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/motion.mcfunction b/data/ckenja.ghook/functions/feature/swing/motion.mcfunction index 79d7eab..428cd41 100644 --- a/data/ckenja.ghook/functions/feature/swing/motion.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/motion.mcfunction @@ -4,6 +4,6 @@ # # @within function ckenja.ghook:feature/swing/_ -execute store result score $intertia.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[0] 5000 -execute store result score $intertia.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[1] 5000 -execute store result score $intertia.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 5000 +execute store result score #intertia.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[0] 5000 +execute store result score #intertia.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[1] 5000 +execute store result score #intertia.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 5000 diff --git a/data/ckenja.ghook/functions/load.mcfunction b/data/ckenja.ghook/functions/load.mcfunction index ee1d285..291b99f 100644 --- a/data/ckenja.ghook/functions/load.mcfunction +++ b/data/ckenja.ghook/functions/load.mcfunction @@ -12,4 +12,5 @@ scoreboard objectives add ckenja.ghook.l dummy scoreboard players set #98 ckenja.ghook 98 scoreboard players set #100 ckenja.ghook 100 +scoreboard players set #10000 ckenja.ghook 10000 scoreboard players set #2 ckenja.ghook 2 From 229dc42af807a9313fbe9df5ef53250849c6f5ff Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sat, 16 Dec 2023 14:38:20 +0900 Subject: [PATCH 16/51] =?UTF-8?q?1=E5=8D=98=E4=BD=8D=E4=BB=A5=E5=86=85?= =?UTF-8?q?=E3=81=AB=E3=83=9E=E3=83=BC=E3=82=AB=E3=83=BC=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8C=E3=81=B0=E3=81=9D=E3=81=AE=E5=BA=A7=E6=A8=99=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E5=87=A6=E7=90=86=E3=82=92=E3=81=A1=E3=82=87?= =?UTF-8?q?=E3=81=84=E5=A4=89=E3=81=88=E3=81=A6=E3=81=BF=E3=81=9F=E3=80=82?= =?UTF-8?q?=E3=81=A0=E3=82=81=E3=81=AA=E3=82=89=E4=BF=AE=E6=AD=A3=E3=81=97?= =?UTF-8?q?=E3=82=88=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/swing/loop.mcfunction | 5 +++-- .../functions/feature/swing/no_tension.mcfunction | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction b/data/ckenja.ghook/functions/feature/swing/loop.mcfunction index c08a554..336732a 100644 --- a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/loop.mcfunction @@ -18,9 +18,10 @@ scoreboard players add #temp.feature.swing.updated_length ckenja.ghook 125 #ロープの長さより長く距離をとろうとするとunmoveableフラグを建てる execute if score #temp.feature.swing.loop ckenja.ghook matches ..0 run scoreboard players set #flag.unmoveable ckenja.ghook 1 -#ジェットモードの場合、1単位以内にマーカーがあればその座標になる。 -execute if score #flag.have_hook ckenja.ghook matches 1 if entity @s[distance=..0.125] run scoreboard players set #flag.unmoveable ckenja.ghook 1 +#1単位以内にマーカーがあればその座標になる。 +execute if score #flag.have_hook ckenja.ghook matches 1 if entity @s[distance=..0.125] run function ckenja.ghook:feature/no_tension #unmoveableフラグは、次の地点に移動できない場合に建てる。 execute if score #flag.unmoveable ckenja.ghook matches 1 run tp @s ~ ~ ~ + execute unless score #flag.unmoveable ckenja.ghook matches 1 positioned ^ ^ ^-0.125 run function ckenja.ghook:feature/swing/loop diff --git a/data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction b/data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction new file mode 100644 index 0000000..a5a3b0c --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction @@ -0,0 +1,2 @@ +execute at @s run tp @s ~ ~ ~ +scoreboard players set #flag.unmoveable ckenja.ghook 1 From e908ba1fdd35b4a637c87da9ae0f40334f42ca41 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sat, 16 Dec 2023 15:54:24 +0900 Subject: [PATCH 17/51] =?UTF-8?q?=E3=83=91=E3=82=B9=E9=96=93=E9=81=95?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=A6=E8=8D=89=E3=80=82=E3=81=9D=E3=82=8A?= =?UTF-8?q?=E3=82=83=E3=81=84=E3=81=84=E6=84=9F=E3=81=98=E3=81=AB=E5=8B=95?= =?UTF-8?q?=E3=81=8B=E3=82=93=E3=82=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/swing/loop.mcfunction | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction b/data/ckenja.ghook/functions/feature/swing/loop.mcfunction index 336732a..e2a174c 100644 --- a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/loop.mcfunction @@ -19,7 +19,7 @@ scoreboard players add #temp.feature.swing.updated_length ckenja.ghook 125 execute if score #temp.feature.swing.loop ckenja.ghook matches ..0 run scoreboard players set #flag.unmoveable ckenja.ghook 1 #1単位以内にマーカーがあればその座標になる。 -execute if score #flag.have_hook ckenja.ghook matches 1 if entity @s[distance=..0.125] run function ckenja.ghook:feature/no_tension +execute if score #flag.have_hook ckenja.ghook matches 1 if entity @s[distance=..0.125] run function ckenja.ghook:feature/swing/no_tension #unmoveableフラグは、次の地点に移動できない場合に建てる。 execute if score #flag.unmoveable ckenja.ghook matches 1 run tp @s ~ ~ ~ From 119dd4ee78bafbae1ec6670a7e385d65a6a08ca6 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 17 Dec 2023 12:01:21 +0900 Subject: [PATCH 18/51] =?UTF-8?q?=E8=85=B0=E3=81=AB=E7=AB=8B=E4=BD=93?= =?UTF-8?q?=E6=A9=9F=E5=8B=95=E8=A3=85=E7=BD=AE=E3=81=AF=E6=AC=B2=E3=81=97?= =?UTF-8?q?=E3=81=84=E3=82=88=E3=81=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/shot/vehicle.mcfunction | 2 +- .../functions/feature/swing/_.mcfunction | 8 ++------ .../functions/feature/swing/near.mcfunction | 1 - data/ckenja.ghook/functions/load.mcfunction | 6 ++++++ .../functions/player/not_vehicle.mcfunction | 14 ++++++++++++++ .../functions/player/not_vehicle2.mcfunction | 1 + .../ckenja.ghook/functions/player/tick.mcfunction | 15 ++++++++++----- data/ckenja.ghook/loot_tables/ghook.json | 4 ++++ 8 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 data/ckenja.ghook/functions/player/not_vehicle.mcfunction create mode 100644 data/ckenja.ghook/functions/player/not_vehicle2.mcfunction diff --git a/data/ckenja.ghook/functions/feature/shot/vehicle.mcfunction b/data/ckenja.ghook/functions/feature/shot/vehicle.mcfunction index 7685a31..156fd41 100644 --- a/data/ckenja.ghook/functions/feature/shot/vehicle.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/vehicle.mcfunction @@ -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 diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 2d981f3..1831d38 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -5,6 +5,7 @@ # @within function ckenja.ghook:player/tick scoreboard players operation #temp.feature.swing.loop ckenja.ghook = @s ckenja.ghook.l +data modify storage ckenja.ghook.__temp__: player.data.Motion set from entity @s Motion #アニメーションでずれるので移動前にパーティクルを出す execute positioned as @s run particle cloud ~ ~ ~ @@ -28,12 +29,6 @@ scoreboard players operation #temp.feature.swing.loop ckenja.ghook = @s ckenja.g scoreboard players operation #moving_vector.y ckenja.ghook = #intertia.y ckenja.ghook scoreboard players operation #moving_vector.z ckenja.ghook = #intertia.z ckenja.ghook - -#現在座標 - 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 @@ -64,3 +59,4 @@ scoreboard players operation @s ckenja.ghook.z -= #player.pos.z ckenja.ghook scoreboard players operation @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook scoreboard players reset #temp.feature.swing.updated_length ckenja.ghook +execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0 diff --git a/data/ckenja.ghook/functions/feature/swing/near.mcfunction b/data/ckenja.ghook/functions/feature/swing/near.mcfunction index 8793be4..d97e730 100644 --- a/data/ckenja.ghook/functions/feature/swing/near.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/near.mcfunction @@ -5,5 +5,4 @@ # @within function ckenja.ghook:feature/swing/collision_detection execute if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ - scoreboard players set #feature.swing.collision ckenja.ghook 0 diff --git a/data/ckenja.ghook/functions/load.mcfunction b/data/ckenja.ghook/functions/load.mcfunction index 291b99f..fb9d288 100644 --- a/data/ckenja.ghook/functions/load.mcfunction +++ b/data/ckenja.ghook/functions/load.mcfunction @@ -9,8 +9,14 @@ scoreboard objectives add ckenja.ghook.x dummy scoreboard objectives add ckenja.ghook.y dummy scoreboard objectives add ckenja.ghook.z dummy scoreboard objectives add ckenja.ghook.l dummy +scoreboard objectives add ckenja.ghook.pos.x dummy +scoreboard objectives add ckenja.ghook.pos.y dummy +scoreboard objectives add ckenja.ghook.pos.z dummy scoreboard players set #98 ckenja.ghook 98 scoreboard players set #100 ckenja.ghook 100 scoreboard players set #10000 ckenja.ghook 10000 scoreboard players set #2 ckenja.ghook 2 + +execute in overworld run forceload add -1 -1 0 0 +data modify storage ckenja.ghook.__temp__: marker.merge.Pos set value [0.0,0.0,0.0] diff --git a/data/ckenja.ghook/functions/player/not_vehicle.mcfunction b/data/ckenja.ghook/functions/player/not_vehicle.mcfunction new file mode 100644 index 0000000..4f84130 --- /dev/null +++ b/data/ckenja.ghook/functions/player/not_vehicle.mcfunction @@ -0,0 +1,14 @@ +execute if score #flag.have_hook ckenja.ghook matches 1 run scoreboard players set #flag.hook.kill ckenja.ghook 1 + +scoreboard players operation #displacement.x ckenja.ghook = @s ckenja.ghook.pos.x +scoreboard players operation #displacement.y ckenja.ghook = @s ckenja.ghook.pos.y +scoreboard players operation #displacement.z ckenja.ghook = @s ckenja.ghook.pos.z + +scoreboard players operation #displacement.x ckenja.ghook -= #player.pos.x ckenja.ghook +scoreboard players operation #displacement.y ckenja.ghook -= #player.pos.y ckenja.ghook +scoreboard players operation #displacement.z ckenja.ghook -= #player.pos.z ckenja.ghook + +execute store result storage ckenja.ghook.__temp__: player.not_vehicle.Pos.0 double 0.0001 run scoreboard players get #displacement.x ckenja.ghook +execute store result storage ckenja.ghook.__temp__: player.not_vehicle.Pos.1 double 0.0001 run scoreboard players get #displacement.y ckenja.ghook +execute store result storage ckenja.ghook.__temp__: player.not_vehicle.Pos.2 double 0.0001 run scoreboard players get #displacement.z ckenja.ghook +#function ckenja.ghook:player/not_vehicle2 with storage ckenja.ghook.__temp__: player.not_vehicle.Pos diff --git a/data/ckenja.ghook/functions/player/not_vehicle2.mcfunction b/data/ckenja.ghook/functions/player/not_vehicle2.mcfunction new file mode 100644 index 0000000..57d6060 --- /dev/null +++ b/data/ckenja.ghook/functions/player/not_vehicle2.mcfunction @@ -0,0 +1 @@ +$execute positioned 0.0 0.0 0.0 facing $(0) $(1) $(2) diff --git a/data/ckenja.ghook/functions/player/tick.mcfunction b/data/ckenja.ghook/functions/player/tick.mcfunction index d3b5d9f..575eb03 100644 --- a/data/ckenja.ghook/functions/player/tick.mcfunction +++ b/data/ckenja.ghook/functions/player/tick.mcfunction @@ -4,6 +4,11 @@ # # @within function ckenja.ghook:tick +data modify storage ckenja.ghook.__temp__: player.data.Pos set from entity @s Pos +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 +data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity @s Rotation execute unless score @s ckenja.ghook matches -2147483648..2147483647 run function ckenja.ghook:player/id scoreboard players operation #temp.id ckenja.ghook = @s ckenja.ghook @@ -16,7 +21,7 @@ execute as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score #temp.id c #二回クリックし終わったら、flag.hook.killを立てる。あとでフック収納して慣性をMotion代入 execute if entity @s[tag=ckenja.ghook.player.using_item.before,tag=!ckenja.ghook.player.using_item] run function ckenja.ghook:player/check_quit_using -execute if score #flag.have_hook ckenja.ghook matches 1 unless predicate ckenja.ghook:vehicle run scoreboard players set #flag.hook.kill ckenja.ghook 1 +execute unless predicate ckenja.ghook:vehicle run function ckenja.ghook:player/not_vehicle #クリック検知 execute if entity @s[tag=ckenja.ghook.player.using_item] run function ckenja.ghook:player/using_item @@ -24,15 +29,15 @@ execute if entity @s[tag=ckenja.ghook.player.using_item] run function ckenja.gho execute if score #flag.hook.kill ckenja.ghook matches 1 run function ckenja.ghook:feature/reel #フックがあればスイング計算 - data modify storage ckenja.ghook.__temp__: player.data.Pos set from entity @s Pos - 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 if score #flag.have_hook ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/_ +scoreboard players operation @s ckenja.ghook.pos.x = #player.pos.x ckenja.ghook +scoreboard players operation @s ckenja.ghook.pos.y = #player.pos.y ckenja.ghook +scoreboard players operation @s ckenja.ghook.pos.z = #player.pos.z ckenja.ghook + #リセット tag @s remove ckenja.ghook.player.using_item scoreboard players reset #flag.hook_shot_this_tick ckenja.ghook scoreboard players reset #flag.have_hook ckenja.ghook scoreboard players reset #flag.jet ckenja.ghook scoreboard players reset #flag.hook.kill ckenja.ghook - diff --git a/data/ckenja.ghook/loot_tables/ghook.json b/data/ckenja.ghook/loot_tables/ghook.json index 5d60590..18387e5 100644 --- a/data/ckenja.ghook/loot_tables/ghook.json +++ b/data/ckenja.ghook/loot_tables/ghook.json @@ -11,6 +11,10 @@ "function": "minecraft:set_nbt", "tag": "{CustomModelData:126000,Unbreakable:true,ctc:{id:\"ghook\",from:\"ckenja.ghook:\"}}" }, + { + "function": "set_attributes", + "modifiers": [{"amount": -10,"attribute": "generic.attack_speed","id": "3ac3f8f8-6407-491a-ad90-c7305393668c","name": "アイテム書き換え時にアイテムが下に下がるのを防ぐ","operation": "addition","slot": "mainhand"}] + }, { "function": "minecraft:set_name", "name": { From 0ed43970047a324f5d324a35ed7f65fa52c8d9be Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 17 Dec 2023 12:10:01 +0900 Subject: [PATCH 19/51] =?UTF-8?q?=E4=B8=8B=E3=81=AB=E4=B8=8B=E3=81=8C?= =?UTF-8?q?=E3=82=89=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=80=82?= =?UTF-8?q?=E3=82=AA=E3=83=95=E3=83=8F=E3=83=B3=E3=83=89=E3=81=A0=E3=81=A8?= =?UTF-8?q?=E4=B8=8A=E3=81=8C=E3=81=A3=E3=81=A1=E3=82=83=E3=81=86=E3=81=91?= =?UTF-8?q?=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/loot_tables/ghook.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/ckenja.ghook/loot_tables/ghook.json b/data/ckenja.ghook/loot_tables/ghook.json index 18387e5..f35d647 100644 --- a/data/ckenja.ghook/loot_tables/ghook.json +++ b/data/ckenja.ghook/loot_tables/ghook.json @@ -13,7 +13,7 @@ }, { "function": "set_attributes", - "modifiers": [{"amount": -10,"attribute": "generic.attack_speed","id": "3ac3f8f8-6407-491a-ad90-c7305393668c","name": "アイテム書き換え時にアイテムが下に下がるのを防ぐ","operation": "addition","slot": "mainhand"}] + "modifiers": [{"amount": -10,"attribute": "generic.attack_speed","id": "3ac3f8f8-6407-491a-ad90-c7305393668c","name": "アイテム書き換え時にアイテムが下に下がるのを防ぐ","operation": "addition","slot": "mainhand"},{"amount": -10,"attribute": "generic.attack_speed","id": "4a0bd08e-4272-450b-9bfa-de4a26e7380f","name": "アイテム書き換え時にアイテムが下に下がるのを防ぐ","operation": "addition","slot": "offhand"}] }, { "function": "minecraft:set_name", From 480b8ce0678b1c88346bb2467492e11d7710cdf5 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 17 Dec 2023 15:00:50 +0900 Subject: [PATCH 20/51] =?UTF-8?q?=E3=82=B0=E3=83=A9=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=B0=E3=83=95=E3=83=83=E3=82=AF=E3=81=AE?= =?UTF-8?q?=E8=A6=8B=E3=81=9F=E7=9B=AE=E3=81=A7=E3=83=95=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=92=E6=92=83=E3=81=A6=E3=82=8B=E3=81=8B=E3=81=A9=E3=81=86?= =?UTF-8?q?=E3=81=8B=E7=A2=BA=E8=AA=8D=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/shot/_.mcfunction | 11 +++-------- .../functions/feature/shot/loop.mcfunction | 6 +++--- .../functions/feature/shot/on_trigger.mcfunction | 9 +++++++++ .../functions/feature/shot/success.mcfunction | 13 +++++++++++++ .../functions/feature/shot/using_item.mcfunction | 15 +++++++++++++++ .../ckenja.ghook/functions/player/tick.mcfunction | 4 +++- .../functions/player/using_item.mcfunction | 4 ---- data/ckenja.ghook/loot_tables/ghook.json | 2 +- 8 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 data/ckenja.ghook/functions/feature/shot/on_trigger.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/shot/success.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/shot/using_item.mcfunction diff --git a/data/ckenja.ghook/functions/feature/shot/_.mcfunction b/data/ckenja.ghook/functions/feature/shot/_.mcfunction index 757255f..47e2b95 100644 --- a/data/ckenja.ghook/functions/feature/shot/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/_.mcfunction @@ -4,6 +4,8 @@ # # @within function ckenja.ghook:player/using_item +scoreboard players set #feature.shot.on_trigger ckenja.ghook 0 + #フック射出 data modify storage ckenja.ghook.__temp__: player.data.UUID set from entity @s UUID #0.25m単位で十分だろう @@ -11,11 +13,4 @@ scoreboard players set @s ckenja.ghook.l -250 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: 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 +execute if score #feature.shot.on_trigger ckenja.ghook matches 0 run function ckenja.ghook:feature/shot/on_trigger diff --git a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction index 17fe2f7..d34678f 100644 --- a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction @@ -5,8 +5,8 @@ # @within ckenja.ghook:feature/shot/** scoreboard players add @s ckenja.ghook.l 250 -execute store success score #flag.hook_shot_this_tick ckenja.ghook unless block ~ ~ ~ #ckenja.ghook:no_collision -execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 align xyz positioned ~0.5 ~ ~0.5 summon bat run function ckenja.ghook:feature/shot/hook +execute store success score #feature.shot.loop ckenja.ghook unless block ~ ~ ~ #ckenja.ghook:no_collision +execute if score #feature.shot.loop ckenja.ghook matches 1 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 ~ ~ ~ diff --git a/data/ckenja.ghook/functions/feature/shot/on_trigger.mcfunction b/data/ckenja.ghook/functions/feature/shot/on_trigger.mcfunction new file mode 100644 index 0000000..edc51ef --- /dev/null +++ b/data/ckenja.ghook/functions/feature/shot/on_trigger.mcfunction @@ -0,0 +1,9 @@ +#> ckenja.ghook:feature/shot/on_trigger +# +# +# +# @within function ckenja.ghook:feature/shot/_ + +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 diff --git a/data/ckenja.ghook/functions/feature/shot/success.mcfunction b/data/ckenja.ghook/functions/feature/shot/success.mcfunction new file mode 100644 index 0000000..a2f9ffb --- /dev/null +++ b/data/ckenja.ghook/functions/feature/shot/success.mcfunction @@ -0,0 +1,13 @@ +#> ckenja.ghook:feature/shot/success +# +# +# +# @within function ckenja.ghook:feature/shot/loop + +execute if entity @s[tag=ckenja.ghook.player.using_item] run function ckenja.ghook:feature/shot/using_item +execute unless entity @s[tag=ckenja.ghook.player.using_item] run data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126000}} + +data modify storage player_item_tuner: condition.if set value {tag:{ctc:{id:"ghook",from:"ckenja.ghook:"}}} +function #player_item_tuner:merge/inventory + +scoreboard players set #feature.shot.on_trigger ckenja.ghook 1 diff --git a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction new file mode 100644 index 0000000..136683a --- /dev/null +++ b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction @@ -0,0 +1,15 @@ +#> ckenja.ghook:feature/shot/using_item +# +# +# +# @within function ckenja.ghook:feature/shot/success + +execute align xyz positioned ~0.5 ~ ~0.5 summon bat run function ckenja.ghook:feature/shot/hook + +#アイテムの見た目変更 +data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126001}} +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 diff --git a/data/ckenja.ghook/functions/player/tick.mcfunction b/data/ckenja.ghook/functions/player/tick.mcfunction index 575eb03..b317f00 100644 --- a/data/ckenja.ghook/functions/player/tick.mcfunction +++ b/data/ckenja.ghook/functions/player/tick.mcfunction @@ -23,6 +23,9 @@ execute if entity @s[tag=ckenja.ghook.player.using_item.before,tag=!ckenja.ghook execute unless predicate ckenja.ghook:vehicle run function ckenja.ghook:player/not_vehicle +#フックがないならフック射出試行 +execute unless score #flag.have_hook ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/_ + #クリック検知 execute if entity @s[tag=ckenja.ghook.player.using_item] run function ckenja.ghook:player/using_item @@ -39,5 +42,4 @@ scoreboard players operation @s ckenja.ghook.pos.z = #player.pos.z ckenja.ghook tag @s remove ckenja.ghook.player.using_item scoreboard players reset #flag.hook_shot_this_tick ckenja.ghook scoreboard players reset #flag.have_hook ckenja.ghook - scoreboard players reset #flag.jet ckenja.ghook scoreboard players reset #flag.hook.kill ckenja.ghook diff --git a/data/ckenja.ghook/functions/player/using_item.mcfunction b/data/ckenja.ghook/functions/player/using_item.mcfunction index 0401076..393e29e 100644 --- a/data/ckenja.ghook/functions/player/using_item.mcfunction +++ b/data/ckenja.ghook/functions/player/using_item.mcfunction @@ -8,7 +8,3 @@ tag @s remove ckenja.ghook.player.using_item #使い終わり検知用にタグ付ける tag @s add ckenja.ghook.player.using_item.before - -#フックがないならフック射出、あるならジェット噴出 -execute unless score #flag.have_hook ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/_ -execute if score #flag.have_hook ckenja.ghook matches 1 run scoreboard players set #flag.jet ckenja.ghook 1 diff --git a/data/ckenja.ghook/loot_tables/ghook.json b/data/ckenja.ghook/loot_tables/ghook.json index f35d647..8fb6777 100644 --- a/data/ckenja.ghook/loot_tables/ghook.json +++ b/data/ckenja.ghook/loot_tables/ghook.json @@ -9,7 +9,7 @@ "functions": [ { "function": "minecraft:set_nbt", - "tag": "{CustomModelData:126000,Unbreakable:true,ctc:{id:\"ghook\",from:\"ckenja.ghook:\"}}" + "tag": "{CustomModelData:126000,Unbreakable:true,ctc:{id:\"ghook\",from:\"ckenja.ghook:\"},HideFlags:2}" }, { "function": "set_attributes", From be0481f06a275bc1091a0e5fb4928bba8261200f Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 17 Dec 2023 15:08:59 +0900 Subject: [PATCH 21/51] =?UTF-8?q?effects=E3=81=AE=E4=BB=95=E6=A7=98?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=81=AB=E4=BC=B4=E3=81=84=E3=80=81=E3=82=B3?= =?UTF-8?q?=E3=82=A6=E3=83=A2=E3=83=AA=E3=81=8C=E9=80=8F=E6=98=8E=E3=81=98?= =?UTF-8?q?=E3=82=83=E3=81=AA=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=9F?= =?UTF-8?q?=E3=82=8A=E8=90=BD=E4=B8=8B=E3=83=80=E3=83=A1=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E7=84=A1=E5=8A=B9=E3=81=8C=E5=8B=95=E3=81=8B=E3=81=AA=E3=81=8F?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/shot/hook.mcfunction | 2 +- data/ckenja.ghook/functions/player/tick.mcfunction | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction index 127a5ee..1fd14c9 100644 --- a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction @@ -4,7 +4,7 @@ # # @within function ckenja.ghook:feature/shot/loop -data merge entity @s {Silent:1b,Invulnerable:1b,DeathTime:19,DeathLootTable:"minecraft:empty",PersistenceRequired:1b,NoAI:1b,Tags:["ckenja.ghook.hook"],active_effects:[{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 diff --git a/data/ckenja.ghook/functions/player/tick.mcfunction b/data/ckenja.ghook/functions/player/tick.mcfunction index b317f00..5fd8ea5 100644 --- a/data/ckenja.ghook/functions/player/tick.mcfunction +++ b/data/ckenja.ghook/functions/player/tick.mcfunction @@ -13,7 +13,7 @@ execute unless score @s ckenja.ghook matches -2147483648..2147483647 run functio scoreboard players operation #temp.id ckenja.ghook = @s ckenja.ghook #落下ダメージの無効化 -execute if score #nofall_timer ckenja.ghook matches 3.. run summon minecraft:area_effect_cloud ~ ~ ~ {Duration:6,Age:4,Effects:[{Id:28,Amplifier:0b,Duration:2,ShowParticles:0b}]} +execute if score #nofall_timer ckenja.ghook matches 3.. run summon area_effect_cloud ~ ~ ~ {Duration:6,Age:4,effects:[{id:"minecraft:slow_falling",amplifier:0b,duration:2,show_particles:0b}]} #座標をロープ長検知に使うのでatはつけない execute as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:hook/tick From d2cc70ee0e8536e7a96fc4770bee9d1d0496ceeb Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 17 Dec 2023 16:15:03 +0900 Subject: [PATCH 22/51] =?UTF-8?q?=E9=9F=B3=E6=BC=94=E5=87=BA=E3=81=AF?= =?UTF-8?q?=E5=A4=A7=E4=BA=8B=E3=80=82=E3=83=91=E3=83=BC=E3=83=881?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/reel.mcfunction | 4 ++++ .../ckenja.ghook/functions/feature/shot/using_item.mcfunction | 4 ++++ data/ckenja.ghook/functions/feature/swing/_.mcfunction | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/data/ckenja.ghook/functions/feature/reel.mcfunction b/data/ckenja.ghook/functions/feature/reel.mcfunction index f1b61ff..b699ca9 100644 --- a/data/ckenja.ghook/functions/feature/reel.mcfunction +++ b/data/ckenja.ghook/functions/feature/reel.mcfunction @@ -22,3 +22,7 @@ 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 diff --git a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction index 136683a..d95806a 100644 --- a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction @@ -13,3 +13,7 @@ execute at @s positioned ~ ~0.6 ~ summon item_display run function ckenja.ghook: 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 ~ ~ ~ 1 1.5 +execute positioned as @s run playsound minecraft:entity.blaze.hurt player @a ~ ~ ~ 1 1.67 +execute positioned as @s run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.5 0.67 diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 1831d38..8f0dee4 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -8,7 +8,7 @@ scoreboard players operation #temp.feature.swing.loop ckenja.ghook = @s ckenja.g data modify storage ckenja.ghook.__temp__: player.data.Motion set from entity @s Motion #アニメーションでずれるので移動前にパーティクルを出す - execute positioned as @s run particle cloud ~ ~ ~ + execute at @s rotated ~ 0 run particle cloud ^ ^0.6 ^-0.125 #慣性。ないならMotionを参照する execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/motion @@ -60,3 +60,4 @@ scoreboard players operation @s ckenja.ghook.l = #temp.feature.swing.updated_len scoreboard players reset #temp.feature.swing.updated_length ckenja.ghook execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0 +execute positioned as @s run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.125 0.67 From 943536ae799a1474cdfff16e96b949c4ff7635a0 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:40:00 +0900 Subject: [PATCH 23/51] =?UTF-8?q?=E9=9F=B3=E6=BC=94=E5=87=BA=E3=81=AF?= =?UTF-8?q?=E5=A4=A7=E4=BA=8B=E3=80=82=E3=83=91=E3=83=BC=E3=83=882?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/shot/using_item.mcfunction | 6 +++--- data/ckenja.ghook/functions/feature/swing/_.mcfunction | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction index d95806a..3d80849 100644 --- a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction @@ -14,6 +14,6 @@ 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 ~ ~ ~ 1 1.5 -execute positioned as @s run playsound minecraft:entity.blaze.hurt player @a ~ ~ ~ 1 1.67 -execute positioned as @s run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.5 0.67 +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 diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 8f0dee4..19c874c 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -60,4 +60,4 @@ scoreboard players operation @s ckenja.ghook.l = #temp.feature.swing.updated_len scoreboard players reset #temp.feature.swing.updated_length ckenja.ghook execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0 -execute positioned as @s run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.125 0.67 +execute positioned as @s run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.125 1 From a7ca472bc802d60785f4990587b2de4dca81afff Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:41:07 +0900 Subject: [PATCH 24/51] =?UTF-8?q?=E8=A1=9D=E7=AA=81=E5=BF=9C=E7=AD=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../swing/collision_responce/_.mcfunction | 203 ++++++++++-------- .../swing/collision_responce/_2.mcfunction | 33 +++ .../intersection_with_x.mcfunction | 25 +-- .../intersection_with_y.mcfunction | 28 +-- .../intersection_with_z.mcfunction | 26 +-- .../looking_at_function2.mcfunction | 14 +- .../update_nearest.mcfunction | 1 + 7 files changed, 196 insertions(+), 134 deletions(-) create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction index e4a11d4..4113d94 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction @@ -4,98 +4,121 @@ # # @within function ckenja.ghook:feature/swing/collision_detection -scoreboard players set #feature.swing.nearest.range ckenja.ghook 2147483647 - -#looking_at_functionで各点がどの面に衝突しうるか調べ、その面と移動ベクトルの交点を求める -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~0.3 ~ ~0.3 run function ckenja.looking_at_function:run -scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~-0.3 ~ ~0.3 run function ckenja.looking_at_function:run -scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~0.3 ~ ~-0.3 run function ckenja.looking_at_function:run -scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~-0.3 ~ ~-0.3 run function ckenja.looking_at_function:run -scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~0.3 ~0.9 ~0.3 run function ckenja.looking_at_function:run -scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 9000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~-0.3 ~0.9 ~0.3 run function ckenja.looking_at_function:run -scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 9000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~0.3 ~0.9 ~-0.3 run function ckenja.looking_at_function:run -scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 9000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~-0.3 ~0.9 ~-0.3 run function ckenja.looking_at_function:run -scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 9000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~0.3 ~1.8 ~0.3 run function ckenja.looking_at_function:run -scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 18000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~-0.3 ~1.8 ~0.3 run function ckenja.looking_at_function:run -scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 18000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~0.3 ~1.8 ~-0.3 run function ckenja.looking_at_function:run -scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 18000 -function ckenja.ghook:feature/swing/collision_responce/calc_range - -data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:swing/collision_responce/looking_at_function" -execute positioned ~-0.3 ~1.8 ~-0.3 run function ckenja.looking_at_function:run -scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 -scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 -scoreboard players remove #feature.swing.intersection.z ckenja.ghook 18000 -function ckenja.ghook:feature/swing/collision_responce/calc_range + scoreboard players set #feature.swing.nearest.range ckenja.ghook 2147483647 + + #looking_at_functionで各点がどの面に衝突しうるか調べ、その面と移動ベクトルの交点を求める + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~0.3 ~ ~0.3 run function ckenja.looking_at_function:run + #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~-0.3 ~ ~0.3 run function ckenja.looking_at_function:run + #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~0.3 ~ ~-0.3 run function ckenja.looking_at_function:run + #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~-0.3 ~ ~-0.3 run function ckenja.looking_at_function:run + #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~0.3 ~0.9 ~0.3 run function ckenja.looking_at_function:run + #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 9000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~-0.3 ~0.9 ~0.3 run function ckenja.looking_at_function:run + #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 9000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~0.3 ~0.9 ~-0.3 run function ckenja.looking_at_function:run + #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 9000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~-0.3 ~0.9 ~-0.3 run function ckenja.looking_at_function:run + #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 9000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~0.3 ~1.8 ~0.3 run function ckenja.looking_at_function:run + #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 18000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~-0.3 ~1.8 ~0.3 run function ckenja.looking_at_function:run + #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 18000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~0.3 ~1.8 ~-0.3 run function ckenja.looking_at_function:run + #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 18000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range + + scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 + data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" + data modify storage ckenja.looking_at_function:_ steps set value 3 + execute positioned ~-0.3 ~1.8 ~-0.3 run function ckenja.looking_at_function:run + #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 + #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 + #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 18000 + execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range #もっとも近い交点に位置を変更する - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.intersection.x ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.intersection.y ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.intersection.z ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.nearest.x ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.nearest.y ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.nearest.z ckenja.ghook data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos -#本来の移動距離と実際の移動距離の差から衝突時間を求める - #衝突向きのベクトルを消したうえで力を再計算する。 -execute as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ + #execute at @s run function ckenja.ghook:feature/swing/collision_responce/_2 + execute at @s run function ckenja.ghook:feature/swing/tp diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction new file mode 100644 index 0000000..6d36790 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction @@ -0,0 +1,33 @@ + # #feature.swing.intersection(実際の移動先座標) - #player.pos(現在の座標) = 実際の移動距離 + scoreboard players operation #feature.swing.displacement.x ckenja.ghook = #feature.swing.intersection.x ckenja.ghook + scoreboard players operation #feature.swing.displacement.x ckenja.ghook -= #player.pos.x ckenja.ghook + scoreboard players operation #feature.swing.displacement.y ckenja.ghook = #feature.swing.intersection.y ckenja.ghook + scoreboard players operation #feature.swing.displacement.y ckenja.ghook -= #player.pos.y ckenja.ghook + scoreboard players operation #feature.swing.displacement.z ckenja.ghook = #feature.swing.intersection.z ckenja.ghook + scoreboard players operation #feature.swing.displacement.z ckenja.ghook -= #player.pos.z ckenja.ghook + tellraw @a {"score": {"name": "#feature.swing.displacement.x", "objective": "ckenja.ghook"}} + tellraw @a {"score": {"name": "#feature.swing.displacement.z", "objective": "ckenja.ghook"}} + tellraw @a {"score": {"name": "#feature.swing.displacement.z", "objective": "ckenja.ghook"}} + # #moving_vector(本来の移動距離) - 実際の移動距離 = 残ってる力 + scoreboard players operation #feature.swing.vector.x ckenja.ghook = #moving_vector.x ckenja.ghook + scoreboard players operation #feature.swing.vector.x ckenja.ghook -= #feature.swing.displacement.x ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook = #moving_vector.y ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook -= #feature.swing.displacement.y ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook = #moving_vector.z ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook -= #feature.swing.displacement.z ckenja.ghook + #storage ckenja.ghook.__temp__: swing.collision_responce.nearest_direction(衝突方向) + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 + scoreboard players operation #feature.swing.vector.x ckenja.ghook += #swing.intersection.x ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook += #swing.intersection.y ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook += #swing.intersection.z ckenja.ghook + + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.vector.x ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.vector.y ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.vector.z ckenja.ghook + data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos + execute facing entity @s feet positioned as @s as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction index 029ad05..59d888a 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction @@ -3,22 +3,23 @@ # # # @within function ckenja.ghook:feature/swing/collision_responce/intersection_with_x + tp @s ~ ~ ~ execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[0] 10000 -scoreboard players operation #feature.swing.k ckenja.ghook = #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook -= #player.pos.x ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook *= #10000 ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook /= #moving_vector.x ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook = #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook -= #player.pos.x ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook *= #10000 ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook /= #moving_vector.x ckenja.ghook scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #player.pos.y ckenja.ghook -scoreboard players operation #feature.swing.intersection.y ckenja.ghook -= #moving_vector.y ckenja.ghook -scoreboard players operation #feature.swing.intersection.y ckenja.ghook *= #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #feature.swing.t ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook *= #moving_vector.y ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook += #player.pos.y ckenja.ghook -scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #player.pos.z ckenja.ghook -scoreboard players operation #feature.swing.intersection.z ckenja.ghook -= #moving_vector.z ckenja.ghook -scoreboard players operation #feature.swing.intersection.z ckenja.ghook *= #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #feature.swing.t ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook *= #moving_vector.z ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook += #player.pos.z ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction index 27b2586..2cd4b56 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction @@ -3,22 +3,24 @@ # # # @within function ckenja.ghook:feature/swing/collision_responce/intersection_with_y + tp @s ~ ~ ~ -execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[0] 10000 +execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[1] 10000 -scoreboard players operation #feature.swing.k ckenja.ghook = #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook -= #player.pos.y ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook *= #10000 ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook /= #moving_vector.y ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook = #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook -= #player.pos.y ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook *= #10000 ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook /= #moving_vector.y ckenja.ghook -scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #player.pos.x ckenja.ghook -scoreboard players operation #feature.swing.intersection.x ckenja.ghook -= #moving_vector.x ckenja.ghook -scoreboard players operation #feature.swing.intersection.x ckenja.ghook *= #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #feature.swing.t ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook *= #moving_vector.x ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook += #player.pos.x ckenja.ghook scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #player.pos.z ckenja.ghook -scoreboard players operation #feature.swing.intersection.z ckenja.ghook -= #moving_vector.z ckenja.ghook -scoreboard players operation #feature.swing.intersection.z ckenja.ghook *= #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #feature.swing.t ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook *= #moving_vector.z ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook += #player.pos.z ckenja.ghook + diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction index 926a929..a2e71a8 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction @@ -5,22 +5,22 @@ # @within function ckenja.ghook:feature/swing/collision_responce/intersection_with_z tp @s ~ ~ ~ -execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[0] 10000 +execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[2] 10000 -scoreboard players operation #feature.swing.k ckenja.ghook = #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook -= #player.pos.z ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook *= #10000 ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook /= #moving_vector.z ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook = #feature.swing.k ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook -= #player.pos.z ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook *= #10000 ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook /= #moving_vector.z ckenja.ghook -scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #player.pos.x ckenja.ghook -scoreboard players operation #feature.swing.intersection.x ckenja.ghook -= #moving_vector.x ckenja.ghook -scoreboard players operation #feature.swing.intersection.x ckenja.ghook *= #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #feature.swing.t ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook *= #moving_vector.x ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook += #player.pos.x ckenja.ghook -scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #player.pos.y ckenja.ghook -scoreboard players operation #feature.swing.intersection.y ckenja.ghook -= #moving_vector.y ckenja.ghook -scoreboard players operation #feature.swing.intersection.y ckenja.ghook *= #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.k ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #feature.swing.t ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook *= #moving_vector.y ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook += #player.pos.y ckenja.ghook scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #feature.swing.k ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction index 4e60571..03ffa2f 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction @@ -4,11 +4,13 @@ # # @within function ckenja.ghook:feature/swing/collision_responce/looking_at_function +setblock ~ ~ ~ bedrock data modify storage ckenja.ghook.__temp__: swing.collision_responce.direction set from storage ckenja.looking_at_function:_ directionList[-1].value +scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 1 -execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-X"} align x positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x -execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+X"} align x positioned ~1 ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x -execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Z"} align z positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z -execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Z"} align z positioned ~ ~ ~1 run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z -execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Y"} align y positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y -execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Y"} align y positioned ~ ~1 ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-X"} align x positioned ~1 ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+X"} align x positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Z"} align z positioned ~ ~ ~1 run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Z"} align z positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Y"} align y positioned ~ ~1 ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Y"} align y positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction index 33ffdce..caf54e3 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction @@ -3,3 +3,4 @@ scoreboard players operation #feature.swing.nearest.x ckenja.ghook = #feature.sw scoreboard players operation #feature.swing.nearest.y ckenja.ghook = #feature.swing.intersection.y ckenja.ghook scoreboard players operation #feature.swing.nearest.z ckenja.ghook = #feature.swing.intersection.z ckenja.ghook scoreboard players operation #feature.swing.nearest.range ckenja.ghook = #feature.swing.temp.range ckenja.ghook +data modify storage ckenja.ghook.__temp__: swing.collision_responce.nearest_direction set from storage ckenja.ghook.__temp__: swing.collision_responce.direction From eb0a7899131255b21a60bf109c516aa4a586a245 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:50:25 +0900 Subject: [PATCH 25/51] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E5=A3=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/loot_tables/ghook.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/ckenja.ghook/loot_tables/ghook.json b/data/ckenja.ghook/loot_tables/ghook.json index 8fb6777..4e544a6 100644 --- a/data/ckenja.ghook/loot_tables/ghook.json +++ b/data/ckenja.ghook/loot_tables/ghook.json @@ -9,7 +9,7 @@ "functions": [ { "function": "minecraft:set_nbt", - "tag": "{CustomModelData:126000,Unbreakable:true,ctc:{id:\"ghook\",from:\"ckenja.ghook:\"},HideFlags:2}" + "tag": "{CustomModelData:126000,Unbreakable:true,ctc:{id:\"ghook\",from:\"ckenja.ghook:\"},HideFlags:6}" }, { "function": "set_attributes", From 52a45372227af3c6bb30ad1e56c2741635e5d06f Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Wed, 20 Dec 2023 22:20:40 +0900 Subject: [PATCH 26/51] =?UTF-8?q?=E8=A1=9D=E7=AA=81=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=82=92=E3=82=88=E3=82=8A=E6=AD=A3=E7=A2=BA=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../swing/collision_detection.mcfunction | 12 ---------- .../swing/collision_detection/_.mcfunction | 23 +++++++++++++++++++ .../check_and_tp.mcfunction} | 9 +------- .../collision_detection/check_back.mcfunction | 4 ++++ .../swing/collision_detection/tp.mcfunction | 2 ++ .../swing/collision_responce/_.mcfunction | 4 ++-- .../looking_at_function2.mcfunction | 1 - .../functions/feature/swing/marker.mcfunction | 4 ++-- 8 files changed, 34 insertions(+), 25 deletions(-) delete mode 100644 data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction rename data/ckenja.ghook/functions/feature/swing/{near.mcfunction => collision_detection/check_and_tp.mcfunction} (65%) create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_detection/tp.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction deleted file mode 100644 index 23928fa..0000000 --- a/data/ckenja.ghook/functions/feature/swing/collision_detection.mcfunction +++ /dev/null @@ -1,12 +0,0 @@ -#> ckenja.ghook:feature/swing/collision_detection -# -# -# -# @within function ckenja.ghook:feature/swing/marker - -execute store success score #feature.swing.collision ckenja.ghook positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision - -execute if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_responce/_ -execute if entity @s[distance=..0.125] at @s run function ckenja.ghook:feature/swing/near - -execute if score #feature.swing.collision ckenja.ghook matches 1 unless entity @s[distance=..0.125] positioned ^ ^ ^0.125 run function ckenja.ghook:feature/swing/collision_detection diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction new file mode 100644 index 0000000..440b7b8 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction @@ -0,0 +1,23 @@ +#> ckenja.ghook:feature/swing/collision_detection/_ +# +# +# +# @within function ckenja.ghook:feature/swing/marker + +scoreboard players set #feature.swing.collision ckenja.ghook 0 +execute positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision run scoreboard players set #feature.swing.collision ckenja.ghook 1 + +#次の探査地点に空間がないけど、近くに移動予定地点があるなら移動予定地点を見てみる +execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 if entity @s[distance=..0.125] at @s run function ckenja.ghook:feature/swing/collision_detection/check_and_tp + +#次の探査地点に空間がないなら衝突処理をする +#execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_responce/_ + +#次の探査地点に空間はあるが、移動予定地点が後ろならそこを見てみる +execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_detection/check_back + +#次の探査地点を探索しないならもうここにする +execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_detection/tp + +#決まってないなら、次の探査地点を探索する +execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 1 positioned ^ ^ ^0.125 run function ckenja.ghook:feature/swing/collision_detection/_ diff --git a/data/ckenja.ghook/functions/feature/swing/near.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_and_tp.mcfunction similarity index 65% rename from data/ckenja.ghook/functions/feature/swing/near.mcfunction rename to data/ckenja.ghook/functions/feature/swing/collision_detection/check_and_tp.mcfunction index d97e730..fe16dda 100644 --- a/data/ckenja.ghook/functions/feature/swing/near.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_and_tp.mcfunction @@ -1,8 +1 @@ -#> ckenja.ghook:feature/swing/near -# -# -# -# @within function ckenja.ghook:feature/swing/collision_detection - -execute if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ -scoreboard players set #feature.swing.collision ckenja.ghook 0 +execute if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_detection/tp diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction new file mode 100644 index 0000000..89114ac --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction @@ -0,0 +1,4 @@ +# 前後検知 +execute facing entity @s feet positioned as @s run tp @s ~ ~ ~ ~ ~ +# positioned ^ ^ ^0.125 rotated as @s positioned ^ ^ ^0.125 if entity @s[distance=..0.01] +execute at @s run function ckenja.ghook:feature/swing/collision_detection/check_and_tp diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection/tp.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/tp.mcfunction new file mode 100644 index 0000000..93ea825 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/tp.mcfunction @@ -0,0 +1,2 @@ +execute as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ +scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 0 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction index 4113d94..25adfa1 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction @@ -2,7 +2,7 @@ # # # -# @within function ckenja.ghook:feature/swing/collision_detection +# @within function ckenja.ghook:feature/swing/collision_detection/_ scoreboard players set #feature.swing.nearest.range ckenja.ghook 2147483647 @@ -121,4 +121,4 @@ #衝突向きのベクトルを消したうえで力を再計算する。 #execute at @s run function ckenja.ghook:feature/swing/collision_responce/_2 - execute at @s run function ckenja.ghook:feature/swing/tp + execute at @s run function ckenja.ghook:feature/swing/collision_detection/tp diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction index 03ffa2f..905dcec 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction @@ -4,7 +4,6 @@ # # @within function ckenja.ghook:feature/swing/collision_responce/looking_at_function -setblock ~ ~ ~ bedrock data modify storage ckenja.ghook.__temp__: swing.collision_responce.direction set from storage ckenja.looking_at_function:_ directionList[-1].value scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 1 diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index 42ec78a..0bdced8 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -10,7 +10,7 @@ data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.P execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s positioned ^ ^ ^-0.125 as @e[type=marker,tag=ckenja.ghook.marker,distance=..120] run function ckenja.ghook:feature/swing/loop #衝突判定を取る - scoreboard players reset #feature.swing.collision.neared ckenja.ghook - execute facing entity @s feet positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_detection + scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 1 + execute facing entity @s feet positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_detection/_ kill @s From f4458fcf458e28b507f36a06c1cac8473ac920c3 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Fri, 22 Dec 2023 23:11:38 +0900 Subject: [PATCH 27/51] =?UTF-8?q?=E5=89=8D=E5=BE=8C=E6=A4=9C=E7=9F=A5?= =?UTF-8?q?=E3=81=8C=E5=8B=95=E3=81=84=E3=81=A6=E3=81=AA=E3=81=8B=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/swing/_.mcfunction | 1 - .../feature/swing/collision_detection/_.mcfunction | 14 +++++++++++++- .../collision_detection/check_back.mcfunction | 5 +++-- data/ckenja.ghook/functions/load.mcfunction | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 19c874c..4241f4b 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -35,7 +35,6 @@ data modify storage ckenja.ghook.__temp__: player.data.Motion set from entity @s 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 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction index 440b7b8..6bcb2c8 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction @@ -6,6 +6,18 @@ scoreboard players set #feature.swing.collision ckenja.ghook 0 execute positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision run scoreboard players set #feature.swing.collision ckenja.ghook 1 +#execute positioned ~0.3 ~ ~0.3 run particle flame +#execute positioned ~0.3 ~ ~-0.3 run particle flame +#execute positioned ~-0.3 ~ ~0.3 run particle flame +#execute positioned ~-0.3 ~ ~-0.3 run particle flame +#execute positioned ~0.3 ~0.9 ~0.3 run particle flame +#execute positioned ~0.3 ~0.9 ~-0.3 run particle flame +#execute positioned ~-0.3 ~0.9 ~0.3 run particle flame +#execute positioned ~-0.3 ~0.9 ~-0.3 run particle flame +#execute positioned ~0.3 ~1.8 ~0.3 run particle flame +#execute positioned ~0.3 ~1.8 ~-0.3 run particle flame +#execute positioned ~-0.3 ~1.8 ~0.3 run particle flame +#execute positioned ~-0.3 ~1.8 ~-0.3 run particle flame #次の探査地点に空間がないけど、近くに移動予定地点があるなら移動予定地点を見てみる execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 if entity @s[distance=..0.125] at @s run function ckenja.ghook:feature/swing/collision_detection/check_and_tp @@ -14,7 +26,7 @@ execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if #execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_responce/_ #次の探査地点に空間はあるが、移動予定地点が後ろならそこを見てみる -execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_detection/check_back +execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 1 if entity @s[distance=..0.125] run function ckenja.ghook:feature/swing/collision_detection/check_back #次の探査地点を探索しないならもうここにする execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_detection/tp diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction index 89114ac..732dc7a 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction @@ -1,4 +1,5 @@ # 前後検知 execute facing entity @s feet positioned as @s run tp @s ~ ~ ~ ~ ~ -# positioned ^ ^ ^0.125 rotated as @s positioned ^ ^ ^0.125 if entity @s[distance=..0.01] -execute at @s run function ckenja.ghook:feature/swing/collision_detection/check_and_tp +execute store result score #feature.swing.collision_detection.check_back ckenja.ghook positioned as @s positioned ^ ^ ^0.125 rotated as @s positioned ^ ^ ^-0.125 if entity @s[distance=..0.001] +execute if score #feature.swing.collision_detection.check_back ckenja.ghook matches 1 at @s run function ckenja.ghook:feature/swing/collision_detection/check_and_tp +execute if score #feature.swing.collision_detection.check_back ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_detection/tp diff --git a/data/ckenja.ghook/functions/load.mcfunction b/data/ckenja.ghook/functions/load.mcfunction index fb9d288..8fdb858 100644 --- a/data/ckenja.ghook/functions/load.mcfunction +++ b/data/ckenja.ghook/functions/load.mcfunction @@ -20,3 +20,4 @@ scoreboard players set #2 ckenja.ghook 2 execute in overworld run forceload add -1 -1 0 0 data modify storage ckenja.ghook.__temp__: marker.merge.Pos set value [0.0,0.0,0.0] +data modify storage ckenja.ghook.__temp__: player.not_vehicle.Pos.0 set value [0.0,0.0,0.0] From bf24129ccfc35d2407a1c3396377951dedd90f4b Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sat, 23 Dec 2023 10:49:48 +0900 Subject: [PATCH 28/51] =?UTF-8?q?jet=E6=AE=8B=E3=81=A3=E3=81=A6=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/swing/jet.marker.mcfunction | 8 -------- .../functions/feature/swing/jet.mcfunction | 17 ----------------- .../functions/feature/swing/loop.mcfunction | 4 ---- 3 files changed, 29 deletions(-) delete mode 100644 data/ckenja.ghook/functions/feature/swing/jet.marker.mcfunction delete mode 100644 data/ckenja.ghook/functions/feature/swing/jet.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/jet.marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/jet.marker.mcfunction deleted file mode 100644 index 12a294b..0000000 --- a/data/ckenja.ghook/functions/feature/swing/jet.marker.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -#> ckenja.ghook:feature/swing/jet.marker -# -# -# -# @within function ckenja.ghook:feature/swing/jet - -data modify storage ckenja.ghook.__temp__: marker.data.Pos set from entity @s Pos -kill @s diff --git a/data/ckenja.ghook/functions/feature/swing/jet.mcfunction b/data/ckenja.ghook/functions/feature/swing/jet.mcfunction deleted file mode 100644 index 07d4b29..0000000 --- a/data/ckenja.ghook/functions/feature/swing/jet.mcfunction +++ /dev/null @@ -1,17 +0,0 @@ -#> ckenja.ghook:feature/swing/jet -# -# -# -# @within function ckenja.ghook:feature/swing/_ - -execute positioned 0.0 0.0 0.0 in minecraft:overworld store success score #temp.query ckenja.ghook run forceload add ~ ~ -execute rotated as @s positioned 0.0 0.0 0.0 in minecraft:overworld run summon marker ^ ^ ^0.05 {Tags:["ckenja.ghook.marker"]} -execute as @e[type=marker,tag=ckenja.ghook.marker] run function ckenja.ghook:feature/swing/jet.marker -execute positioned 0.0 0.0 0.0 in minecraft:overworld if score #temp.query ckenja.ghook matches 1 run forceload remove ~ ~ -execute store result score #jet.x ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[0] 1000 -execute store result score #jet.y ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[1] 1000 -execute store result score #jet.z ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[2] 1000 -scoreboard players operation #intertia.x ckenja.ghook += #jet.x ckenja.ghook -scoreboard players operation #intertia.y ckenja.ghook += #jet.y ckenja.ghook -scoreboard players operation #intertia.z ckenja.ghook += #jet.z ckenja.ghook - diff --git a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction b/data/ckenja.ghook/functions/feature/swing/loop.mcfunction index e2a174c..cab7518 100644 --- a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/loop.mcfunction @@ -1,10 +1,6 @@ #> ckenja.ghook:feature/swing/loop # # 当たり判定チェックとか挟みつつループ -# 100m以上離れているかつ衝突: 終了 -# jet使うかつmarkerを通り過ぎる: 終了 -# ロープ長まで行った: 終了 -# そうでなければ次のループ # # @within function ckenja.ghook:feature/swing/marker From 9fa81c4e30636022d75e7a753c8df9f489b5b12d Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sat, 23 Dec 2023 17:04:45 +0900 Subject: [PATCH 29/51] =?UTF-8?q?=E8=A1=9D=E7=AA=81=E7=82=B9=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/swing/_.mcfunction | 11 +- .../swing/collision_detection/_.mcfunction | 2 +- .../swing/collision_responce/_.mcfunction | 182 +++++++----------- .../swing/collision_responce/_2.mcfunction | 68 +++---- .../swing/collision_responce/_3.mcfunction | 32 +++ .../collision_responce/calc_range.mcfunction | 4 + .../get_intersection.mcfunction | 11 ++ .../intersection_with_x.mcfunction | 8 +- .../intersection_with_y.mcfunction | 7 +- .../intersection_with_z.mcfunction | 7 +- .../looking_at_function2.mcfunction | 13 +- .../functions/feature/swing/motion.mcfunction | 6 +- 12 files changed, 177 insertions(+), 174 deletions(-) create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 4241f4b..71fb128 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -15,20 +15,15 @@ data modify storage ckenja.ghook.__temp__: player.data.Motion set from entity @s 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 + execute store result score #player.motion.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[0] 10000 + execute store result score #player.motion.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[1] 10000 + execute store result score #player.motion.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 10000 #の和 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 -#運動方向のベクトルとして保存 - scoreboard players operation #moving_vector.x ckenja.ghook = #intertia.x ckenja.ghook - scoreboard players operation #moving_vector.y ckenja.ghook = #intertia.y ckenja.ghook - scoreboard players operation #moving_vector.z ckenja.ghook = #intertia.z ckenja.ghook - #との和 scoreboard players operation #intertia.x ckenja.ghook += #player.pos.x ckenja.ghook scoreboard players operation #intertia.y ckenja.ghook += #player.pos.y ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction index 6bcb2c8..aee9677 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction @@ -23,7 +23,7 @@ execute positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 if entity @s[distance=..0.125] at @s run function ckenja.ghook:feature/swing/collision_detection/check_and_tp #次の探査地点に空間がないなら衝突処理をする -#execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_responce/_ +execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_responce/_ #次の探査地点に空間はあるが、移動予定地点が後ろならそこを見てみる execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 1 if entity @s[distance=..0.125] run function ckenja.ghook:feature/swing/collision_detection/check_back diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction index 25adfa1..97d556a 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction @@ -6,119 +6,73 @@ scoreboard players set #feature.swing.nearest.range ckenja.ghook 2147483647 - #looking_at_functionで各点がどの面に衝突しうるか調べ、その面と移動ベクトルの交点を求める - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~0.3 ~ ~0.3 run function ckenja.looking_at_function:run - #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~-0.3 ~ ~0.3 run function ckenja.looking_at_function:run - #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~0.3 ~ ~-0.3 run function ckenja.looking_at_function:run - #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~-0.3 ~ ~-0.3 run function ckenja.looking_at_function:run - #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~0.3 ~0.9 ~0.3 run function ckenja.looking_at_function:run - #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 9000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~-0.3 ~0.9 ~0.3 run function ckenja.looking_at_function:run - #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 9000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~0.3 ~0.9 ~-0.3 run function ckenja.looking_at_function:run - #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 9000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~-0.3 ~0.9 ~-0.3 run function ckenja.looking_at_function:run - #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 9000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~0.3 ~1.8 ~0.3 run function ckenja.looking_at_function:run - #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 18000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~-0.3 ~1.8 ~0.3 run function ckenja.looking_at_function:run - #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.z ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 18000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~0.3 ~1.8 ~-0.3 run function ckenja.looking_at_function:run - #scoreboard players remove #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 18000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range - - scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 - data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" - data modify storage ckenja.looking_at_function:_ steps set value 3 - execute positioned ~-0.3 ~1.8 ~-0.3 run function ckenja.looking_at_function:run - #scoreboard players add #feature.swing.intersection.x ckenja.ghook 3000 - #scoreboard players add #feature.swing.intersection.z ckenja.ghook 3000 - #scoreboard players remove #feature.swing.intersection.y ckenja.ghook 18000 - execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range +#移動予定地と現座標の差を、この1tickの運動の近似として使う + data modify storage ckenja.ghook.__temp__: feature.swing.collision_responce.Pos set from entity @s Pos + execute store result score #marker.pos.x ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.swing.collision_responce.Pos[0] 10000 + execute store result score #marker.pos.y ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.swing.collision_responce.Pos[1] 10000 + execute store result score #marker.pos.z ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.swing.collision_responce.Pos[2] 10000 + scoreboard players operation #moving_vector.x ckenja.ghook = #marker.pos.x ckenja.ghook + scoreboard players operation #moving_vector.y ckenja.ghook = #marker.pos.y ckenja.ghook + scoreboard players operation #moving_vector.z ckenja.ghook = #marker.pos.z ckenja.ghook + scoreboard players operation #moving_vector.x ckenja.ghook -= #player.pos.x ckenja.ghook + scoreboard players operation #moving_vector.y ckenja.ghook -= #player.pos.y ckenja.ghook + scoreboard players operation #moving_vector.z ckenja.ghook -= #player.pos.z ckenja.ghook + +#looking_at_functionで各点がどの面に衝突しうるか調べ、その面と移動ベクトルの交点を求める + scoreboard players set #feature.swing.relative.y ckenja.ghook 0 + + scoreboard players set #feature.swing.relative.x ckenja.ghook 3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook 3000 + execute positioned ~0.3 ~ ~0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.x ckenja.ghook -3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook 3000 + execute positioned ~-0.3 ~ ~0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.x ckenja.ghook 3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook -3000 + execute positioned ~0.3 ~ ~-0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.x ckenja.ghook -3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook -3000 + execute positioned ~-0.3 ~ ~-0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.y ckenja.ghook 9000 + + scoreboard players set #feature.swing.relative.x ckenja.ghook 3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook 3000 + execute positioned ~0.3 ~0.9 ~0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.x ckenja.ghook -3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook 3000 + execute positioned ~-0.3 ~0.9 ~0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.x ckenja.ghook 3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook -3000 + execute positioned ~0.3 ~0.9 ~-0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.x ckenja.ghook -3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook -3000 + execute positioned ~-0.3 ~0.9 ~-0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.y ckenja.ghook 18000 + + scoreboard players set #feature.swing.relative.x ckenja.ghook 3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook 3000 + execute positioned ~0.3 ~1.8 ~0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.x ckenja.ghook -3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook 3000 + execute positioned ~-0.3 ~1.8 ~0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.x ckenja.ghook 3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook -3000 + execute positioned ~0.3 ~1.8 ~-0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection + + scoreboard players set #feature.swing.relative.x ckenja.ghook -3000 + scoreboard players set #feature.swing.relative.z ckenja.ghook -3000 + execute positioned ~-0.3 ~1.8 ~-0.3 run function ckenja.ghook:feature/swing/collision_responce/get_intersection #もっとも近い交点に位置を変更する - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.nearest.x ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.nearest.y ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.nearest.z ckenja.ghook - data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos - -#衝突向きのベクトルを消したうえで力を再計算する。 - #execute at @s run function ckenja.ghook:feature/swing/collision_responce/_2 - execute at @s run function ckenja.ghook:feature/swing/collision_detection/tp + execute unless score #feature.swing.nearest.range ckenja.ghook matches 2147483647 run function ckenja.ghook:feature/swing/collision_responce/_2 + execute if score #feature.swing.nearest.range ckenja.ghook matches 2147483647 run say fail! diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction index 6d36790..dc518ba 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction @@ -1,33 +1,35 @@ - # #feature.swing.intersection(実際の移動先座標) - #player.pos(現在の座標) = 実際の移動距離 - scoreboard players operation #feature.swing.displacement.x ckenja.ghook = #feature.swing.intersection.x ckenja.ghook - scoreboard players operation #feature.swing.displacement.x ckenja.ghook -= #player.pos.x ckenja.ghook - scoreboard players operation #feature.swing.displacement.y ckenja.ghook = #feature.swing.intersection.y ckenja.ghook - scoreboard players operation #feature.swing.displacement.y ckenja.ghook -= #player.pos.y ckenja.ghook - scoreboard players operation #feature.swing.displacement.z ckenja.ghook = #feature.swing.intersection.z ckenja.ghook - scoreboard players operation #feature.swing.displacement.z ckenja.ghook -= #player.pos.z ckenja.ghook - tellraw @a {"score": {"name": "#feature.swing.displacement.x", "objective": "ckenja.ghook"}} - tellraw @a {"score": {"name": "#feature.swing.displacement.z", "objective": "ckenja.ghook"}} - tellraw @a {"score": {"name": "#feature.swing.displacement.z", "objective": "ckenja.ghook"}} - # #moving_vector(本来の移動距離) - 実際の移動距離 = 残ってる力 - scoreboard players operation #feature.swing.vector.x ckenja.ghook = #moving_vector.x ckenja.ghook - scoreboard players operation #feature.swing.vector.x ckenja.ghook -= #feature.swing.displacement.x ckenja.ghook - scoreboard players operation #feature.swing.vector.y ckenja.ghook = #moving_vector.y ckenja.ghook - scoreboard players operation #feature.swing.vector.y ckenja.ghook -= #feature.swing.displacement.y ckenja.ghook - scoreboard players operation #feature.swing.vector.z ckenja.ghook = #moving_vector.z ckenja.ghook - scoreboard players operation #feature.swing.vector.z ckenja.ghook -= #feature.swing.displacement.z ckenja.ghook - #storage ckenja.ghook.__temp__: swing.collision_responce.nearest_direction(衝突方向) - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 - scoreboard players operation #feature.swing.vector.x ckenja.ghook += #swing.intersection.x ckenja.ghook - scoreboard players operation #feature.swing.vector.y ckenja.ghook += #swing.intersection.y ckenja.ghook - scoreboard players operation #feature.swing.vector.z ckenja.ghook += #swing.intersection.z ckenja.ghook - - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.vector.x ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.vector.y ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.vector.z ckenja.ghook - data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos - execute facing entity @s feet positioned as @s as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ +execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.nearest.x ckenja.ghook +execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.nearest.y ckenja.ghook +execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.nearest.z ckenja.ghook +data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos + +#衝突向きのベクトルを消したうえで力を再計算する。 +#execute at @s run function ckenja.ghook:feature/swing/collision_responce/_3 +#execute at @s run function ckenja.ghook:feature/swing/collision_detection/tp +scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 0 + +#execute positioned ~0.3 ~ ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~0.3 ~ ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~-0.3 ~ ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~-0.3 ~ ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~0.3 ~0.9 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~0.3 ~0.9 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~-0.3 ~0.9 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~-0.3 ~0.9 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~0.3 ~1.8 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~0.3 ~1.8 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~-0.3 ~1.8 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! +#execute positioned ~-0.3 ~1.8 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! + +#execute positioned ~0.3 ~ ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~0.3 ~ ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~-0.3 ~ ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~-0.3 ~ ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~0.3 ~0.9 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~0.3 ~0.9 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~-0.3 ~0.9 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~-0.3 ~0.9 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~0.3 ~1.8 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~0.3 ~1.8 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~-0.3 ~1.8 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator +#execute positioned ~-0.3 ~1.8 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction new file mode 100644 index 0000000..4c1b104 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction @@ -0,0 +1,32 @@ + # #feature.swing.intersection(実際の移動先座標) - #player.pos(現在の座標) = 実際の移動距離 + scoreboard players operation #feature.swing.displacement.x ckenja.ghook = #feature.swing.intersection.x ckenja.ghook + scoreboard players operation #feature.swing.displacement.x ckenja.ghook -= #player.pos.x ckenja.ghook + scoreboard players operation #feature.swing.displacement.y ckenja.ghook = #feature.swing.intersection.y ckenja.ghook + scoreboard players operation #feature.swing.displacement.y ckenja.ghook -= #player.pos.y ckenja.ghook + scoreboard players operation #feature.swing.displacement.z ckenja.ghook = #feature.swing.intersection.z ckenja.ghook + scoreboard players operation #feature.swing.displacement.z ckenja.ghook -= #player.pos.z ckenja.ghook + + # #moving_vector(本来の移動距離) - 実際の移動距離 = 残ってる力 + scoreboard players operation #feature.swing.vector.x ckenja.ghook = #moving_vector.x ckenja.ghook + scoreboard players operation #feature.swing.vector.x ckenja.ghook -= #feature.swing.displacement.x ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook = #moving_vector.y ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook -= #feature.swing.displacement.y ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook = #moving_vector.z ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook -= #feature.swing.displacement.z ckenja.ghook + + #storage ckenja.ghook.__temp__: swing.collision_responce.nearest_direction(衝突方向) + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 + scoreboard players operation #feature.swing.vector.x ckenja.ghook += #swing.intersection.x ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook += #swing.intersection.y ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook += #swing.intersection.z ckenja.ghook + + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.vector.x ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.vector.y ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.vector.z ckenja.ghook + data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos + execute facing entity @s feet positioned as @s as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction index db443c7..18b1f6d 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction @@ -1,3 +1,7 @@ +scoreboard players operation #feature.swing.intersection.x ckenja.ghook -= #feature.swing.relative.x ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook -= #feature.swing.relative.y ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook -= #feature.swing.relative.z ckenja.ghook + #現在の座標との距離を求める scoreboard players operation #feature.swing.temp.x ckenja.ghook = #feature.swing.intersection.x ckenja.ghook scoreboard players operation #feature.swing.temp.x ckenja.ghook -= #player.pos.x ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction new file mode 100644 index 0000000..346dfaa --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction @@ -0,0 +1,11 @@ +scoreboard players operation #start_ray.x ckenja.ghook = #marker.pos.x ckenja.ghook +scoreboard players operation #start_ray.y ckenja.ghook = #marker.pos.y ckenja.ghook +scoreboard players operation #start_ray.z ckenja.ghook = #marker.pos.z ckenja.ghook +scoreboard players operation #start_ray.x ckenja.ghook += #feature.swing.relative.x ckenja.ghook +scoreboard players operation #start_ray.y ckenja.ghook += #feature.swing.relative.y ckenja.ghook +scoreboard players operation #start_ray.z ckenja.ghook += #feature.swing.relative.z ckenja.ghook +scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 +data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" +data modify storage ckenja.looking_at_function:_ steps set value 3 +execute positioned ~0.3 ~ ~0.3 run function ckenja.looking_at_function:run +execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction index 59d888a..e0bb2eb 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction @@ -8,7 +8,7 @@ tp @s ~ ~ ~ execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[0] 10000 scoreboard players operation #feature.swing.t ckenja.ghook = #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.t ckenja.ghook -= #player.pos.x ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook -= #start_ray.x ckenja.ghook scoreboard players operation #feature.swing.t ckenja.ghook *= #10000 ckenja.ghook scoreboard players operation #feature.swing.t ckenja.ghook /= #moving_vector.x ckenja.ghook @@ -17,9 +17,11 @@ scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #featu scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #feature.swing.t ckenja.ghook scoreboard players operation #feature.swing.intersection.y ckenja.ghook *= #moving_vector.y ckenja.ghook scoreboard players operation #feature.swing.intersection.y ckenja.ghook /= #10000 ckenja.ghook -scoreboard players operation #feature.swing.intersection.y ckenja.ghook += #player.pos.y ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook += #start_ray.y ckenja.ghook scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #feature.swing.t ckenja.ghook scoreboard players operation #feature.swing.intersection.z ckenja.ghook *= #moving_vector.z ckenja.ghook scoreboard players operation #feature.swing.intersection.z ckenja.ghook /= #10000 ckenja.ghook -scoreboard players operation #feature.swing.intersection.z ckenja.ghook += #player.pos.z ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook += #start_ray.z ckenja.ghook + +execute if score #moving_vector.x ckenja.ghook matches 0 run scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction index 2cd4b56..5a88fd5 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction @@ -8,19 +8,20 @@ tp @s ~ ~ ~ execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[1] 10000 scoreboard players operation #feature.swing.t ckenja.ghook = #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.t ckenja.ghook -= #player.pos.y ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook -= #start_ray.y ckenja.ghook scoreboard players operation #feature.swing.t ckenja.ghook *= #10000 ckenja.ghook scoreboard players operation #feature.swing.t ckenja.ghook /= #moving_vector.y ckenja.ghook scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #feature.swing.t ckenja.ghook scoreboard players operation #feature.swing.intersection.x ckenja.ghook *= #moving_vector.x ckenja.ghook scoreboard players operation #feature.swing.intersection.x ckenja.ghook /= #10000 ckenja.ghook -scoreboard players operation #feature.swing.intersection.x ckenja.ghook += #player.pos.x ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook += #start_ray.x ckenja.ghook scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #feature.swing.k ckenja.ghook scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #feature.swing.t ckenja.ghook scoreboard players operation #feature.swing.intersection.z ckenja.ghook *= #moving_vector.z ckenja.ghook scoreboard players operation #feature.swing.intersection.z ckenja.ghook /= #10000 ckenja.ghook -scoreboard players operation #feature.swing.intersection.z ckenja.ghook += #player.pos.z ckenja.ghook +scoreboard players operation #feature.swing.intersection.z ckenja.ghook += #start_ray.z ckenja.ghook +execute if score #moving_vector.x ckenja.ghook matches 0 run scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction index a2e71a8..4e9b94f 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction @@ -8,19 +8,20 @@ tp @s ~ ~ ~ execute store result score #feature.swing.k ckenja.ghook run data get entity @s Pos[2] 10000 scoreboard players operation #feature.swing.t ckenja.ghook = #feature.swing.k ckenja.ghook -scoreboard players operation #feature.swing.t ckenja.ghook -= #player.pos.z ckenja.ghook +scoreboard players operation #feature.swing.t ckenja.ghook -= #start_ray.z ckenja.ghook scoreboard players operation #feature.swing.t ckenja.ghook *= #10000 ckenja.ghook scoreboard players operation #feature.swing.t ckenja.ghook /= #moving_vector.z ckenja.ghook scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #feature.swing.t ckenja.ghook scoreboard players operation #feature.swing.intersection.x ckenja.ghook *= #moving_vector.x ckenja.ghook scoreboard players operation #feature.swing.intersection.x ckenja.ghook /= #10000 ckenja.ghook -scoreboard players operation #feature.swing.intersection.x ckenja.ghook += #player.pos.x ckenja.ghook +scoreboard players operation #feature.swing.intersection.x ckenja.ghook += #start_ray.x ckenja.ghook scoreboard players operation #feature.swing.intersection.y ckenja.ghook = #feature.swing.t ckenja.ghook scoreboard players operation #feature.swing.intersection.y ckenja.ghook *= #moving_vector.y ckenja.ghook scoreboard players operation #feature.swing.intersection.y ckenja.ghook /= #10000 ckenja.ghook -scoreboard players operation #feature.swing.intersection.y ckenja.ghook += #player.pos.y ckenja.ghook +scoreboard players operation #feature.swing.intersection.y ckenja.ghook += #start_ray.y ckenja.ghook scoreboard players operation #feature.swing.intersection.z ckenja.ghook = #feature.swing.k ckenja.ghook +execute if score #moving_vector.x ckenja.ghook matches 0 run scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction index 905dcec..d4d3182 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction @@ -7,9 +7,10 @@ data modify storage ckenja.ghook.__temp__: swing.collision_responce.direction set from storage ckenja.looking_at_function:_ directionList[-1].value scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 1 -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-X"} align x positioned ~1 ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+X"} align x positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Z"} align z positioned ~ ~ ~1 run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Z"} align z positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Y"} align y positioned ~ ~1 ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Y"} align y positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-X"} align x positioned ~1.001 ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+X"} align x positioned ~-0.001 ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Z"} align z positioned ~ ~ ~1.001 run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Z"} align z positioned ~ ~ ~-0.001 run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Y"} align y positioned ~ ~1.001 ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Y"} align y positioned ~ ~-0.001 ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y + diff --git a/data/ckenja.ghook/functions/feature/swing/motion.mcfunction b/data/ckenja.ghook/functions/feature/swing/motion.mcfunction index 428cd41..3942ffd 100644 --- a/data/ckenja.ghook/functions/feature/swing/motion.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/motion.mcfunction @@ -4,6 +4,6 @@ # # @within function ckenja.ghook:feature/swing/_ -execute store result score #intertia.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[0] 5000 -execute store result score #intertia.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[1] 5000 -execute store result score #intertia.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 5000 +execute store result score #intertia.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[0] 10000 +execute store result score #intertia.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[1] 10000 +execute store result score #intertia.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 10000 From 4ca4617f3cd53ba19f616d606f88203bfe628fce Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 24 Dec 2023 10:52:28 +0900 Subject: [PATCH 30/51] =?UTF-8?q?=E8=AC=8E=E3=81=AE=E5=A3=81=E6=8A=9C?= =?UTF-8?q?=E3=81=91=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../swing/collision_responce/_.mcfunction | 1 - .../swing/collision_responce/_2.mcfunction | 32 ++++--------------- .../get_intersection.mcfunction | 2 +- .../looking_at_function2.mcfunction | 28 ++++++++++++---- .../tags/blocks/air.json | 3 ++ 5 files changed, 32 insertions(+), 34 deletions(-) create mode 100644 data/ckenja.looking_at_function/tags/blocks/air.json diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction index 97d556a..4f6a177 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction @@ -75,4 +75,3 @@ #もっとも近い交点に位置を変更する execute unless score #feature.swing.nearest.range ckenja.ghook matches 2147483647 run function ckenja.ghook:feature/swing/collision_responce/_2 - execute if score #feature.swing.nearest.range ckenja.ghook matches 2147483647 run say fail! diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction index dc518ba..ee3b63b 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction @@ -2,34 +2,14 @@ execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0 execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.nearest.y ckenja.ghook execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.nearest.z ckenja.ghook data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos +#tellraw @a {"nbt": "Pos", "entity": "@s"} +#tellraw @a {"score": {"name": "#feature.swing.nearest.x", "objective": "ckenja.ghook"}} +#tellraw @a {"score": {"name": "#feature.swing.nearest.y", "objective": "ckenja.ghook"}} +#tellraw @a {"score": {"name": "#feature.swing.nearest.z", "objective": "ckenja.ghook"}} +#tellraw @a {"nbt": "Pos", "entity": "@p"} #衝突向きのベクトルを消したうえで力を再計算する。 #execute at @s run function ckenja.ghook:feature/swing/collision_responce/_3 -#execute at @s run function ckenja.ghook:feature/swing/collision_detection/tp +execute at @s run function ckenja.ghook:feature/swing/collision_detection/tp scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 0 -#execute positioned ~0.3 ~ ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~0.3 ~ ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~-0.3 ~ ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~-0.3 ~ ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~0.3 ~0.9 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~0.3 ~0.9 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~-0.3 ~0.9 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~-0.3 ~0.9 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~0.3 ~1.8 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~0.3 ~1.8 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~-0.3 ~1.8 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! -#execute positioned ~-0.3 ~1.8 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision run say error! - -#execute positioned ~0.3 ~ ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~0.3 ~ ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~-0.3 ~ ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~-0.3 ~ ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~0.3 ~0.9 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~0.3 ~0.9 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~-0.3 ~0.9 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~-0.3 ~0.9 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~0.3 ~1.8 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~0.3 ~1.8 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~-0.3 ~1.8 ~0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator -#execute positioned ~-0.3 ~1.8 ~-0.3 unless block ~ ~ ~ #ckenja.ghook:no_collision as @a run gamemode spectator diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction index 346dfaa..a6a0ae0 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction @@ -7,5 +7,5 @@ scoreboard players operation #start_ray.z ckenja.ghook += #feature.swing.relativ scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 0 data modify storage ckenja.looking_at_function: in.function set value "ckenja.ghook:feature/swing/collision_responce/looking_at_function" data modify storage ckenja.looking_at_function:_ steps set value 3 -execute positioned ~0.3 ~ ~0.3 run function ckenja.looking_at_function:run +function ckenja.looking_at_function:run execute if score #feature.swing.success_get_intersection ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/collision_responce/calc_range diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction index d4d3182..f2b1a49 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction @@ -7,10 +7,26 @@ data modify storage ckenja.ghook.__temp__: swing.collision_responce.direction set from storage ckenja.looking_at_function:_ directionList[-1].value scoreboard players set #feature.swing.success_get_intersection ckenja.ghook 1 -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-X"} align x positioned ~1.001 ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+X"} align x positioned ~-0.001 ~ ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Z"} align z positioned ~ ~ ~1.001 run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Z"} align z positioned ~ ~ ~-0.001 run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Y"} align y positioned ~ ~1.001 ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y -execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Y"} align y positioned ~ ~-0.001 ~ run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-X"} align x positioned ~1.001 ~ ~ if block ~ ~ ~ #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+X"} align x positioned ~-0.001 ~ ~ if block ~ ~ ~ #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_responce/intersection_with_x +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Z"} align z positioned ~ ~ ~1.001 if block ~ ~ ~ #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Z"} align z positioned ~ ~ ~-0.001 if block ~ ~ ~ #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Y"} align y positioned ~ ~1.001 ~ if block ~ ~ ~ #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y +execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Y"} align y positioned ~ ~-0.001 ~ if block ~ ~ ~ #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y +#say k-t-d +#tellraw @a {"score": {"name": "#feature.swing.k", "objective": "ckenja.ghook"}} +#tellraw @a {"score": {"name": "#feature.swing.t", "objective": "ckenja.ghook"}} +#tellraw @a {"nbt": "swing.collision_responce.direction", "storage": "ckenja.ghook.__temp__:"} +#say pos +#tellraw @a {"score": {"name": "#start_ray.x", "objective": "ckenja.ghook"}} +#tellraw @a {"score": {"name": "#start_ray.y", "objective": "ckenja.ghook"}} +#tellraw @a {"score": {"name": "#start_ray.z", "objective": "ckenja.ghook"}} +#say vec +#tellraw @a {"score": {"name": "#moving_vector.x", "objective": "ckenja.ghook"}} +#tellraw @a {"score": {"name": "#moving_vector.y", "objective": "ckenja.ghook"}} +#tellraw @a {"score": {"name": "#moving_vector.z", "objective": "ckenja.ghook"}} +#say intersection +#tellraw @a {"score": {"name": "#feature.swing.intersection.x", "objective": "ckenja.ghook"}} +#tellraw @a {"score": {"name": "#feature.swing.intersection.y", "objective": "ckenja.ghook"}} +#tellraw @a {"score": {"name": "#feature.swing.intersection.z", "objective": "ckenja.ghook"}} diff --git a/data/ckenja.looking_at_function/tags/blocks/air.json b/data/ckenja.looking_at_function/tags/blocks/air.json new file mode 100644 index 0000000..66fe10b --- /dev/null +++ b/data/ckenja.looking_at_function/tags/blocks/air.json @@ -0,0 +1,3 @@ +{ + "values": ["#ckenja.ghook:no_collision"] +} From 78761bb6e8de5b7e2f229dbed9a98f66333a1def Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 24 Dec 2023 11:06:29 +0900 Subject: [PATCH 31/51] =?UTF-8?q?=E6=BB=91=E3=82=8A=E3=81=AE=E7=89=A9?= =?UTF-8?q?=E7=90=86=E6=BC=94=E7=AE=97(=E6=8B=98=E6=9D=9F=E3=81=AA?= =?UTF-8?q?=E3=81=97)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../swing/collision_responce/_2.mcfunction | 39 ++++++++++++------- .../swing/collision_responce/_3.mcfunction | 32 --------------- .../looking_at_function2.mcfunction | 17 -------- 3 files changed, 25 insertions(+), 63 deletions(-) delete mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction index ee3b63b..a3fb7e9 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction @@ -1,15 +1,26 @@ -execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.nearest.x ckenja.ghook -execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.nearest.y ckenja.ghook -execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.nearest.z ckenja.ghook -data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos -#tellraw @a {"nbt": "Pos", "entity": "@s"} -#tellraw @a {"score": {"name": "#feature.swing.nearest.x", "objective": "ckenja.ghook"}} -#tellraw @a {"score": {"name": "#feature.swing.nearest.y", "objective": "ckenja.ghook"}} -#tellraw @a {"score": {"name": "#feature.swing.nearest.z", "objective": "ckenja.ghook"}} -#tellraw @a {"nbt": "Pos", "entity": "@p"} - #衝突向きのベクトルを消したうえで力を再計算する。 -#execute at @s run function ckenja.ghook:feature/swing/collision_responce/_3 -execute at @s run function ckenja.ghook:feature/swing/collision_detection/tp -scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 0 - + # 残ってる力 = 移動予定地-交点 + scoreboard players operation #feature.swing.vector.x ckenja.ghook = #marker.pos.x ckenja.ghook + scoreboard players operation #feature.swing.vector.x ckenja.ghook -= #feature.swing.nearest.x ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook = #marker.pos.y ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook -= #feature.swing.nearest.y ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook = #marker.pos.z ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook -= #feature.swing.nearest.z ckenja.ghook + + #storage ckenja.ghook.__temp__: swing.collision_responce.nearest_direction(衝突方向) + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"-X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"+X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"-Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"+Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"-Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"+Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 + scoreboard players operation #feature.swing.vector.x ckenja.ghook += #feature.swing.intersection.x ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook += #feature.swing.intersection.y ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook += #feature.swing.intersection.z ckenja.ghook + + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.vector.x ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.vector.y ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.vector.z ckenja.ghook + data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos + execute at @s run function ckenja.ghook:feature/swing/collision_detection/tp + scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 0 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction deleted file mode 100644 index 4c1b104..0000000 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction +++ /dev/null @@ -1,32 +0,0 @@ - # #feature.swing.intersection(実際の移動先座標) - #player.pos(現在の座標) = 実際の移動距離 - scoreboard players operation #feature.swing.displacement.x ckenja.ghook = #feature.swing.intersection.x ckenja.ghook - scoreboard players operation #feature.swing.displacement.x ckenja.ghook -= #player.pos.x ckenja.ghook - scoreboard players operation #feature.swing.displacement.y ckenja.ghook = #feature.swing.intersection.y ckenja.ghook - scoreboard players operation #feature.swing.displacement.y ckenja.ghook -= #player.pos.y ckenja.ghook - scoreboard players operation #feature.swing.displacement.z ckenja.ghook = #feature.swing.intersection.z ckenja.ghook - scoreboard players operation #feature.swing.displacement.z ckenja.ghook -= #player.pos.z ckenja.ghook - - # #moving_vector(本来の移動距離) - 実際の移動距離 = 残ってる力 - scoreboard players operation #feature.swing.vector.x ckenja.ghook = #moving_vector.x ckenja.ghook - scoreboard players operation #feature.swing.vector.x ckenja.ghook -= #feature.swing.displacement.x ckenja.ghook - scoreboard players operation #feature.swing.vector.y ckenja.ghook = #moving_vector.y ckenja.ghook - scoreboard players operation #feature.swing.vector.y ckenja.ghook -= #feature.swing.displacement.y ckenja.ghook - scoreboard players operation #feature.swing.vector.z ckenja.ghook = #moving_vector.z ckenja.ghook - scoreboard players operation #feature.swing.vector.z ckenja.ghook -= #feature.swing.displacement.z ckenja.ghook - - #storage ckenja.ghook.__temp__: swing.collision_responce.nearest_direction(衝突方向) - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"-Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce.direction{direction:"+Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 - scoreboard players operation #feature.swing.vector.x ckenja.ghook += #swing.intersection.x ckenja.ghook - scoreboard players operation #feature.swing.vector.y ckenja.ghook += #swing.intersection.y ckenja.ghook - scoreboard players operation #feature.swing.vector.z ckenja.ghook += #swing.intersection.z ckenja.ghook - - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.vector.x ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.vector.y ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.vector.z ckenja.ghook - data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos - execute facing entity @s feet positioned as @s as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction index f2b1a49..78afde0 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction @@ -13,20 +13,3 @@ execute if data storage ckenja.ghook.__temp__: swing.collision_responce{directio execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Z"} align z positioned ~ ~ ~-0.001 if block ~ ~ ~ #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_responce/intersection_with_z execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"-Y"} align y positioned ~ ~1.001 ~ if block ~ ~ ~ #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y execute if data storage ckenja.ghook.__temp__: swing.collision_responce{direction:"+Y"} align y positioned ~ ~-0.001 ~ if block ~ ~ ~ #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_responce/intersection_with_y - -#say k-t-d -#tellraw @a {"score": {"name": "#feature.swing.k", "objective": "ckenja.ghook"}} -#tellraw @a {"score": {"name": "#feature.swing.t", "objective": "ckenja.ghook"}} -#tellraw @a {"nbt": "swing.collision_responce.direction", "storage": "ckenja.ghook.__temp__:"} -#say pos -#tellraw @a {"score": {"name": "#start_ray.x", "objective": "ckenja.ghook"}} -#tellraw @a {"score": {"name": "#start_ray.y", "objective": "ckenja.ghook"}} -#tellraw @a {"score": {"name": "#start_ray.z", "objective": "ckenja.ghook"}} -#say vec -#tellraw @a {"score": {"name": "#moving_vector.x", "objective": "ckenja.ghook"}} -#tellraw @a {"score": {"name": "#moving_vector.y", "objective": "ckenja.ghook"}} -#tellraw @a {"score": {"name": "#moving_vector.z", "objective": "ckenja.ghook"}} -#say intersection -#tellraw @a {"score": {"name": "#feature.swing.intersection.x", "objective": "ckenja.ghook"}} -#tellraw @a {"score": {"name": "#feature.swing.intersection.y", "objective": "ckenja.ghook"}} -#tellraw @a {"score": {"name": "#feature.swing.intersection.z", "objective": "ckenja.ghook"}} From 101cd2b471af550538a1138e7fc1f4fe7cfba9ee Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 24 Dec 2023 11:36:12 +0900 Subject: [PATCH 32/51] =?UTF-8?q?=E3=83=AA=E3=83=95=E3=82=A1=E3=82=AF?= =?UTF-8?q?=E3=82=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{reel.mcfunction => reel/_.mcfunction} | 7 +++--- .../feature/reel/kill_display.mcfunction | 8 +++++++ .../{ => feature/reel}/void_kill.mcfunction | 4 ++-- .../functions/feature/shot/hook.mcfunction | 2 +- .../functions/feature/swing/_.mcfunction | 3 +-- .../check_and_tp.mcfunction | 6 +++++ .../collision_detection/check_back.mcfunction | 6 +++++ .../swing/collision_detection/tp.mcfunction | 8 +++++++ .../swing/collision_responce/_2.mcfunction | 6 +++++ .../collision_responce/calc_range.mcfunction | 6 +++++ .../get_intersection.mcfunction | 6 +++++ .../update_nearest.mcfunction | 5 ++++ .../functions/feature/swing/marker.mcfunction | 4 +++- .../feature/swing/no_tension.mcfunction | 6 +++++ .../functions/hook/tick.mcfunction | 3 ++- .../functions/player/not_vehicle.mcfunction | 24 ++++++++++++------- .../functions/player/not_vehicle2.mcfunction | 6 +++++ .../functions/player/tick.mcfunction | 2 +- 18 files changed, 91 insertions(+), 21 deletions(-) rename data/ckenja.ghook/functions/feature/{reel.mcfunction => reel/_.mcfunction} (81%) create mode 100644 data/ckenja.ghook/functions/feature/reel/kill_display.mcfunction rename data/ckenja.ghook/functions/{ => feature/reel}/void_kill.mcfunction (59%) diff --git a/data/ckenja.ghook/functions/feature/reel.mcfunction b/data/ckenja.ghook/functions/feature/reel/_.mcfunction similarity index 81% rename from data/ckenja.ghook/functions/feature/reel.mcfunction rename to data/ckenja.ghook/functions/feature/reel/_.mcfunction index b699ca9..986b330 100644 --- a/data/ckenja.ghook/functions/feature/reel.mcfunction +++ b/data/ckenja.ghook/functions/feature/reel/_.mcfunction @@ -1,14 +1,13 @@ -#> 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 on vehicle run function ckenja.ghook:feature/reel/kill_display #慣性をMotion代入 scoreboard players operation $x delta.api.launch = @s ckenja.ghook.x diff --git a/data/ckenja.ghook/functions/feature/reel/kill_display.mcfunction b/data/ckenja.ghook/functions/feature/reel/kill_display.mcfunction new file mode 100644 index 0000000..a84eac7 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/reel/kill_display.mcfunction @@ -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 diff --git a/data/ckenja.ghook/functions/void_kill.mcfunction b/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction similarity index 59% rename from data/ckenja.ghook/functions/void_kill.mcfunction rename to data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction index 844f8c9..9164a75 100644 --- a/data/ckenja.ghook/functions/void_kill.mcfunction +++ b/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction @@ -1,8 +1,8 @@ -#> ckenja.ghook:void_kill +#> ckenja.ghook:feature/reel/void_kill # # # # @within function ckenja.ghook:feature/reel tp @s ~ ~-10000 ~ -kill @s \ No newline at end of file +kill @s diff --git a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction index 1fd14c9..c09932c 100644 --- a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction @@ -7,5 +7,5 @@ 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 store success score #flag.have_hook ckenja.ghook 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 diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 71fb128..07c32b6 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -33,9 +33,8 @@ data modify storage ckenja.ghook.__temp__: player.data.Motion set from entity @s 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 summon marker run function ckenja.ghook:feature/swing/marker tag @s remove ckenja.ghook.feature.swing.player #移動できるならPos代入して次tick用の慣性作成 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection/check_and_tp.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_and_tp.mcfunction index fe16dda..01b9c6a 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_detection/check_and_tp.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_and_tp.mcfunction @@ -1 +1,7 @@ +#> ckenja.ghook:feature/swing/collision_detection/check_and_tp +# +# +# +# @within function ckenja.ghook:feature/swing/collision_detection/* + execute if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision run function ckenja.ghook:feature/swing/collision_detection/tp diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction index 732dc7a..e646928 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction @@ -1,3 +1,9 @@ +#> ckenja.ghook:feature/swing/collision_detection/check_back +# +# +# +# @within function ckenja.ghook:feature/swing/collision_detection/_ + # 前後検知 execute facing entity @s feet positioned as @s run tp @s ~ ~ ~ ~ ~ execute store result score #feature.swing.collision_detection.check_back ckenja.ghook positioned as @s positioned ^ ^ ^0.125 rotated as @s positioned ^ ^ ^-0.125 if entity @s[distance=..0.001] diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection/tp.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/tp.mcfunction index 93ea825..ea2eb32 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_detection/tp.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/tp.mcfunction @@ -1,2 +1,10 @@ +#> ckenja.ghook:feature/swing/collision_detection/tp +# +# +# +# @within +# function ckenja.ghook:feature/swing/collision_detection/* +# function ckenja.ghook:feature/swing/collision_responce/_2 + execute as @a[tag=ckenja.ghook.feature.swing.player,distance=..120] on vehicle run tp @s ~ ~0.6 ~ scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 0 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction index a3fb7e9..0111c86 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction @@ -1,3 +1,9 @@ +#> ckenja.ghook:feature/swing/collision_responce/_2 +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/_ + #衝突向きのベクトルを消したうえで力を再計算する。 # 残ってる力 = 移動予定地-交点 scoreboard players operation #feature.swing.vector.x ckenja.ghook = #marker.pos.x ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction index 18b1f6d..e6dfa84 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction @@ -1,3 +1,9 @@ +#> ckenja.ghook:feature/swing/collision_responce/calc_range +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/get_intersection + scoreboard players operation #feature.swing.intersection.x ckenja.ghook -= #feature.swing.relative.x ckenja.ghook scoreboard players operation #feature.swing.intersection.y ckenja.ghook -= #feature.swing.relative.y ckenja.ghook scoreboard players operation #feature.swing.intersection.z ckenja.ghook -= #feature.swing.relative.z ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction index a6a0ae0..fd4a793 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction @@ -1,3 +1,9 @@ +#> ckenja.ghook:feature/swing/collision_responce/get_intersection +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/_ + scoreboard players operation #start_ray.x ckenja.ghook = #marker.pos.x ckenja.ghook scoreboard players operation #start_ray.y ckenja.ghook = #marker.pos.y ckenja.ghook scoreboard players operation #start_ray.z ckenja.ghook = #marker.pos.z ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction index caf54e3..596b239 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction @@ -1,3 +1,8 @@ +#> ckenja.ghook:feature/swing/collision_responce/update_nearest +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/_ scoreboard players operation #feature.swing.nearest.x ckenja.ghook = #feature.swing.intersection.x ckenja.ghook scoreboard players operation #feature.swing.nearest.y ckenja.ghook = #feature.swing.intersection.y ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index 0bdced8..cf32c3d 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -7,7 +7,9 @@ data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos #ループでマーカーの方向に移動して球上の位置を出す - execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s positioned ^ ^ ^-0.125 as @e[type=marker,tag=ckenja.ghook.marker,distance=..120] run function ckenja.ghook:feature/swing/loop + tag @s add ckenja.ghook.marker.this + execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s positioned ^ ^ ^-0.125 as @e[type=marker,tag=ckenja.ghook.marker.this,distance=..120] run function ckenja.ghook:feature/swing/loop + tag @s remove ckenja.ghook.marker.this #衝突判定を取る scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 1 diff --git a/data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction b/data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction index a5a3b0c..526aa30 100644 --- a/data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction @@ -1,2 +1,8 @@ +#> ckenja.ghook:feature/swing/no_tension +# +# +# +# @within function ckenja.ghook:feature/swing/loop + execute at @s run tp @s ~ ~ ~ scoreboard players set #flag.unmoveable ckenja.ghook 1 diff --git a/data/ckenja.ghook/functions/hook/tick.mcfunction b/data/ckenja.ghook/functions/hook/tick.mcfunction index 9f78e11..e35b438 100644 --- a/data/ckenja.ghook/functions/hook/tick.mcfunction +++ b/data/ckenja.ghook/functions/hook/tick.mcfunction @@ -6,7 +6,8 @@ #フックを消すか否か #ついでにリードがあるか否か - execute store success score #flag.have_hook ckenja.ghook run execute if data entity @s Leash.UUID + scoreboard players set #flag.have_hook ckenja.ghook 0 + execute on leasher run scoreboard players set #flag.have_hook ckenja.ghook 1 execute if score #flag.have_hook ckenja.ghook matches 0 at @s as @e[type=item,nbt={Item:{id:"minecraft:lead",Count:1b}},distance=..0.1] run kill @s execute if score #flag.have_hook ckenja.ghook matches 1 unless entity @s[distance=..104] run scoreboard players set #flag.have_hook ckenja.ghook 0 #こっちはフックを消すか否かの処理なので共通化はしない diff --git a/data/ckenja.ghook/functions/player/not_vehicle.mcfunction b/data/ckenja.ghook/functions/player/not_vehicle.mcfunction index 4f84130..8c23c33 100644 --- a/data/ckenja.ghook/functions/player/not_vehicle.mcfunction +++ b/data/ckenja.ghook/functions/player/not_vehicle.mcfunction @@ -1,14 +1,20 @@ +#> ckenja.ghook:player/not_vehicle +# +# +# +# @within function ckenja.ghook:player/tick + execute if score #flag.have_hook ckenja.ghook matches 1 run scoreboard players set #flag.hook.kill ckenja.ghook 1 -scoreboard players operation #displacement.x ckenja.ghook = @s ckenja.ghook.pos.x -scoreboard players operation #displacement.y ckenja.ghook = @s ckenja.ghook.pos.y -scoreboard players operation #displacement.z ckenja.ghook = @s ckenja.ghook.pos.z +#scoreboard players operation #displacement.x ckenja.ghook = @s ckenja.ghook.pos.x +#scoreboard players operation #displacement.y ckenja.ghook = @s ckenja.ghook.pos.y +#scoreboard players operation #displacement.z ckenja.ghook = @s ckenja.ghook.pos.z -scoreboard players operation #displacement.x ckenja.ghook -= #player.pos.x ckenja.ghook -scoreboard players operation #displacement.y ckenja.ghook -= #player.pos.y ckenja.ghook -scoreboard players operation #displacement.z ckenja.ghook -= #player.pos.z ckenja.ghook +#scoreboard players operation #displacement.x ckenja.ghook -= #player.pos.x ckenja.ghook +#scoreboard players operation #displacement.y ckenja.ghook -= #player.pos.y ckenja.ghook +#scoreboard players operation #displacement.z ckenja.ghook -= #player.pos.z ckenja.ghook -execute store result storage ckenja.ghook.__temp__: player.not_vehicle.Pos.0 double 0.0001 run scoreboard players get #displacement.x ckenja.ghook -execute store result storage ckenja.ghook.__temp__: player.not_vehicle.Pos.1 double 0.0001 run scoreboard players get #displacement.y ckenja.ghook -execute store result storage ckenja.ghook.__temp__: player.not_vehicle.Pos.2 double 0.0001 run scoreboard players get #displacement.z ckenja.ghook +#execute store result storage ckenja.ghook.__temp__: player.not_vehicle.Pos.0 double 0.0001 run scoreboard players get #displacement.x ckenja.ghook +#execute store result storage ckenja.ghook.__temp__: player.not_vehicle.Pos.1 double 0.0001 run scoreboard players get #displacement.y ckenja.ghook +#execute store result storage ckenja.ghook.__temp__: player.not_vehicle.Pos.2 double 0.0001 run scoreboard players get #displacement.z ckenja.ghook #function ckenja.ghook:player/not_vehicle2 with storage ckenja.ghook.__temp__: player.not_vehicle.Pos diff --git a/data/ckenja.ghook/functions/player/not_vehicle2.mcfunction b/data/ckenja.ghook/functions/player/not_vehicle2.mcfunction index 57d6060..ecdbe8a 100644 --- a/data/ckenja.ghook/functions/player/not_vehicle2.mcfunction +++ b/data/ckenja.ghook/functions/player/not_vehicle2.mcfunction @@ -1 +1,7 @@ +#> ckenja.ghook:player/not_vehicle2 +# +# +# +# @within function ckenja.ghook:player/not_vehicle + $execute positioned 0.0 0.0 0.0 facing $(0) $(1) $(2) diff --git a/data/ckenja.ghook/functions/player/tick.mcfunction b/data/ckenja.ghook/functions/player/tick.mcfunction index 5fd8ea5..7e279a8 100644 --- a/data/ckenja.ghook/functions/player/tick.mcfunction +++ b/data/ckenja.ghook/functions/player/tick.mcfunction @@ -29,7 +29,7 @@ execute unless score #flag.have_hook ckenja.ghook matches 1 run function ckenja. #クリック検知 execute if entity @s[tag=ckenja.ghook.player.using_item] run function ckenja.ghook:player/using_item -execute if score #flag.hook.kill ckenja.ghook matches 1 run function ckenja.ghook:feature/reel +execute if score #flag.hook.kill ckenja.ghook matches 1 run function ckenja.ghook:feature/reel/_ #フックがあればスイング計算 execute if score #flag.have_hook ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/_ From 8381ecd054f17a677d8c6048372cb1b058fb265b Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 24 Dec 2023 12:27:54 +0900 Subject: [PATCH 33/51] =?UTF-8?q?=E6=BB=91=E3=82=8A=E6=99=82=E3=81=AB?= =?UTF-8?q?=E3=82=82=E8=A1=9D=E7=AA=81=E5=88=A4=E5=AE=9A=E3=82=92=E5=AE=9F?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../swing/collision_detection/_.mcfunction | 2 +- .../swing/collision_responce/_2.mcfunction | 29 +++------------ .../swing/collision_responce/_3.mcfunction | 33 +++++++++++++++++ .../collision_responce/calc_range.mcfunction | 8 ++++- .../re_collision_detection.mcfunction | 35 +++++++++++++++++++ 5 files changed, 80 insertions(+), 27 deletions(-) create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/collision_responce/re_collision_detection.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction index aee9677..5e6e5ef 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction @@ -25,7 +25,7 @@ execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if #次の探査地点に空間がないなら衝突処理をする execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_responce/_ -#次の探査地点に空間はあるが、移動予定地点が後ろならそこを見てみる +#次の探査地点に空間はあるが、移動予定地点が後ろならそこを見てみて、そこもだめならもうここにする execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 1 if entity @s[distance=..0.125] run function ckenja.ghook:feature/swing/collision_detection/check_back #次の探査地点を探索しないならもうここにする diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction index 0111c86..46f3bf5 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction @@ -4,29 +4,8 @@ # # @within function ckenja.ghook:feature/swing/collision_responce/_ -#衝突向きのベクトルを消したうえで力を再計算する。 - # 残ってる力 = 移動予定地-交点 - scoreboard players operation #feature.swing.vector.x ckenja.ghook = #marker.pos.x ckenja.ghook - scoreboard players operation #feature.swing.vector.x ckenja.ghook -= #feature.swing.nearest.x ckenja.ghook - scoreboard players operation #feature.swing.vector.y ckenja.ghook = #marker.pos.y ckenja.ghook - scoreboard players operation #feature.swing.vector.y ckenja.ghook -= #feature.swing.nearest.y ckenja.ghook - scoreboard players operation #feature.swing.vector.z ckenja.ghook = #marker.pos.z ckenja.ghook - scoreboard players operation #feature.swing.vector.z ckenja.ghook -= #feature.swing.nearest.z ckenja.ghook - - #storage ckenja.ghook.__temp__: swing.collision_responce.nearest_direction(衝突方向) - execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"-X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"+X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"-Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"+Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"-Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 - execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"+Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 - scoreboard players operation #feature.swing.vector.x ckenja.ghook += #feature.swing.intersection.x ckenja.ghook - scoreboard players operation #feature.swing.vector.y ckenja.ghook += #feature.swing.intersection.y ckenja.ghook - scoreboard players operation #feature.swing.vector.z ckenja.ghook += #feature.swing.intersection.z ckenja.ghook - - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.vector.x ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.vector.y ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.vector.z ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.nearest.x ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.nearest.y ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.nearest.z ckenja.ghook data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos - execute at @s run function ckenja.ghook:feature/swing/collision_detection/tp - scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 0 + execute at @s run function ckenja.ghook:feature/swing/collision_responce/_3 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction new file mode 100644 index 0000000..b126735 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_3.mcfunction @@ -0,0 +1,33 @@ +#> ckenja.ghook:feature/swing/collision_responce/_3 +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/_2 + +#衝突向きのベクトルを消したうえで力を再計算する。 + # 残ってる力 = 移動予定地-交点 + scoreboard players operation #feature.swing.vector.x ckenja.ghook = #marker.pos.x ckenja.ghook + scoreboard players operation #feature.swing.vector.x ckenja.ghook -= #feature.swing.nearest.x ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook = #marker.pos.y ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook -= #feature.swing.nearest.y ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook = #marker.pos.z ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook -= #feature.swing.nearest.z ckenja.ghook + + #storage ckenja.ghook.__temp__: swing.collision_responce.nearest_direction(衝突方向) + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"-X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"+X"} run scoreboard players set #feature.swing.vector.x ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"-Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"+Z"} run scoreboard players set #feature.swing.vector.z ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"-Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 + execute if data storage ckenja.ghook.__temp__: swing.collision_responce{nearest_direction:"+Y"} run scoreboard players set #feature.swing.vector.y ckenja.ghook 0 + scoreboard players operation #feature.swing.vector.x ckenja.ghook += #feature.swing.intersection.x ckenja.ghook + scoreboard players operation #feature.swing.vector.y ckenja.ghook += #feature.swing.intersection.y ckenja.ghook + scoreboard players operation #feature.swing.vector.z ckenja.ghook += #feature.swing.intersection.z ckenja.ghook + + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.vector.x ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.vector.y ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.vector.z ckenja.ghook + data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos + execute facing entity @s feet run function ckenja.ghook:feature/swing/collision_responce/re_collision_detection + #function ckenja.ghook:feature/swing/collision_detection/tp + scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 0 diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction index e6dfa84..692c8a8 100644 --- a/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction @@ -28,5 +28,11 @@ scoreboard players operation #feature.swing.temp.range ckenja.ghook = #feature.s scoreboard players operation #feature.swing.temp.range ckenja.ghook += #feature.swing.temp.y ckenja.ghook scoreboard players operation #feature.swing.temp.range ckenja.ghook += #feature.swing.temp.z ckenja.ghook +#念のためその地点の当たり判定をチェックする + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #feature.swing.intersection.x ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #feature.swing.intersection.y ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #feature.swing.intersection.z ckenja.ghook + data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos + #比較してより近かったら上書き -execute if score #feature.swing.temp.range ckenja.ghook < #feature.swing.nearest.range ckenja.ghook run function ckenja.ghook:feature/swing/collision_responce/update_nearest +execute at @s if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if score #feature.swing.temp.range ckenja.ghook < #feature.swing.nearest.range ckenja.ghook run function ckenja.ghook:feature/swing/collision_responce/update_nearest diff --git a/data/ckenja.ghook/functions/feature/swing/collision_responce/re_collision_detection.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/re_collision_detection.mcfunction new file mode 100644 index 0000000..ddfff92 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/re_collision_detection.mcfunction @@ -0,0 +1,35 @@ +#> ckenja.ghook:feature/swing/collision_responce/re_collision_detection +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/_3 + +scoreboard players set #feature.swing.collision ckenja.ghook 0 +execute positioned ^ ^ ^0.125 if block ~0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~ ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~0.9 ~-0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~0.3 #ckenja.ghook:no_collision if block ~-0.3 ~1.8 ~-0.3 #ckenja.ghook:no_collision run scoreboard players set #feature.swing.collision ckenja.ghook 1 +#execute positioned ~0.3 ~ ~0.3 run particle flame +#execute positioned ~0.3 ~ ~-0.3 run particle flame +#execute positioned ~-0.3 ~ ~0.3 run particle flame +#execute positioned ~-0.3 ~ ~-0.3 run particle flame +#execute positioned ~0.3 ~0.9 ~0.3 run particle flame +#execute positioned ~0.3 ~0.9 ~-0.3 run particle flame +#execute positioned ~-0.3 ~0.9 ~0.3 run particle flame +#execute positioned ~-0.3 ~0.9 ~-0.3 run particle flame +#execute positioned ~0.3 ~1.8 ~0.3 run particle flame +#execute positioned ~0.3 ~1.8 ~-0.3 run particle flame +#execute positioned ~-0.3 ~1.8 ~0.3 run particle flame +#execute positioned ~-0.3 ~1.8 ~-0.3 run particle flame + +#次の探査地点に空間がないけど、近くに移動予定地点があるなら移動予定地点を見てみる +execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 if entity @s[distance=..0.125] at @s run function ckenja.ghook:feature/swing/collision_detection/check_and_tp + +#次の探査地点に空間がないなら衝突処理をする +#execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_responce/_ + +#次の探査地点に空間はあるが、移動予定地点が後ろならそこを見てみて、そこもだめならもうここにする +execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 1 if entity @s[distance=..0.125] run function ckenja.ghook:feature/swing/collision_detection/check_back + +#次の探査地点を探索しないならもうここにする +execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 0 run function ckenja.ghook:feature/swing/collision_detection/tp + +#決まってないなら、次の探査地点を探索する +execute if score #feature.swing.collision_detect_loop ckenja.ghook matches 1 if score #feature.swing.collision ckenja.ghook matches 1 positioned ^ ^ ^0.125 run function ckenja.ghook:feature/swing/collision_responce/re_collision_detection From b184be133cd57405ffdfcd9fadecc8f751083fd4 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 24 Dec 2023 13:18:49 +0900 Subject: [PATCH 34/51] =?UTF-8?q?=E9=99=8D=E3=82=8A=E3=81=9F=E3=81=A8?= =?UTF-8?q?=E3=81=8D=E3=81=AB=E7=AB=8B=E4=BD=93=E6=A9=9F=E5=8B=95=E8=A3=85?= =?UTF-8?q?=E7=BD=AE=E3=81=8C=E6=AE=8B=E3=82=8B=E3=83=90=E3=82=B0=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/reel/_.mcfunction | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/ckenja.ghook/functions/feature/reel/_.mcfunction b/data/ckenja.ghook/functions/feature/reel/_.mcfunction index 986b330..8540334 100644 --- a/data/ckenja.ghook/functions/feature/reel/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/reel/_.mcfunction @@ -7,7 +7,8 @@ #フック収納 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 -execute on vehicle run function ckenja.ghook:feature/reel/kill_display +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 kill @s #慣性をMotion代入 scoreboard players operation $x delta.api.launch = @s ckenja.ghook.x From bd0bc3350322d3425348ef711d9ee5864fca82db Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 24 Dec 2023 13:41:15 +0900 Subject: [PATCH 35/51] =?UTF-8?q?=E3=82=AF=E3=83=BC=E3=83=AB=E3=83=80?= =?UTF-8?q?=E3=82=A6=E3=83=B3=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/advancements/player.init.json | 11 +++++++++++ .../functions/feature/shot/success.mcfunction | 3 ++- .../functions/feature/shot/using_item.mcfunction | 2 ++ data/ckenja.ghook/functions/load.mcfunction | 1 + .../player/{id.mcfunction => init.mcfunction} | 3 ++- data/ckenja.ghook/functions/player/tick.mcfunction | 2 +- 6 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 data/ckenja.ghook/advancements/player.init.json rename data/ckenja.ghook/functions/player/{id.mcfunction => init.mcfunction} (67%) diff --git a/data/ckenja.ghook/advancements/player.init.json b/data/ckenja.ghook/advancements/player.init.json new file mode 100644 index 0000000..de39851 --- /dev/null +++ b/data/ckenja.ghook/advancements/player.init.json @@ -0,0 +1,11 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:tick" + } + }, + "rewards": { + "function": "ckenja.ghook:player/init" + } + } + \ No newline at end of file diff --git a/data/ckenja.ghook/functions/feature/shot/success.mcfunction b/data/ckenja.ghook/functions/feature/shot/success.mcfunction index a2f9ffb..455f030 100644 --- a/data/ckenja.ghook/functions/feature/shot/success.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/success.mcfunction @@ -4,8 +4,9 @@ # # @within function ckenja.ghook:feature/shot/loop -execute if entity @s[tag=ckenja.ghook.player.using_item] run function ckenja.ghook:feature/shot/using_item +execute if entity @s[tag=ckenja.ghook.player.using_item] if score @s ckenja.ghook.c matches 0 run function ckenja.ghook:feature/shot/using_item execute unless entity @s[tag=ckenja.ghook.player.using_item] run data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126000}} +execute unless score @s ckenja.ghook.c matches 0 run data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126000}} data modify storage player_item_tuner: condition.if set value {tag:{ctc:{id:"ghook",from:"ckenja.ghook:"}}} function #player_item_tuner:merge/inventory diff --git a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction index 3d80849..076192a 100644 --- a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction @@ -17,3 +17,5 @@ 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 diff --git a/data/ckenja.ghook/functions/load.mcfunction b/data/ckenja.ghook/functions/load.mcfunction index 8fdb858..98eb923 100644 --- a/data/ckenja.ghook/functions/load.mcfunction +++ b/data/ckenja.ghook/functions/load.mcfunction @@ -9,6 +9,7 @@ scoreboard objectives add ckenja.ghook.x dummy scoreboard objectives add ckenja.ghook.y dummy scoreboard objectives add ckenja.ghook.z dummy scoreboard objectives add ckenja.ghook.l dummy +scoreboard objectives add ckenja.ghook.c dummy scoreboard objectives add ckenja.ghook.pos.x dummy scoreboard objectives add ckenja.ghook.pos.y dummy scoreboard objectives add ckenja.ghook.pos.z dummy diff --git a/data/ckenja.ghook/functions/player/id.mcfunction b/data/ckenja.ghook/functions/player/init.mcfunction similarity index 67% rename from data/ckenja.ghook/functions/player/id.mcfunction rename to data/ckenja.ghook/functions/player/init.mcfunction index 127e3b2..8fc1b43 100644 --- a/data/ckenja.ghook/functions/player/id.mcfunction +++ b/data/ckenja.ghook/functions/player/init.mcfunction @@ -2,7 +2,7 @@ # # # -# @within function ckenja.ghook:player/tick +# @within advancement ckenja.ghook:player.init #> player-id #@private @@ -10,3 +10,4 @@ scoreboard players operation @s ckenja.ghook = #id ckenja.ghook scoreboard players add #id ckenja.ghook 1 +scoreboard players set @s ckenja.ghook.c 0 diff --git a/data/ckenja.ghook/functions/player/tick.mcfunction b/data/ckenja.ghook/functions/player/tick.mcfunction index 7e279a8..f6eed66 100644 --- a/data/ckenja.ghook/functions/player/tick.mcfunction +++ b/data/ckenja.ghook/functions/player/tick.mcfunction @@ -9,8 +9,8 @@ execute store result score #player.pos.x ckenja.ghook run data get storage ckenj 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 data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity @s Rotation -execute unless score @s ckenja.ghook matches -2147483648..2147483647 run function ckenja.ghook:player/id scoreboard players operation #temp.id ckenja.ghook = @s ckenja.ghook +execute if score @s ckenja.ghook.c matches 1.. run scoreboard players remove @s ckenja.ghook.c 1 #落下ダメージの無効化 execute if score #nofall_timer ckenja.ghook matches 3.. run summon area_effect_cloud ~ ~ ~ {Duration:6,Age:4,effects:[{id:"minecraft:slow_falling",amplifier:0b,duration:2,show_particles:0b}]} From c6ff09043380acde9e6bed0a61c000af6cb70c17 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 24 Dec 2023 14:44:51 +0900 Subject: [PATCH 36/51] =?UTF-8?q?=E6=BC=94=E5=87=BA=E3=81=AE=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=80=81=E3=83=97=E3=83=AC=E3=82=A4=E3=83=A4=E3=83=BC?= =?UTF-8?q?=E3=81=AEMotion=E3=81=AE=E5=BD=B1=E9=9F=BF=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/shot/_.mcfunction | 2 +- .../functions/feature/swing/_.mcfunction | 37 +++++++++---------- .../functions/player/tick.mcfunction | 2 +- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/shot/_.mcfunction b/data/ckenja.ghook/functions/feature/shot/_.mcfunction index 47e2b95..423e83b 100644 --- a/data/ckenja.ghook/functions/feature/shot/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/_.mcfunction @@ -10,7 +10,7 @@ scoreboard players set #feature.shot.on_trigger ckenja.ghook 0 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 + scoreboard players set @s ckenja.ghook.l 0 execute anchored eyes positioned ^ ^ ^ run function ckenja.ghook:feature/shot/loop execute if score #feature.shot.on_trigger ckenja.ghook matches 0 run function ckenja.ghook:feature/shot/on_trigger diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 07c32b6..9b541ef 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -7,17 +7,15 @@ scoreboard players operation #temp.feature.swing.loop ckenja.ghook = @s ckenja.ghook.l data modify storage ckenja.ghook.__temp__: player.data.Motion set from entity @s Motion -#アニメーションでずれるので移動前にパーティクルを出す - execute at @s rotated ~ 0 run particle cloud ^ ^0.6 ^-0.125 - #慣性。ないなら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] 10000 - execute store result score #player.motion.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[1] 10000 - execute store result score #player.motion.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 10000 + #execute store result score #player.motion.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[0] 10000 + #execute store result score #player.motion.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[1] 10000 + #execute store result score #player.motion.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 10000 + scoreboard players remove #intertia.y ckenja.ghook 784 #の和 scoreboard players operation #intertia.x ckenja.ghook += #player.motion.x ckenja.ghook @@ -38,19 +36,20 @@ data modify storage ckenja.ghook.__temp__: player.data.Motion set from entity @s tag @s remove ckenja.ghook.feature.swing.player #移動できるならPos代入して次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 -#移動できなかったら当たり判定処理 -#execute unless score #flag.no_collision ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/intertia.half + 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 + +#演出 + execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0 + execute unless score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.25 1 + execute unless score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook rotated ~ 0 run particle cloud ^ ^0.6 ^-0.125 #ロープが縮んだら反映 -scoreboard players operation @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook -scoreboard players reset #temp.feature.swing.updated_length ckenja.ghook + scoreboard players operation @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook + scoreboard players reset #temp.feature.swing.updated_length ckenja.ghook -execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0 -execute positioned as @s run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.125 1 diff --git a/data/ckenja.ghook/functions/player/tick.mcfunction b/data/ckenja.ghook/functions/player/tick.mcfunction index f6eed66..f6d1a15 100644 --- a/data/ckenja.ghook/functions/player/tick.mcfunction +++ b/data/ckenja.ghook/functions/player/tick.mcfunction @@ -32,7 +32,7 @@ execute if entity @s[tag=ckenja.ghook.player.using_item] run function ckenja.gho execute if score #flag.hook.kill ckenja.ghook matches 1 run function ckenja.ghook:feature/reel/_ #フックがあればスイング計算 - execute if score #flag.have_hook ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/_ +execute if score #flag.have_hook ckenja.ghook matches 1 at @s run function ckenja.ghook:feature/swing/_ scoreboard players operation @s ckenja.ghook.pos.x = #player.pos.x ckenja.ghook scoreboard players operation @s ckenja.ghook.pos.y = #player.pos.y ckenja.ghook From be1308426e128004cf98770c1f48a6c33db8ea9a Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 24 Dec 2023 20:13:55 +0900 Subject: [PATCH 37/51] =?UTF-8?q?=E3=82=B8=E3=82=A7=E3=83=83=E3=83=88?= =?UTF-8?q?=E5=99=B4=E5=B0=84=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/swing/_.mcfunction | 25 +--- .../feature/swing/get_jet_vec.mcfunction | 118 ++++++++++++++++++ .../functions/feature/swing/marker.mcfunction | 30 ++++- .../functions/player/tick.mcfunction | 1 - 4 files changed, 150 insertions(+), 24 deletions(-) create mode 100644 data/ckenja.ghook/functions/feature/swing/get_jet_vec.mcfunction diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 9b541ef..ebf2fa8 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -6,33 +6,14 @@ scoreboard players operation #temp.feature.swing.loop ckenja.ghook = @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 #慣性。ないなら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] 10000 - #execute store result score #player.motion.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[1] 10000 - #execute store result score #player.motion.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 10000 - scoreboard players remove #intertia.y ckenja.ghook 784 - -#の和 - 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 - -#との和 - 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 - -#その座標にマーカーを出し、フックからロープ距離分マーカー方向に進んで、その場所の座標を記憶 - 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 tag @s add ckenja.ghook.feature.swing.player - execute summon 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用の慣性作成 @@ -47,7 +28,7 @@ data modify storage ckenja.ghook.__temp__: player.data.Motion set from entity @s #演出 execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0 execute unless score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.25 1 - execute unless score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook rotated ~ 0 run particle cloud ^ ^0.6 ^-0.125 + #execute unless score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook rotated ~ 0 run particle cloud ^ ^0.6 ^-0.125 #ロープが縮んだら反映 scoreboard players operation @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/get_jet_vec.mcfunction b/data/ckenja.ghook/functions/feature/swing/get_jet_vec.mcfunction new file mode 100644 index 0000000..50a6d90 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/get_jet_vec.mcfunction @@ -0,0 +1,118 @@ + +#視線を使って回転軸単位ベクトルを取得 +execute rotated ~90 0 positioned 0.0 0.0 0.0 in minecraft:overworld run tp @s ^ ^ ^1 +data modify storage ckenja.ghook.__temp__: marker.data.Pos set from entity @s Pos +execute store result score #feature.swing.axis.x ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[0] 10000 +#execute store result score #feature.swing.axis.y ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[1] 10000 +execute store result score #feature.swing.axis.z ckenja.ghook run data get storage ckenja.ghook.__temp__: marker.data.Pos[2] 10000 + +#let cos_theta = angle_rad.cos(); +#sin(-Θ)=-sin(Θ) +data modify storage math: in set from storage ckenja.ghook.__temp__: player.data.Rotation[1] +function #math:sin +execute store result score #feature.swing.sin_theta ckenja.ghook run data get storage math: out -10000 + +#let sin_theta = angle_rad.sin(); +data modify storage math: in set from storage ckenja.ghook.__temp__: player.data.Rotation[1] +function #math:cos +execute store result score #feature.swing.cos_theta ckenja.ghook run data get storage math: out 10000 + +#let one_minus_cos_theta = 1.0 - cos_theta; +scoreboard players set #feature.swing.one_minus_cos_theta ckenja.ghook 10000 +scoreboard players operation #feature.swing.one_minus_cos_theta ckenja.ghook -= #feature.swing.cos_theta ckenja.ghook + +#let xy = axis.x * axis.y * one_minus_cos_theta; +#axis.y=0 + +#let xz = axis.x * axis.z * one_minus_cos_theta; +scoreboard players operation #feature.swing.xz ckenja.ghook = #feature.swing.one_minus_cos_theta ckenja.ghook +scoreboard players operation #feature.swing.xz ckenja.ghook *= #feature.swing.axis.x ckenja.ghook +scoreboard players operation #feature.swing.xz ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.xz ckenja.ghook *= #feature.swing.axis.z ckenja.ghook +scoreboard players operation #feature.swing.xz ckenja.ghook /= #10000 ckenja.ghook + +#let yz = axis.y * axis.z * one_minus_cos_theta; +#axis.y=0 + +#let sin_x = axis.x * sin_theta; +scoreboard players operation #feature.swing.sin_x ckenja.ghook = #feature.swing.sin_theta ckenja.ghook +scoreboard players operation #feature.swing.sin_x ckenja.ghook *= #feature.swing.axis.x ckenja.ghook +scoreboard players operation #feature.swing.sin_x ckenja.ghook /= #10000 ckenja.ghook + +#let sin_y = axis.y * sin_theta; +#axis.y=0 + +#let sin_z = axis.z * sin_theta; +scoreboard players operation #feature.swing.sin_z ckenja.ghook = #feature.swing.sin_theta ckenja.ghook +scoreboard players operation #feature.swing.sin_z ckenja.ghook *= #feature.swing.axis.z ckenja.ghook +scoreboard players operation #feature.swing.sin_z ckenja.ghook /= #10000 ckenja.ghook + +#result.x = self.x * (cos_theta + axis.x * axis.x * one_minus_cos_theta) +scoreboard players operation #feature.swing.result.x ckenja.ghook = #feature.swing.one_minus_cos_theta ckenja.ghook +scoreboard players operation #feature.swing.result.x ckenja.ghook *= #feature.swing.axis.x ckenja.ghook +scoreboard players operation #feature.swing.result.x ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.result.x ckenja.ghook *= #feature.swing.axis.x ckenja.ghook +scoreboard players operation #feature.swing.result.x ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.result.x ckenja.ghook += #feature.swing.cos_theta ckenja.ghook +scoreboard players operation #feature.swing.result.x ckenja.ghook *= #feature.swing.motion.x ckenja.ghook +scoreboard players operation #feature.swing.result.x ckenja.ghook /= #10000 ckenja.ghook + +#result.y = self.y * (cos_theta + axis.y * axis.y * one_minus_cos_theta) +#self.y=0 + +#result.z = self.z * (cos_theta + axis.z * axis.z * one_minus_cos_theta) +scoreboard players operation #feature.swing.result.z ckenja.ghook = #feature.swing.one_minus_cos_theta ckenja.ghook +scoreboard players operation #feature.swing.result.z ckenja.ghook *= #feature.swing.axis.z ckenja.ghook +scoreboard players operation #feature.swing.result.z ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.result.z ckenja.ghook *= #feature.swing.axis.z ckenja.ghook +scoreboard players operation #feature.swing.result.z ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.result.z ckenja.ghook += #feature.swing.cos_theta ckenja.ghook +scoreboard players operation #feature.swing.result.z ckenja.ghook *= #feature.swing.motion.z ckenja.ghook +scoreboard players operation #feature.swing.result.z ckenja.ghook /= #10000 ckenja.ghook + +#result.x += self.y * (xy - sin_z) +#self.y=0 + +#result.x += self.z * (xz + sin_y) +#sin_y=0 +scoreboard players operation #feature.swing.temp ckenja.ghook = #feature.swing.xz ckenja.ghook +scoreboard players operation #feature.swing.temp ckenja.ghook *= #feature.swing.motion.z ckenja.ghook +scoreboard players operation #feature.swing.temp ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.result.x ckenja.ghook += #feature.swing.temp ckenja.ghook + +#result.y += self.x * (xy + sin_z) +#xy=0 +scoreboard players operation #feature.swing.temp ckenja.ghook = #feature.swing.sin_z ckenja.ghook +scoreboard players operation #feature.swing.temp ckenja.ghook *= #feature.swing.motion.x ckenja.ghook +scoreboard players operation #feature.swing.temp ckenja.ghook /= #10000 ckenja.ghook +#ここだけ+=じゃなくて= +scoreboard players operation #feature.swing.result.y ckenja.ghook = #feature.swing.temp ckenja.ghook + +#result.y += self.z * (yz - sin_x) +#yz=0 +scoreboard players set #feature.swing.temp ckenja.ghook 0 +scoreboard players operation #feature.swing.temp ckenja.ghook -= #feature.swing.sin_x ckenja.ghook +scoreboard players operation #feature.swing.temp ckenja.ghook *= #feature.swing.motion.z ckenja.ghook +scoreboard players operation #feature.swing.temp ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.result.y ckenja.ghook += #feature.swing.temp ckenja.ghook + +#result.z += self.x * (xz - sin_y) +#sin_y=0 +scoreboard players operation #feature.swing.temp ckenja.ghook = #feature.swing.xz ckenja.ghook +scoreboard players operation #feature.swing.temp ckenja.ghook *= #feature.swing.motion.x ckenja.ghook +scoreboard players operation #feature.swing.temp ckenja.ghook /= #10000 ckenja.ghook +scoreboard players operation #feature.swing.result.z ckenja.ghook += #feature.swing.temp ckenja.ghook + +#result.z += self.y * (yz + sin_x) +#self.y=0 + +scoreboard players operation #marker.merge.x ckenja.ghook += #feature.swing.result.x ckenja.ghook +scoreboard players operation #marker.merge.y ckenja.ghook += #feature.swing.result.y ckenja.ghook +scoreboard players operation #marker.merge.z ckenja.ghook += #feature.swing.result.z ckenja.ghook + +#噴射演出 + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #marker.merge.x ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #marker.merge.y ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #marker.merge.z ckenja.ghook + data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos + execute facing entity @s feet run particle cloud ~ ~0.6 ~ ^ ^ ^-2500000 0.0000001 0 normal diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index cf32c3d..3323637 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -4,9 +4,37 @@ # # @within function ckenja.ghook:feature/swing/_ -data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos +#プレイヤー座標と慣性の和 + scoreboard players operation #marker.merge.x ckenja.ghook = #player.pos.x ckenja.ghook + scoreboard players operation #marker.merge.y ckenja.ghook = #player.pos.y ckenja.ghook + scoreboard players operation #marker.merge.z ckenja.ghook = #player.pos.z ckenja.ghook + +#ガス噴射 + execute store result score #feature.swing.motion.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[0] 10000 + #scoreboard players set #feature.swing.motion.y ckenja.ghook 0 + execute store result score #feature.swing.motion.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 10000 + scoreboard players operation #feature.swing.temp.x ckenja.ghook = #feature.swing.motion.x ckenja.ghook + scoreboard players operation #feature.swing.temp.x ckenja.ghook *= #feature.swing.motion.x ckenja.ghook + scoreboard players operation #feature.swing.temp.z ckenja.ghook = #feature.swing.motion.z ckenja.ghook + scoreboard players operation #feature.swing.temp.z ckenja.ghook *= #feature.swing.motion.z ckenja.ghook + scoreboard players operation #feature.swing.temp ckenja.ghook = #feature.swing.temp.x ckenja.ghook + scoreboard players operation #feature.swing.temp ckenja.ghook += #feature.swing.temp.z ckenja.ghook + execute if score #feature.swing.temp ckenja.ghook matches 10000.. run function ckenja.ghook:feature/swing/get_jet_vec + +#慣性 + scoreboard players operation #marker.merge.x ckenja.ghook += #intertia.x ckenja.ghook + scoreboard players operation #marker.merge.y ckenja.ghook += #intertia.y ckenja.ghook + scoreboard players operation #marker.merge.z ckenja.ghook += #intertia.z ckenja.ghook + +#重力 + scoreboard players remove #marker.merge.y ckenja.ghook 784 #ループでマーカーの方向に移動して球上の位置を出す +#フックからロープ距離分マーカー方向に進んで、その場所の座標を記憶 + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #marker.merge.x ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #marker.merge.y ckenja.ghook + execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #marker.merge.z ckenja.ghook + data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos tag @s add ckenja.ghook.marker.this execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s positioned ^ ^ ^-0.125 as @e[type=marker,tag=ckenja.ghook.marker.this,distance=..120] run function ckenja.ghook:feature/swing/loop tag @s remove ckenja.ghook.marker.this diff --git a/data/ckenja.ghook/functions/player/tick.mcfunction b/data/ckenja.ghook/functions/player/tick.mcfunction index f6d1a15..5b2d432 100644 --- a/data/ckenja.ghook/functions/player/tick.mcfunction +++ b/data/ckenja.ghook/functions/player/tick.mcfunction @@ -8,7 +8,6 @@ data modify storage ckenja.ghook.__temp__: player.data.Pos set from entity @s Po 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 -data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity @s Rotation scoreboard players operation #temp.id ckenja.ghook = @s ckenja.ghook execute if score @s ckenja.ghook.c matches 1.. run scoreboard players remove @s ckenja.ghook.c 1 From 6638c31d112f9d9c681d19c408b0a554fae93056 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sun, 24 Dec 2023 22:39:32 +0900 Subject: [PATCH 38/51] =?UTF-8?q?=E6=8C=99=E5=8B=95=E3=81=AE=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/swing/_.mcfunction | 2 +- .../functions/feature/swing/marker.mcfunction | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index ebf2fa8..65b69d4 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -28,7 +28,7 @@ data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity #演出 execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0 execute unless score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.25 1 - #execute unless score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook rotated ~ 0 run particle cloud ^ ^0.6 ^-0.125 + execute if score #feature.swing.jet ckenja.ghook matches 10000.. if score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook run scoreboard players remove #temp.feature.swing.updated_length ckenja.ghook 125 #ロープが縮んだら反映 scoreboard players operation @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index 3323637..82e57b7 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -17,9 +17,9 @@ scoreboard players operation #feature.swing.temp.x ckenja.ghook *= #feature.swing.motion.x ckenja.ghook scoreboard players operation #feature.swing.temp.z ckenja.ghook = #feature.swing.motion.z ckenja.ghook scoreboard players operation #feature.swing.temp.z ckenja.ghook *= #feature.swing.motion.z ckenja.ghook - scoreboard players operation #feature.swing.temp ckenja.ghook = #feature.swing.temp.x ckenja.ghook - scoreboard players operation #feature.swing.temp ckenja.ghook += #feature.swing.temp.z ckenja.ghook - execute if score #feature.swing.temp ckenja.ghook matches 10000.. run function ckenja.ghook:feature/swing/get_jet_vec + scoreboard players operation #feature.swing.jet ckenja.ghook = #feature.swing.temp.x ckenja.ghook + scoreboard players operation #feature.swing.jet ckenja.ghook += #feature.swing.temp.z ckenja.ghook + execute if score #feature.swing.jet ckenja.ghook matches 10000.. run function ckenja.ghook:feature/swing/get_jet_vec #慣性 scoreboard players operation #marker.merge.x ckenja.ghook += #intertia.x ckenja.ghook @@ -27,7 +27,7 @@ scoreboard players operation #marker.merge.z ckenja.ghook += #intertia.z ckenja.ghook #重力 - scoreboard players remove #marker.merge.y ckenja.ghook 784 + scoreboard players remove #marker.merge.y ckenja.ghook 392 #ループでマーカーの方向に移動して球上の位置を出す #フックからロープ距離分マーカー方向に進んで、その場所の座標を記憶 From 2e6b2991136461da012dbeb3e28029c1687ea865 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Mon, 25 Dec 2023 20:05:49 +0900 Subject: [PATCH 39/51] =?UTF-8?q?=E3=83=95=E3=83=83=E3=82=AF=E3=81=8C?= =?UTF-8?q?=E3=82=A8=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86=E3=82=A3=E3=81=AB?= =?UTF-8?q?=E5=88=BA=E3=81=95=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/reel/_.mcfunction | 4 ++++ data/ckenja.ghook/functions/feature/shot/_.mcfunction | 5 ++++- .../functions/feature/shot/detect_entity.mcfunction | 4 ++++ .../functions/feature/shot/detect_entity2.mcfunction | 7 +++++++ .../functions/feature/shot/get_pos.mcfunction | 7 +++++++ .../functions/feature/shot/hook.mcfunction | 1 + .../functions/feature/shot/loop.mcfunction | 1 + .../functions/feature/shot/setting_entity.mcfunction | 9 +++++++++ .../functions/feature/shot/success.mcfunction | 2 +- .../functions/feature/shot/using_item.mcfunction | 3 ++- data/ckenja.ghook/functions/hook/entity.mcfunction | 11 +++++++++++ data/ckenja.ghook/functions/hook/tick.mcfunction | 3 ++- data/ckenja.ghook/functions/load.mcfunction | 3 +++ 13 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 data/ckenja.ghook/functions/feature/shot/detect_entity.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/shot/detect_entity2.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/shot/get_pos.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/shot/setting_entity.mcfunction create mode 100644 data/ckenja.ghook/functions/hook/entity.mcfunction diff --git a/data/ckenja.ghook/functions/feature/reel/_.mcfunction b/data/ckenja.ghook/functions/feature/reel/_.mcfunction index 8540334..7f1c844 100644 --- a/data/ckenja.ghook/functions/feature/reel/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/reel/_.mcfunction @@ -26,3 +26,7 @@ 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 diff --git a/data/ckenja.ghook/functions/feature/shot/_.mcfunction b/data/ckenja.ghook/functions/feature/shot/_.mcfunction index 423e83b..6467858 100644 --- a/data/ckenja.ghook/functions/feature/shot/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/_.mcfunction @@ -4,8 +4,11 @@ # # @within function ckenja.ghook:player/using_item -scoreboard players set #feature.shot.on_trigger ckenja.ghook 0 +scoreboard players set #feature.shot.on_trigger ckenja.ghook 0 +scoreboard players set #feature.shot.detect_entity ckenja.ghook 0 +scoreboard players set #feature.shot.using_item ckenja.ghook 0 +execute 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単位で十分だろう diff --git a/data/ckenja.ghook/functions/feature/shot/detect_entity.mcfunction b/data/ckenja.ghook/functions/feature/shot/detect_entity.mcfunction new file mode 100644 index 0000000..0742fb0 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/shot/detect_entity.mcfunction @@ -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 diff --git a/data/ckenja.ghook/functions/feature/shot/detect_entity2.mcfunction b/data/ckenja.ghook/functions/feature/shot/detect_entity2.mcfunction new file mode 100644 index 0000000..4e6d244 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/shot/detect_entity2.mcfunction @@ -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.creeper.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.creeper.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.creeper.z ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.shot.detect_entity.Pos[2] 10000 diff --git a/data/ckenja.ghook/functions/feature/shot/get_pos.mcfunction b/data/ckenja.ghook/functions/feature/shot/get_pos.mcfunction new file mode 100644 index 0000000..583b7d7 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/shot/get_pos.mcfunction @@ -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 diff --git a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction index c09932c..19310ad 100644 --- a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction @@ -9,3 +9,4 @@ data modify entity @s Leash.UUID set from storage ckenja.ghook.__temp__: player. scoreboard players operation @s ckenja.ghook = #temp.id ckenja.ghook execute store success score #flag.have_hook ckenja.ghook 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 +execute if score #feature.shot.detect_entity ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/get_pos diff --git a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction index d34678f..33eb985 100644 --- a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction @@ -6,6 +6,7 @@ scoreboard players add @s ckenja.ghook.l 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=creeper,dx=0,dy=0,dz=0] run function ckenja.ghook:feature/shot/detect_entity execute if score #feature.shot.loop ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/success 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 diff --git a/data/ckenja.ghook/functions/feature/shot/setting_entity.mcfunction b/data/ckenja.ghook/functions/feature/shot/setting_entity.mcfunction new file mode 100644 index 0000000..c2d9dc3 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/shot/setting_entity.mcfunction @@ -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.creeper.x ckenja.ghook +scoreboard players operation #feature.shot.detect_entity.hook.y ckenja.ghook -= #feature.shot.detect_entity.creeper.y ckenja.ghook +scoreboard players operation #feature.shot.detect_entity.hook.z ckenja.ghook -= #feature.shot.detect_entity.creeper.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 diff --git a/data/ckenja.ghook/functions/feature/shot/success.mcfunction b/data/ckenja.ghook/functions/feature/shot/success.mcfunction index 455f030..ed23c31 100644 --- a/data/ckenja.ghook/functions/feature/shot/success.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/success.mcfunction @@ -4,7 +4,7 @@ # # @within function ckenja.ghook:feature/shot/loop -execute if entity @s[tag=ckenja.ghook.player.using_item] if score @s ckenja.ghook.c matches 0 run function ckenja.ghook:feature/shot/using_item +execute if score #feature.shot.using_item ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/using_item execute unless entity @s[tag=ckenja.ghook.player.using_item] run data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126000}} execute unless score @s ckenja.ghook.c matches 0 run data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126000}} diff --git a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction index 076192a..9ae915b 100644 --- a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction @@ -4,7 +4,8 @@ # # @within function ckenja.ghook:feature/shot/success -execute 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 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 #アイテムの見た目変更 data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126001}} diff --git a/data/ckenja.ghook/functions/hook/entity.mcfunction b/data/ckenja.ghook/functions/hook/entity.mcfunction new file mode 100644 index 0000000..1cb7982 --- /dev/null +++ b/data/ckenja.ghook/functions/hook/entity.mcfunction @@ -0,0 +1,11 @@ +execute as @e[type=creeper,tag=ckenja.ghook.target_entity,distance=..8] if score @s ckenja.ghook = #temp.id ckenja.ghook run data modify storage ckenja.ghook.__temp__: hook.creeper.Pos set from entity @s Pos +execute store result score #hook.creeper.x ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.creeper.Pos[0] 10000 +execute store result score #hook.creeper.y ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.creeper.Pos[1] 10000 +execute store result score #hook.creeper.z ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.creeper.Pos[2] 10000 +scoreboard players operation #hook.creeper.x ckenja.ghook += @s ckenja.ghook.hook.x +scoreboard players operation #hook.creeper.y ckenja.ghook += @s ckenja.ghook.hook.y +scoreboard players operation #hook.creeper.z ckenja.ghook += @s ckenja.ghook.hook.z +execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #hook.creeper.x ckenja.ghook +execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #hook.creeper.y ckenja.ghook +execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #hook.creeper.z ckenja.ghook +data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos diff --git a/data/ckenja.ghook/functions/hook/tick.mcfunction b/data/ckenja.ghook/functions/hook/tick.mcfunction index e35b438..ecf28ef 100644 --- a/data/ckenja.ghook/functions/hook/tick.mcfunction +++ b/data/ckenja.ghook/functions/hook/tick.mcfunction @@ -10,5 +10,6 @@ execute on leasher run scoreboard players set #flag.have_hook ckenja.ghook 1 execute if score #flag.have_hook ckenja.ghook matches 0 at @s as @e[type=item,nbt={Item:{id:"minecraft:lead",Count:1b}},distance=..0.1] run kill @s execute if score #flag.have_hook ckenja.ghook matches 1 unless entity @s[distance=..104] run scoreboard players set #flag.have_hook ckenja.ghook 0 - #こっちはフックを消すか否かの処理なので共通化はしない +#こっちはフックを消すか否かの処理なので共通化はしない execute if score #flag.have_hook ckenja.ghook matches 0 run scoreboard players set #flag.hook.kill ckenja.ghook 1 + execute if score #flag.have_hook ckenja.ghook matches 1 if score @s ckenja.ghook.c matches 1 run function ckenja.ghook:hook/entity diff --git a/data/ckenja.ghook/functions/load.mcfunction b/data/ckenja.ghook/functions/load.mcfunction index 98eb923..3ac61a7 100644 --- a/data/ckenja.ghook/functions/load.mcfunction +++ b/data/ckenja.ghook/functions/load.mcfunction @@ -13,6 +13,9 @@ scoreboard objectives add ckenja.ghook.c dummy scoreboard objectives add ckenja.ghook.pos.x dummy scoreboard objectives add ckenja.ghook.pos.y dummy scoreboard objectives add ckenja.ghook.pos.z dummy +scoreboard objectives add ckenja.ghook.hook.x dummy +scoreboard objectives add ckenja.ghook.hook.y dummy +scoreboard objectives add ckenja.ghook.hook.z dummy scoreboard players set #98 ckenja.ghook 98 scoreboard players set #100 ckenja.ghook 100 From f0e4132b071174a0953ddf091dea993987dd918b Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Mon, 25 Dec 2023 20:06:44 +0900 Subject: [PATCH 40/51] =?UTF-8?q?Your=20name=20is=20=E7=AB=8B=E4=BD=93?= =?UTF-8?q?=E6=A9=9F=E5=8B=95=E8=A3=85=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/loot_tables/ghook.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/ckenja.ghook/loot_tables/ghook.json b/data/ckenja.ghook/loot_tables/ghook.json index 4e544a6..7e9ed6b 100644 --- a/data/ckenja.ghook/loot_tables/ghook.json +++ b/data/ckenja.ghook/loot_tables/ghook.json @@ -18,7 +18,7 @@ { "function": "minecraft:set_name", "name": { - "text": "Grappling hook", + "text": "立体機動装置", "italic": false } }, @@ -26,7 +26,7 @@ "function": "minecraft:set_lore", "lore": [ { - "text": "立体機動装置を模して開発されたグラップリングフック", + "text": "ワイヤーは一本しか射出できないようだ...", "italic": false } ] From 9843fd683db7f62925c4fe42fd96ffb6f5ee2059 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Mon, 25 Dec 2023 20:08:56 +0900 Subject: [PATCH 41/51] =?UTF-8?q?=E3=82=AD=E3=83=BC=E5=85=A5=E5=8A=9B?= =?UTF-8?q?=E4=B8=AD=E3=82=82=E5=B7=BB=E3=81=8D=E3=81=A8=E3=82=8A=E9=9F=B3?= =?UTF-8?q?=E3=82=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/swing/_.mcfunction | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 65b69d4..db5f176 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -25,12 +25,13 @@ data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity scoreboard players operation @s ckenja.ghook.y -= #player.pos.y ckenja.ghook scoreboard players operation @s ckenja.ghook.z -= #player.pos.z ckenja.ghook +#キー入力してたら短くしたろ + execute if score #feature.swing.jet ckenja.ghook matches 10000.. if score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook run scoreboard players remove #temp.feature.swing.updated_length ckenja.ghook 125 + #演出 execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0 execute unless score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.25 1 - execute if score #feature.swing.jet ckenja.ghook matches 10000.. if score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook run scoreboard players remove #temp.feature.swing.updated_length ckenja.ghook 125 #ロープが縮んだら反映 scoreboard players operation @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook scoreboard players reset #temp.feature.swing.updated_length ckenja.ghook - From 553c81c4a0038d91f038c9abcc513d91b5339ce6 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Mon, 25 Dec 2023 20:15:19 +0900 Subject: [PATCH 42/51] =?UTF-8?q?=E5=B8=B8=E3=81=ABshot=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=81=8B=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/shot/_.mcfunction | 8 +++++--- .../functions/feature/shot/on_trigger.mcfunction | 9 --------- .../functions/feature/shot/success.mcfunction | 6 +----- .../functions/feature/shot/using_item.mcfunction | 1 - data/ckenja.ghook/functions/player/tick.mcfunction | 4 ++-- 5 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 data/ckenja.ghook/functions/feature/shot/on_trigger.mcfunction diff --git a/data/ckenja.ghook/functions/feature/shot/_.mcfunction b/data/ckenja.ghook/functions/feature/shot/_.mcfunction index 6467858..fbaa100 100644 --- a/data/ckenja.ghook/functions/feature/shot/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/_.mcfunction @@ -2,18 +2,20 @@ # # # -# @within function ckenja.ghook:player/using_item +# @within function ckenja.ghook:player/tick scoreboard players set #feature.shot.on_trigger ckenja.ghook 0 scoreboard players set #feature.shot.detect_entity ckenja.ghook 0 scoreboard players set #feature.shot.using_item ckenja.ghook 0 -execute 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 +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 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:"}}} -execute if score #feature.shot.on_trigger ckenja.ghook matches 0 run function ckenja.ghook:feature/shot/on_trigger +function #player_item_tuner:merge/inventory diff --git a/data/ckenja.ghook/functions/feature/shot/on_trigger.mcfunction b/data/ckenja.ghook/functions/feature/shot/on_trigger.mcfunction deleted file mode 100644 index edc51ef..0000000 --- a/data/ckenja.ghook/functions/feature/shot/on_trigger.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -#> ckenja.ghook:feature/shot/on_trigger -# -# -# -# @within function ckenja.ghook:feature/shot/_ - -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 diff --git a/data/ckenja.ghook/functions/feature/shot/success.mcfunction b/data/ckenja.ghook/functions/feature/shot/success.mcfunction index ed23c31..55f9b57 100644 --- a/data/ckenja.ghook/functions/feature/shot/success.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/success.mcfunction @@ -5,10 +5,6 @@ # @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 -execute unless entity @s[tag=ckenja.ghook.player.using_item] run data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126000}} -execute unless score @s ckenja.ghook.c matches 0 run data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126000}} - -data modify storage player_item_tuner: condition.if set value {tag:{ctc:{id:"ghook",from:"ckenja.ghook:"}}} -function #player_item_tuner:merge/inventory +data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126000}} scoreboard players set #feature.shot.on_trigger ckenja.ghook 1 diff --git a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction index 9ae915b..56c397b 100644 --- a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction @@ -8,7 +8,6 @@ execute if score #feature.shot.detect_entity ckenja.ghook matches 0 align xyz po execute if score #feature.shot.detect_entity ckenja.ghook matches 1 summon bat run function ckenja.ghook:feature/shot/setting_entity #アイテムの見た目変更 -data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126001}} 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 diff --git a/data/ckenja.ghook/functions/player/tick.mcfunction b/data/ckenja.ghook/functions/player/tick.mcfunction index 5b2d432..377ab74 100644 --- a/data/ckenja.ghook/functions/player/tick.mcfunction +++ b/data/ckenja.ghook/functions/player/tick.mcfunction @@ -22,8 +22,8 @@ execute if entity @s[tag=ckenja.ghook.player.using_item.before,tag=!ckenja.ghook execute unless predicate ckenja.ghook:vehicle run function ckenja.ghook:player/not_vehicle -#フックがないならフック射出試行 -execute unless score #flag.have_hook ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/_ +#フック射出試行 +function ckenja.ghook:feature/shot/_ #クリック検知 execute if entity @s[tag=ckenja.ghook.player.using_item] run function ckenja.ghook:player/using_item From f30bbb820cabaf2dab76fb2135224a92d51f931c Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Mon, 25 Dec 2023 21:35:20 +0900 Subject: [PATCH 43/51] =?UTF-8?q?Delta=E5=8F=A4=E3=81=84=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=8C=E6=AE=8B=E3=81=A3=E3=81=A6=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/delta/LICENSE | 21 ------- data/delta/advancements/explode_bed.json | 25 --------- data/delta/advancements/place_bed.json | 21 ------- .../advancements/place_respawn_anchor.json | 18 ------ .../delta/advancements/sheared_mooshroom.json | 21 ------- .../api/explosion_emitter_particle.mcfunction | 5 -- .../api/explosion_particle.mcfunction | 12 ---- .../functions/api/explosion_sound.mcfunction | 4 -- .../dragon_death/death_explosion.mcfunction | 16 ------ .../effects/dragon_death/end_death.mcfunction | 53 ------------------ .../dragon_death/initialize.mcfunction | 39 ------------- .../intermediate_initialize.mcfunction | 6 -- .../dragon_death/intermediate_tick.mcfunction | 7 --- .../intermediate_tick_wrapper.mcfunction | 7 --- .../effects/dragon_death/tick.mcfunction | 11 ---- .../dragon_death/tick_wrapper.mcfunction | 7 --- .../particle/explosion/initialize.mcfunction | 37 ------------ .../particle/explosion/spawn.mcfunction | 6 -- .../particle/explosion/spread_0.mcfunction | 9 --- .../particle/explosion/spread_1.mcfunction | 11 ---- .../particle/explosion/spread_2.mcfunction | 56 ------------------- .../particle/explosion/tick.mcfunction | 16 ------ .../explosion_emitter/initialize.mcfunction | 15 ----- .../explosion_emitter/spawn.mcfunction | 5 -- .../spawn_recursive_particles.mcfunction | 41 -------------- .../explosion_emitter/spread_0.mcfunction | 9 --- .../explosion_emitter/spread_1.mcfunction | 11 ---- .../explosion_emitter/spread_2.mcfunction | 54 ------------------ .../explosion_emitter/tick.mcfunction | 13 ----- .../internal/effects/particle/tick.mcfunction | 13 ----- .../adjust_position.mcfunction | 17 ------ .../explosion_detection/bed.mcfunction | 7 --- .../check_tnt_minecart_misfire.mcfunction | 4 -- .../ender_dragon_tick.mcfunction | 6 -- .../ender_dragon_tick_wrapper.mcfunction | 7 --- .../explode_bed.mcfunction | 5 -- .../large_explosion.mcfunction | 5 -- .../marker_tick.mcfunction | 5 -- .../explosion_detection/mooshroom.mcfunction | 9 --- .../explosion_detection/setup/bed.mcfunction | 8 --- .../setup/bed_found.mcfunction | 5 -- .../setup/bed_raycast.mcfunction | 7 --- .../setup/creeper.mcfunction | 6 -- .../setup/end_crystal.mcfunction | 6 -- .../setup/ender_dragon.mcfunction | 4 -- .../setup/fireball.mcfunction | 11 ---- .../setup/process_entity.mcfunction | 16 ------ .../setup/respawn_anchor.mcfunction | 8 --- .../setup/respawn_anchor_found.mcfunction | 5 -- .../setup/respawn_anchor_raycast.mcfunction | 7 --- .../setup/shulker_bullet.mcfunction | 6 -- .../explosion_detection/setup/tnt.mcfunction | 5 -- .../setup/tnt_minecart.mcfunction | 6 -- .../setup/wither.mcfunction | 8 --- .../setup/wither_skull.mcfunction | 8 --- .../shulker_bullet.mcfunction | 30 ---------- .../shulker_explosion.mcfunction | 9 --- .../simulate_explosion.mcfunction | 12 ---- .../explosion_detection/slow_check.mcfunction | 7 --- .../small_explosion.mcfunction | 7 --- .../explosion_detection/tnt_tick.mcfunction | 9 --- .../track_motion.mcfunction | 7 --- .../wither_explode.mcfunction | 5 -- .../wither_tick.mcfunction | 6 -- .../wither_tick_wrapper.mcfunction | 6 -- .../internal/technical/loop_1s.mcfunction | 18 ------ 66 files changed, 866 deletions(-) delete mode 100644 data/delta/LICENSE delete mode 100644 data/delta/advancements/explode_bed.json delete mode 100644 data/delta/advancements/place_bed.json delete mode 100644 data/delta/advancements/place_respawn_anchor.json delete mode 100644 data/delta/advancements/sheared_mooshroom.json delete mode 100644 data/delta/functions/api/explosion_emitter_particle.mcfunction delete mode 100644 data/delta/functions/api/explosion_particle.mcfunction delete mode 100644 data/delta/functions/api/explosion_sound.mcfunction delete mode 100644 data/delta/functions/internal/effects/dragon_death/death_explosion.mcfunction delete mode 100644 data/delta/functions/internal/effects/dragon_death/end_death.mcfunction delete mode 100644 data/delta/functions/internal/effects/dragon_death/initialize.mcfunction delete mode 100644 data/delta/functions/internal/effects/dragon_death/intermediate_initialize.mcfunction delete mode 100644 data/delta/functions/internal/effects/dragon_death/intermediate_tick.mcfunction delete mode 100644 data/delta/functions/internal/effects/dragon_death/intermediate_tick_wrapper.mcfunction delete mode 100644 data/delta/functions/internal/effects/dragon_death/tick.mcfunction delete mode 100644 data/delta/functions/internal/effects/dragon_death/tick_wrapper.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion/initialize.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion/spawn.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion/spread_0.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion/spread_1.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion/spread_2.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion/tick.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion_emitter/initialize.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion_emitter/spawn.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion_emitter/spawn_recursive_particles.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion_emitter/spread_0.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion_emitter/spread_1.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion_emitter/spread_2.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/explosion_emitter/tick.mcfunction delete mode 100644 data/delta/functions/internal/effects/particle/tick.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/adjust_position.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/bed.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/check_tnt_minecart_misfire.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/ender_dragon_tick.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/ender_dragon_tick_wrapper.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/explode_bed.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/large_explosion.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/marker_tick.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/mooshroom.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/bed.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/bed_found.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/bed_raycast.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/creeper.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/end_crystal.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/ender_dragon.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/fireball.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/process_entity.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/respawn_anchor.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/respawn_anchor_found.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/respawn_anchor_raycast.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/shulker_bullet.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/tnt.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/tnt_minecart.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/wither.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/setup/wither_skull.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/shulker_bullet.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/shulker_explosion.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/simulate_explosion.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/slow_check.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/small_explosion.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/tnt_tick.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/track_motion.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/wither_explode.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/wither_tick.mcfunction delete mode 100644 data/delta/functions/internal/explosion_detection/wither_tick_wrapper.mcfunction delete mode 100644 data/delta/functions/internal/technical/loop_1s.mcfunction diff --git a/data/delta/LICENSE b/data/delta/LICENSE deleted file mode 100644 index 59992af..0000000 --- a/data/delta/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 BigPapi13 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/data/delta/advancements/explode_bed.json b/data/delta/advancements/explode_bed.json deleted file mode 100644 index 0b66c09..0000000 --- a/data/delta/advancements/explode_bed.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "criteria": { - "requirement": { - "trigger": "minecraft:item_used_on_block", - "conditions": { - "location": [ - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": [ - "minecraft:air", - "minecraft:fire" - ] - } - } - } - ] - } - } - }, - "rewards": { - "function": "delta:internal/explosion_detection/bed" - } -} diff --git a/data/delta/advancements/place_bed.json b/data/delta/advancements/place_bed.json deleted file mode 100644 index 9d2322f..0000000 --- a/data/delta/advancements/place_bed.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "criteria": { - "requirement": { - "trigger": "minecraft:placed_block", - "conditions": { - "player": [], - "location": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "tag": "minecraft:beds" - } - } - ] - } - } - }, - "rewards": { - "function": "delta:internal/explosion_detection/setup/bed" - } -} diff --git a/data/delta/advancements/place_respawn_anchor.json b/data/delta/advancements/place_respawn_anchor.json deleted file mode 100644 index 6344b98..0000000 --- a/data/delta/advancements/place_respawn_anchor.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "criteria": { - "requirement": { - "trigger": "minecraft:placed_block", - "conditions": { - "location": [ - { - "condition": "minecraft:block_state_property", - "block": "minecraft:respawn_anchor" - } - ] - } - } - }, - "rewards": { - "function": "delta:internal/explosion_detection/setup/respawn_anchor" - } -} diff --git a/data/delta/advancements/sheared_mooshroom.json b/data/delta/advancements/sheared_mooshroom.json deleted file mode 100644 index 9945461..0000000 --- a/data/delta/advancements/sheared_mooshroom.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "criteria": { - "requirement": { - "trigger": "minecraft:player_interacted_with_entity", - "conditions": { - "item": { - "items": [ - "minecraft:shears" - ] - }, - "entity": { - "type": "minecraft:mooshroom" - } - } - } - }, - "rewards": { - "function": "delta:internal/explosion_detection/mooshroom" - } - } - \ No newline at end of file diff --git a/data/delta/functions/api/explosion_emitter_particle.mcfunction b/data/delta/functions/api/explosion_emitter_particle.mcfunction deleted file mode 100644 index 17c2c69..0000000 --- a/data/delta/functions/api/explosion_emitter_particle.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -#> delta:api/explosion_emitter_particle -# Replicates the particle effects of an explosion with a radius of 2 or more - -execute unless score $count delta.api.particle matches -2147483648..2147483647 run function delta:internal/effects/particle/explosion_emitter/spawn -execute if score $count delta.api.particle matches -2147483648..2147483647 run function delta:internal/effects/particle/explosion_emitter/spread_0 \ No newline at end of file diff --git a/data/delta/functions/api/explosion_particle.mcfunction b/data/delta/functions/api/explosion_particle.mcfunction deleted file mode 100644 index 40a397e..0000000 --- a/data/delta/functions/api/explosion_particle.mcfunction +++ /dev/null @@ -1,12 +0,0 @@ -#> delta:api/explosion_particle -# Simulates the particles of an explosion with a radius of 1 or less -# -# Inputs: -# score $dx delta.api.particle << X spread of the particle (Scale factor 100) -# score $dy delta.api.particle << Y spread of the particle (Scale factor 100) -# score $dz delta.api.particle << Z spread of the particle (Scale factor 100) -# -# score $count delta.api.particle << Number of particles to spawn - -execute unless score $count delta.api.particle matches -2147483648..2147483647 run function delta:internal/effects/particle/explosion/spawn -execute if score $count delta.api.particle matches -2147483648..2147483647 run function delta:internal/effects/particle/explosion/spread_0 \ No newline at end of file diff --git a/data/delta/functions/api/explosion_sound.mcfunction b/data/delta/functions/api/explosion_sound.mcfunction deleted file mode 100644 index 343b235..0000000 --- a/data/delta/functions/api/explosion_sound.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -#> delta:api/explosion_sound -# Simulates the sound of an explosion - -playsound minecraft:delta.entity.generic.explode block @a ~ ~ ~ 4.0 0.7 \ No newline at end of file diff --git a/data/delta/functions/internal/effects/dragon_death/death_explosion.mcfunction b/data/delta/functions/internal/effects/dragon_death/death_explosion.mcfunction deleted file mode 100644 index 0e713f0..0000000 --- a/data/delta/functions/internal/effects/dragon_death/death_explosion.mcfunction +++ /dev/null @@ -1,16 +0,0 @@ -#> delta:internal/effects/dragon_death/death_explosion -# Simulates a single explosion from the death sequence - -scoreboard players set $min random -256 -scoreboard players set $max random 256 -function random:uniform -execute store result storage delta:storage Pos[0] double 0.015625 run scoreboard players operation $out random += @s delta.internal.x -function random:uniform -execute store result storage delta:storage Pos[2] double 0.015625 run scoreboard players operation $out random += @s delta.internal.z - -scoreboard players set $min random -128 -scoreboard players set $max random 128 -function random:uniform -execute store result storage delta:storage Pos[1] double 0.015625 run scoreboard players operation $out random += @s delta.internal.y - -execute at @s run function delta:internal/effects/particle/explosion_emitter/spawn diff --git a/data/delta/functions/internal/effects/dragon_death/end_death.mcfunction b/data/delta/functions/internal/effects/dragon_death/end_death.mcfunction deleted file mode 100644 index 5d2c561..0000000 --- a/data/delta/functions/internal/effects/dragon_death/end_death.mcfunction +++ /dev/null @@ -1,53 +0,0 @@ -#> delta:internal/effects/dragon_death/end_death -# Marks the end of the ender dragon death - -kill @s - -#Check for gateway - -scoreboard players set $current_gateways delta.internal.dummy 0 -execute if block 96 75 0 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 1 -execute if block 91 75 29 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 2 -execute if block 77 75 56 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 4 -execute if block 56 75 77 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 8 -execute if block 29 75 91 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 16 -execute if block -1 75 96 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 32 -execute if block -30 75 91 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 64 -execute if block -57 75 77 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 128 -execute if block -78 75 56 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 256 -execute if block -92 75 29 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 512 -execute if block -96 75 -1 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 1024 -execute if block -92 75 -30 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 2048 -execute if block -78 75 -57 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 4096 -execute if block -57 75 -78 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 8192 -execute if block -30 75 -92 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 16384 -execute if block 0 75 -96 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 32768 -execute if block 29 75 -92 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 65536 -execute if block 56 75 -78 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 131072 -execute if block 77 75 -57 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 262144 -execute if block 91 75 -30 end_gateway run scoreboard players add $current_gateways delta.internal.dummy 524288 - -scoreboard players operation $temp delta.internal.dummy = $current_gateways delta.internal.dummy -scoreboard players operation $current_gateways delta.internal.dummy -= $gateway_tracker delta.internal.dummy -scoreboard players operation $gateway_tracker delta.internal.dummy = $temp delta.internal.dummy - -execute if score $current_gateways delta.internal.dummy matches 1 positioned 96 75 0 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 2 positioned 91 75 29 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 4 positioned 77 75 56 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 8 positioned 56 75 77 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 16 positioned 29 75 91 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 32 positioned -1 75 96 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 64 positioned -30 75 91 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 128 positioned -57 75 77 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 256 positioned -78 75 56 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 512 positioned -92 75 29 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 1024 positioned -96 75 -1 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 2048 positioned -92 75 -30 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 4096 positioned -78 75 -57 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 8192 positioned -57 75 -78 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 16384 positioned -30 75 -92 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 32768 positioned 0 75 -96 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 65536 positioned 29 75 -92 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 131072 positioned 56 75 -78 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 262144 positioned 77 75 -57 run function delta:internal/explosion_detection/large_explosion -execute if score $current_gateways delta.internal.dummy matches 524288 positioned 91 75 -30 run function delta:internal/explosion_detection/large_explosion \ No newline at end of file diff --git a/data/delta/functions/internal/effects/dragon_death/initialize.mcfunction b/data/delta/functions/internal/effects/dragon_death/initialize.mcfunction deleted file mode 100644 index 2b449dd..0000000 --- a/data/delta/functions/internal/effects/dragon_death/initialize.mcfunction +++ /dev/null @@ -1,39 +0,0 @@ -#> delta:internal/effects/dragon_death/initialize -# Begins the dragon death sequence, recreating the explosion effects - -ride @s dismount -tag @s remove delta.dragon_death_intermediate - -tag @s add delta.dragon_death -tag @s remove delta.explosion_detection.ender_dragon - -data modify storage delta:storage Pos set from entity @s Pos -execute store result score @s delta.internal.x run data get storage delta:storage Pos[0] 64 -execute store result score @s delta.internal.y run data get storage delta:storage Pos[1] 64 -execute store result score @s delta.internal.z run data get storage delta:storage Pos[2] 64 - -schedule function delta:internal/effects/dragon_death/tick_wrapper 1t replace - -#Grab gateway data at the beginning just for future reference - -scoreboard players set $gateway_tracker delta.internal.dummy 0 -execute if block 96 75 0 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 1 -execute if block 91 75 29 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 2 -execute if block 77 75 56 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 4 -execute if block 56 75 77 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 8 -execute if block 29 75 91 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 16 -execute if block -1 75 96 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 32 -execute if block -30 75 91 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 64 -execute if block -57 75 77 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 128 -execute if block -78 75 56 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 256 -execute if block -92 75 29 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 512 -execute if block -96 75 -1 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 1024 -execute if block -92 75 -30 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 2048 -execute if block -78 75 -57 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 4096 -execute if block -57 75 -78 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 8192 -execute if block -30 75 -92 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 16384 -execute if block 0 75 -96 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 32768 -execute if block 29 75 -92 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 65536 -execute if block 56 75 -78 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 131072 -execute if block 77 75 -57 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 262144 -execute if block 91 75 -30 end_gateway run scoreboard players add $gateway_tracker delta.internal.dummy 524288 \ No newline at end of file diff --git a/data/delta/functions/internal/effects/dragon_death/intermediate_initialize.mcfunction b/data/delta/functions/internal/effects/dragon_death/intermediate_initialize.mcfunction deleted file mode 100644 index 93dfb98..0000000 --- a/data/delta/functions/internal/effects/dragon_death/intermediate_initialize.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -#> delta:internal/effects/dragon_death/intermediate_initialize -# Sets the marker into the phase while the dragon is flying to the fountain to die - -tag @s add delta.dragon_death_intermediate - -schedule function delta:internal/effects/dragon_death/intermediate_tick_wrapper 1t replace \ No newline at end of file diff --git a/data/delta/functions/internal/effects/dragon_death/intermediate_tick.mcfunction b/data/delta/functions/internal/effects/dragon_death/intermediate_tick.mcfunction deleted file mode 100644 index 206c9d6..0000000 --- a/data/delta/functions/internal/effects/dragon_death/intermediate_tick.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#> delta:internal/effects/dragon_death/intermediate_tick -# Simulates the flying phase right before death - -scoreboard players set $pre_dragon_death_loop_active delta.internal.dummy 1 - -function delta:internal/effects/dragon_death/death_explosion -tp @s ~ ~1 ~ \ No newline at end of file diff --git a/data/delta/functions/internal/effects/dragon_death/intermediate_tick_wrapper.mcfunction b/data/delta/functions/internal/effects/dragon_death/intermediate_tick_wrapper.mcfunction deleted file mode 100644 index a74c6fe..0000000 --- a/data/delta/functions/internal/effects/dragon_death/intermediate_tick_wrapper.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#> delta:internal/effects/dragon_death/tick_wrapper -# Wraps the tick, of course - -scoreboard players set $pre_dragon_death_loop_active delta.internal.dummy 0 -execute as @e[type=marker,tag=delta.dragon_death_intermediate] at @s run function delta:internal/effects/dragon_death/intermediate_tick - -execute if score $pre_dragon_death_loop_active delta.internal.dummy matches 1 run schedule function delta:internal/effects/dragon_death/intermediate_tick_wrapper 10t replace \ No newline at end of file diff --git a/data/delta/functions/internal/effects/dragon_death/tick.mcfunction b/data/delta/functions/internal/effects/dragon_death/tick.mcfunction deleted file mode 100644 index d1a165a..0000000 --- a/data/delta/functions/internal/effects/dragon_death/tick.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -#> delta:internal/effects/dragon_death/tick -# Simulates the dragon's death - -scoreboard players set $dragon_death_loop_active delta.internal.dummy 1 - -execute unless score @s delta.internal.lifetime matches 21.. run function delta:internal/effects/dragon_death/death_explosion -tp @s ~ ~1 ~ - -scoreboard players add @s delta.internal.lifetime 1 - -execute if score @s delta.internal.lifetime matches 22 run function delta:internal/effects/dragon_death/end_death \ No newline at end of file diff --git a/data/delta/functions/internal/effects/dragon_death/tick_wrapper.mcfunction b/data/delta/functions/internal/effects/dragon_death/tick_wrapper.mcfunction deleted file mode 100644 index c826d4e..0000000 --- a/data/delta/functions/internal/effects/dragon_death/tick_wrapper.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#> delta:internal/effects/dragon_death/tick_wrapper -# Wraps the tick, of course - -scoreboard players set $dragon_death_loop_active delta.internal.dummy 0 -execute as @e[type=marker,tag=delta.dragon_death] at @s run function delta:internal/effects/dragon_death/tick - -execute if score $dragon_death_loop_active delta.internal.dummy matches 1 run schedule function delta:internal/effects/dragon_death/tick_wrapper 10t replace \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion/initialize.mcfunction b/data/delta/functions/internal/effects/particle/explosion/initialize.mcfunction deleted file mode 100644 index 5bfb3cb..0000000 --- a/data/delta/functions/internal/effects/particle/explosion/initialize.mcfunction +++ /dev/null @@ -1,37 +0,0 @@ -#> delta:internal/effects/particle/explosion/initialize -# Sets up starting parameters for explosion particle - -#Set initial data -tag @s add delta.explosion_particle - -execute if score $temp delta.internal.size matches 1 run data modify storage delta:storage data_to_apply.transformation.scale set value [3.75f,3.75f,0.0f] -execute if score $temp delta.internal.size matches 2 run data modify storage delta:storage data_to_apply.transformation.scale set value [3.50f,3.50f,0.0f] -execute if score $temp delta.internal.size matches 3 run data modify storage delta:storage data_to_apply.transformation.scale set value [3.25f,3.25f,0.0f] -execute if score $temp delta.internal.size matches 4 run data modify storage delta:storage data_to_apply.transformation.scale set value [3.00f,3.00f,0.0f] -execute if score $temp delta.internal.size matches 5 run data modify storage delta:storage data_to_apply.transformation.scale set value [2.75f,2.75f,0.0f] -execute if score $temp delta.internal.size matches 6 run data modify storage delta:storage data_to_apply.transformation.scale set value [2.50f,2.50f,0.0f] -execute if score $temp delta.internal.size matches 7 run data modify storage delta:storage data_to_apply.transformation.scale set value [2.25f,2.25f,0.0f] -execute if score $temp delta.internal.size matches 8 run data modify storage delta:storage data_to_apply.transformation.scale set value [2.00f,2.00f,0.0f] - -#Set up random color -scoreboard players set $min random 102 -scoreboard players set $max random 255 -function random:uniform - -scoreboard players operation $tint delta.internal.math = $out random -scoreboard players operation $tint delta.internal.math *= #constant.65793 delta.internal.math - -execute store result storage delta:storage data_to_apply.item.tag.CustomPotionColor int 1 run scoreboard players get $tint delta.internal.math - - -#Set up random lifetime -scoreboard players set $min random 6 -scoreboard players set $max random 10 -function random:uniform -scoreboard players operation @s delta.internal.lifetime = $out random - -#Save size CMD offset -scoreboard players set @s delta.internal.size 130000 - -#Merge data -data modify entity @s {} merge from storage delta:storage data_to_apply \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion/spawn.mcfunction b/data/delta/functions/internal/effects/particle/explosion/spawn.mcfunction deleted file mode 100644 index 0b1178b..0000000 --- a/data/delta/functions/internal/effects/particle/explosion/spawn.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -#> delta:internal/effects/particle/explosion/spawn -# Summons a fake explosion particle, since real ones are untextured - -schedule function delta:internal/effects/particle/tick 1t replace -scoreboard players set $temp delta.internal.size 1 -execute summon item_display run function delta:internal/effects/particle/explosion/initialize \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion/spread_0.mcfunction b/data/delta/functions/internal/effects/particle/explosion/spread_0.mcfunction deleted file mode 100644 index c8628be..0000000 --- a/data/delta/functions/internal/effects/particle/explosion/spread_0.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -#> delta:internal/effects/particle/explosion/spread_0 -# Applies a distribution to the particles and spawns recursively - -execute summon marker run function delta:internal/effects/particle/explosion/spread_1 - -scoreboard players reset $dx delta.api.particle -scoreboard players reset $dy delta.api.particle -scoreboard players reset $dz delta.api.particle -scoreboard players reset $count delta.api.particle \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion/spread_1.mcfunction b/data/delta/functions/internal/effects/particle/explosion/spread_1.mcfunction deleted file mode 100644 index fe4f8d8..0000000 --- a/data/delta/functions/internal/effects/particle/explosion/spread_1.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -#> delta:internal/effects/particle/explosion/spread_1 -# Initial setup - -data modify storage delta:storage Pos set from entity @s Pos -execute store result score $root.x delta.internal.math run data get entity @s Pos[0] 100 -execute store result score $root.y delta.internal.math run data get entity @s Pos[1] 100 -execute store result score $root.z delta.internal.math run data get entity @s Pos[2] 100 - -function delta:internal/effects/particle/explosion/spread_2 - -kill @s \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion/spread_2.mcfunction b/data/delta/functions/internal/effects/particle/explosion/spread_2.mcfunction deleted file mode 100644 index 079169f..0000000 --- a/data/delta/functions/internal/effects/particle/explosion/spread_2.mcfunction +++ /dev/null @@ -1,56 +0,0 @@ -#> delta:internal/effects/particle/explosion/spread_2 -# Applies a distribution to the particles and spawns recursively - -data modify storage delta:storage Pos set value [0.0d,0.0d,0.0d] - -#> Get x value -scoreboard players operation $min random = $dx delta.api.particle -scoreboard players operation $max random = $dx delta.api.particle -scoreboard players operation $min random *= #constant.-1 delta.internal.math -function random:uniform -scoreboard players operation $particle.x delta.internal.math = $out random -scoreboard players operation $particle.x delta.internal.math *= $out random -scoreboard players operation $particle.x delta.internal.math *= $out random -execute unless score $dx delta.api.particle matches 0 run scoreboard players operation $particle.x delta.internal.math /= $dx delta.api.particle -execute unless score $dx delta.api.particle matches 0 run scoreboard players operation $particle.x delta.internal.math /= $dx delta.api.particle -scoreboard players operation $out random /= #constant.2 delta.internal.math -scoreboard players operation $particle.x delta.internal.math += $out random -execute store result storage delta:storage Pos[0] double 0.01 run scoreboard players operation $particle.x delta.internal.math += $root.x delta.internal.math - -#> Get y value -scoreboard players operation $min random = $dy delta.api.particle -scoreboard players operation $max random = $dy delta.api.particle -scoreboard players operation $min random *= #constant.-1 delta.internal.math -function random:uniform -scoreboard players operation $particle.y delta.internal.math = $out random -scoreboard players operation $particle.y delta.internal.math *= $out random -scoreboard players operation $particle.y delta.internal.math *= $out random -execute unless score $dy delta.api.particle matches 0 run scoreboard players operation $particle.y delta.internal.math /= $dy delta.api.particle -execute unless score $dy delta.api.particle matches 0 run scoreboard players operation $particle.y delta.internal.math /= $dy delta.api.particle -scoreboard players operation $out random /= #constant.2 delta.internal.math -scoreboard players operation $particle.y delta.internal.math += $out random -execute store result storage delta:storage Pos[1] double 0.01 run scoreboard players operation $particle.y delta.internal.math += $root.y delta.internal.math - -#> Get z value -scoreboard players operation $min random = $dz delta.api.particle -scoreboard players operation $max random = $dz delta.api.particle -scoreboard players operation $min random *= #constant.-1 delta.internal.math -function random:uniform -scoreboard players operation $particle.z delta.internal.math = $out random -scoreboard players operation $particle.z delta.internal.math *= $out random -scoreboard players operation $particle.z delta.internal.math *= $out random -execute unless score $dz delta.api.particle matches 0 run scoreboard players operation $particle.z delta.internal.math /= $dz delta.api.particle -execute unless score $dz delta.api.particle matches 0 run scoreboard players operation $particle.z delta.internal.math /= $dz delta.api.particle -scoreboard players operation $out random /= #constant.2 delta.internal.math -scoreboard players operation $particle.z delta.internal.math += $out random -execute store result storage delta:storage Pos[2] double 0.01 run scoreboard players operation $particle.z delta.internal.math += $root.z delta.internal.math - - -#> Modify position -data modify entity @s Pos set from storage delta:storage Pos - -#> Summon particle -execute at @s run function delta:internal/effects/particle/explosion/spawn - -scoreboard players remove $count delta.api.particle 1 -execute if score $count delta.api.particle matches 1.. run function delta:internal/effects/particle/explosion/spread_2 \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion/tick.mcfunction b/data/delta/functions/internal/effects/particle/explosion/tick.mcfunction deleted file mode 100644 index e57eef0..0000000 --- a/data/delta/functions/internal/effects/particle/explosion/tick.mcfunction +++ /dev/null @@ -1,16 +0,0 @@ -#> delta:internal/effects/particle/explosion/tick -# Animates the explosion particle - -scoreboard players set $particle_loop_active delta.internal.dummy 1 - -scoreboard players add @s delta.internal.frame 1 -scoreboard players set $temp delta.internal.frame 15 -scoreboard players operation $temp delta.internal.frame *= @s delta.internal.frame -scoreboard players operation $temp delta.internal.frame /= @s delta.internal.lifetime -scoreboard players add $temp delta.internal.frame 130000 - -#execute store result entity @s Item.tag.CustomModelData int 1 run scoreboard players get $temp delta.internal.frame -execute store result storage delta:storage CustomModelData int 1 run scoreboard players get $temp delta.internal.frame -item modify entity @s container.0 delta:set_frame - -execute if score @s delta.internal.frame > @s delta.internal.lifetime run kill @s \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion_emitter/initialize.mcfunction b/data/delta/functions/internal/effects/particle/explosion_emitter/initialize.mcfunction deleted file mode 100644 index 0594c62..0000000 --- a/data/delta/functions/internal/effects/particle/explosion_emitter/initialize.mcfunction +++ /dev/null @@ -1,15 +0,0 @@ -#> delta:internal/effects/particle/explosion_emitter/initialize -# One-time setup for position score for explosion emitter - -tag @s add delta.explosion_emitter -tag @s add global.ignore - -data modify storage delta:storage Pos set from entity @s Pos -execute store result score @s delta.internal.x run data get storage delta:storage Pos[0] 64 -execute store result score @s delta.internal.y run data get storage delta:storage Pos[1] 64 -execute store result score @s delta.internal.z run data get storage delta:storage Pos[2] 64 -data remove storage delta:storage Pos - -scoreboard players set @s delta.internal.lifetime 1 - -tag @s remove delta.explosion_emitter.init \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion_emitter/spawn.mcfunction b/data/delta/functions/internal/effects/particle/explosion_emitter/spawn.mcfunction deleted file mode 100644 index 511ad8c..0000000 --- a/data/delta/functions/internal/effects/particle/explosion_emitter/spawn.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -#> delta:internal/effects/particle/explosion_emitter/spawn -# Replicates the explosion_emitter particle effect - -schedule function delta:internal/effects/particle/tick 1t replace -execute summon marker run function delta:internal/effects/particle/explosion_emitter/initialize \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion_emitter/spawn_recursive_particles.mcfunction b/data/delta/functions/internal/effects/particle/explosion_emitter/spawn_recursive_particles.mcfunction deleted file mode 100644 index 74732e9..0000000 --- a/data/delta/functions/internal/effects/particle/explosion_emitter/spawn_recursive_particles.mcfunction +++ /dev/null @@ -1,41 +0,0 @@ -#> delta:internal/effects/particle/explosion_emitter/spawn_recursive_particles -# Recursively spawns the particles for an explosion emitter -# -# Callers: -# > delta:internal/effects/particle/explosion_emitter/spawn_recursive_particles - -#Get random position -data modify storage delta:storage Pos set value [0d,0d,0d] - -scoreboard players set $min random 0 -scoreboard players set $max random 256 -function random:uniform -scoreboard players operation $spawn.x delta.internal.math = $out random -function random:uniform -scoreboard players operation $spawn.x delta.internal.math -= $out random -execute store result storage delta:storage Pos[0] double 0.015625 run scoreboard players operation $spawn.x delta.internal.math += @s delta.internal.x - -scoreboard players set $min random 0 -scoreboard players set $max random 256 -function random:uniform -scoreboard players operation $spawn.y delta.internal.math = $out random -function random:uniform -scoreboard players operation $spawn.y delta.internal.math -= $out random -execute store result storage delta:storage Pos[1] double 0.015625 run scoreboard players operation $spawn.y delta.internal.math += @s delta.internal.y - -scoreboard players set $min random 0 -scoreboard players set $max random 256 -function random:uniform -scoreboard players operation $spawn.z delta.internal.math = $out random -function random:uniform -scoreboard players operation $spawn.z delta.internal.math -= $out random -execute store result storage delta:storage Pos[2] double 0.015625 run scoreboard players operation $spawn.z delta.internal.math += @s delta.internal.z - -data modify entity @s Pos set from storage delta:storage Pos -data remove storage delta:storage Pos - -#Summon item display -execute at @s summon item_display run function delta:internal/effects/particle/explosion/initialize - -scoreboard players add $remaining_particles delta.internal.math 1 -execute if score $remaining_particles delta.internal.math matches ..5 run function delta:internal/effects/particle/explosion_emitter/spawn_recursive_particles \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion_emitter/spread_0.mcfunction b/data/delta/functions/internal/effects/particle/explosion_emitter/spread_0.mcfunction deleted file mode 100644 index 0780536..0000000 --- a/data/delta/functions/internal/effects/particle/explosion_emitter/spread_0.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -#> delta:internal/effects/particle/explosion_emitter/spread_0 -# Applies a distribution to the particles and spawns recursively - -execute summon marker run function delta:internal/effects/particle/explosion_emitter/spread_1 - -scoreboard players reset $dx delta.api.particle -scoreboard players reset $dy delta.api.particle -scoreboard players reset $dz delta.api.particle -scoreboard players reset $count delta.api.particle \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion_emitter/spread_1.mcfunction b/data/delta/functions/internal/effects/particle/explosion_emitter/spread_1.mcfunction deleted file mode 100644 index c96298c..0000000 --- a/data/delta/functions/internal/effects/particle/explosion_emitter/spread_1.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -#> delta:internal/effects/particle/explosion_emitter/spread_1 -# Initial setup - -data modify storage delta:storage Pos set from entity @s Pos -execute store result score $root.x delta.internal.math run data get entity @s Pos[0] 100 -execute store result score $root.y delta.internal.math run data get entity @s Pos[1] 100 -execute store result score $root.z delta.internal.math run data get entity @s Pos[2] 100 - -function delta:internal/effects/particle/explosion_emitter/spread_2 - -kill @s \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion_emitter/spread_2.mcfunction b/data/delta/functions/internal/effects/particle/explosion_emitter/spread_2.mcfunction deleted file mode 100644 index 00f609c..0000000 --- a/data/delta/functions/internal/effects/particle/explosion_emitter/spread_2.mcfunction +++ /dev/null @@ -1,54 +0,0 @@ -#> delta:internal/effects/particle/explosion/spread_2 -# Applies a distribution to the particles and spawns recursively - -data modify storage delta:storage Pos set value [0.0d,0.0d,0.0d] - -#> Get x value -scoreboard players operation $min random = $dx delta.api.particle -scoreboard players operation $max random = $dx delta.api.particle -scoreboard players operation $min random *= #constant.-1 delta.internal.math -function random:uniform -scoreboard players operation $particle.x delta.internal.math = $out random -scoreboard players operation $particle.x delta.internal.math *= $out random -scoreboard players operation $particle.x delta.internal.math *= $out random -execute unless score $dx delta.api.particle matches 0 run scoreboard players operation $particle.x delta.internal.math /= $dx delta.api.particle -execute unless score $dx delta.api.particle matches 0 run scoreboard players operation $particle.x delta.internal.math /= $dx delta.api.particle -scoreboard players operation $out random /= #constant.2 delta.internal.math -scoreboard players operation $particle.x delta.internal.math += $out random -execute store result storage delta:storage Pos[0] double 0.01 run scoreboard players operation $particle.x delta.internal.math += $root.x delta.internal.math - -#> Get y value -scoreboard players operation $min random = $dy delta.api.particle -scoreboard players operation $max random = $dy delta.api.particle -scoreboard players operation $min random *= #constant.-1 delta.internal.math -function random:uniform -scoreboard players operation $particle.y delta.internal.math = $out random -scoreboard players operation $particle.y delta.internal.math *= $out random -scoreboard players operation $particle.y delta.internal.math *= $out random -execute unless score $dy delta.api.particle matches 0 run scoreboard players operation $particle.y delta.internal.math /= $dy delta.api.particle -execute unless score $dy delta.api.particle matches 0 run scoreboard players operation $particle.y delta.internal.math /= $dy delta.api.particle -scoreboard players operation $out random /= #constant.2 delta.internal.math -scoreboard players operation $particle.y delta.internal.math += $out random -execute store result storage delta:storage Pos[1] double 0.01 run scoreboard players operation $particle.y delta.internal.math += $root.y delta.internal.math - -#> Get z value -scoreboard players operation $min random = $dz delta.api.particle -scoreboard players operation $max random = $dz delta.api.particle -scoreboard players operation $min random *= #constant.-1 delta.internal.math -function random:uniform -scoreboard players operation $particle.z delta.internal.math = $out random -scoreboard players operation $particle.z delta.internal.math *= $out random -scoreboard players operation $particle.z delta.internal.math *= $out random -execute unless score $dz delta.api.particle matches 0 run scoreboard players operation $particle.z delta.internal.math /= $dz delta.api.particle -execute unless score $dz delta.api.particle matches 0 run scoreboard players operation $particle.z delta.internal.math /= $dz delta.api.particle -scoreboard players operation $out random /= #constant.2 delta.internal.math -scoreboard players operation $particle.z delta.internal.math += $out random -execute store result storage delta:storage Pos[2] double 0.01 run scoreboard players operation $particle.z delta.internal.math += $root.z delta.internal.math -#> Modify position -data modify entity @s Pos set from storage delta:storage Pos - -#> Summon particle -execute at @s run function delta:internal/effects/particle/explosion_emitter/spawn - -scoreboard players remove $count delta.api.particle 1 -execute if score $count delta.api.particle matches 1.. run function delta:internal/effects/particle/explosion_emitter/spread_2 \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/explosion_emitter/tick.mcfunction b/data/delta/functions/internal/effects/particle/explosion_emitter/tick.mcfunction deleted file mode 100644 index 7e5b774..0000000 --- a/data/delta/functions/internal/effects/particle/explosion_emitter/tick.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -#> delta:internal/effects/particle/explosion_emitter/tick -# Ticks the explosion_emitter particle replication - -scoreboard players set $particle_loop_active delta.internal.dummy 1 - -scoreboard players add @s delta.internal.lifetime 1 -scoreboard players operation $temp delta.internal.size = @s delta.internal.lifetime - -scoreboard players set $remaining_particles delta.internal.math 0 -function delta:internal/effects/particle/explosion_emitter/spawn_recursive_particles -tp @s ~ ~ ~ - -execute if score @s delta.internal.lifetime matches 8.. run kill @s \ No newline at end of file diff --git a/data/delta/functions/internal/effects/particle/tick.mcfunction b/data/delta/functions/internal/effects/particle/tick.mcfunction deleted file mode 100644 index e31feff..0000000 --- a/data/delta/functions/internal/effects/particle/tick.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -#> delta:internal/effects/particle/tick -# Manually recreates particle effects and noises for explosions -# -# Callers: -# > delta:internal/effects/particle/explosion/spawn -# > delta:internal/effects/particle/explosion_emitter/spawn - -scoreboard players set $particle_loop_active delta.internal.dummy 0 -execute as @e[type=item_display,tag=delta.explosion_particle] run function delta:internal/effects/particle/explosion/tick -execute as @e[type=marker,tag=delta.explosion_emitter] at @s run function delta:internal/effects/particle/explosion_emitter/tick - -#Only continue checking if there are still existing particles -execute if score $particle_loop_active delta.internal.dummy matches 1 run schedule function delta:internal/effects/particle/tick 1t replace \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/adjust_position.mcfunction b/data/delta/functions/internal/explosion_detection/adjust_position.mcfunction deleted file mode 100644 index 531776d..0000000 --- a/data/delta/functions/internal/explosion_detection/adjust_position.mcfunction +++ /dev/null @@ -1,17 +0,0 @@ -#> delta:internal/explosion_detection/adjust_position -# Nudges the explosion a little bit to account for the riding entity lagging behind - -data modify storage delta:storage Pos set from entity @s Pos -execute store result score $pos.x delta.internal.math run data get storage delta:storage Pos[0] 64 -execute store result score $pos.y delta.internal.math run data get storage delta:storage Pos[1] 64 -execute store result score $pos.z delta.internal.math run data get storage delta:storage Pos[2] 64 - -data modify storage delta:storage Motion set from entity @s data.Motion -execute store result score $motion.x delta.internal.math run data get storage delta:storage Motion[0] 128 -execute store result score $motion.y delta.internal.math run data get storage delta:storage Motion[1] 128 -execute store result score $motion.z delta.internal.math run data get storage delta:storage Motion[2] 128 - -execute store result storage delta:storage Pos[0] double 0.015625 run scoreboard players operation $pos.x delta.internal.math += $motion.x delta.internal.math -execute store result storage delta:storage Pos[1] double 0.015625 run scoreboard players operation $pos.y delta.internal.math += $motion.y delta.internal.math -execute store result storage delta:storage Pos[2] double 0.015625 run scoreboard players operation $pos.z delta.internal.math += $motion.z delta.internal.math -data modify entity @s Pos set from storage delta:storage Pos diff --git a/data/delta/functions/internal/explosion_detection/bed.mcfunction b/data/delta/functions/internal/explosion_detection/bed.mcfunction deleted file mode 100644 index cb9d067..0000000 --- a/data/delta/functions/internal/explosion_detection/bed.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#> delta:internal/explosion_detection/bed -# Detects a bed exploding - -advancement revoke @s only delta:explode_bed - -execute as @e[type=marker,distance=..7,tag=delta.bed] at @s unless block ~ ~ ~ #minecraft:beds run function delta:internal/explosion_detection/explode_bed -execute as @e[type=marker,distance=..7,tag=delta.respawn_anchor] at @s unless block ~ ~ ~ minecraft:respawn_anchor run function delta:internal/explosion_detection/explode_bed diff --git a/data/delta/functions/internal/explosion_detection/check_tnt_minecart_misfire.mcfunction b/data/delta/functions/internal/explosion_detection/check_tnt_minecart_misfire.mcfunction deleted file mode 100644 index 9578d53..0000000 --- a/data/delta/functions/internal/explosion_detection/check_tnt_minecart_misfire.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -#> delta:internal/explosion_detection/check_tnt_minecart_misfire -# Checks to see if a tnt minecart was broken instead of exploded - -execute if entity @e[type=item,distance=..1,nbt={Item:{id:"minecraft:tnt_minecart"},PickupDelay:10s,Age:0s}] run scoreboard players set $cancel delta.internal.dummy 1 \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/ender_dragon_tick.mcfunction b/data/delta/functions/internal/explosion_detection/ender_dragon_tick.mcfunction deleted file mode 100644 index 69cff45..0000000 --- a/data/delta/functions/internal/explosion_detection/ender_dragon_tick.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -#> delta:internal/explosion_detection/ender_dragon_tick -# Used to detect when the ender dragon dies - -scoreboard players set $continue_loop delta.internal.dummy 1 -execute unless entity @e[type=ender_dragon] run function delta:internal/effects/dragon_death/initialize -execute unless entity @s[tag=delta.dragon_death_intermediate] on vehicle if entity @s[nbt={DragonPhase:9}] on passengers as @s[type=marker,tag=delta.explosion_detection.ender_dragon] run function delta:internal/effects/dragon_death/intermediate_initialize \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/ender_dragon_tick_wrapper.mcfunction b/data/delta/functions/internal/explosion_detection/ender_dragon_tick_wrapper.mcfunction deleted file mode 100644 index 8892500..0000000 --- a/data/delta/functions/internal/explosion_detection/ender_dragon_tick_wrapper.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#> delta:internal/explosion_detection/ender_dragon_tick_wrapper -# Description here - -scoreboard players set $continue_loop delta.internal.dummy 0 -execute as @e[type=marker,tag=delta.explosion_detection.ender_dragon] at @s run function delta:internal/explosion_detection/ender_dragon_tick - -execute if score $continue_loop delta.internal.dummy matches 1 run schedule function delta:internal/explosion_detection/ender_dragon_tick_wrapper 1t replace \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/explode_bed.mcfunction b/data/delta/functions/internal/explosion_detection/explode_bed.mcfunction deleted file mode 100644 index d118238..0000000 --- a/data/delta/functions/internal/explosion_detection/explode_bed.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -#> delta:internal/explosion_detection/explode_bed -# I had to make this function to avoid using 2 @e's - -execute positioned ~0.5 ~0.5 ~0.5 run function delta:internal/explosion_detection/large_explosion -kill @s \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/large_explosion.mcfunction b/data/delta/functions/internal/explosion_detection/large_explosion.mcfunction deleted file mode 100644 index 510d428..0000000 --- a/data/delta/functions/internal/explosion_detection/large_explosion.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -#> delta:internal/explosion_detection/large_explosion -# Simulates a small explosion - -function delta:internal/effects/particle/explosion_emitter/spawn -playsound minecraft:delta.entity.generic.explode block @a ~ ~ ~ 4.0 0.7 diff --git a/data/delta/functions/internal/explosion_detection/marker_tick.mcfunction b/data/delta/functions/internal/explosion_detection/marker_tick.mcfunction deleted file mode 100644 index b3e4c52..0000000 --- a/data/delta/functions/internal/explosion_detection/marker_tick.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -#> delta:internal/explosion_detection/marker_tick -# Commands run by explosion tracker markers each tick - -execute as @s[predicate=!delta:riding_entity] run function delta:internal/explosion_detection/simulate_explosion -execute as @s[tag=delta.explosion_detection.track_motion] at @s run function delta:internal/explosion_detection/track_motion \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/mooshroom.mcfunction b/data/delta/functions/internal/explosion_detection/mooshroom.mcfunction deleted file mode 100644 index 730ce8a..0000000 --- a/data/delta/functions/internal/explosion_detection/mooshroom.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -#> delta:internal/explosion_detection/mooshroom -# Sets up and schedules for mooshroom - -advancement revoke @s only delta:sheared_mooshroom - -schedule function delta:internal/effects/particle/tick 1t replace -scoreboard players set $temp delta.internal.size 2 -execute as @e[type=cow,tag=!delta.checked_cow,distance=..7,limit=1,sort=nearest] at @s positioned ~ ~1 ~ run execute summon item_display run function delta:internal/effects/particle/explosion/initialize -tag @e[type=cow,tag=!delta.checked_cow,distance=..7,limit=1,sort=nearest] add delta.checked_cow \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/bed.mcfunction b/data/delta/functions/internal/explosion_detection/setup/bed.mcfunction deleted file mode 100644 index 3832950..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/bed.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -#> delta:internal/explosion_detection/setup/bed -# Sets up a marker at the bed - -advancement revoke @s only delta:place_bed - -scoreboard players set $cast_distance delta.internal.dummy 60 -scoreboard players set $bed_found delta.internal.dummy 0 -execute unless dimension overworld anchored eyes positioned ^ ^ ^ run function delta:internal/explosion_detection/setup/bed_raycast \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/bed_found.mcfunction b/data/delta/functions/internal/explosion_detection/setup/bed_found.mcfunction deleted file mode 100644 index a35de3b..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/bed_found.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -#> delta:internal/explosion_detection/setup/bed_found -# Sets a marker at the bed when it is found - -summon marker ~ ~ ~ {Tags:["delta.bed"]} -scoreboard players set $bed_found delta.internal.dummy 1 \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/bed_raycast.mcfunction b/data/delta/functions/internal/explosion_detection/setup/bed_raycast.mcfunction deleted file mode 100644 index 97f0422..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/bed_raycast.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#> delta:internal/explosion_detection/setup/bed_raycast -# Recursively checks for a newly placed bed and sets up the marker there if found - -execute if block ~ ~ ~ #minecraft:beds[part=foot] align xyz unless entity @e[type=marker,limit=1,distance=..0.01,tag=delta.bed] run function delta:internal/explosion_detection/setup/bed_found - -scoreboard players remove $cast_distance delta.internal.dummy 1 -execute if score $cast_distance delta.internal.dummy matches 1.. if score $bed_found delta.internal.dummy matches 0 positioned ^ ^ ^0.1 run function delta:internal/explosion_detection/setup/bed_raycast \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/creeper.mcfunction b/data/delta/functions/internal/explosion_detection/setup/creeper.mcfunction deleted file mode 100644 index 83f1bc6..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/creeper.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -#> delta:internal/explosion_detection/setup/creeper -# Sets up marker for a creeper - -tag @s add delta.explosion_detection.slow -tag @s add delta.explosion_detection.creeper -execute store result score @s delta.internal.explosion_size on vehicle run data get entity @s ExplosionRadius \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/end_crystal.mcfunction b/data/delta/functions/internal/explosion_detection/setup/end_crystal.mcfunction deleted file mode 100644 index 2448bec..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/end_crystal.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -#> delta:internal/explosion_detection/setup/end_crystal -# Sets up marker for a end crystal - -tag @s add delta.explosion_detection.rapid -scoreboard players set @s delta.internal.explosion_size 2 -execute on vehicle if entity @s[nbt={ShowBottom:1b}] at @s run function delta:internal/explosion_detection/large_explosion \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/ender_dragon.mcfunction b/data/delta/functions/internal/explosion_detection/setup/ender_dragon.mcfunction deleted file mode 100644 index 5505fcf..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/ender_dragon.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -#> delta:internal/explosion_detection/setup/ender_dragon -# Sets up marker for the ender dragon - -tag @s add delta.explosion_detection.ender_dragon diff --git a/data/delta/functions/internal/explosion_detection/setup/fireball.mcfunction b/data/delta/functions/internal/explosion_detection/setup/fireball.mcfunction deleted file mode 100644 index 9c9b38e..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/fireball.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -#> delta:internal/explosion_detection/setup/fireball -# Sets up marker for a fireball - -tag @s add delta.explosion_detection.rapid -tag @s add delta.explosion_detection.fireball -tag @s add delta.explosion_detection.adjust -tag @s add delta.explosion_detection.track_motion -execute store result score @s delta.internal.explosion_size on vehicle run data get entity @s ExplosionPower - -execute on vehicle run data modify storage delta:storage Motion set from entity @s power -data modify entity @s data.Motion set from storage delta:storage Motion diff --git a/data/delta/functions/internal/explosion_detection/setup/process_entity.mcfunction b/data/delta/functions/internal/explosion_detection/setup/process_entity.mcfunction deleted file mode 100644 index e69977a..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/process_entity.mcfunction +++ /dev/null @@ -1,16 +0,0 @@ -#> delta:internal/explosion_detection/setup/process_entity -# Initializes entity to be tracked for explosions - -tag @s add delta.processed - -summon marker ~ ~ ~ {Tags:["delta.explosion_tracker","delta.explosion_tracker.init"]} -ride @e[type=marker,tag=delta.explosion_tracker.init,limit=1] mount @s -execute on passengers run tag @s remove delta.explosion_tracker.init - -execute as @s[type=minecraft:creeper] on passengers as @s[tag=delta.explosion_tracker] run function delta:internal/explosion_detection/setup/creeper -execute as @s[type=minecraft:fireball] on passengers as @s[tag=delta.explosion_tracker] run function delta:internal/explosion_detection/setup/fireball -execute as @s[type=minecraft:wither_skull] on passengers as @s[tag=delta.explosion_tracker] run function delta:internal/explosion_detection/setup/wither_skull -execute as @s[type=minecraft:end_crystal] on passengers as @s[tag=delta.explosion_tracker] run function delta:internal/explosion_detection/setup/end_crystal -execute as @s[type=minecraft:tnt_minecart] on passengers as @s[tag=delta.explosion_tracker] run function delta:internal/explosion_detection/setup/tnt_minecart -execute as @s[type=minecraft:ender_dragon] on passengers as @s[tag=delta.explosion_tracker] run function delta:internal/explosion_detection/setup/ender_dragon -execute as @s[type=minecraft:shulker_bullet] on passengers as @s[tag=delta.explosion_tracker] run function delta:internal/explosion_detection/setup/shulker_bullet \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/respawn_anchor.mcfunction b/data/delta/functions/internal/explosion_detection/setup/respawn_anchor.mcfunction deleted file mode 100644 index 73b33fc..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/respawn_anchor.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -#> delta:internal/explosion_detection/setup/bed -# Sets up a marker at the bed - -advancement revoke @s only delta:place_respawn_anchor - -scoreboard players set $cast_distance delta.internal.dummy 60 -scoreboard players set $anchor_found delta.internal.dummy 0 -execute unless dimension the_nether anchored eyes positioned ^ ^ ^ run function delta:internal/explosion_detection/setup/respawn_anchor_raycast \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/respawn_anchor_found.mcfunction b/data/delta/functions/internal/explosion_detection/setup/respawn_anchor_found.mcfunction deleted file mode 100644 index 9b637f7..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/respawn_anchor_found.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -#> delta:internal/explosion_detection/setup/bed_found -# Sets a marker at the respawn anchor when it is found - -summon marker ~ ~ ~ {Tags:["delta.respawn_anchor"]} -scoreboard players set $anchor_found delta.internal.dummy 1 \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/respawn_anchor_raycast.mcfunction b/data/delta/functions/internal/explosion_detection/setup/respawn_anchor_raycast.mcfunction deleted file mode 100644 index 7f2b51a..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/respawn_anchor_raycast.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#> delta:internal/explosion_detection/setup/respawn_anchor_raycast -# Recursively checks for a newly placed respawn anchor and sets up the marker there if found - -execute if block ~ ~ ~ minecraft:respawn_anchor align xyz unless entity @e[type=marker,limit=1,distance=..0.01,tag=delta.respawn_anchor] run function delta:internal/explosion_detection/setup/respawn_anchor_found - -scoreboard players remove $cast_distance delta.internal.dummy 1 -execute if score $cast_distance delta.internal.dummy matches 1.. if score $anchor_found delta.internal.dummy matches 0 positioned ^ ^ ^0.1 run function delta:internal/explosion_detection/setup/respawn_anchor_raycast \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/shulker_bullet.mcfunction b/data/delta/functions/internal/explosion_detection/setup/shulker_bullet.mcfunction deleted file mode 100644 index 12dfaa2..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/shulker_bullet.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -#> delta:internal/explosion_detection/setup/shulker_bullet -# Sets up initial stuff for shulker bullets - -tag @s add delta.explosion_detection.rapid -tag @s add delta.explosion_detection.shulker_bullet -tag @s add delta.explosion_detection.track_motion \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/tnt.mcfunction b/data/delta/functions/internal/explosion_detection/setup/tnt.mcfunction deleted file mode 100644 index 5793f6f..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/tnt.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -#> delta:internal/explosion_detection/setup/tnt -# Grabs initial fuse of tnt - -execute store result score @s delta.internal.fuse run data get entity @s Fuse -tag @s add delta.tnt.initialized \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/tnt_minecart.mcfunction b/data/delta/functions/internal/explosion_detection/setup/tnt_minecart.mcfunction deleted file mode 100644 index be7df64..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/tnt_minecart.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -#> delta:internal/explosion_detection/setup/fireball -# Sets up marker for a fireball - -tag @s add delta.explosion_detection.rapid -tag @s add delta.explosion_detection.tnt_minecart -scoreboard players set @s delta.internal.explosion_size 2 \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/wither.mcfunction b/data/delta/functions/internal/explosion_detection/setup/wither.mcfunction deleted file mode 100644 index ecd4887..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/wither.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -#> delta:internal/explosion_detection/setup/wither -# Initializes wither spawn explosion detection - -tag @s add delta.wither.processed -execute store result score @s delta.internal.fuse run data get entity @s Invul - -#Start checking loop -schedule function delta:internal/explosion_detection/wither_tick_wrapper 1t replace \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/setup/wither_skull.mcfunction b/data/delta/functions/internal/explosion_detection/setup/wither_skull.mcfunction deleted file mode 100644 index 8f0a907..0000000 --- a/data/delta/functions/internal/explosion_detection/setup/wither_skull.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -#> delta:internal/explosion_detection/setup/wither_skull -# Sets up marker for a wither skull - -tag @s add delta.explosion_detection.rapid -tag @s add delta.explosion_detection.adjust -tag @s add delta.explosion_detection.track_motion -tag @s add delta.explosion_detection.wither_skull -scoreboard players set @s delta.internal.explosion_size 0 \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/shulker_bullet.mcfunction b/data/delta/functions/internal/explosion_detection/shulker_bullet.mcfunction deleted file mode 100644 index 4e11ae1..0000000 --- a/data/delta/functions/internal/explosion_detection/shulker_bullet.mcfunction +++ /dev/null @@ -1,30 +0,0 @@ -#> delta:internal/explosion_detection/shulker_bullet -# Creates the shulker bullet explosion effect if the conditions are right - -scoreboard players set $cancel delta.internal.dummy 1 - -data modify storage delta:storage Pos set from entity @s Pos -execute store result score $pos.x delta.internal.math run data get storage delta:storage Pos[0] 64 -execute store result score $pos.y delta.internal.math run data get storage delta:storage Pos[1] 64 -execute store result score $pos.z delta.internal.math run data get storage delta:storage Pos[2] 64 - -data modify storage delta:storage Motion set from entity @s data.Motion -execute store result score $motion.x delta.internal.math run data get storage delta:storage Motion[0] 64 -execute store result score $motion.y delta.internal.math run data get storage delta:storage Motion[1] 64 -execute store result score $motion.z delta.internal.math run data get storage delta:storage Motion[2] 64 - -execute store result storage delta:storage Pos[0] double 0.015625 run scoreboard players operation $pos.x delta.internal.math += $motion.x delta.internal.math -execute store result storage delta:storage Pos[1] double 0.015625 run scoreboard players operation $pos.y delta.internal.math += $motion.y delta.internal.math -execute store result storage delta:storage Pos[2] double 0.015625 run scoreboard players operation $pos.z delta.internal.math += $motion.z delta.internal.math -data modify entity @s Pos set from storage delta:storage Pos - - -#Check for collision -scoreboard players set $block_hit delta.internal.dummy 0 -execute unless block ~ ~ ~ #delta:no_collision run scoreboard players set $block_hit delta.internal.dummy 1 -execute facing entity @s feet positioned as @s unless block ^ ^ ^0.15 #delta:no_collision run scoreboard players set $block_hit delta.internal.dummy 1 -execute facing entity @s feet positioned as @s unless block ^ ^ ^0.3 #delta:no_collision run scoreboard players set $block_hit delta.internal.dummy 1 - -execute if score $block_hit delta.internal.dummy matches 1 run function delta:internal/explosion_detection/shulker_explosion - -kill @s \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/shulker_explosion.mcfunction b/data/delta/functions/internal/explosion_detection/shulker_explosion.mcfunction deleted file mode 100644 index 9433928..0000000 --- a/data/delta/functions/internal/explosion_detection/shulker_explosion.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -#> delta:internal/explosion_detection/shulker_explosion -# Creates the effect for when a shulker bullet explodes against a block - -scoreboard players set $count delta.api.particle 2 -scoreboard players set $dx delta.api.particle 20 -scoreboard players set $dy delta.api.particle 20 -scoreboard players set $dz delta.api.particle 20 - -function delta:api/explosion_particle \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/simulate_explosion.mcfunction b/data/delta/functions/internal/explosion_detection/simulate_explosion.mcfunction deleted file mode 100644 index e62ffb2..0000000 --- a/data/delta/functions/internal/explosion_detection/simulate_explosion.mcfunction +++ /dev/null @@ -1,12 +0,0 @@ -#> delta:internal/explosion_detection/simulate_explosion -# When an entity explodes, provide fake explosion - -scoreboard players set $cancel delta.internal.dummy 0 -execute if entity @s[tag=delta.explosion_detection.tnt_minecart] run function delta:internal/explosion_detection/check_tnt_minecart_misfire -execute if entity @s[tag=delta.explosion_detection.shulker_bullet] run function delta:internal/explosion_detection/shulker_bullet - -execute if entity @s[tag=delta.explosion_detection.adjust] run function delta:internal/explosion_detection/adjust_position -execute if score @s delta.internal.explosion_size matches ..1 if score $cancel delta.internal.dummy matches 0 at @s run function delta:internal/explosion_detection/small_explosion -execute if score @s delta.internal.explosion_size matches 2.. if score $cancel delta.internal.dummy matches 0 at @s run function delta:internal/explosion_detection/large_explosion - -kill @s \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/slow_check.mcfunction b/data/delta/functions/internal/explosion_detection/slow_check.mcfunction deleted file mode 100644 index 53ac5b9..0000000 --- a/data/delta/functions/internal/explosion_detection/slow_check.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#> delta:internal/explosion_detection/slow_check -# Slow checks things like creepers to swap them in and out of active mode - -execute as @s[tag=!delta.explosion_detection.rapid] if entity @a[distance=..15] run tag @s add delta.explosion_detection.rapid -execute as @s[tag=delta.explosion_detection.rapid] unless entity @a[distance=..15] run tag @s remove delta.explosion_detection.rapid -execute as @s[tag=delta.explosion_detection.rapid] on vehicle unless data entity @s {DeathTime:0s} on passengers run kill @s[tag=delta.explosion_tracker] -execute as @s[predicate=!delta:riding_entity] run kill @s \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/small_explosion.mcfunction b/data/delta/functions/internal/explosion_detection/small_explosion.mcfunction deleted file mode 100644 index 3969520..0000000 --- a/data/delta/functions/internal/explosion_detection/small_explosion.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#> delta:internal/explosion_detection/small_explosion -# Simulates a small explosion - -schedule function delta:internal/effects/particle/tick 1t replace -scoreboard players set $temp delta.internal.size 8 -playsound minecraft:delta.entity.generic.explode block @a ~ ~ ~ 4.0 0.7 -execute summon item_display run function delta:internal/effects/particle/explosion/initialize \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/tnt_tick.mcfunction b/data/delta/functions/internal/explosion_detection/tnt_tick.mcfunction deleted file mode 100644 index e557174..0000000 --- a/data/delta/functions/internal/explosion_detection/tnt_tick.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -#> delta:internal/explosion_detection/tnt_tick -# Commands run by tnt per tick - -#Set up score for fuse -execute as @s[tag=!delta.tnt.initialized] run function delta:internal/explosion_detection/setup/tnt - -#Decrement fuse and trigger if it hits 0 -scoreboard players remove @s delta.internal.fuse 1 -execute if score @s delta.internal.fuse matches ..0 at @s run function delta:internal/explosion_detection/large_explosion \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/track_motion.mcfunction b/data/delta/functions/internal/explosion_detection/track_motion.mcfunction deleted file mode 100644 index 53a221c..0000000 --- a/data/delta/functions/internal/explosion_detection/track_motion.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -#> delta:internal/explosion_detection/track_motion -# Does some checks to help distinguish whether the shulker bullet hit a block or was destroyed by something else - -execute as @s[tag=delta.explosion_detection.shulker_bullet] on vehicle run data modify storage delta:storage Motion set from entity @s Motion -execute as @s[tag=delta.explosion_detection.fireball] on vehicle run data modify storage delta:storage Motion set from entity @s power -execute as @s[tag=delta.explosion_detection.wither] on vehicle run data modify storage delta:storage Motion set from entity @s power -data modify entity @s data.Motion set from storage delta:storage Motion diff --git a/data/delta/functions/internal/explosion_detection/wither_explode.mcfunction b/data/delta/functions/internal/explosion_detection/wither_explode.mcfunction deleted file mode 100644 index 075557b..0000000 --- a/data/delta/functions/internal/explosion_detection/wither_explode.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -#> delta:internal/explosion_detection/wither_explode -# Makes the wither do its spawn explosion - -execute positioned ~ ~1.75 ~ run function delta:internal/explosion_detection/large_explosion -tag @s add delta.wither.exploded \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/wither_tick.mcfunction b/data/delta/functions/internal/explosion_detection/wither_tick.mcfunction deleted file mode 100644 index f19a159..0000000 --- a/data/delta/functions/internal/explosion_detection/wither_tick.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -#> delta:internal/explosion_detection/wither_tick -# Checks to see whether the wither should do its spawn explosion - -scoreboard players remove @s delta.internal.fuse 1 -execute if score @s delta.internal.fuse matches 0 run function delta:internal/explosion_detection/wither_explode -scoreboard players set $continue_loop delta.internal.dummy 1 \ No newline at end of file diff --git a/data/delta/functions/internal/explosion_detection/wither_tick_wrapper.mcfunction b/data/delta/functions/internal/explosion_detection/wither_tick_wrapper.mcfunction deleted file mode 100644 index 9ab7b41..0000000 --- a/data/delta/functions/internal/explosion_detection/wither_tick_wrapper.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -#> delta:internal/explosion_detection/wither_tick_wrapper - -scoreboard players set $continue_loop delta.internal.dummy 0 -execute as @e[type=wither,tag=delta.wither.processed,tag=!delta.wither.exploded] at @s run function delta:internal/explosion_detection/wither_tick - -execute if score $continue_loop delta.internal.dummy matches 1 run schedule function delta:internal/explosion_detection/wither_tick_wrapper 1t replace \ No newline at end of file diff --git a/data/delta/functions/internal/technical/loop_1s.mcfunction b/data/delta/functions/internal/technical/loop_1s.mcfunction deleted file mode 100644 index 26919c0..0000000 --- a/data/delta/functions/internal/technical/loop_1s.mcfunction +++ /dev/null @@ -1,18 +0,0 @@ -#> delta:internal/technical/loop_1s -# Commands run once every 19 ticks (was 20, but needs to be 19 to detect dying creepers) - -execute as @e[type=marker,tag=delta.explosion_detection.slow] at @s run function delta:internal/explosion_detection/slow_check -execute as @e[type=wither,tag=!delta.wither.processed] run function delta:internal/explosion_detection/setup/wither -execute if entity @e[type=ender_dragon] run schedule function delta:internal/explosion_detection/ender_dragon_tick_wrapper 1t replace -tag @e[type=cow,tag=!delta.checked_cow] add delta.checked_cow - -#Cleanup for if schedule loops fail -execute if score $particle_loop_active delta.internal.dummy matches 0 run function delta:internal/effects/particle/tick -execute if score $dragon_death_loop_active delta.internal.dummy matches 0 run function delta:internal/effects/dragon_death/tick_wrapper -execute if score $pre_dragon_death_loop_active delta.internal.dummy matches 0 run function delta:internal/effects/dragon_death/intermediate_tick_wrapper - -#Bed and anchor cleanup -execute as @e[type=marker,tag=delta.bed] at @s unless block ~ ~ ~ #minecraft:beds run kill @s -execute as @e[type=marker,tag=delta.respawn_anchor] at @s unless block ~ ~ ~ minecraft:respawn_anchor run kill @s - -schedule function delta:internal/technical/loop_1s 19t replace \ No newline at end of file From 0d6add7fd58edd68edc79b908599cade4babfbb1 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Mon, 25 Dec 2023 21:52:21 +0900 Subject: [PATCH 44/51] =?UTF-8?q?=E3=82=B8=E3=82=A7=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=81=A7=E9=87=8D=E5=8A=9B=E8=BB=BD=E6=B8=9B=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=82=8B=E3=81=A0=E3=82=8D=E5=A4=9A=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/swing/marker.mcfunction | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index 82e57b7..ad090c6 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -27,7 +27,8 @@ scoreboard players operation #marker.merge.z ckenja.ghook += #intertia.z ckenja.ghook #重力 - scoreboard players remove #marker.merge.y ckenja.ghook 392 + execute if score #feature.swing.jet ckenja.ghook matches 10000.. run scoreboard players remove #marker.merge.y ckenja.ghook 196 + execute unless score #feature.swing.jet ckenja.ghook matches 10000.. run scoreboard players remove #marker.merge.y ckenja.ghook 784 #ループでマーカーの方向に移動して球上の位置を出す #フックからロープ距離分マーカー方向に進んで、その場所の座標を記憶 @@ -36,7 +37,7 @@ execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #marker.merge.z ckenja.ghook data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos tag @s add ckenja.ghook.marker.this - execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s positioned ^ ^ ^-0.125 as @e[type=marker,tag=ckenja.ghook.marker.this,distance=..120] run function ckenja.ghook:feature/swing/loop + execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s as @e[type=marker,tag=ckenja.ghook.marker.this,distance=..120] run function ckenja.ghook:feature/swing/get_sphere tag @s remove ckenja.ghook.marker.this #衝突判定を取る From 51318f7068bd319037d47819e3fc562b63fe9132 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Mon, 25 Dec 2023 21:53:04 +0900 Subject: [PATCH 45/51] =?UTF-8?q?=E7=A9=BA=E6=B0=97=E6=8A=B5=E6=8A=97?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/swing/_.mcfunction | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index db5f176..9ed1bfe 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -24,9 +24,12 @@ data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity 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 - -#キー入力してたら短くしたろ - execute if score #feature.swing.jet ckenja.ghook matches 10000.. if score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook run scoreboard players remove #temp.feature.swing.updated_length ckenja.ghook 125 + 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 From d6964d8cff24ec667e0c236ca6d103d3e2affc80 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Tue, 26 Dec 2023 11:28:40 +0900 Subject: [PATCH 46/51] =?UTF-8?q?hook=E5=87=BA=E6=9D=A5=E3=82=8B=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86=E3=82=A3=E3=82=92=E3=82=BF?= =?UTF-8?q?=E3=82=B0=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB/=E3=83=AF=E3=82=A4=E3=83=A4=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E9=95=B7=E3=81=95=E3=81=AE=E5=8D=98=E4=BD=8D=E3=82=92?= =?UTF-8?q?1mm=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/feature/shot/_.mcfunction | 2 +- .../feature/shot/detect_entity2.mcfunction | 6 ++--- .../functions/feature/shot/loop.mcfunction | 4 ++-- .../feature/shot/setting_entity.mcfunction | 6 ++--- .../feature/shot/using_item.mcfunction | 1 + .../functions/feature/swing/_.mcfunction | 15 +++++++----- .../feature/swing/get_length.mcfunction | 3 +++ .../feature/swing/get_sphere.mcfunction | 9 ++++++++ .../functions/feature/swing/loop.mcfunction | 23 ------------------- .../functions/feature/swing/marker.mcfunction | 4 ++-- .../feature/swing/no_tension.mcfunction | 8 ------- .../functions/hook/entity.mcfunction | 20 ++++++++-------- data/ckenja.ghook/functions/load.mcfunction | 1 + .../tags/entity_types/hookable_entity.json | 1 + 14 files changed, 45 insertions(+), 58 deletions(-) create mode 100644 data/ckenja.ghook/functions/feature/swing/get_length.mcfunction create mode 100644 data/ckenja.ghook/functions/feature/swing/get_sphere.mcfunction delete mode 100644 data/ckenja.ghook/functions/feature/swing/loop.mcfunction delete mode 100644 data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction create mode 100644 data/ckenja.ghook/tags/entity_types/hookable_entity.json diff --git a/data/ckenja.ghook/functions/feature/shot/_.mcfunction b/data/ckenja.ghook/functions/feature/shot/_.mcfunction index fbaa100..70b6469 100644 --- a/data/ckenja.ghook/functions/feature/shot/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/_.mcfunction @@ -13,7 +13,7 @@ execute unless score #flag.have_hook ckenja.ghook matches 1 if entity @s[tag=cke 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 0 + 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:"}}} diff --git a/data/ckenja.ghook/functions/feature/shot/detect_entity2.mcfunction b/data/ckenja.ghook/functions/feature/shot/detect_entity2.mcfunction index 4e6d244..47f056c 100644 --- a/data/ckenja.ghook/functions/feature/shot/detect_entity2.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/detect_entity2.mcfunction @@ -2,6 +2,6 @@ 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.creeper.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.creeper.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.creeper.z ckenja.ghook run data get storage ckenja.ghook.__temp__: feature.shot.detect_entity.Pos[2] 10000 +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 diff --git a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction index 33eb985..95a06b8 100644 --- a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction @@ -4,9 +4,9 @@ # # @within ckenja.ghook:feature/shot/** -scoreboard players add @s ckenja.ghook.l 250 +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=creeper,dx=0,dy=0,dz=0] run function ckenja.ghook:feature/shot/detect_entity +execute if score #feature.shot.loop ckenja.ghook matches 0 as @e[type=#ckenja.ghook:hookable_entity,dx=0,dy=0,dz=0] run function ckenja.ghook:feature/shot/detect_entity execute if score #feature.shot.loop ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/success 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 diff --git a/data/ckenja.ghook/functions/feature/shot/setting_entity.mcfunction b/data/ckenja.ghook/functions/feature/shot/setting_entity.mcfunction index c2d9dc3..862328b 100644 --- a/data/ckenja.ghook/functions/feature/shot/setting_entity.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/setting_entity.mcfunction @@ -1,8 +1,8 @@ function ckenja.ghook:feature/shot/hook -scoreboard players operation #feature.shot.detect_entity.hook.x ckenja.ghook -= #feature.shot.detect_entity.creeper.x ckenja.ghook -scoreboard players operation #feature.shot.detect_entity.hook.y ckenja.ghook -= #feature.shot.detect_entity.creeper.y ckenja.ghook -scoreboard players operation #feature.shot.detect_entity.hook.z ckenja.ghook -= #feature.shot.detect_entity.creeper.z ckenja.ghook +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 diff --git a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction index 56c397b..a77a00a 100644 --- a/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction @@ -19,3 +19,4 @@ execute positioned as @s run playsound minecraft:entity.blaze.hurt player @a ~ ~ 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 diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 9ed1bfe..c1a7c77 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -4,7 +4,8 @@ # # @within function ckenja.ghook:player/tick -scoreboard players operation #temp.feature.swing.loop ckenja.ghook = @s ckenja.ghook.l +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 @@ -31,10 +32,12 @@ data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity scoreboard players operation @s ckenja.ghook.y /= #100 ckenja.ghook scoreboard players operation @s ckenja.ghook.z /= #100 ckenja.ghook +#ロープが縮んだら反映 + execute at @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:feature/swing/get_length + #演出 execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0 - execute unless score @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.25 1 - -#ロープが縮んだら反映 - scoreboard players operation @s ckenja.ghook.l = #temp.feature.swing.updated_length ckenja.ghook - scoreboard players reset #temp.feature.swing.updated_length ckenja.ghook + execute unless score @s ckenja.ghook.l = #feature.swing.temp.length ckenja.ghook run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.25 1 + tellraw @a {"score": {"name": "@s", "objective": "ckenja.ghook.l"}} + scoreboard players operation @s ckenja.ghook.l < #feature.swing.temp.length ckenja.ghook + tellraw @a {"score": {"name": "@s", "objective": "ckenja.ghook.l"}} diff --git a/data/ckenja.ghook/functions/feature/swing/get_length.mcfunction b/data/ckenja.ghook/functions/feature/swing/get_length.mcfunction new file mode 100644 index 0000000..2347fc9 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/get_length.mcfunction @@ -0,0 +1,3 @@ +function entity_distance:api/get +scoreboard players operation #feature.swing.temp.length ckenja.ghook = @s EntityDistance +scoreboard players operation #feature.swing.temp.length ckenja.ghook /= #10 ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/swing/get_sphere.mcfunction b/data/ckenja.ghook/functions/feature/swing/get_sphere.mcfunction new file mode 100644 index 0000000..078cad3 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/get_sphere.mcfunction @@ -0,0 +1,9 @@ +#> ckenja.ghook:feature/swing/get_sphere +# +# 当たり判定チェックとか挟みつつループ +# +# @within function ckenja.ghook:feature/swing/marker + +#球の中にマーカーがあればその座標になる。 +$execute if entity @s[distance=..$(plus)] at @s run tp @s ~ ~ ~ +$execute unless entity @s[distance=..$(plus)] positioned ^ ^ ^$(minus) run tp @s ~ ~ ~ diff --git a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction b/data/ckenja.ghook/functions/feature/swing/loop.mcfunction deleted file mode 100644 index cab7518..0000000 --- a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction +++ /dev/null @@ -1,23 +0,0 @@ -#> ckenja.ghook:feature/swing/loop -# -# 当たり判定チェックとか挟みつつループ -# -# @within function ckenja.ghook:feature/swing/marker - -scoreboard players reset #flag.unmoveable ckenja.ghook - -scoreboard players remove #temp.feature.swing.loop ckenja.ghook 125 - -#次のtickのロープの長さを決める -scoreboard players add #temp.feature.swing.updated_length ckenja.ghook 125 - -#ロープの長さより長く距離をとろうとするとunmoveableフラグを建てる -execute if score #temp.feature.swing.loop ckenja.ghook matches ..0 run scoreboard players set #flag.unmoveable ckenja.ghook 1 - -#1単位以内にマーカーがあればその座標になる。 -execute if score #flag.have_hook ckenja.ghook matches 1 if entity @s[distance=..0.125] run function ckenja.ghook:feature/swing/no_tension - -#unmoveableフラグは、次の地点に移動できない場合に建てる。 -execute if score #flag.unmoveable ckenja.ghook matches 1 run tp @s ~ ~ ~ - -execute unless score #flag.unmoveable ckenja.ghook matches 1 positioned ^ ^ ^-0.125 run function ckenja.ghook:feature/swing/loop diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index ad090c6..53d61c6 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -37,11 +37,11 @@ execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #marker.merge.z ckenja.ghook data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos tag @s add ckenja.ghook.marker.this - execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s as @e[type=marker,tag=ckenja.ghook.marker.this,distance=..120] run function ckenja.ghook:feature/swing/get_sphere + execute positioned as @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score @s ckenja.ghook = #temp.id ckenja.ghook facing entity @s feet positioned as @s as @e[type=marker,tag=ckenja.ghook.marker.this,distance=..120] run function ckenja.ghook:feature/swing/get_sphere with storage ckenja.ghook.__temp__: feature.swing.get_sphere tag @s remove ckenja.ghook.marker.this #衝突判定を取る scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 1 execute facing entity @s feet positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_detection/_ - + kill @s diff --git a/data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction b/data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction deleted file mode 100644 index 526aa30..0000000 --- a/data/ckenja.ghook/functions/feature/swing/no_tension.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -#> ckenja.ghook:feature/swing/no_tension -# -# -# -# @within function ckenja.ghook:feature/swing/loop - -execute at @s run tp @s ~ ~ ~ -scoreboard players set #flag.unmoveable ckenja.ghook 1 diff --git a/data/ckenja.ghook/functions/hook/entity.mcfunction b/data/ckenja.ghook/functions/hook/entity.mcfunction index 1cb7982..10c9a5c 100644 --- a/data/ckenja.ghook/functions/hook/entity.mcfunction +++ b/data/ckenja.ghook/functions/hook/entity.mcfunction @@ -1,11 +1,11 @@ -execute as @e[type=creeper,tag=ckenja.ghook.target_entity,distance=..8] if score @s ckenja.ghook = #temp.id ckenja.ghook run data modify storage ckenja.ghook.__temp__: hook.creeper.Pos set from entity @s Pos -execute store result score #hook.creeper.x ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.creeper.Pos[0] 10000 -execute store result score #hook.creeper.y ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.creeper.Pos[1] 10000 -execute store result score #hook.creeper.z ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.creeper.Pos[2] 10000 -scoreboard players operation #hook.creeper.x ckenja.ghook += @s ckenja.ghook.hook.x -scoreboard players operation #hook.creeper.y ckenja.ghook += @s ckenja.ghook.hook.y -scoreboard players operation #hook.creeper.z ckenja.ghook += @s ckenja.ghook.hook.z -execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #hook.creeper.x ckenja.ghook -execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #hook.creeper.y ckenja.ghook -execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #hook.creeper.z ckenja.ghook +execute as @e[type=#ckenja.ghook:hookable_entity,tag=ckenja.ghook.target_entity,distance=..8] if score @s ckenja.ghook = #temp.id ckenja.ghook run data modify storage ckenja.ghook.__temp__: hook.target_entity.Pos set from entity @s Pos +execute store result score #hook.target_entity.x ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.target_entity.Pos[0] 10000 +execute store result score #hook.target_entity.y ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.target_entity.Pos[1] 10000 +execute store result score #hook.target_entity.z ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.target_entity.Pos[2] 10000 +scoreboard players operation #hook.target_entity.x ckenja.ghook += @s ckenja.ghook.hook.x +scoreboard players operation #hook.target_entity.y ckenja.ghook += @s ckenja.ghook.hook.y +scoreboard players operation #hook.target_entity.z ckenja.ghook += @s ckenja.ghook.hook.z +execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get #hook.target_entity.x ckenja.ghook +execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get #hook.target_entity.y ckenja.ghook +execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get #hook.target_entity.z ckenja.ghook data modify entity @s Pos set from storage ckenja.ghook.__temp__: marker.merge.Pos diff --git a/data/ckenja.ghook/functions/load.mcfunction b/data/ckenja.ghook/functions/load.mcfunction index 3ac61a7..8670e01 100644 --- a/data/ckenja.ghook/functions/load.mcfunction +++ b/data/ckenja.ghook/functions/load.mcfunction @@ -19,6 +19,7 @@ scoreboard objectives add ckenja.ghook.hook.z dummy scoreboard players set #98 ckenja.ghook 98 scoreboard players set #100 ckenja.ghook 100 +scoreboard players set #10 ckenja.ghook 10 scoreboard players set #10000 ckenja.ghook 10000 scoreboard players set #2 ckenja.ghook 2 diff --git a/data/ckenja.ghook/tags/entity_types/hookable_entity.json b/data/ckenja.ghook/tags/entity_types/hookable_entity.json new file mode 100644 index 0000000..8af6c46 --- /dev/null +++ b/data/ckenja.ghook/tags/entity_types/hookable_entity.json @@ -0,0 +1 @@ +{"values": ["creeper"]} From 8991dffaff759a2860563decf977f6d701e9280a Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Tue, 26 Dec 2023 11:41:23 +0900 Subject: [PATCH 47/51] =?UTF-8?q?tellraw=E3=81=AE=E3=81=93=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/swing/_.mcfunction | 2 -- 1 file changed, 2 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index c1a7c77..06bb972 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -38,6 +38,4 @@ data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity #演出 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 - tellraw @a {"score": {"name": "@s", "objective": "ckenja.ghook.l"}} scoreboard players operation @s ckenja.ghook.l < #feature.swing.temp.length ckenja.ghook - tellraw @a {"score": {"name": "@s", "objective": "ckenja.ghook.l"}} From dc86f2697b7406605cbbd8ec7dd1876e5804e6bf Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Tue, 26 Dec 2023 11:47:05 +0900 Subject: [PATCH 48/51] =?UTF-8?q?=E3=82=BF=E3=82=B0=E5=A4=96=E3=81=97?= =?UTF-8?q?=E5=BF=98=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction b/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction index 9164a75..fd8bfce 100644 --- a/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction +++ b/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction @@ -6,3 +6,5 @@ tp @s ~ ~-10000 ~ kill @s +execute as @e[type=#ckenja.ghook:hookable_entity,tag=ckenja.ghook.target_entity,distance=..8] if score @s ckenja.ghook = #temp.id ckenja.ghook run tag @s remove ckenja.ghook.target_entity + From cd6b2c0643ac9689a60bae0df941db7d44b8a2d5 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Tue, 26 Dec 2023 18:31:28 +0900 Subject: [PATCH 49/51] =?UTF-8?q?=E3=83=95=E3=83=83=E3=82=AF=E3=82=92?= =?UTF-8?q?=E5=88=BA=E3=81=9B=E3=81=AA=E3=81=84=E3=83=96=E3=83=AD=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=81=AB=E3=83=95=E3=83=83=E3=82=AF=E3=82=92=E5=88=BA?= =?UTF-8?q?=E3=81=9B=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/ckenja.ghook/functions/feature/shot/_.mcfunction | 1 - data/ckenja.ghook/functions/feature/shot/hook.mcfunction | 5 ++--- data/ckenja.ghook/functions/feature/shot/loop.mcfunction | 2 +- data/ckenja.ghook/functions/feature/shot/success.mcfunction | 2 -- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/data/ckenja.ghook/functions/feature/shot/_.mcfunction b/data/ckenja.ghook/functions/feature/shot/_.mcfunction index 70b6469..95d4f3c 100644 --- a/data/ckenja.ghook/functions/feature/shot/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/_.mcfunction @@ -4,7 +4,6 @@ # # @within function ckenja.ghook:player/tick -scoreboard players set #feature.shot.on_trigger ckenja.ghook 0 scoreboard players set #feature.shot.detect_entity ckenja.ghook 0 scoreboard players set #feature.shot.using_item ckenja.ghook 0 diff --git a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction index 19310ad..1c742db 100644 --- a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction @@ -2,11 +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"],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 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 diff --git a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction index 95a06b8..56b3bea 100644 --- a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction @@ -7,7 +7,7 @@ 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] run function ckenja.ghook:feature/shot/detect_entity -execute if score #feature.shot.loop ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/success +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 #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 ~ ~ ~ diff --git a/data/ckenja.ghook/functions/feature/shot/success.mcfunction b/data/ckenja.ghook/functions/feature/shot/success.mcfunction index 55f9b57..f45f306 100644 --- a/data/ckenja.ghook/functions/feature/shot/success.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/success.mcfunction @@ -6,5 +6,3 @@ 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}} - -scoreboard players set #feature.shot.on_trigger ckenja.ghook 1 From d5d8ff01164f6e42ab26c9cd94c704a3ab3320f5 Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sat, 30 Dec 2023 09:52:09 +0900 Subject: [PATCH 50/51] =?UTF-8?q?=E3=82=A8=E3=83=B3=E3=83=86=E3=82=A3?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=81=AB=E3=83=95=E3=83=83=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BB=98=E3=81=91=E3=82=8B=E3=82=84=E3=81=A4=E3=81=AE=E3=83=AA?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=AF=E3=82=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reel/remove_from_target.mcfunction | 2 + .../feature/reel/void_kill.mcfunction | 3 +- .../functions/feature/shot/loop.mcfunction | 2 +- .../functions/hook/entity.mcfunction | 4 +- .../functions/hook/entity2.mcfunction | 4 + .../tags/entity_types/hookable_entity.json | 113 +++++++++++++++++- 6 files changed, 123 insertions(+), 5 deletions(-) create mode 100644 data/ckenja.ghook/functions/feature/reel/remove_from_target.mcfunction create mode 100644 data/ckenja.ghook/functions/hook/entity2.mcfunction diff --git a/data/ckenja.ghook/functions/feature/reel/remove_from_target.mcfunction b/data/ckenja.ghook/functions/feature/reel/remove_from_target.mcfunction new file mode 100644 index 0000000..b6b3f9c --- /dev/null +++ b/data/ckenja.ghook/functions/feature/reel/remove_from_target.mcfunction @@ -0,0 +1,2 @@ +tag @s remove ckenja.ghook.target_entity +scoreboard players reset @s ckenja.ghook diff --git a/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction b/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction index fd8bfce..c0b538e 100644 --- a/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction +++ b/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction @@ -6,5 +6,4 @@ tp @s ~ ~-10000 ~ kill @s -execute as @e[type=#ckenja.ghook:hookable_entity,tag=ckenja.ghook.target_entity,distance=..8] if score @s ckenja.ghook = #temp.id ckenja.ghook run tag @s remove ckenja.ghook.target_entity - +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 diff --git a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction index 56b3bea..c231836 100644 --- a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction @@ -6,7 +6,7 @@ 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] run function ckenja.ghook:feature/shot/detect_entity +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 #feature.shot.loop ckenja.ghook matches 0 positioned ^ ^ ^0.25 if entity @s[distance=..104] run function ckenja.ghook:feature/shot/loop diff --git a/data/ckenja.ghook/functions/hook/entity.mcfunction b/data/ckenja.ghook/functions/hook/entity.mcfunction index 10c9a5c..cd17be7 100644 --- a/data/ckenja.ghook/functions/hook/entity.mcfunction +++ b/data/ckenja.ghook/functions/hook/entity.mcfunction @@ -1,4 +1,6 @@ -execute as @e[type=#ckenja.ghook:hookable_entity,tag=ckenja.ghook.target_entity,distance=..8] if score @s ckenja.ghook = #temp.id ckenja.ghook run data modify storage ckenja.ghook.__temp__: hook.target_entity.Pos set from entity @s Pos +scoreboard players set #hook.have_entity ckenja.ghook 0 +execute at @s as @e[type=#ckenja.ghook:hookable_entity,tag=ckenja.ghook.target_entity,distance=..8] if score @s ckenja.ghook = #temp.id ckenja.ghook run function ckenja.ghook:hook/entity2 +execute if score #hook.have_entity ckenja.ghook matches 0 run scoreboard players set #flag.hook.kill ckenja.ghook 0 execute store result score #hook.target_entity.x ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.target_entity.Pos[0] 10000 execute store result score #hook.target_entity.y ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.target_entity.Pos[1] 10000 execute store result score #hook.target_entity.z ckenja.ghook run data get storage ckenja.ghook.__temp__: hook.target_entity.Pos[2] 10000 diff --git a/data/ckenja.ghook/functions/hook/entity2.mcfunction b/data/ckenja.ghook/functions/hook/entity2.mcfunction new file mode 100644 index 0000000..2b2fd86 --- /dev/null +++ b/data/ckenja.ghook/functions/hook/entity2.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set #hook.have_entity ckenja.ghook 1 +data modify storage ckenja.ghook.__temp__: hook.target_entity.Pos set from entity @s Pos +say y diff --git a/data/ckenja.ghook/tags/entity_types/hookable_entity.json b/data/ckenja.ghook/tags/entity_types/hookable_entity.json index 8af6c46..bfd4843 100644 --- a/data/ckenja.ghook/tags/entity_types/hookable_entity.json +++ b/data/ckenja.ghook/tags/entity_types/hookable_entity.json @@ -1 +1,112 @@ -{"values": ["creeper"]} +{ + "values": [ + "player", + "boat", + "chest_boat", + "minecart", + "chest_minecart", + "furnace_minecart", + "tnt_minecart", + "hopper_minecart", + "spawner_minecart", + "command_block_minecart", + "item", + "experience_orb", + "arrow", + "trident", + "snowball", + "egg", + "llama_spit", + "ender_pearl", + "eye_of_ender", + "firework_rocket", + "tnt", + "falling_block", + "fishing_bobber", + "armor_stand", + "fireball", + "wither_skull", + "dragon_fireball", + "shulker_bullet", + "end_crystal", + "evoker_fangs", + "axolotl", + "bat", + "bee", + "blaze", + "camel", + "cat", + "cave_spider", + "chicken", + "cod", + "cow", + "creeper", + "dolphin", + "donkey", + "drowned", + "elder_guardian", + "ender_dragon", + "enderman", + "endermite", + "evoker", + "fox", + "frog", + "ghast", + "giant", + "glow_squid", + "goat", + "guardian", + "hoglin", + "horse", + "husk", + "illusioner", + "iron_golem", + "llama", + "magma_cube", + "mooshroom", + "mule", + "ocelot", + "panda", + "parrot", + "phantom", + "pig", + "piglin", + "piglin_brute", + "pillager", + "polar_bear", + "pufferfish", + "rabbit", + "ravager", + "salmon", + "sheep", + "shulker", + "silverfish", + "sniffer", + "skeleton", + "skeleton_horse", + "slime", + "snow_golem", + "spider", + "squid", + "stray", + "strider", + "tadpole", + "trader_llama", + "tropical_fish", + "turtle", + "vex", + "villager", + "vindicator", + "wandering_trader", + "warden", + "witch", + "wither", + "wither_skeleton", + "wolf", + "zoglin", + "zombie", + "zombie_horse", + "zombie_villager", + "zombified_piglin" + ] +} From 8b0558c9b5b92d7ffa8eebfb267874797bf895cc Mon Sep 17 00:00:00 2001 From: CKenJa <41111170+CKenJa@users.noreply.github.com> Date: Sat, 30 Dec 2023 10:47:37 +0900 Subject: [PATCH 51/51] =?UTF-8?q?=E6=B5=AE=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ckenja.ghook/advancements/using_item.json | 5 +++- .../functions/feature/swing/_.mcfunction | 26 +++++++++---------- .../functions/feature/swing/marker.mcfunction | 7 +++-- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/data/ckenja.ghook/advancements/using_item.json b/data/ckenja.ghook/advancements/using_item.json index 712e3f6..66b7301 100644 --- a/data/ckenja.ghook/advancements/using_item.json +++ b/data/ckenja.ghook/advancements/using_item.json @@ -5,6 +5,9 @@ "conditions": { "item": { "nbt": "{ctc:{id:\"ghook\",from:\"ckenja.ghook:\"}}" + }, + "player": { + "flags": {"is_sneaking": false} } } } @@ -12,4 +15,4 @@ "rewards": { "function": "ckenja.ghook:using_item" } - } \ No newline at end of file + } diff --git a/data/ckenja.ghook/functions/feature/swing/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/_.mcfunction index 06bb972..30f4df0 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -4,20 +4,21 @@ # # @within function ckenja.ghook:player/tick +#慣性を取得。ないなら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 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 -#慣性。ないなら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 - +#マーカーで移動位置を計算 tag @s add ckenja.ghook.feature.swing.player execute rotated as @s summon marker run function ckenja.ghook:feature/swing/marker tag @s remove ckenja.ghook.feature.swing.player -#移動できるならPos代入して次tick用の慣性作成 +#次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 @@ -25,15 +26,12 @@ data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity 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 at @s as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:feature/swing/get_length + #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 diff --git a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction index 53d61c6..a279e29 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -27,8 +27,8 @@ scoreboard players operation #marker.merge.z ckenja.ghook += #intertia.z ckenja.ghook #重力 - execute if score #feature.swing.jet ckenja.ghook matches 10000.. run scoreboard players remove #marker.merge.y ckenja.ghook 196 - execute unless score #feature.swing.jet ckenja.ghook matches 10000.. run scoreboard players remove #marker.merge.y ckenja.ghook 784 + scoreboard players remove #marker.merge.y ckenja.ghook 784 + execute if block ~ ~ ~ water run scoreboard players add #marker.merge.y ckenja.ghook 780 #ループでマーカーの方向に移動して球上の位置を出す #フックからロープ距離分マーカー方向に進んで、その場所の座標を記憶 @@ -44,4 +44,7 @@ scoreboard players set #feature.swing.collision_detect_loop ckenja.ghook 1 execute facing entity @s feet positioned ~ ~ ~ run function ckenja.ghook:feature/swing/collision_detection/_ +#ロープが縮んだら反映 + 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/swing/get_length + kill @s