Skip to content

Commit

Permalink
perf: put dragon attack clearing in separate function
Browse files Browse the repository at this point in the history
  • Loading branch information
Franco227 committed Jul 9, 2024
1 parent ce97074 commit 8a83c0c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ scoreboard players set @a[tag=!hub,tag=!garden] dirt_timer 0
scoreboard players set @a[tag=!hub,tag=!garden] liquid_timer 0
scoreboard players set @a[tag=!hub,tag=!garden] lava_timer 0

schedule clear custom_ender_dragon:p2/attack_timer
schedule clear custom_ender_dragon:p3/attack_timer
schedule clear custom_ender_dragon:two_second_tick
schedule clear custom_ender_dragon:quarter_second_tick
schedule clear custom_ender_dragon:p5/attack_timer_10s
schedule clear custom_ender_dragon:p5/attack_timer_15s
schedule clear custom_ender_dragon:p5/attack_timer_5s
function roguecraft:ender_dragon/reset_dragon_attacks
bossbar set minecraft:dragon players @a[tag=olkjahsoihaef]
bossbar set minecraft:phase_4_mobs players @a[tag=olkjahsoihaef]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
schedule clear custom_ender_dragon:p2/attack_timer
schedule clear custom_ender_dragon:p3/attack_timer
schedule clear custom_ender_dragon:two_second_tick
schedule clear custom_ender_dragon:quarter_second_tick
schedule clear custom_ender_dragon:p5/attack_timer_10s
schedule clear custom_ender_dragon:p5/attack_timer_15s
schedule clear custom_ender_dragon:p5/attack_timer_5s
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ scoreboard players set @a[tag=!garden,tag=!hub] lava_timer 0
scoreboard players reset @a stronghold_location
scoreboard players reset @a restart_run

schedule clear custom_ender_dragon:p2/attack_timer
schedule clear custom_ender_dragon:p3/attack_timer
schedule clear custom_ender_dragon:two_second_tick
schedule clear custom_ender_dragon:quarter_second_tick
schedule clear custom_ender_dragon:p5/attack_timer_10s
schedule clear custom_ender_dragon:p5/attack_timer_15s
schedule clear custom_ender_dragon:p5/attack_timer_5s
function roguecraft:ender_dragon/reset_dragon_attacks
bossbar set minecraft:dragon players @a[tag=olkjahsoihaef]
bossbar set minecraft:phase_4_mobs players @a[tag=olkjahsoihaef]

Expand Down
4 changes: 3 additions & 1 deletion Data_Pack/data/roguecraft/functions/reset_end.mcfunction
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
function roguecraft:ender_dragon/reset_dragon_attacks

kill @e[type=minecraft:ender_dragon,tag=!cdragon]
kill @e[tag=phase_4_mob]
kill @e[type=minecraft:interaction,tag=egg_interaction]
kill @e[type=minecraft:block_display,tag=egg_block]
execute in minecraft:the_end positioned 0 0 0 as @e[type=#roguecraft:post_enderdragon_removed,distance=..2000] at @s run tp ~ -100 ~
execute in minecraft:the_end positioned 0 0 0 as @e[type=#roguecraft:post_enderdragon_removed,distance=..2000] run tp 0 -100 0
execute in minecraft:the_end positioned 0 -100 0 as @e[type=#roguecraft:post_enderdragon_removed,distance=..100] run kill @s
bossbar remove minecraft:phase_4_mobs

Expand Down

0 comments on commit 8a83c0c

Please sign in to comment.