Skip to content

Commit

Permalink
refactor last of the files
Browse files Browse the repository at this point in the history
  • Loading branch information
Frustrated-Programmer committed Jan 11, 2025
1 parent 61b8f48 commit 21a8e2c
Show file tree
Hide file tree
Showing 22 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 21a8e2c

Please sign in to comment.