Skip to content

Advancements #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft

Advancements #137

wants to merge 20 commits into from

Conversation

p1k0chu
Copy link
Contributor

@p1k0chu p1k0chu commented Apr 4, 2025

meh
no tree builder no node stuff just advancements here (means have to manually set the position)
boop:

val root = AdvancementManager.addAdvancement(
    advancement("dockyard:tab1/root") {
        withTitle("<blue>Dockyard")
        withDescription("On github!!!\nDockyardMC/Dockyard")
        withIcon(Items.LAPIS_BLOCK)
        withBackground(Blocks.CHERRY_LEAVES)
        withPosition(0f, 0f)
    })

val advApi = AdvancementManager.addAdvancement(
    advancement("dockyard:tab1/advancements") {
        withParent(root.id)

        withTitle("Advancements API")
        withDescription("Soon! Maybe! Probably!")
        withIcon(Items.PAPER)
        withPosition(0.5f, 1f)
    })

there are toasts (the only reason you wanted advancements)
Player.showToast extension function that takes title, icon and a frame

also event for when player selects an advancement tab

@LukynkaCZE LukynkaCZE added priority:2 Moderately important. Relied on by some users or impeding the usability area/packets area/other type/cosmetic type/missing-implementation labels Apr 5, 2025
@LukynkaCZE LukynkaCZE linked an issue Apr 5, 2025 that may be closed by this pull request
p1k0chu added 2 commits April 7, 2025 13:00
removed TODO because codefactor shut up
* fix multiple ConcurrentModificationException :skull emoji:
@LukynkaCZE
Copy link
Contributor

How is this going :3

Are you planning on merging to 1.21.4 still? 1.21.5 will take a WHILE

@p1k0chu
Copy link
Contributor Author

p1k0chu commented Apr 13, 2025

yes, im not waiting for 1.21.5,
but i kinda want to make advancements just viewable (so you can send them to individual players)
like with a boss bar

+ need to fix stuff, like when deleting an advancement that has children, clients also delete all the children recursively, so need to keep track of that on server-side too

also might actually make advancements mutable now that advancements will keep track of their children (you need to delete advancement and add it again to update properties, and then you probably need to send all the children again)

@LukynkaCZE
Copy link
Contributor

oki got it

p1k0chu added 6 commits April 15, 2025 14:17
Keep track of advancement's children and parent.
its useless but since progress map is private
might be good to have some public function to get progress
instead of having one billion collections
just send a packet to a client
when you add advancement, or remove, or change progress

* fix: add advancement viewers to the list
* fix: when disposing PlayerAdvancementTracker remove itself
from all visible advancements
because if you send progress of an advancement, you need to send the
full progress of that advancement
dont need to send every advancement tho
p1k0chu added 3 commits April 15, 2025 22:54
also get rid of advancement display,
in favor of just always having it (previously it was nullable).
because displayless advancements are COMPLETELY useless here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/other area/packets priority:2 Moderately important. Relied on by some users or impeding the usability size/XL type/cosmetic type/missing-implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add achievement API
2 participants