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 paper's player isConnected method #6100

Closed
1 task done
Fusezion opened this issue Oct 5, 2023 · 4 comments
Closed
1 task done

Add paper's player isConnected method #6100

Fusezion opened this issue Oct 5, 2023 · 4 comments
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).

Comments

@Fusezion
Copy link
Contributor

Fusezion commented Oct 5, 2023

Suggestion

Add OfflinePlayer#isConnected into skript.

Why?

This method is a better alternative to isOnline for while loops and not added yet

Other

Link to it's documentation: https://jd.papermc.io/paper/1.20/org/bukkit/OfflinePlayer.html#isConnected()
This is a paper 1.20.1 method if I remember properly

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.
@sovdeeth sovdeeth added enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements). good first issue An issue that would be good for a first-time contributor to make a PR for labels Oct 5, 2023
@TheLimeGlass
Copy link
Collaborator

TheLimeGlass commented Oct 5, 2023

I don't believe this is a good addition to Skript.
Skript stores the instance of the OfflinePlayer, and once that instance has left the server, it will always be false until a new instance is created of the offlineplayer as stated in the JavaDoc.

The method makes sense for Paper, as a plugin may store Collections of OfflinePlayers, not Skript.

@TheLimeGlass TheLimeGlass added the up for debate When the decision is yet to be debated on the issue in question label Oct 5, 2023
@Fusezion
Copy link
Contributor Author

Fusezion commented Oct 5, 2023

I don't understand your message Mr. Lime, this has nothing to do with skript's instance fully and is mostly there for while loops where we're actively using while {_p} is online or while player is online both of these cases are not gonna be affected by using is connected

To add to this, I've already had this within SkBee for awhile now with no reports of issues when using it. Like I said this is mostly for while loops where the issue of multiple loops are from is online

@sovdeeth
Copy link
Member

sovdeeth commented Oct 5, 2023

Skript stores the instance of the OfflinePlayer, and once that instance has left the server, it will always be false until a new instance is created of the offlineplayer as stated in the JavaDoc.

That's kind of the point. Right now you can't tell if a player has left and rejoined between calls to is online, so adding this would allow you to tell if the player has relogged in the interim.

@Moderocky
Copy link
Member

I think I've done what you wanted but I don't fully understand so please check my PR and see if it's what you're looking for :)

@Moderocky Moderocky added PR available Issues which have a yet-to-be merged PR resolving it and removed up for debate When the decision is yet to be debated on the issue in question labels Oct 6, 2023
@TheLimeGlass TheLimeGlass removed the good first issue An issue that would be good for a first-time contributor to make a PR for label Oct 6, 2023
@APickledWalrus APickledWalrus added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Projects
None yet
Development

No branches or pull requests

5 participants