Rework adventure handling#1505
Conversation
We instead add adventure-platform-fabric as a dependency
|
That's a good way to solve problem, but I think relocate is the better solution because it's easier to support. I don't think deserialize/serialize causes any critical latency, but I haven't tested it. For example, I give my users a choice for this, and when they enable deserialize/serialize mode, they don't feel any message delay, even though my plugin sends messages through PacketEvents and it happens almost every tick. I haven't tested both cases, so I can't say for sure that this is a great way to do it, but I don't think it will be a bottleneck in PacketEvents. Anyway, thank you for your work. You're doing a lot |
I get where you are coming from, but this still has the issue of breaking changes |
Developers will have to choose between using Kyori from PacketEvents or from Paper. In my personal experience with Paper, I very rarely need to use Kyori because most messages are sent through PacketEvents, which is more convenient. Developers also have the option to relocate Kyori and PacketEvents libraries together to use their own version of Kyori. I understand this is a breaking change, so it's probably best to discuss this for version 3.0.0. For now, your solution is good |
|
Im vouching for either 1 or 4 First option sucks for packevents but works. |
|
im sorry to question this but how would this fix #1500 ? it's a compile-time induced error not really dependent on the adventure version in the server basically if packetevents is compiled with 4.26.1 you can't call any Serializer#builder on 5.0.1 if its compiled with 5.0.1 you can't call Serializer#builder in older versions |
|
Would this approach fix the sponge problem? We shade adventure-nbt since sponge doesn't include it, but if two plugins shade it then everything breaks; so would this be checking if adventure-nbt exists and then download and install it if not? |
@iiAhmedYT with this PR, we would no longer shade the adventure gson serializer ourselves but download it at runtime matching the adventure version currently installed on the platform (or defaulting to 4.26.1 if there is no adventure present) feel free to test if this PR actually does fix the issue in your case, though it should work according to my testing
@SamB440 yes, although this PR currently only does this for spigot |
|
Is removing Adventure from packetevents a valid alternative? Like completely stopping using it at all so packetevents doesn't need it anymore? Or maybe distributing two different packetevents: One with adventure bundled for legacy servers |
Would simplify things a lot, although you will still get breaking changes and less interopability with other plugins which may already use adventure
This is basically what this PR does, but as one jar (and without hard failures) |
Then I think that implementing the local cache so the download is made just at first boot is 100% necessary. Also packetevents should check on boot if the hash of the downloaded libraries is the same as the one needed, in case you update packetevents which requires a different adventure version compared to the cached one. (maybe you have already done it, I haven't looked at diffs) Regarding dropping it, we are skipping a few things because "it would break everything", but one day I hope packetevents will be going to switch major version without caring of breaking things |
yes, this should be done 100% - this PR is not finished yet, just wanted to gather feedback on this approach and what others think about this
v3 will contain breaking changes, though we aren't working on anything related to it yet |
Will be properly solved with #1505
Reworks how packetevents handles adventure, should fix #1500
With this PR, packetevents now determines the currently installed version of adventure (if any) and downloads required dependencies with correct versions at runtime
This is not an optimal solution, though its the best solution in my opinion
I'd love to hear some feedback/other opinions on this
The options we currently have:
Componentclass and the default adventureComponentclass, other than expensive serialization/deserialization)(this PR is also not fully done yet, we currently download adventure artifacts from maven central (against their ToS) and don't even cache them locally)