Use AsyncPlayerSpawnLocationEvent for SpawnMatchModule on modern#1622
Use AsyncPlayerSpawnLocationEvent for SpawnMatchModule on modern#1622calcastor wants to merge 1 commit intoPGMDev:devfrom
Conversation
|
Draft until I actually test on SportPaper |
8cea5df to
5126b9c
Compare
|
This also works on SportPaper provided we only make the PGM event asynchronous on modern which isn't very surprising. I've renamed the event accordingly. |
| var pgmEvent = new PlayerSpawnLocationEvent(event.getSpawnLocation()); | ||
| handleCall(pgmEvent, event); | ||
| event.setSpawnLocation(pgmEvent.getSpawnLocation()); |
There was a problem hiding this comment.
it is likely unsafe to query pgm async for a spawn location, it probably needs to run in the main thread, at which point, why are we even trying to replace the old event that did just that
There was a problem hiding this comment.
PlayerSpawnLocationEvent is deprecated by Paper, hence.
If we don't care about that right now then I'll just suppress the deprecation warning for this specific event and call it a day. This seems like it could matter more in the future though.
There was a problem hiding this comment.
i'm aware of the deprecation, but it still is the event that fits us best, they've not added a 1:1 replacement as far as i know while the deprecated one works as intended
adf7703 to
7d9297a
Compare
Signed-off-by: BT (calcastor/mame) <43831917+calcastor@users.noreply.github.com>
Adds a shim of
AsyncPlayerSpawnLocationEventto handle Paper'sAsyncPlayerSpawnLocationEventon modern andPlayerSpawnLocationEventon legacy. This avoids early creation of the player object on modern by use of the deprecatedPlayerSpawnLocationEvent.Prior to Spigot support, PGM used to use
PlayerInitialSpawnEventfor SportPaper; perhaps we should use this again given that we have limited our supported platforms to SportPaper and modern Paper?