-
-
Notifications
You must be signed in to change notification settings - Fork 43
Feat: PacketEvents support #256
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
Conversation
Also began implementing ProtocolPlatform instance for PacketEvents. Made some adjustments to PreChatPacketSendEvent, as that directly references ProtocolLib PacketContainers, which isn't ideal as PE code also needs to trigger that event. We've thought of making a wrapper but more thought needs to be invested concerning what information would actually be stored within that wrapper that would actually be useful (after all, it's in the API so it needs to be relatively usable), as well as needing to figure out a nice way to map the PacketWrapper<?>(s) (PE) and PacketContainer(s) (PLib) to this wrapper.
DummyPlayer used to just use the shaded version of ByteBuddy within ProtocolLib (along with a utility class). To remove the dependency on ProtocolLib, we have shaded and relocated ByteBuddy ourselves, and implemented the necessary utility classes.
1. Previously I installed the latest version of ByteBuddy, which uses Java 24 (class ver 68). As IC compiles with Java 8, I had to downgrade to v1.15.11 which compiles with java 8. 2. A PlayerUtils method used PLib code directly.
|
This PR is now able to be compiled. This message will be edited with updates.
Identified an issue where placeholders are not parsed. Likely a result of reflection issues. |
Thanks to the FANTASTIC decision of PacketEvents to shade Adventure API and NOT shade it, we encounter a large amount of errors, where we try to provide our own instance of Adventure (which is shaded and relocated), which obviously won't work. We can't have any helper classes that convert to PE's shaded adventure because it's shaded but not relocated, so any instance of it will just be relocated by the compiler to our shaded version. In the end, we do a bunch of reflection fuckery.
|
Okay. Due to PacketEvents not relocating Adventure, and have confirmed they won't be (at least for a while), PacketEvents support will be provided in two steps:
This PR won't be ready for review until the actual addon is created. |
|
Will be finishing and testing later this week. |
|
This PR is ready for review. If you wish to test, please download the latest release from https://github.com/TerraByteDev/InteractiveChat-PacketEvents/releases/tag/v1.0.5 and the following InteractiveChat plugin https://github.com/Skullians/InteractiveChatPacketEvents/releases/tag/v4.2.17.0 That release will be periodically updated with future commits (the file will be different, same name) |
common/src/main/java/com/loohp/interactivechat/InteractiveChat.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/loohp/interactivechat/api/events/PreChatPacketSendEvent.java
Outdated
Show resolved
Hide resolved
|
@Skullians Is this project discontinued? Or is it just for your server? |
|
@MVanilla This isn’t quite ready yet, I’m still ironing out some bugs, and my time is limited. |
! THIS IS A DRAFT PR. This is purely to track progress and to allow code reviewing. It is not yet completed nor is it stable. !
PR Summary:
This PR adds compatibility for PacketEvents, while maintaining ProtocolLib compatibility as well.
The default selected plugin is PacketEvents, and is found in the
config.ymlunderSettings.TODO: