OpenInv icon indicating copy to clipboard operation
OpenInv copied to clipboard

Update to 1.20.6

Open Jikoo opened this issue 10 months ago • 1 comments

Spigot 1.20.5/1.20.6 is currently supported. However, Paper 1.20.5/1.20.6 is not due to the fact that they pushed their removal of Craftbukkit package relocation. As Paper is the vast majority of the server market, I don't see much point in cutting a release until this is resolved.

The simplest, lightest weight fix will likely be to target Spigot and then use ASM to rewrite classes at runtime on Paper to remove the CB packaging. It may also be possible to leverage this to improve backwards compatibility without hugely bloating the plugin file. A more secure and future-proof approach will be to abstract out the plugin base a bit more and create separate versions for Paper and Spigot.

Jikoo avatar Apr 24 '24 14:04 Jikoo

For anyone who is running Spigot and wants to update OI in the meantime, builds can be downloaded from runs of the CI action: https://github.com/Jikoo/OpenInv/actions/workflows/ci.yml?query=branch%3Amaster

Jikoo avatar May 08 '24 03:05 Jikoo

A status update: I had started working on using ASM to remap all Craftbukkit usages, only to find out that now Paper has unbent a little more on their stance and now remaps plugins. Now all that needs to be done to is load the correct internals for the unversioned package, which I did a couple days ago.

I also noticed that player data is not saving correctly when doing offline edits (I swear I checked that and it was working on Spigot before, but rolling back to the previous Spigot build yields the same problem), so that is the current release blocker.

Jikoo avatar May 11 '24 15:05 Jikoo

How ro download

Bot24280 avatar May 13 '24 08:05 Bot24280

You cannot currently download a fully functional build because of the bug I mentioned in my previous post. You can download one of the buggy builds from the corresponding actions run, the dist artifact.

Jikoo avatar May 13 '24 13:05 Jikoo

PaperMC currently automatically remaps spigot-mapped jars to paper-mapped jars before a plugin loads automatically. The only thing that it doesn't work for is reflection. If I'm not mistaken, OpenInv uses modules and not reflection to use NMS internals. Wouldn't it just work on its own?

LOOHP avatar May 13 '24 19:05 LOOHP

OI uses reflection to load the correct corresponding classes. 170ebaad2b8da56ab3d77fada3a4b7e1f3f894c3 will update this to handle Paper's changes.

Jikoo avatar May 13 '24 20:05 Jikoo

I see, though I was mainly referring to the part where you mention the need to use ASM to rewrite classes at runtime on Paper on your own.

LOOHP avatar May 13 '24 20:05 LOOHP

https://github.com/Jikoo/OpenInv/issues/194#issuecomment-2105934923

Guess I should update OP.

Jikoo avatar May 13 '24 20:05 Jikoo

Ah, sorry for not reading carefully. My bad.

LOOHP avatar May 13 '24 20:05 LOOHP

Finally found the problem after going in circles for hours, one little change. PlayerDataStorage#load(Player) now also tries to load the data into the player. The most painful part about it is that's the first place I had looked for changes, and somehow overlooked it.

Jikoo avatar May 13 '24 21:05 Jikoo