-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 PlayerLoadedWorldEvent #11940
base: main
Are you sure you want to change the base?
Add PlayerLoadedWorldEvent #11940
Conversation
paper-api/src/main/java/io/papermc/paper/event/player/PlayerLoadedEvent.java
Outdated
Show resolved
Hide resolved
paper-server/patches/sources/net/minecraft/world/entity/player/Player.java.patch
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally a bit unsure on both the naming of the event and the exposed caused.
PlayerLoadedEvent can mean a lot, the packet name is fine-ish given it is a packet.
But in the context of the API, it could easily be confused for player data being loaded. As for alternative suggestions, uh nothing immediately comes to mind?
PlayerClientLoadedEvent?
In regards to the cause, I'd rather not introduce the concept of "packet" triggered.
Tho I am having a bit of a hard time to think of a usecase for the cause, so if you can elaborate on that, maybe that'll help my understanding 👍
Hm yeah I can try to find a better name for the class (my personal favourite would be I added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since lynxplay mentioned bad naming, I have some suggestions
paper-api/src/main/java/io/papermc/paper/event/player/PlayerLoadedEvent.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/event/player/PlayerLoadedEvent.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you accidentally removed unused imports in the newest commits
...-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch
Outdated
Show resolved
Hide resolved
...-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch
Outdated
Show resolved
Hide resolved
Why not |
83ef0b8
to
7193f14
Compare
7193f14
to
edba3c0
Compare
edba3c0
to
f60ad31
Compare
I don't like the term |
I just feel it's important not to name it something that sounds like Bukkit-level actions, but rather is a later phase of joining a server. Don't mind Use-case wise I can see a lot of visual-state things I would move into something like this, setting team packets, checking for player notifications, or anything that a player wouldn't need to "see" while still loading the game. Many clients do crash/timeout/etc during the join process as well, so not having to do extra work in those cases is attractive. |
Maybe PlayerLoadedInWorldEvent? |
Realistically, it is an event that is called when the client finished loading into the world. |
|
I am also good with |
Starting with Minecraft 1.21.4, the client sends a newly
player_loaded
packet as soon as the client closes the downloading terrain screen / starts rendering the world. This PR adds a new event so plugins can execute/delay code until a player is considered as loaded, which happens if they send the packet or if they haven't sent the packet for 60 ticks.Same as PaperMC/Velocity#1466
I would appreciate any feedback on the API.