为什么我的api没有为我的minecraft插件加载?

x7yiwoj4  于 2021-07-12  发布在  Java
关注(0)|答案(0)|浏览(242)

我为自己制作了一个奇特的tikzapi,它允许对数据进行可视化(绘图、图表)。它的工作方式是,将api的示例 TikZAPI api = new TikZAPI(); 然后为绘图添加数据(带点的简单绘图),如 api.addPoint(xCoord, yCoord) . 在我收集了一些数据之后,我可以用 api.print(); . 然后代码将出现在控制台中,我可以手动复制并粘贴到一个latex文档中,在那里我可以查看绘图。现在实际的问题与api无关,api工作得非常好。我想收集我的minecraft服务器的一些数据,例如每小时的最大玩家数,并将这些数据添加到绘图中,以便打印到控制台中。但是,当我将api用作库(intellij:project structure->libraries->+->library,工作正常,我可以访问插件中api的所有方法)并重新加载服务器时,我会遇到以下错误:

org.bukkit.command.CommandException: Unhandled exception executing command 'test' in plugin TestAPI v1.0.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[Spi
got.jar:git-Spigot-ad703da-e2403a3]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14
9) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at org.bukkit.craftbukkit.v1_16_R1.CraftServer.dispatchCommand(CraftServ
er.java:755) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.PlayerConnection.handleCommand(PlayerCo
nnection.java:1703) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.jav
a:1546) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.PacketPlayInChat.a(PacketPlayInChat.jav
a:47) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.PacketPlayInChat.a(PacketPlayInChat.jav
a:1) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.PlayerConnectionUtils.lambda$0(PlayerCo
nnectionUtils.java:19) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.TickTask.run(SourceFile:18) ~[Spigot.ja
r:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeTask(SourceFil
e:144) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.IAsyncTaskHandlerReentrant.executeTask(
SourceFile:23) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeNext(SourceFil
e:118) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.MinecraftServer.aZ(MinecraftServer.java
:943) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.MinecraftServer.executeNext(MinecraftSe
rver.java:936) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.awaitTasks(SourceFile
:127) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.MinecraftServer.sleepForTick(MinecraftS
erver.java:920) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:
852) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServe
r.java:164) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]
Caused by: java.lang.NoClassDefFoundError: tikzapi/TikZAPI
        at test.Commands.onCommand(Commands.java:39) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[Spi
got.jar:git-Spigot-ad703da-e2403a3]
        ... 18 more
Caused by: java.lang.ClassNotFoundException: tikzapi.TikZAPI
        at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_291]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
java:167) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
java:96) ~[Spigot.jar:git-Spigot-ad703da-e2403a3]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_291]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_291]
        at test.Commands.onCommand(Commands.java:39) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[Spi
got.jar:git-Spigot-ad703da-e2403a3]
        ... 18 more

好吧,我认为错误在于api没有被加载。但我该怎么做呢?我已经把api放进了我服务器的plugins文件夹,不起作用。我在plugins文件夹中创建了一个名为“lib”的子文件夹,它也不起作用。不管我使用eclipse还是intellij,这两个ide都不起作用。我已经读到它与清单文件有关,但我如何制作这样一个清单文件,它真的解决了我的问题吗?我不能使用maven,因为它是我自己为自己制作的api,我想像普通的库一样使用它。有什么想法吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题