Skip to content
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

Add undead players and animi shamir compatibility #935

Merged
merged 3 commits into from
Jan 6, 2024

Conversation

misode
Copy link
Member

@misode misode commented Jan 5, 2024

This adds the gm4_player_death library, which detects player deaths and then calls 4 main function hooks, on order:

  • #gm4_player_death:soul_bound: catch items that should return to the player
  • #gm4_player_death:relocate: catch items that should end up somewhere else
  • #gm4_player_death:grave: summon a grave or catch the remaining items
  • #gm4_player_death:death: anything else

These phases are up for discussion, and more can be added in the future without breaking compatibility.

misode added 2 commits January 5, 2024 23:23
- the gm4_animi_leave score could increase past 1 and the rejoin advancement would never trigger
@misode misode added fix This fixes something that was wrong quality-update Improves efficiency or structure without affecting functionality of a module labels Jan 5, 2024
Copy link
Member

@BPR02 BPR02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but there are some leftover advancement revokes and scoreboard objective resets. I also left a comment about versioning the function tag this library calls.

Additionally, ZC has a death check, but doesn't use an advancement to detect it, instead relying on a schedule loop (player/submain) to check the score and run the event. It may be worth it to make ZC use this library.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be versioned? I think this is okay unversioned if we plan to never remove any of the values or rearrange the current values (which is a reasonable assumption to make; this would basically require us to never make a breaking change, thus major version will always be 1). Without versioning we can only insert new values to this function tag (tho depending on how MC merges function tags, that may also cause issues with the order of future insertions).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe one slight bit of pedantry that should at least be discussed:
Do we want to name these function tags after explicit uses or generic descriptions? E.g. should it be #gm4_player_death:soul_bound or #gm4_player_death:item_manipulating?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think it's good to be explicit about these. All 4 phases can do item manipulation (soul bound, void fishing, graves). The point of these different phases is to make the priority predictable. I see soul_bound as being filtering on item properties, relocate on filtering based on the environment, grave as a catch all for item filtering, and death as anything after all items have been processed. If we have good generic names for those 4 phases I think I would prefer that but these explicit examples are fine for me as well.

@misode
Copy link
Member Author

misode commented Jan 6, 2024

I did notice the ZC check, but decided to leave it because it would probably conflict with #885

As for versioning the private tag, I don't think that's necessary since we wouldn't ever want to remove phases. Unless you see a good use case for it, and think it should include the major version?

@Bloo-dev Bloo-dev self-assigned this Jan 6, 2024
@Bloo-dev
Copy link
Member

Bloo-dev commented Jan 6, 2024

Zauber Cauldrons will no longer require any death checks once #885 has been merged, so there's nothing to re-write there.

Copy link
Member

@BPR02 BPR02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I don't think versioning the function tag is necessary

@misode misode merged commit 0378575 into Gamemode4Dev:master Jan 6, 2024
1 check passed
@misode misode deleted the lib-player-death branch January 6, 2024 22:05
github-actions bot pushed a commit that referenced this pull request Jan 6, 2024
* Add player death library to make undead players and animi shamir compatible

* Fix issue when animi shamir module is removed and later re-added
- the gm4_animi_leave score could increase past 1 and the rejoin advancement would never trigger

* Remove unused scoreboard in undead players + fix edge case when disabling module
SpecialBuilder32 added a commit to SpecialBuilder32/GM4_Datapacks that referenced this pull request Jan 8, 2024
commit 2a42d4b
Author: Misode <[email protected]>
Date:   Sun Jan 7 04:39:03 2024 +0100

    Fix command typo in player death library
    Not sure how this slipped through, I noticed while running the tests so I guess that's a good thing

commit 0378575
Author: Misode <[email protected]>
Date:   Sat Jan 6 23:05:25 2024 +0100

    Add undead players and animi shamir compatibility (Gamemode4Dev#935)

    * Add player death library to make undead players and animi shamir compatible

    * Fix issue when animi shamir module is removed and later re-added
    - the gm4_animi_leave score could increase past 1 and the rejoin advancement would never trigger

    * Remove unused scoreboard in undead players + fix edge case when disabling module

commit 8068bd4
Author: Bloo <[email protected]>
Date:   Thu Jan 4 13:54:32 2024 +0100

    Auto Crafting: Fix Recipe Shape Update Advancement (Gamemode4Dev#928)

    Makes Auto Crafters work in 1.20.3-1.20.4. An undocumented change in text components had broken the recipe shape detection.

commit 032de39
Author: Misode <[email protected]>
Date:   Tue Jan 2 02:04:44 2024 +0100

    Fix compression level lore (Gamemode4Dev#933)

    * Fix compression level lore

    * Remove extra space

    * Return to using `×` (U+00d7)

    This was accidentally changed back to `*` by PR#867 (1.19.4 Update).

    ---------

    Co-authored-by: Bloo <[email protected]>

commit 5c47354
Author: Misode <[email protected]>
Date:   Sat Dec 30 16:53:39 2023 +0100

    Only fetch latest commit in build workflow

commit 34a0047
Author: BluePsychoRanger <[email protected]>
Date:   Sun Dec 24 14:46:04 2023 -0800

    Fix Custom Cart Placement (Gamemode4Dev#929)

    * Fix Custom Cart Placement

    1.20.3 changed the string format once again. This fixes placement of our custom carts.

    Auto Crafters are still broken, but Gamemode4Dev#928 fixes that separately.

    Also changes the name of newly placed tunnel bores to include a translate tag since the names are visible now.

    * Beet config for overlay loading

    ---------

    Co-authored-by: SpecialBuilder <[email protected]>

commit 93ccbed
Author: Misode <[email protected]>
Date:   Sun Dec 24 23:44:29 2023 +0100

    Fix custom crafter creation not requiring a crafting table
    This advancement incorrectly upgraded in Gamemode4Dev#872
    Faulty commit: 5ea12a8

commit c672701
Author: Misode <[email protected]>
Date:   Sat Dec 16 20:29:11 2023 +0100

    Update soul glass block state predicate for 1.20.2 (Gamemode4Dev#927)

commit 0c43add
Author: Misode <[email protected]>
Date:   Mon Dec 11 23:12:05 2023 +0100

    Fix ender bolt tridents in the ground not spreading (Gamemode4Dev#926)

commit ea8d16f
Author: Misode <[email protected]>
Date:   Sat Dec 9 12:57:22 2023 +0100

    Trapped Signs: Add support for trapped hanging signs (Gamemode4Dev#913)

commit 5ae9941
Author: Bloo <[email protected]>
Date:   Fri Dec 8 16:30:23 2023 +0100

    Double Doors: Close doors automatically after a player walks through (Gamemode4Dev#920)

    Introduces auto-closing to Double Doors. When a player opens a door a marker is spawned which lingers around for a few seconds. If a player walks through that marker within that time, the associated door will be closed (i.e. returned to the state it was in before the player clicked it) automatically behind the player. As with the current Double Doors, sneaking prevents this behavior.
    ---------
    Co-authored-by: SpecialBuilder <[email protected]>

commit 904bf97
Author: Misode <[email protected]>
Date:   Thu Dec 7 16:50:18 2023 +0100

    Add support for 1.20.4

commit 21fc83f
Author: Misode <[email protected]>
Date:   Wed Dec 6 00:03:55 2023 +0100

    Add 1.20.3 to list of supported version

commit 43922da
Author: Misode <[email protected]>
Date:   Tue Dec 5 23:55:02 2023 +0100

    Add support for 1.20.3 (Gamemode4Dev#923)

    * Update grass -> short_grass

    * Update overlay pack format ranges

    * Update Fuse -> fuse

    * Update the supported formats

    * Update Trident -> item

commit 73e2bf7
Author: Misode <[email protected]>
Date:   Tue Dec 5 13:08:55 2023 +0100

    Fix typo in display frames description

commit cb4fa13
Author: Misode <[email protected]>
Date:   Tue Dec 5 10:48:47 2023 +0100

    Fix AEC duration in overlay_18 (Gamemode4Dev#924)

commit e2e875c
Author: Bloo-dev <[email protected]>
Date:   Sat Nov 25 15:44:00 2023 +0100

    Reduce Size of Bookshelf Inspector Image

commit 38b7304
Author: Thanathor <[email protected]>
Date:   Wed Nov 22 18:54:09 2023 +0100

    Fix bookshelf inspector not properly deleting markers (Gamemode4Dev#921)

commit d30102d
Author: Bloo <[email protected]>
Date:   Tue Nov 21 14:27:22 2023 +0100

    Bookshelf Inspector: Link Modrinth & Smithed Projects

commit bea8fe6
Author: Thanathor <[email protected]>
Date:   Tue Nov 14 23:42:55 2023 +0100

    fix note location (Gamemode4Dev#919)

commit 18ee74e
Author: Thanathor <[email protected]>
Date:   Tue Nov 14 22:48:48 2023 +0100

    Bookshelf Inspector (Gamemode4Dev#907)

    Shows a text hint when hovering over any book in a Chiseled Bookshelf!

    ---------

    Co-authored-by: Misode <[email protected]>

commit ee28dc3
Author: Misode <[email protected]>
Date:   Mon Nov 13 21:23:19 2023 +0100

    Remove redundant check-commands github action

commit 5c33b89
Author: SpecialBuilder <[email protected]>
Date:   Sun Nov 5 19:05:00 2023 -0500

    Add MC-264739 compensation to 1.20.2 overlays

    Fixes Gamemode4Dev#916 - 1.20.2 requires non-string blockstates in predicates to be quoted now.

commit 80ff94f
Author: SpecialBuilder <[email protected]>
Date:   Wed Nov 1 23:58:41 2023 -0400

    Delete extraneous load directory

commit a76da1e
Author: Misode <[email protected]>
Date:   Tue Oct 31 12:48:18 2023 +0100

    Update mecha version in test workflow

commit c615159
Author: Misode <[email protected]>
Date:   Tue Oct 31 00:38:16 2023 +0100

    Fix Gamemode4Dev#911 lib brewing ray not working (Gamemode4Dev#912)

commit 3c85f6e
Author: Misode <[email protected]>
Date:   Wed Oct 25 16:03:46 2023 +0200

    Fix missing effect changes for 1.20.2 (Gamemode4Dev#910)

    * Add new overlays

    * Fix missing effect changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix This fixes something that was wrong quality-update Improves efficiency or structure without affecting functionality of a module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants