4drian3d / 4drian3d/SignedVelocity

Detect the need and implement handling for legacy AsyncPlayerChatEvent

Offen
#151 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
wontfix
Vorherrschende Sprache
Java
Sterne
73
Forks
23
Ø Merge
11 Std. 19 Min.
Gemergte PRs (30 T.)
9

Beschreibung

SignedVelocity has first-class support for AsyncChatEvent, which is fantastic. However, for multiple reasons, it should support `AsyncPlayerChatEvent`, and not just in a separate (and unmaintained) repository like https://github.com/4drian3d/SignedVelocity-Legacy.

### Proposal
SignedVelocity could easily check `AsyncPlayerChatEvent.getHandlerList()` to see if there are any listeners, and if so, add handling for this event. If I remember correctly, the AsyncPlayerChatEvent happens first. Thus, existing logic and data could be re-used, except that SignedVelocity could perform a "peek" on the data queue while listening to it (whereas standard "poll" is reserved for AsyncChatEvent).

If you want to discourage usage of `AsyncPlayerChatEvent`, which is certainly a worthy goal, this could also be an opportunity to print a warning message.

### Motivation
Besides it being already difficult to debug chat cancelation across plugins, SignedVelocity introduces another complication. By forgoing to implement the AsyncPlayerChatEvent in the main repository, SignedVelocity causes unexpected behavior when interacting with established or aged chat plugins. This plugin is advertised on Modrinth as transmitting chat event behavior to the backend servers, but if there are cases where that fails, then SignedVelocity starts to fail in its stated objective.

AsyncPlayerChatEvent may be deprecated. However, it is still supported API, and it is a go-to for plugins that want to run on Spigot. We may see plugins continue to use this event for several years, and I don't think SignedVelocity is in a good position to push everyone toward Paper & `AsyncChatEvent` - at least not instantly, which is why I suggested a warning message.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Look at the existing AsyncChatEvent handling in the codebase, likely in a main plugin class. Find where event listeners are registered and data queues are managed. Check AsyncPlayerChatEvent.getHandlerList() to understand listener detection. The change involves adding conditional logic, possibly a 'peek' operation on the queue, and a warning message. Test with plugins that use the legacy event.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
api, backend
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.