ChestShop-3 icon indicating copy to clipboard operation
ChestShop-3 copied to clipboard

Include AuthMe as a softdepend

Open HaHaWTH opened this issue 2 months ago • 3 comments

Closes #546.

ChestShop doesn't specify AuthMe as a softdepend in plugin.yml, which causes the plugin load order cannot be determined and leads to a NoClassDefFoundError.

HaHaWTH avatar Nov 03 '25 13:11 HaHaWTH

Can you please explain how this solves the linked issue? Because as far as I know this should not be necessary as soft-depend is for determining the order, the classes should still be accessible even if AuthMe should load after ChestShop. (Or do you intend to fix a different issue? Because I could imagine that the AuthMe listener code indeed fails to even register like it is written now if AuthMe does not enable it before because there is an isEnabled check there but ideally the solution for that would not be to have a soft-dependency screwing with the load-order but register the listener when AuthMe is detected enabling similar to how other dependencies are done. Granted setting it as a soft-dependency might still be good, but there is no guarantee that soft-dependencies enable before the plugin anyways in case of circular dependencies so a listener on plugin enable would be required still)

Also please reduce the diff to only the necessary change, not additional line ending changes.

Phoenix616 avatar Nov 03 '25 14:11 Phoenix616

This change resolves this error, theoretically the current version of ChestShop on Paper 1.21.8 won't cause this. But Paper's class loader isolation preventing accessing classes of oher plugins without depending on it (Only when the plugin uses paper-plugin.yml manifest, but ChestShop doesn't), however leaving AuthMe as a softdepend in plugin manifest is always a good practice, this is my opinion.

Also, when I tested on the environment that is used in #546, the ClassNotFoundException gets resolved by adding a softdepend.

HaHaWTH avatar Nov 03 '25 14:11 HaHaWTH

Ok, it's weird that it would cause that error but good to know you saw it too and this solved it. However the fact remains that this might still cause issues when the load order is not respected (which is not guaranteed by the soft-dependency system) and AuthMe should be moved to use ChestShop's Dependencies class too. (not sure why it wasn't in the first place tbh.)

Phoenix616 avatar Nov 03 '25 14:11 Phoenix616

Implemented as a proper separate Dependency in 26a3bf7ca24169cb4e0baae9108b38130da41318 now.

Phoenix616 avatar Dec 13 '25 18:12 Phoenix616