所以我有一个使用TitleAPI 1.8的插件(功能齐全),当我将MyPlugin和TitleAPI放在插件文件夹中时,我启动服务器,然后
[17:33:23 ERROR]: Could not load 'plugins\TitlesAPI.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: net/mi
necraft/server/v1_7_R4/Packet
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
ava:133) ~[craftbukkit.jar:git-Bukkit-33d5de3]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
java:328) ~[craftbukkit.jar:git-Bukkit-33d5de3]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
.java:251) [craftbukkit.jar:git-Bukkit-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.ja
va:288) [craftbukkit.jar:git-Bukkit-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.<init>(CraftServer.java:25
0) [craftbukkit.jar:git-Bukkit-33d5de3]
at net.minecraft.server.v1_8_R1.PlayerList.<init>(PlayerList.java:69) [c
raftbukkit.jar:git-Bukkit-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedPlayerList.<init>(SourceFile:14
) [craftbukkit.jar:git-Bukkit-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.jav
a:133) [craftbukkit.jar:git-Bukkit-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java
:484) [craftbukkit.jar:git-Bukkit-33d5de3]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_45]
Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/v1_7_R4/Packet
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_45]
at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_45]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
a:40) ~[craftbukkit.jar:git-Bukkit-33d5de3]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
ava:129) ~[craftbukkit.jar:git-Bukkit-33d5de3]
... 9 more
Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_7_R4.Packet
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
java:67) ~[craftbukkit.jar:git-Bukkit-33d5de3]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
java:62) ~[craftbukkit.jar:git-Bukkit-33d5de3]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_45]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_45]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_45]
at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_45]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
a:40) ~[craftbukkit.jar:git-Bukkit-33d5de3]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
ava:129) ~[craftbukkit.jar:git-Bukkit-33d5de3]
所以我尝试使用不同版本的bukkit和spigot,它总是说找不到net.minecraft.server(NMS)类,我也不知道为什么。
最佳答案
似乎在这里,如果您依赖于另一个bukkit插件,则应将其放入库中。
只需添加一个外部罐的Title API。
另外,您还需要在plugin.yml中依赖此插件:
name: Whatever
main: [pathToMain]
version: Whatever
depend: [TitleAPI]
description: Whatever
author: Whatever
website: Whatever
commands:
确保TitleAPI是插件的确切名称。
基于此错误,您的问题没有得到完全表达,但是如果您在插件中使用TitleAPI,这将是答案。