From 21a8e2cee2ea11c6771317b5b14bf0d69a580a7a Mon Sep 17 00:00:00 2001 From: FrustratedProgrammer Date: Fri, 10 Jan 2025 22:38:09 -0600 Subject: [PATCH] refactor last of the files --- .../ensure_bat_count.mcfunction | 0 .../ensure_fish_count.mcfunction | 4 ++-- .../ensure_glow_squid_count.mcfunction | 0 .../fish_counts/determine_variant.mcfunction | 0 .../fish_counts/summon_common_variant.mcfunction | 2 +- .../fish_counts/summon_fish.mcfunction | 4 ++-- .../fish_counts/summon_fish_markers.mcfunction | 0 .../fish_counts/summon_random_variant.mcfunction | 2 +- .../force_vex_tracking.mcfunction | 0 .../kill_bad_mobs.mcfunction | 0 .../data/do2/functions/events/on_20_ticks.mcfunction | 12 ++++++------ .../do2/functions/events/on_datapack_load.mcfunction | 4 ++-- .../do2/functions/events/on_datapack_tick.mcfunction | 2 +- .../data/do2/functions/events/on_game_end.mcfunction | 2 +- .../data/do2/functions/events/on_tick.mcfunction | 4 ++-- .../{ => scoreboard}/reset_player.mcfunction | 0 .../{ => utility}/as_item_entity.mcfunction | 0 .../functions/{ => utility}/dungeon_timer.mcfunction | 0 .../functions/{ => utility}/locate_player.mcfunction | 0 .../{ => utility}/per_level_actions.mcfunction | 0 .../{ => utility}/postpone_dungeon_setup.mcfunction | 0 .../{ => utility}/update_command_blocks.mcfunction | 0 22 files changed, 18 insertions(+), 18 deletions(-) rename Brilliance Datapack/data/do2/functions/{mob_spawning => entity_controller}/ensure_bat_count.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{mob_spawning => entity_controller}/ensure_fish_count.mcfunction (75%) rename Brilliance Datapack/data/do2/functions/{mob_spawning => entity_controller}/ensure_glow_squid_count.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{mob_spawning => entity_controller}/fish_counts/determine_variant.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{mob_spawning => entity_controller}/fish_counts/summon_common_variant.mcfunction (98%) rename Brilliance Datapack/data/do2/functions/{mob_spawning => entity_controller}/fish_counts/summon_fish.mcfunction (65%) rename Brilliance Datapack/data/do2/functions/{mob_spawning => entity_controller}/fish_counts/summon_fish_markers.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{mob_spawning => entity_controller}/fish_counts/summon_random_variant.mcfunction (85%) rename Brilliance Datapack/data/do2/functions/{ => entity_controller}/force_vex_tracking.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{mob_spawning => entity_controller}/kill_bad_mobs.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{ => scoreboard}/reset_player.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{ => utility}/as_item_entity.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{ => utility}/dungeon_timer.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{ => utility}/locate_player.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{ => utility}/per_level_actions.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{ => utility}/postpone_dungeon_setup.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/{ => utility}/update_command_blocks.mcfunction (100%) diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/ensure_bat_count.mcfunction b/Brilliance Datapack/data/do2/functions/entity_controller/ensure_bat_count.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/mob_spawning/ensure_bat_count.mcfunction rename to Brilliance Datapack/data/do2/functions/entity_controller/ensure_bat_count.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/ensure_fish_count.mcfunction b/Brilliance Datapack/data/do2/functions/entity_controller/ensure_fish_count.mcfunction similarity index 75% rename from Brilliance Datapack/data/do2/functions/mob_spawning/ensure_fish_count.mcfunction rename to Brilliance Datapack/data/do2/functions/entity_controller/ensure_fish_count.mcfunction index 75ddabc4..5bba87e4 100644 --- a/Brilliance Datapack/data/do2/functions/mob_spawning/ensure_fish_count.mcfunction +++ b/Brilliance Datapack/data/do2/functions/entity_controller/ensure_fish_count.mcfunction @@ -1,7 +1,7 @@ # Check for fish markers -execute unless entity @e[type=minecraft:marker,tag=fish_marker] run function do2:mob_spawning/fish_counts/summon_fish_markers +execute unless entity @e[type=minecraft:marker,tag=fish_marker] run function do2:entity_controller/fish_counts/summon_fish_markers scoreboard players set $dungeon do2.utility.currentFishCount 0 execute as @e[type=minecraft:tropical_fish] run scoreboard players add $dungeon do2.utility.currentFishCount 1 -execute if score $dungeon do2.config.amountOfFish > $dungeon do2.utility.currentFishCount at @r at @e[distance=24..64,type=marker,tag=fish_marker,limit=1,sort=random] unless entity @e[type=tropical_fish,distance=..3] run function do2:mob_spawning/fish_counts/summon_fish +execute if score $dungeon do2.config.amountOfFish > $dungeon do2.utility.currentFishCount at @r at @e[distance=24..64,type=marker,tag=fish_marker,limit=1,sort=random] unless entity @e[type=tropical_fish,distance=..3] run function do2:entity_controller/fish_counts/summon_fish diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/ensure_glow_squid_count.mcfunction b/Brilliance Datapack/data/do2/functions/entity_controller/ensure_glow_squid_count.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/mob_spawning/ensure_glow_squid_count.mcfunction rename to Brilliance Datapack/data/do2/functions/entity_controller/ensure_glow_squid_count.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/determine_variant.mcfunction b/Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/determine_variant.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/determine_variant.mcfunction rename to Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/determine_variant.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_common_variant.mcfunction b/Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_common_variant.mcfunction similarity index 98% rename from Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_common_variant.mcfunction rename to Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_common_variant.mcfunction index 291e9cd3..08a493d5 100644 --- a/Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_common_variant.mcfunction +++ b/Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_common_variant.mcfunction @@ -24,4 +24,4 @@ execute if score $dungeon do2.utility.randomNum matches 18 run summon minecraft: execute if score $dungeon do2.utility.randomNum matches 19 run summon minecraft:tropical_fish ~ ~ ~ {Variant:185008129,Tags:["do2.manually_spawned"]} execute if score $dungeon do2.utility.randomNum matches 20 run summon minecraft:tropical_fish ~ ~ ~ {Variant:234882305,Tags:["do2.manually_spawned"]} execute if score $dungeon do2.utility.randomNum matches 21 run summon minecraft:tropical_fish ~ ~ ~ {Variant:235340288,Tags:["do2.manually_spawned"]} -execute if score $dungeon do2.utility.randomNum matches 22.. run function do2:mob_spawning/fish_counts/summon_common_variant +execute if score $dungeon do2.utility.randomNum matches 22.. run function do2:entity_controller/fish_counts/summon_common_variant diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_fish.mcfunction b/Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_fish.mcfunction similarity index 65% rename from Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_fish.mcfunction rename to Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_fish.mcfunction index e9531e18..68a7257f 100644 --- a/Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_fish.mcfunction +++ b/Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_fish.mcfunction @@ -1,4 +1,4 @@ scoreboard players set $dungeon do2.utility.randomNumberRange 10 function do2:utility/random_gen/generate_random_number -execute if score $dungeon do2.utility.randomNum matches ..8 run function do2:mob_spawning/fish_counts/summon_common_variant -execute if score $dungeon do2.utility.randomNum matches 9.. run function do2:mob_spawning/fish_counts/summon_random_variant +execute if score $dungeon do2.utility.randomNum matches ..8 run function do2:entity_controller/fish_counts/summon_common_variant +execute if score $dungeon do2.utility.randomNum matches 9.. run function do2:entity_controller/fish_counts/summon_random_variant diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_fish_markers.mcfunction b/Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_fish_markers.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_fish_markers.mcfunction rename to Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_fish_markers.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_random_variant.mcfunction b/Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_random_variant.mcfunction similarity index 85% rename from Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_random_variant.mcfunction rename to Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_random_variant.mcfunction index 526c4f35..35eb3b81 100644 --- a/Brilliance Datapack/data/do2/functions/mob_spawning/fish_counts/summon_random_variant.mcfunction +++ b/Brilliance Datapack/data/do2/functions/entity_controller/fish_counts/summon_random_variant.mcfunction @@ -1,4 +1,4 @@ summon minecraft:tropical_fish ~ ~ ~ {Variant:235340288,Tags:["determine_variant","do2.manually_spawned"]} -function do2:mob_spawning/fish_counts/determine_variant +function do2:entity_controller/fish_counts/determine_variant execute store result entity @e[type=minecraft:tropical_fish,tag=determine_variant,limit=1] Variant double 1 run scoreboard players get $dungeon do2.utility.fishVariant tag @e[type=minecraft:tropical_fish,tag=determine_variant] remove determine_variant diff --git a/Brilliance Datapack/data/do2/functions/force_vex_tracking.mcfunction b/Brilliance Datapack/data/do2/functions/entity_controller/force_vex_tracking.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/force_vex_tracking.mcfunction rename to Brilliance Datapack/data/do2/functions/entity_controller/force_vex_tracking.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/kill_bad_mobs.mcfunction b/Brilliance Datapack/data/do2/functions/entity_controller/kill_bad_mobs.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/mob_spawning/kill_bad_mobs.mcfunction rename to Brilliance Datapack/data/do2/functions/entity_controller/kill_bad_mobs.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/events/on_20_ticks.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_20_ticks.mcfunction index 78aefb7f..abe913df 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_20_ticks.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_20_ticks.mcfunction @@ -15,20 +15,20 @@ execute if score $dungeon do2.utility.dungeonRepair matches 1 positioned -548 41 execute if score $dungeon do2.config.batDistraction matches 1 as @e[type=minecraft:bat,tag=!mobcap] at @s unless entity @s[z=1933,dz=-200] run tp @s ~ -200 ~ execute if score $dungeon do2.config.batDistraction matches 0 as @e[type=minecraft:bat,tag=!mobcap] at @s run tp @s ~ -200 ~ # Ensure correct bat count for L3 & L4 -execute if score $dungeon do2.config.batDistraction matches 1 if score $dungeon do2.config.amountOfBats matches 1.. run function do2:mob_spawning/ensure_bat_count +execute if score $dungeon do2.config.batDistraction matches 1 if score $dungeon do2.config.amountOfBats matches 1.. run function do2:entity_controller/ensure_bat_count # Ensure correct glow squids -function do2:mob_spawning/ensure_glow_squid_count +function do2:entity_controller/ensure_glow_squid_count # Ensure correct fish counts -function do2:mob_spawning/ensure_fish_count +function do2:entity_controller/ensure_fish_count # Kill all not allowed mobs. -function do2:mob_spawning/kill_bad_mobs +function do2:entity_controller/kill_bad_mobs # Figure out where players are -execute as @a[tag=!do2.fakePlayer,team=do2.players] at @s run function do2:locate_player +execute as @a[tag=!do2.fakePlayer,team=do2.players] at @s run function do2:utility/locate_player # Run any "area specific" actions -function do2:per_level_actions +function do2:utility/per_level_actions # IF player DOESN'T have the credits tab, set up ALL advancement's roots execute as @a[advancements={do2:visible/credits/credits_root=false}] run function do2:advancements/order_tabs diff --git a/Brilliance Datapack/data/do2/functions/events/on_datapack_load.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_datapack_load.mcfunction index d35d71a5..fed1ae8e 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_datapack_load.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_datapack_load.mcfunction @@ -15,7 +15,7 @@ function do2:scoreboard/setup/all # Setup stats room function do2:statistics_room/setup # Update cmd blocks -function do2:update_command_blocks +function do2:utility/update_command_blocks # Make all player's who may have joined already be setup execute as @a at @s run function do2:events/on_player_join @@ -28,7 +28,7 @@ execute unless score $dungeon do2.tests.doesTangoCamExist matches 1 run function scoreboard objectives remove do2.tests.doesTangoCamExist # Attempt to run dungeon_setup -schedule function do2:postpone_dungeon_setup 1s append +schedule function do2:utility/postpone_dungeon_setup 1s append # One time setup: gamerule spawnRadius 0 diff --git a/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction index 15f76bd0..cd18fbe0 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction @@ -23,7 +23,7 @@ execute if score $dungeon do2.run.active matches 2.. as @e[type=minecraft:evoker execute if score $dungeon do2.run.active matches 2.. as @e[type=minecraft:witch] if entity @s[nbt={ActiveEffects:[{Id:24}]}] run effect clear @s minecraft:glowing # Have vex track players better -execute if score $dungeon do2.config.vexTracking matches 1 run function do2:force_vex_tracking +execute if score $dungeon do2.config.vexTracking matches 1 run function do2:entity_controller/force_vex_tracking # Spectate Controller execute if score $dungeon do2.config.forceGamemode matches 1 run function do2:spectating_controller/spectator_logic diff --git a/Brilliance Datapack/data/do2/functions/events/on_game_end.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_game_end.mcfunction index e193fda6..5e761b04 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_game_end.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_game_end.mcfunction @@ -24,7 +24,7 @@ execute as @a[team=do2.ghosts] unless entity @s[tag=do2.won] run function do2:ev execute as @a[team=do2.players] if entity @s[tag=do2.won] run function do2:external/agronet/add_items/add_crowns # Reset Players -execute as @a[tag=!do2.fakePlayer] run function do2:reset_player +execute as @a[tag=!do2.fakePlayer] run function do2:scoreboard/reset_player # Unlock Settings function do2:scoreboard/config/config_unlock diff --git a/Brilliance Datapack/data/do2/functions/events/on_tick.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_tick.mcfunction index 738030af..d32ccafb 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_tick.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_tick.mcfunction @@ -21,11 +21,11 @@ execute if score $dungeon do2.utility.currentTick matches 10000000.. run scorebo execute as @a if score @s do2.utility.advancementOrdering matches 0 run function do2:advancements/grant_visible/all # track ticks/seconds in the dungeon. Also handles if dungeon is empty. -execute if score $dungeon do2.run.active matches 2 run function do2:dungeon_timer +execute if score $dungeon do2.run.active matches 2 run function do2:utility/dungeon_timer # For every UNTRACKED item, (item entities not tagged) # Mark the item as UNTRACKED -execute as @e[type=item,tag=!tracked] run function do2:as_item_entity +execute as @e[type=item,tag=!tracked] run function do2:utility/as_item_entity # Display GUI function do2:gui/display diff --git a/Brilliance Datapack/data/do2/functions/reset_player.mcfunction b/Brilliance Datapack/data/do2/functions/scoreboard/reset_player.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/reset_player.mcfunction rename to Brilliance Datapack/data/do2/functions/scoreboard/reset_player.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/as_item_entity.mcfunction b/Brilliance Datapack/data/do2/functions/utility/as_item_entity.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/as_item_entity.mcfunction rename to Brilliance Datapack/data/do2/functions/utility/as_item_entity.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/dungeon_timer.mcfunction b/Brilliance Datapack/data/do2/functions/utility/dungeon_timer.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/dungeon_timer.mcfunction rename to Brilliance Datapack/data/do2/functions/utility/dungeon_timer.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/locate_player.mcfunction b/Brilliance Datapack/data/do2/functions/utility/locate_player.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/locate_player.mcfunction rename to Brilliance Datapack/data/do2/functions/utility/locate_player.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/per_level_actions.mcfunction b/Brilliance Datapack/data/do2/functions/utility/per_level_actions.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/per_level_actions.mcfunction rename to Brilliance Datapack/data/do2/functions/utility/per_level_actions.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/postpone_dungeon_setup.mcfunction b/Brilliance Datapack/data/do2/functions/utility/postpone_dungeon_setup.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/postpone_dungeon_setup.mcfunction rename to Brilliance Datapack/data/do2/functions/utility/postpone_dungeon_setup.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/update_command_blocks.mcfunction b/Brilliance Datapack/data/do2/functions/utility/update_command_blocks.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/update_command_blocks.mcfunction rename to Brilliance Datapack/data/do2/functions/utility/update_command_blocks.mcfunction