kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
49 stars 23 forks source link

1.20.1: Kaiiju(Folia Fork) Compatibility #2496

Closed TheShyDolphin closed 11 months ago

TheShyDolphin commented 11 months ago

"/version ChatControlRed" - plugin version

10.22.5

Are you using MySQL?

No

Are you using BungeeCord?

No

Error log (if applicable)

https://paste.gg/p/anonymous/da542f1885e845a08395a7be4ff3eb6c

"/chc debug" output (strongly recommended)

No response

Information about the issue/bug

It seems that the plugin can't recognize it's running on a Folia fork. The following code should detect any Folia-related server software.

private static boolean isFolia() { try { Class.forName("io.papermc.paper.threadedregions.RegionizedServer"); return true; } catch (ClassNotFoundException e) { return false; } }

kangarko commented 11 months ago

I would love to, but I really have no time for this being a hobby dev for five plugins. I am happy to give you source code access if you can fix that.

TheShyDolphin commented 11 months ago

I would love to, but I really have no time for this being a hobby dev for five plugins. I am happy to give you source code access if you can fix that.

I can give it a try.

kangarko commented 11 months ago

Sure, contact me at matej@matejpacan.com with your full name and contact details and I will prepare a NDA

TheShyDolphin commented 11 months ago

It's actually quite simple, all you need to do is to replace isFolia = Bukkit.getVersion().contains("Folia"); with private boolean isFolia() { try { Class.forName("io.papermc.paper.threadedregions.RegionizedServer"); return true; } catch (ClassNotFoundException e) { return false; } }. (Code from PaperMC Discord pinned message)

(This works for Foundation, so I guess this could too.)

kangarko commented 11 months ago

I see. We already do that. I just added that fork to the list: https://github.com/kangarko/Foundation/commit/a54ec8fa96f2b317ff4177f34e32c377ac67017f