-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hibtox detection is no longer ray facing dependent, now it's vector d…
…ependent
- Loading branch information
1 parent
849565e
commit ad87eeb
Showing
10 changed files
with
62 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
data/mrcd/function/private/recurse/entity_collision/block_end_marker/post_summon.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
tag @s add mrcd_ignore | ||
tag @s add mrcd_block_end | ||
tag @s add mrcd_block_marker | ||
|
||
# Set marker position: depends if reached ray total or colided with a block | ||
execute if score #total_before_collision mrcd_system matches 1 run function mrcd:private/recurse/entity_collision/block_end_marker/total | ||
execute if score #total_before_collision mrcd_system matches 0 run function mrcd:private/recurse/entity_collision/block_end_marker/collision |
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
.../mrcd/function/private/recurse/entity_collision/block_start_marker/post_summon.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
tag @s add mrcd_ignore | ||
tag @s add mrcd_block_start | ||
tag @s add mrcd_block_marker | ||
|
||
scoreboard players operation #temp_x mrcd_system = #block_x mrcd_system | ||
scoreboard players operation #temp_y mrcd_system = #block_y mrcd_system | ||
scoreboard players operation #temp_z mrcd_system = #block_z mrcd_system | ||
|
||
scoreboard players operation #temp_x mrcd_system += #block_corner_x mrcd_system | ||
scoreboard players operation #temp_y mrcd_system += #block_corner_y mrcd_system | ||
scoreboard players operation #temp_z mrcd_system += #block_corner_z mrcd_system | ||
|
||
execute store result entity @s Pos[0] double 0.001 run scoreboard players get #temp_x mrcd_system | ||
execute store result entity @s Pos[1] double 0.001 run scoreboard players get #temp_y mrcd_system | ||
execute store result entity @s Pos[2] double 0.001 run scoreboard players get #temp_z mrcd_system | ||
|
||
execute at @s run tp @s ~ ~ ~ facing entity @n[type=area_effect_cloud,tag=mrcd_block_end] |
6 changes: 3 additions & 3 deletions
6
data/mrcd/function/private/recurse/entity_collision/loop.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
data/mrcd/function/private/recurse/entity_collision/main.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
execute if entity @s[tag=mrcd_entity,tag=!mrcd_entity_targeted] run return run execute if entity @e[type=!#mrcd:ignore,tag=!mrcd_ignore,dx=0,limit=1] run function mrcd:private/recurse/entity_collision/main_ | ||
execute if entity @s[tag=mrcd_entity_targeted] run return run execute if entity @e[tag=mrcd_target,tag=!mrcd_ignore,dx=0,limit=1] run function mrcd:private/recurse/entity_collision/main_ | ||
# If there is a entity hitbox in this block (and this hitbox was not previously considered in the iteration | ||
execute if entity @s[tag=!mrcd_entity_targeted] run return run execute if entity @e[type=!#mrcd:ignore,tag=!mrcd_ignore,tag=!mrcd_target_entity,dx=0,limit=1] run function mrcd:private/recurse/entity_collision/main_ | ||
execute if entity @s[tag=mrcd_entity_targeted] run return run execute if entity @e[tag=mrcd_target,tag=!mrcd_ignore,tag=!mrcd_target_entity,dx=0,limit=1] run function mrcd:private/recurse/entity_collision/main_ |
33 changes: 17 additions & 16 deletions
33
data/mrcd/function/private/recurse/entity_collision/main_.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
# Summon finish point marker at block edge (collision or total) | ||
summon area_effect_cloud ~ ~ ~ {Tags:["mrcd_block_end","mrcd_ignore"]} | ||
execute if score #total_before_collision mrcd_system matches 1 as @e[type=area_effect_cloud,tag=mrcd_block_end,limit=1] run function mrcd:private/recurse/entity_collision/marker/total | ||
execute if score #total_before_collision mrcd_system matches 0 as @e[type=area_effect_cloud,tag=mrcd_block_end,limit=1] run function mrcd:private/recurse/entity_collision/marker/collision | ||
# Summon finish position marker at block edge | ||
execute summon area_effect_cloud run function mrcd:private/recurse/entity_collision/block_end_marker/post_summon | ||
|
||
# Tp @s to current block starting position | ||
scoreboard players operation #temp_x mrcd_system = #block_x mrcd_system | ||
scoreboard players operation #temp_y mrcd_system = #block_y mrcd_system | ||
scoreboard players operation #temp_z mrcd_system = #block_z mrcd_system | ||
# Summon starting position marker | ||
execute summon area_effect_cloud run function mrcd:private/recurse/entity_collision/block_start_marker/post_summon | ||
|
||
scoreboard players operation #temp_x mrcd_system += #block_corner_x mrcd_system | ||
scoreboard players operation #temp_y mrcd_system += #block_corner_y mrcd_system | ||
scoreboard players operation #temp_z mrcd_system += #block_corner_z mrcd_system | ||
# Debug (show block where entity is found) | ||
# particle wax_off ~ ~ ~ 0 0 0 0 1 force | ||
# particle wax_off ~1 ~ ~ 0 0 0 0 1 force | ||
# particle wax_off ~ ~1 ~ 0 0 0 0 1 force | ||
# particle wax_off ~ ~ ~1 0 0 0 0 1 force | ||
# particle wax_off ~1 ~1 ~ 0 0 0 0 1 force | ||
# particle wax_off ~1 ~ ~1 0 0 0 0 1 force | ||
# particle wax_off ~ ~1 ~1 0 0 0 0 1 force | ||
# particle wax_off ~1 ~1 ~1 0 0 0 0 1 force | ||
|
||
execute store result entity @s Pos[0] double 0.001 run scoreboard players get #temp_x mrcd_system | ||
execute store result entity @s Pos[1] double 0.001 run scoreboard players get #temp_y mrcd_system | ||
execute store result entity @s Pos[2] double 0.001 run scoreboard players get #temp_z mrcd_system | ||
# execute at @e[type=area_effect_cloud,tag=mrcd_block_start,limit=1] run particle scrape ~ ~ ~ 0 0 0 0 1 force | ||
# execute at @e[type=area_effect_cloud,tag=mrcd_block_end,limit=1] run particle wax_on ~ ~ ~ 0 0 0 0 1 force | ||
|
||
# Iterate in small steps checking if entity is reached | ||
scoreboard players set #steps mrcd_system 0 | ||
execute at @s run function mrcd:private/recurse/entity_collision/loop | ||
execute as @e[type=area_effect_cloud,tag=mrcd_block_start,limit=1] at @s run function mrcd:private/recurse/entity_collision/loop | ||
|
||
# If collision detected and is bullet | ||
execute if entity @e[tag=mrcd_target_entity,limit=1] if entity @s[tag=!mrcd_entity_bullet] run function mrcd:private/recurse/entity_collision/not_bullet | ||
execute if entity @e[tag=mrcd_target_entity,limit=1] run tag @s add mrcd_touch_entity | ||
|
||
# Clean | ||
kill @e[type=area_effect_cloud,tag=mrcd_block_end,limit=1] | ||
kill @e[type=area_effect_cloud,tag=mrcd_block_marker] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters