Jannyboy11 / ScalaPluginLoader

PluginLoader for Bukkit that provides Scala runtime classes and enhanced APIs.
https://www.spigotmc.org/resources/scalaloader.59568/
GNU Lesser General Public License v3.0
26 stars 10 forks source link

Warning while loading Scala Plugins #13

Closed freeze-dolphin closed 3 years ago

freeze-dolphin commented 3 years ago

Logs

[13:17:40] [Server thread/INFO]: [io.freeze_dolphin.plain_cmder.PlugGividado$] [PlainCmder] Enabling PlainCmder v0.1.0
[13:17:40] [Server thread/WARN]: java.lang.ClassNotFoundException: io.freeze_dolphin.plain_cmder.PlugGividado$
[13:17:40] [Server thread/WARN]:     at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:153)
[13:17:40] [Server thread/WARN]:     at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:114)
[13:17:40] [Server thread/WARN]:     at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[13:17:40] [Server thread/WARN]:     at java.base/java.lang.Class.forName0(Native Method)
[13:17:40] [Server thread/WARN]:     at java.base/java.lang.Class.forName(Class.java:315)
[13:17:40] [Server thread/WARN]:     at redempt.redlib.RedLib.getCallingPlugin(RedLib.java:99)
[13:17:40] [Server thread/WARN]:     at redempt.redlib.commandmanager.CommandCollection.register(CommandCollection.java:46)
[13:17:40] [Server thread/WARN]:     at io.freeze_dolphin.plain_cmder.PlugGividado$.onEnable(PlugGividado.scala:26)
[13:17:40] [Server thread/WARN]:     at xyz.janboerman.scalaloader.plugin.ScalaPluginLoader.enablePlugin(ScalaPluginLoader.java:585)
[13:17:40] [Server thread/WARN]:     at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500)
[13:17:40] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518)
[13:17:40] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432)
[13:17:40] [Server thread/WARN]:     at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:596)
[13:17:40] [Server thread/WARN]:     at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:309)
[13:17:40] [Server thread/WARN]:     at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074)
[13:17:40] [Server thread/WARN]:     at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:293)
[13:17:40] [Server thread/WARN]:     at java.base/java.lang.Thread.run(Thread.java:834)

Descs

Though this won't cause any trouble in features (the commands can be executed as normal), but I think such warnings are annoying. BTW, they only occur while loading ScalaPlugin(s).

I don't know which plugin (the RedLib, or the ScalaPluginLoader) is the source of the warnings, and I am sure that I followed the instructions of using ScalaPluginLoader. So I am here to ask for your assistance

Something else

I've reported almost the same thing to the author of RedLib, Redempt. And here is the repository of delfeno_craft, you can get access to my code by running:

git clone https://gitlab.com/elixir-crystal/delfeno_craft.git
git checkout upload
boxbeam commented 3 years ago

CommandCollection line 46 is the method that doesn't take a plugin, so it tries to get it reflectively. That's the problem, you need to pass in the plugin when registering with a non-java plugin.

freeze-dolphin commented 3 years ago

CommandCollection line 46 is the method that doesn't take a plugin, so it tries to get it reflectively. That's the problem, you need to pass in the plugin when registering with a non-java plugin.

Thanks :)