Skip to content

Detect AFK Players 1.20.1 backport #83

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

Closed
wants to merge 4 commits into from

Conversation

iantheone234
Copy link

Wrote a workaround for the "return run" functionality within the constraints of Minecraft version 1.20.1

@iantheone234 iantheone234 marked this pull request as draft April 21, 2025 18:29
@iantheone234 iantheone234 marked this pull request as ready for review April 21, 2025 18:34
@clo4
Copy link
Owner

clo4 commented May 3, 2025

Sorry for the delay, haven't had the mental bandwidth to do anything other than my job the last few weeks 🥲

Thanks for drafting this up! Good signal that it would be worth backporting the newer features. (fwiw, Detect AFK does support older versions of the game, but it doesn't have the features from v1.2 which some of the addons now require)

The build system this repo uses is a little different in that it uses Nix, but this also yields great flexibility to do things like applying patches during the build process. I'll explore what that would look like before reimplementing the logic in the functions folder but slightly differently.

It looks like you took a lot of care to maintain really low overhead! Very clean. If I go a different direction, I may still end up using parts of this, in which case you'll of course be credited as co-author. Will keep this PR open until I know how to proceed.

@clo4
Copy link
Owner

clo4 commented Jul 26, 2025

In the time since I last replied I was working a lot, went through a heap of job interviews, became very tired all the time, started another job, and slowly regained my ability to function as a human. Whew! Anyway, I finally have the energy in me to pick this up again.

I've decided to close this PR in favor of #87 - I use a similar solution (using a scoreboard value to track whether the logic has "branched") but I integrated it directly into the build system. This isn't something I'd expect another human to go through, nor be willing to subject someone to without a good relationship first :p Having the change built as a patch allows me to maintain just one version of the code and simultaneously have a different code path for older versions of the game. This was the technique I orignally used to make afk-sleep work in older versions too.

Thank you for creating this PR and for letting me know it's worth the effort to backport! I really appreciate it and that you put the work in to make it work.

@clo4 clo4 closed this Jul 26, 2025
@clo4
Copy link
Owner

clo4 commented Jul 26, 2025

I've released the new version now: https://modrinth.com/datapack/detect-afk/versions
Thanks again @iantheone234!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants