* Improve pipeline
This simplifies all pipeline code and ensures some listeners like the sizer are always present. The code already assumed that the sizer is always there and thus causes issues. The sizer can be deactivated still now and has pretty much no performance losses from this. The profit from this PR is that there is less logic with modifying the PR and thus developers interacting with the channel can assume specific things about the order and placements of elements in the pipeline. This will be useful once ViaVersion is supported, and it is expected that certain elements always are in the pipeline and don't change. My plan is to also always have an encryption and compression handler in the pipeline that is controlled via AttributeKeys from netty, but for that first #828 needs to be merged. So this PR only completes the goal partially, but that's fine. PR is ready for review like it is right now.
* Revert some stuff
* Fix channel race condition
* Fix closing race condition
* Prevent client race conditions.
* Fix test failure, idk how, idk why, but it works now
* Address review
* Update protocol/src/main/java/org/geysermc/mcprotocollib/network/BuiltinFlags.java
Co-authored-by: Konicai <71294714+Konicai@users.noreply.github.com>
* Update protocol/src/main/java/org/geysermc/mcprotocollib/network/BuiltinFlags.java
Co-authored-by: Konicai <71294714+Konicai@users.noreply.github.com>
* Update protocol/src/main/java/org/geysermc/mcprotocollib/network/BuiltinFlags.java
Co-authored-by: chris <github@onechris.mozmail.com>
* Update protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java
Co-authored-by: chris <github@onechris.mozmail.com>
* Update protocol/src/main/java/org/geysermc/mcprotocollib/network/BuiltinFlags.java
Co-authored-by: chris <github@onechris.mozmail.com>
* Update protocol/src/main/java/org/geysermc/mcprotocollib/network/BuiltinFlags.java
Co-authored-by: chris <github@onechris.mozmail.com>
* Update protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java
Co-authored-by: chris <github@onechris.mozmail.com>
* Update protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java
Co-authored-by: chris <github@onechris.mozmail.com>
* Update protocol/src/main/java/org/geysermc/mcprotocollib/network/tcp/TcpServer.java
Co-authored-by: chris <github@onechris.mozmail.com>
---------
Co-authored-by: Konicai <71294714+Konicai@users.noreply.github.com>
Co-authored-by: chris <github@onechris.mozmail.com>
This basically makes MinecraftCodec stateless and removes unused APIs.
The MinecraftCodecHelper has a state for an unused registry API, which is not needed at all. Developers can just send their own registry as seen in ServerListener. These only exist because there was an attempt at allowing multi-version support inside MinecraftCodecHelper, but that's not gonna be necessary if ViaVersion support gets added to MCPL.
The option to add back logic for multi-version support is fully open for the future. I didn't remove MinecraftCodecHelper being instance-based, so it's fully possible to readd the multi-version logic back in the future. Just level events and sounds being dynamic is not enough for multi-version support and thus should be removed to streamline the API.
This also removes many workarounds from the code that cause possible inconsistency. Often the MinecraftCodecHelper gets initialized in the tests with empty parameters. This removes them as parameters and removes the need to provide them by moving them to the object itself.
PacketCodecs were also improved to decrease the inheritance issues and streamline the code flow and remove the UnsupportedOperationExceptions being needed.
BufferedPacket was also removed since it's useless for Minecraft.
* Fix edge-case where Texture#toString has a NullPointer because gson set a null metadata
Also changes NORMAL name to WIDE since that's the accurate name.
* Fix join requests
Fixes#837
* Use translatable components like vanilla and cleanup type casts
Just a few messages becoming dynamic using translatable components like vanilla instead of being hardcoded.
* Use checkerframework
* Readd disconnect string methods
* Do not make nullable
* Make code more readable before changes
* Use proper kyori methods
* Make PlayerInfo and VersionInfo optional
* Sort ServerStatusInfo fields in the way they appear in the packet
* Initial work on moving over mcauth
* Initial work on importing MinecraftAuth
* Make compile
* Remove extra headers code
* Switch to different http utils
* Merge changes
* Cleanup
* Remove unused exceptions and constructors
* Implement proxies
* Fixup proxy stuff
* Cleanup
* Remove SR license header
* Remove custom exceptions
* Move auth into main module
Auth has become so small that it's not worth keeping separate
* Make ProxyInfo be part of network again
* Fix indent
* Allow null id and name in GameProfile
* Fix remaining logs
* Make texture checker more accurate
* Fix spaces
* Update dependencies
* Remove usage of var
* Use faster approach for reading raw uuids.
* Use built-in ResourceLocation type
* Use kyori Key instead of built-in type
* Fix missing keys
* Fix packets with incorrect resource location types
* Fix more packets with invalid resource locations
* Update jigsaw packet to use ResourceLocation
* Fix test compilation
* Fully use Key for ResourceProperties
* Fix all Key.key() warnings
* Fix HolderSet revert
* Address review
* Implement HolderSet class and cleanup item codec
* Also validate both being set case
* Fix equals and hashcode by migrating from a record to a class
* Change field names to match vanilla