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..2a0e592 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,9 @@ { "values": [ "#ckenja.ghook.smart_motion:ignore_collision", + "grass", + "snow", + "powder_snow", "frogspawn", "sculk_vein", "mangrove_sign", @@ -27,6 +30,13 @@ "torchflower_crop", "pitcher_plant", "pitcher_crop", + "oak_hanging_sign", + "dark_oak_hanging_sign", + "acacia_hanging_sign", + "spruce_hanging_sign", + "jungle_hanging_sign", + "warped_hanging_sign", + "crimson_hanging_sign", "minecraft:fern", "minecraft:fire", "minecraft:kelp", @@ -130,7 +140,6 @@ "minecraft:detector_rail", "minecraft:hanging_roots", "minecraft:jungle_button", - "minecraft:lava_cauldron", "minecraft:lightning_rod", "minecraft:nether_portal", "minecraft:oak_wall_sign", @@ -165,7 +174,6 @@ "minecraft:structure_void", "minecraft:tube_coral_fan", "minecraft:twisting_vines", - "minecraft:water_cauldron", "minecraft:birch_wall_sign", "minecraft:brain_coral_fan", "minecraft:dark_oak_button", 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/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/reel.mcfunction b/data/ckenja.ghook/functions/feature/reel/_.mcfunction similarity index 64% rename from data/ckenja.ghook/functions/feature/reel.mcfunction rename to data/ckenja.ghook/functions/feature/reel/_.mcfunction index f1b61ff..7f1c844 100644 --- a/data/ckenja.ghook/functions/feature/reel.mcfunction +++ b/data/ckenja.ghook/functions/feature/reel/_.mcfunction @@ -1,14 +1,14 @@ -#> ckenja.ghook:feature/reel +#> ckenja.ghook:feature/reel/_ # # # # @within function ckenja.ghook:player/tick #フック収納 -execute as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:void_kill +execute as @e[type=bat,tag=ckenja.ghook.hook,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:feature/reel/void_kill ride @s dismount -execute as @e[type=item_display,tag=ckenja.ghook.vehicle,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:void_kill +execute as @e[type=item_display,tag=ckenja.ghook.vehicle,distance=..120] if score #temp.id ckenja.ghook = @s ckenja.ghook run kill @s #慣性をMotion代入 scoreboard players operation $x delta.api.launch = @s ckenja.ghook.x @@ -22,3 +22,11 @@ data modify storage player_item_tuner: result.merge set value {tag:{CustomModelD function #player_item_tuner:merge/inventory scoreboard players set #flag.have_hook ckenja.ghook 0 + +playsound minecraft:block.ender_chest.close master @s ~ ~ ~ 0.25 2 +playsound minecraft:block.iron_trapdoor.open master @s ~ ~ ~ 1 1.33 +playsound minecraft:entity.fishing_bobber.retrieve master @s ~ ~ ~ 1 0.67 + +scoreboard players reset @s ckenja.ghook.hook.x +scoreboard players reset @s ckenja.ghook.hook.y +scoreboard players reset @s ckenja.ghook.hook.z 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/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 new file mode 100644 index 0000000..c0b538e --- /dev/null +++ b/data/ckenja.ghook/functions/feature/reel/void_kill.mcfunction @@ -0,0 +1,9 @@ +#> ckenja.ghook:feature/reel/void_kill +# +# +# +# @within function ckenja.ghook:feature/reel + +tp @s ~ ~-10000 ~ +kill @s +execute as @e[type=#ckenja.ghook:hookable_entity,tag=ckenja.ghook.target_entity] if score @s ckenja.ghook = #temp.id ckenja.ghook run function ckenja.ghook:feature/reel/remove_from_target diff --git a/data/ckenja.ghook/functions/feature/shot/_.mcfunction b/data/ckenja.ghook/functions/feature/shot/_.mcfunction index 5ddf069..95d4f3c 100644 --- a/data/ckenja.ghook/functions/feature/shot/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/_.mcfunction @@ -2,20 +2,19 @@ # # # -# @within function ckenja.ghook:player/using_item +# @within function ckenja.ghook:player/tick +scoreboard players set #feature.shot.detect_entity ckenja.ghook 0 +scoreboard players set #feature.shot.using_item ckenja.ghook 0 + +execute unless score #flag.have_hook ckenja.ghook matches 1 if entity @s[tag=ckenja.ghook.player.using_item] if score @s ckenja.ghook.c matches 0 run scoreboard players set #feature.shot.using_item ckenja.ghook 1 #フック射出 data modify storage ckenja.ghook.__temp__: player.data.UUID set from entity @s UUID #0.25m単位で十分だろう #batの横の当たり判定が0.5だからギリ足りないのでは? - scoreboard players set @s ckenja.ghook.l -250 - execute anchored eyes run function ckenja.ghook:feature/shot/loop + scoreboard players set #feature.shot.length ckenja.ghook 0 + data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126001}} + execute anchored eyes positioned ^ ^ ^ run function ckenja.ghook:feature/shot/loop + data modify storage player_item_tuner: condition.if set value {tag:{ctc:{id:"ghook",from:"ckenja.ghook:"}}} -#アイテムの見た目変更 -data modify storage player_item_tuner: condition.if set value {tag:{ctc:{id:"ghook",from:"ckenja.ghook:"}}} -data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126001}} function #player_item_tuner:merge/inventory - -tag @s add ckenja.ghook.feature.shot.player -execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 positioned ~ ~0.6 ~ summon item_display run function ckenja.ghook:feature/shot/vehicle -tag @s remove ckenja.ghook.feature.shot.player 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..47f056c --- /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.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/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 a183686..1c742db 100644 --- a/data/ckenja.ghook/functions/feature/shot/hook.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/hook.mcfunction @@ -2,10 +2,10 @@ # # # -# @within function ckenja.ghook:feature/shot/loop +# @within function ckenja.ghook:feature/shot/using_item -data merge entity @s {Silent:1b,Invulnerable:1b,DeathTime:19,DeathLootTable:"minecraft:empty",PersistenceRequired:1b,NoAI:1b,Tags:["ckenja.ghook.hook"],ActiveEffects:[{Id:14,Amplifier:0b,Duration:2147483647,ShowParticles:0b}]} +data merge entity @s {Silent:1b,Invulnerable:1b,DeathTime:19,DeathLootTable:"minecraft:empty",PersistenceRequired:1b,NoAI:1b,Tags:["ckenja.ghook.hook"],active_effects:[{id:"minecraft:invisibility",amplifier:0b,duration:2147483647,show_particles:0b}]} data modify entity @s Leash.UUID set from storage ckenja.ghook.__temp__: player.data.UUID scoreboard players operation @s ckenja.ghook = #temp.id ckenja.ghook -execute store success score #flag.have_hook ckenja.ghook run execute unless block ~ ~ ~ #ckenja.ghook:unable_hook -execute if score #flag.have_hook ckenja.ghook matches 0 run scoreboard players reset #flag.hook_shot_this_tick ckenja.ghook +scoreboard players reset #flag.hook_shot_this_tick ckenja.ghook +execute if score #feature.shot.detect_entity ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/get_pos diff --git a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction index 76d1a5b..c231836 100644 --- a/data/ckenja.ghook/functions/feature/shot/loop.mcfunction +++ b/data/ckenja.ghook/functions/feature/shot/loop.mcfunction @@ -4,8 +4,10 @@ # # @within ckenja.ghook:feature/shot/** -scoreboard players add @s ckenja.ghook.l 250 -execute store success score #flag.hook_shot_this_tick ckenja.ghook run execute unless block ^ ^ ^0.25 #ckenja.ghook:no_collision -execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 align xyz positioned ~0.5 ~0.5 ~0.5 summon bat run function ckenja.ghook:feature/shot/hook +scoreboard players add #feature.shot.length ckenja.ghook 250 +execute store success score #feature.shot.loop ckenja.ghook unless block ~ ~ ~ #ckenja.ghook:no_collision +execute if score #feature.shot.loop ckenja.ghook matches 0 as @e[type=#ckenja.ghook:hookable_entity,dx=0,dy=0,dz=0] unless score #temp.id ckenja.ghook = @s ckenja.ghook run function ckenja.ghook:feature/shot/detect_entity +execute if score #feature.shot.loop ckenja.ghook matches 1 unless block ~ ~ ~ #ckenja.ghook:unable_hook run function ckenja.ghook:feature/shot/success -execute if score #flag.hook_shot_this_tick ckenja.ghook matches 0 positioned ^ ^ ^0.25 if entity @s[distance=..104] run function ckenja.ghook:feature/shot/loop +execute if score #feature.shot.loop ckenja.ghook matches 0 positioned ^ ^ ^0.25 if entity @s[distance=..104] run function ckenja.ghook:feature/shot/loop +execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 run particle crit ~ ~ ~ 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..862328b --- /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.target_entity.x ckenja.ghook +scoreboard players operation #feature.shot.detect_entity.hook.y ckenja.ghook -= #feature.shot.detect_entity.target_entity.y ckenja.ghook +scoreboard players operation #feature.shot.detect_entity.hook.z ckenja.ghook -= #feature.shot.detect_entity.target_entity.z ckenja.ghook + +scoreboard players operation @s ckenja.ghook.hook.x = #feature.shot.detect_entity.hook.x ckenja.ghook +scoreboard players operation @s ckenja.ghook.hook.y = #feature.shot.detect_entity.hook.y ckenja.ghook +scoreboard players operation @s ckenja.ghook.hook.z = #feature.shot.detect_entity.hook.z ckenja.ghook 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..f45f306 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/shot/success.mcfunction @@ -0,0 +1,8 @@ +#> ckenja.ghook:feature/shot/success +# +# +# +# @within function ckenja.ghook:feature/shot/loop + +execute if score #feature.shot.using_item ckenja.ghook matches 1 run function ckenja.ghook:feature/shot/using_item +data modify storage player_item_tuner: result.merge set value {tag:{CustomModelData:126000}} 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..a77a00a --- /dev/null +++ b/data/ckenja.ghook/functions/feature/shot/using_item.mcfunction @@ -0,0 +1,22 @@ +#> ckenja.ghook:feature/shot/using_item +# +# +# +# @within function ckenja.ghook:feature/shot/success + +execute if score #feature.shot.detect_entity ckenja.ghook matches 0 align xyz positioned ~0.5 ~ ~0.5 summon bat run function ckenja.ghook:feature/shot/hook +execute if score #feature.shot.detect_entity ckenja.ghook matches 1 summon bat run function ckenja.ghook:feature/shot/setting_entity + +#アイテムの見た目変更 +tag @s add ckenja.ghook.feature.shot.player +execute at @s positioned ~ ~0.6 ~ summon item_display run function ckenja.ghook:feature/shot/vehicle +tag @s remove ckenja.ghook.feature.shot.player + +scoreboard players set #flag.hook_shot_this_tick ckenja.ghook 1 + +execute positioned as @s run playsound minecraft:block.iron_trapdoor.open player @a ~ ~ ~ 0.75 1.5 +execute positioned as @s run playsound minecraft:entity.blaze.hurt player @a ~ ~ ~ 0.5 1.33 +execute positioned as @s run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.25 0.67 + +scoreboard players set @s ckenja.ghook.c 5 +scoreboard players operation @s ckenja.ghook.l = #feature.shot.length ckenja.ghook 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 0fe3fa0..30f4df0 100644 --- a/data/ckenja.ghook/functions/feature/swing/_.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/_.mcfunction @@ -4,54 +4,36 @@ # # @within function ckenja.ghook:player/tick -scoreboard players operation #temp.long ckenja.ghook = @s ckenja.ghook.l - -#アニメーションでずれるので移動前にパーティクルを出す - execute positioned as @s run particle cloud ~ ~ ~ - -#慣性。ないならMotionを参照する +#慣性を取得。ないならMotionを参照する execute if score #flag.hook_shot_this_tick ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/motion execute unless score #flag.hook_shot_this_tick ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/intertia.get -#追加のベクトル(重力とキー操作) - execute store result score $player.motion.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[0] 5000 - execute store result score $player.motion.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[1] 5000 - execute store result score $player.motion.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Motion[2] 5000 - -#の和 - scoreboard players operation $intertia.x ckenja.ghook += $player.motion.x ckenja.ghook - scoreboard players operation $intertia.y ckenja.ghook += $player.motion.y ckenja.ghook - scoreboard players operation $intertia.z ckenja.ghook += $player.motion.z ckenja.ghook - -#長押ししてたらジェットのベクトルも追加 - execute if score #flag.jet ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/jet +execute store result storage ckenja.ghook.__temp__: feature.swing.get_sphere.plus double 0.001 run scoreboard players get @s ckenja.ghook.l +execute store result storage ckenja.ghook.__temp__: feature.swing.get_sphere.minus double -0.001 run scoreboard players get @s ckenja.ghook.l +data modify storage ckenja.ghook.__temp__: player.data.Motion set from entity @s Motion +data modify storage ckenja.ghook.__temp__: player.data.Rotation set from entity @s Rotation -#現在座標 - execute store result score $player.pos.x ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Pos[0] 10000 - execute store result score $player.pos.y ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Pos[1] 10000 - execute store result score $player.pos.z ckenja.ghook run data get storage ckenja.ghook.__temp__: player.data.Pos[2] 10000 - -#との和 - scoreboard players operation $intertia.x ckenja.ghook += $player.pos.x ckenja.ghook - scoreboard players operation $intertia.y ckenja.ghook += $player.pos.y ckenja.ghook - scoreboard players operation $intertia.z ckenja.ghook += $player.pos.z ckenja.ghook - -#その座標にマーカーを出し、フックからロープ距離分マーカー方向に進んで、その場所の座標を記憶 - data modify storage ckenja.ghook.__temp__: marker.merge.Pos set value [0.0,0.0,0.0] - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[0] double 0.0001 run scoreboard players get $intertia.x ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[1] double 0.0001 run scoreboard players get $intertia.y ckenja.ghook - execute store result storage ckenja.ghook.__temp__: marker.merge.Pos[2] double 0.0001 run scoreboard players get $intertia.z ckenja.ghook - summon marker ~ ~ ~ {Tags:["ckenja.ghook.marker"]} +#マーカーで移動位置を計算 tag @s add ckenja.ghook.feature.swing.player - execute as @e[type=marker,tag=ckenja.ghook.marker] run function ckenja.ghook:feature/swing/marker + execute rotated as @s summon marker run function ckenja.ghook:feature/swing/marker tag @s remove ckenja.ghook.feature.swing.player -#移動できるならPos代入して次tick用の慣性作成 -#execute if score #flag.no_collision ckenja.ghook matches 1 run -function ckenja.ghook:feature/swing/intertia.make -#移動できなかったら慣性を半分にして二分探索的なアプローチで次tickに移動を託す -#execute unless score #flag.no_collision ckenja.ghook matches 1 run function ckenja.ghook:feature/swing/intertia.half - -#ロープが縮んだら反映 -scoreboard players operation @s ckenja.ghook.l -= #temp.long ckenja.ghook -scoreboard players reset #temp.long ckenja.ghook +#次tick用の慣性作成 + data modify storage ckenja.ghook.__temp__: player.feature.swing.Pos set from entity @s Pos + execute store result score @s ckenja.ghook.x run data get storage ckenja.ghook.__temp__: player.feature.swing.Pos[0] 10000 + execute store result score @s ckenja.ghook.y run data get storage ckenja.ghook.__temp__: player.feature.swing.Pos[1] 10000 + execute store result score @s ckenja.ghook.z run data get storage ckenja.ghook.__temp__: player.feature.swing.Pos[2] 10000 + scoreboard players operation @s ckenja.ghook.x -= #player.pos.x ckenja.ghook + scoreboard players operation @s ckenja.ghook.y -= #player.pos.y ckenja.ghook + scoreboard players operation @s ckenja.ghook.z -= #player.pos.z ckenja.ghook + #scoreboard players operation @s ckenja.ghook.x *= #98 ckenja.ghook + #scoreboard players operation @s ckenja.ghook.y *= #98 ckenja.ghook + #scoreboard players operation @s ckenja.ghook.z *= #98 ckenja.ghook + #scoreboard players operation @s ckenja.ghook.x /= #100 ckenja.ghook + #scoreboard players operation @s ckenja.ghook.y /= #100 ckenja.ghook + #scoreboard players operation @s ckenja.ghook.z /= #100 ckenja.ghook + +#演出 + execute rotated as @s on vehicle positioned as @s run tp @s ~ ~ ~ ~ 0 + execute unless score @s ckenja.ghook.l = #feature.swing.temp.length ckenja.ghook run playsound minecraft:block.chain.place player @a ~ ~ ~ 0.25 1 + scoreboard players operation @s ckenja.ghook.l < #feature.swing.temp.length ckenja.ghook 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..5e6e5ef --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/_.mcfunction @@ -0,0 +1,35 @@ +#> 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 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_detection/_ 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 new file mode 100644 index 0000000..01b9c6a --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_and_tp.mcfunction @@ -0,0 +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 new file mode 100644 index 0000000..e646928 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/check_back.mcfunction @@ -0,0 +1,11 @@ +#> 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] +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/feature/swing/collision_detection/tp.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_detection/tp.mcfunction new file mode 100644 index 0000000..ea2eb32 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_detection/tp.mcfunction @@ -0,0 +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/_.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction new file mode 100644 index 0000000..4f6a177 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_.mcfunction @@ -0,0 +1,77 @@ +#> ckenja.ghook:feature/swing/collision_responce/_ +# +# +# +# @within function ckenja.ghook:feature/swing/collision_detection/_ + + scoreboard players set #feature.swing.nearest.range ckenja.ghook 2147483647 + +#移動予定地と現座標の差を、この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 unless score #feature.swing.nearest.range ckenja.ghook matches 2147483647 run function ckenja.ghook:feature/swing/collision_responce/_2 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..46f3bf5 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/_2.mcfunction @@ -0,0 +1,11 @@ +#> ckenja.ghook:feature/swing/collision_responce/_2 +# +# +# +# @within function ckenja.ghook:feature/swing/collision_responce/_ + + 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 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 new file mode 100644 index 0000000..692c8a8 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/calc_range.mcfunction @@ -0,0 +1,38 @@ +#> 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 + +#現在の座標との距離を求める +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 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 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/get_intersection.mcfunction b/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction new file mode 100644 index 0000000..fd4a793 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/get_intersection.mcfunction @@ -0,0 +1,17 @@ +#> 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 +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 +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 new file mode 100644 index 0000000..e0bb2eb --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_x.mcfunction @@ -0,0 +1,27 @@ +#> 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.t ckenja.ghook = #feature.swing.k 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 + +scoreboard players operation #feature.swing.intersection.x ckenja.ghook = #feature.swing.k 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 += #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 += #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 new file mode 100644 index 0000000..5a88fd5 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_y.mcfunction @@ -0,0 +1,27 @@ +#> 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[1] 10000 + +scoreboard players operation #feature.swing.t ckenja.ghook = #feature.swing.k 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 += #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 += #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 new file mode 100644 index 0000000..4e9b94f --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/intersection_with_z.mcfunction @@ -0,0 +1,27 @@ +#> 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[2] 10000 + +scoreboard players operation #feature.swing.t ckenja.ghook = #feature.swing.k 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 += #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 += #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_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..78afde0 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/looking_at_function2.mcfunction @@ -0,0 +1,15 @@ +#> 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 +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 ~ ~ 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 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 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..596b239 --- /dev/null +++ b/data/ckenja.ghook/functions/feature/swing/collision_responce/update_nearest.mcfunction @@ -0,0 +1,11 @@ +#> 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 +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 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/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/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.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/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.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 2c31107..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 deleted file mode 100644 index 2e123b8..0000000 --- a/data/ckenja.ghook/functions/feature/swing/loop.mcfunction +++ /dev/null @@ -1,27 +0,0 @@ -#> ckenja.ghook:feature/swing/loop -# -# 当たり判定チェックとか挟みつつループ -# 100m以上離れているかつ衝突: 終了 -# jet使うかつmarkerを通り過ぎる: 終了 -# ロープ長まで行った: 終了 -# そうでなければ次のループ -# -# @within function ckenja.ghook:feature/swing/marker - -scoreboard players reset #flag.unmoveable ckenja.ghook - -scoreboard players remove #temp.long ckenja.ghook 125 - -#ロープの長さより長く距離をとろうとするとunmoveableフラグを建てる -execute if score #temp.long 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フラグは、その地点に移動できない場合に建てる。 -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..a279e29 100644 --- a/data/ckenja.ghook/functions/feature/swing/marker.mcfunction +++ b/data/ckenja.ghook/functions/feature/swing/marker.mcfunction @@ -4,9 +4,47 @@ # # @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.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 + 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 if block ~ ~ ~ water run scoreboard players add #marker.merge.y ckenja.ghook 780 #ループでマーカーの方向に移動して球上の位置を出す - 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 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 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/_ + +#ロープが縮んだら反映 + 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 diff --git a/data/ckenja.ghook/functions/feature/swing/motion.mcfunction b/data/ckenja.ghook/functions/feature/swing/motion.mcfunction index 79d7eab..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 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/hook/entity.mcfunction b/data/ckenja.ghook/functions/hook/entity.mcfunction new file mode 100644 index 0000000..cd17be7 --- /dev/null +++ b/data/ckenja.ghook/functions/hook/entity.mcfunction @@ -0,0 +1,13 @@ +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 +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/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/functions/hook/tick.mcfunction b/data/ckenja.ghook/functions/hook/tick.mcfunction index 9f78e11..ecf28ef 100644 --- a/data/ckenja.ghook/functions/hook/tick.mcfunction +++ b/data/ckenja.ghook/functions/hook/tick.mcfunction @@ -6,8 +6,10 @@ #フックを消すか否か #ついでにリードがあるか否か - 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 - #こっちはフックを消すか否かの処理なので共通化はしない +#こっちはフックを消すか否かの処理なので共通化はしない 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 ee1d285..8670e01 100644 --- a/data/ckenja.ghook/functions/load.mcfunction +++ b/data/ckenja.ghook/functions/load.mcfunction @@ -9,7 +9,20 @@ 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 +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 +scoreboard players set #10 ckenja.ghook 10 +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] +data modify storage ckenja.ghook.__temp__: player.not_vehicle.Pos.0 set value [0.0,0.0,0.0] 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/not_vehicle.mcfunction b/data/ckenja.ghook/functions/player/not_vehicle.mcfunction new file mode 100644 index 0000000..8c23c33 --- /dev/null +++ b/data/ckenja.ghook/functions/player/not_vehicle.mcfunction @@ -0,0 +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 -= #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..ecdbe8a --- /dev/null +++ b/data/ckenja.ghook/functions/player/not_vehicle2.mcfunction @@ -0,0 +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 6f87676..377ab74 100644 --- a/data/ckenja.ghook/functions/player/tick.mcfunction +++ b/data/ckenja.ghook/functions/player/tick.mcfunction @@ -4,11 +4,15 @@ # # @within function ckenja.ghook:tick -execute unless score @s ckenja.ghook matches -2147483648..2147483647 run function ckenja.ghook:player/id +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 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 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 @@ -16,24 +20,25 @@ 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 + +#フック射出試行 +function ckenja.ghook:feature/shot/_ #クリック検知 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/_ #フックがあればスイング計算 - 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/_ +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 +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.no_collision 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/functions/void_kill.mcfunction b/data/ckenja.ghook/functions/void_kill.mcfunction deleted file mode 100644 index 844f8c9..0000000 --- a/data/ckenja.ghook/functions/void_kill.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -#> ckenja.ghook:void_kill -# -# -# -# @within function ckenja.ghook:feature/reel - -tp @s ~ ~-10000 ~ -kill @s \ No newline at end of file diff --git a/data/ckenja.ghook/loot_tables/ghook.json b/data/ckenja.ghook/loot_tables/ghook.json index ae7c322..7e9ed6b 100644 --- a/data/ckenja.ghook/loot_tables/ghook.json +++ b/data/ckenja.ghook/loot_tables/ghook.json @@ -9,12 +9,16 @@ "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:\"},HideFlags:6}" + }, + { + "function": "set_attributes", + "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", "name": { - "text": "Grappling hook", + "text": "立体機動装置", "italic": false } }, @@ -22,7 +26,7 @@ "function": "minecraft:set_lore", "lore": [ { - "text": "ブタさんの飛ぶ頃に", + "text": "ワイヤーは一本しか射出できないようだ...", "italic": false } ] 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 +} 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..bfd4843 --- /dev/null +++ b/data/ckenja.ghook/tags/entity_types/hookable_entity.json @@ -0,0 +1,112 @@ +{ + "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" + ] +} 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"] +} 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