Fetchr

Fetchr

556 Downloads

Be better at documenting

NeunEinser opened this issue ยท 10 comments

commented

There is no documentation.
git gud

commented

Is #bingo:post_register_items the same thing as #bingo:post_registration?

  • storage bingo:items categories[].items - mentions #bingo:post_register_items
    # items: (Compund List) (readonly) List of all items this category has. Entries
    # have the same structure as in the items array. Will be created
    # automatically, after #bingo:post_register_items ran.
  • storage bingo:registries - mentions both:
    # To execute an action before the registries are processed but after all active
    # extension packs have registered everything, add a function to the function tag
    # #bingo:post_registration
    # In order to modify existing items, either added by the default bingo datapack,
    # or added by another extension pack, please use a function registered to the
    # function tag #bingo:post_register_items
  • no declaration for #bingo:post_register_items
  • #bingo:post_registration declaration:
    #>
    # Function tag for doing actions after the item registration, but before the
    # items are duplicated into the categories array.
    #
    # You may use this function tag for modifing existing items from the default
    # bingo item pool or from other extensio packs.
    #
    # @api
    #declare tag/function bingo:post_registration
    function #bingo:post_registration
commented

Maybe add info that bingo:items are generated from bingo:registries?

# This storage is used to keep track of all items that are available in
# Minecraft: Bingo.
#region initialize items
#>
# @within function bingo:init/*
#declare storage tmp.bingo:init
# initialize items
data modify storage tmp.bingo:init items set from storage bingo:registries items
data modify storage bingo:items categories set from storage bingo:registries categories
data remove storage bingo:items items
function bingo:init/initialize_items
execute unless data storage bingo:items activeTags run data modify storage bingo:items activeTags set value ["bingo:default"]
# Schedule to avoid maxCommandChainLength being hit (setting it in init doesn't work the first time)
schedule function bingo:util/apply_active_item_tags 1t
#endregion

commented

Add more info about strict mode (description, only used in MP)

#>
# Whether strict mode is turned on
#
# @internal
#declare score_holder $strict_mode
scoreboard players add $strict_mode bingo.settings 0

commented

Maybe encapsulate consts in #region consts?
#>
# Whether the card needs to be updated
#
# @internal
#declare score_holder $update_card
#>
# @public
#declare score_holder -2
scoreboard players set -2 bingo.const -2
#>
# @public
#declare score_holder -1
scoreboard players set -1 bingo.const -1

commented

Add declaration for #bingo:fill_registries
#region run registries
data remove storage bingo:registries categories
data remove storage bingo:registries items
data remove storage bingo:registries structures
data remove storage bingo:registries hud_components
data remove storage bingo:registries preferences
function #bingo:fill_registries

commented

Explain registration of own items (or delete line 5 if it's to be done somewhere else)
#> bingo:init/fill_registries
#
# Registers everything in vanilla bingo.
#
# To register your own ite

commented

Add declaration for #bingo:fill_registries

#region run registries
data remove storage bingo:registries categories
data remove storage bingo:registries items
data remove storage bingo:registries structures
data remove storage bingo:registries hud_components
data remove storage bingo:registries preferences
function #bingo:fill_registries

Only tags that are not otherwise declared (through a file) are declared with #declare. Unfortunately DPH+/SPYglass/IMP does currently not support documentation for tags like that.
See Arcensoth/imp-spec#1

commented

Is #bingo:post_register_items the same thing as #bingo:post_registration?

  • storage bingo:items categories[].items - mentions #bingo:post_register_items

    # items: (Compund List) (readonly) List of all items this category has. Entries
    # have the same structure as in the items array. Will be created
    # automatically, after #bingo:post_register_items ran.

  • storage bingo:registries - mentions both:

    # To execute an action before the registries are processed but after all active
    # extension packs have registered everything, add a function to the function tag
    # #bingo:post_registration

    # In order to modify existing items, either added by the default bingo datapack,
    # or added by another extension pack, please use a function registered to the
    # function tag #bingo:post_register_items

  • no declaration for #bingo:post_register_items

  • #bingo:post_registration declaration:

    #>
    # Function tag for doing actions after the item registration, but before the
    # items are duplicated into the categories array.
    #
    # You may use this function tag for modifing existing items from the default
    # bingo item pool or from other extensio packs.
    #
    # @api
    #declare tag/function bingo:post_registration
    function #bingo:post_registration

I think #bingo:post_register_items is the old name when nothing else but items were registered.

commented

Is lacking @context here?

#> bingo:game/start/set_spawn
#
# Sets the spawnpoint for all players and spawns a marker aec incase the player
# respawns in the overworld
#
# @within function bingo:game/start/countdown

from here (at @a[...):

execute if score $start_game.countdown bingo.schedule matches 3 at @a[predicate=bingo:is_in_game, limit=1] align xz positioned ~0.5 ~ ~0.5 run function bingo:game/start/set_spawn

commented

I think it's good enough now. No need to keep track of this issue anymore.