加入彩色关闭消息时 Spigot 出错
Error in Spigot when Joining with colored shutdown message
我在 Spigot 1.8 中有一条彩色的关机和重启消息
spigot.yml:
restart: "\xa7bServer wird neu gestartet"
bukkit.yml:
shutdown-message: "\xa7bServer wurde geschlossen!"
使用“\xa7b ...”是为消息着色的唯一有效方法。 \u00a7b §b 和 $b 不起作用。
一旦有玩家加入,我就会在控制台中收到错误消息:
[12:50:26 ERROR]: Could not pass event PlayerJoinEvent to First_Plugin v1.0
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader.execute(JavaPluginLoader.java:305) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.PlayerList.onPlayerJoin(PlayerList.java:272) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.PlayerList.a(PlayerList.java:156) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.LoginListener.b(LoginListener.java:109) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.LoginListener.c(LoginListener.java:41) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.NetworkManager.a(NetworkManager.java:159) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.ServerConnection.c(ServerConnection.java:82) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:800) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at java.base/java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalArgumentException: Invalid page number 1/0
at org.bukkit.craftbukkit.v1_8_R1.inventory.CraftMetaBook.setPage(CraftMetaBook.java:213) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at de.prog_kid.first_plugin.listeners.JoinListener.handlePlayerJoin(JoinListener.java:47) ~[?:?]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader.execute(JavaPluginLoader.java:301) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
... 14 more
[12:50:26 INFO]: Flatuss[/127.0.0.1:51052] logged in with entity id 29 at ([world] 0.5, 66.0, 0.5)
这是一个本地服务器,所以我无法测试多个玩家。播放和加入正常。
错误是什么意思,我该如何解决?
您可以在此处查看导致错误的原因
Caused by: java.lang.IllegalArgumentException: Invalid page number 1/0
在这种情况下,错误出在第 47 行的 JoinListener.java 中
at de.prog_kid.first_plugin.listeners.JoinListener.handlePlayerJoin(JoinListener.java:47)
我在 Spigot 1.8 中有一条彩色的关机和重启消息
spigot.yml:
restart: "\xa7bServer wird neu gestartet"
bukkit.yml:
shutdown-message: "\xa7bServer wurde geschlossen!"
使用“\xa7b ...”是为消息着色的唯一有效方法。 \u00a7b §b 和 $b 不起作用。
一旦有玩家加入,我就会在控制台中收到错误消息:
[12:50:26 ERROR]: Could not pass event PlayerJoinEvent to First_Plugin v1.0
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader.execute(JavaPluginLoader.java:305) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.PlayerList.onPlayerJoin(PlayerList.java:272) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.PlayerList.a(PlayerList.java:156) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.LoginListener.b(LoginListener.java:109) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.LoginListener.c(LoginListener.java:41) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.NetworkManager.a(NetworkManager.java:159) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.ServerConnection.c(ServerConnection.java:82) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:800) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigot.jar:git-Spigot-c3c767f-33d5de3]
at java.base/java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalArgumentException: Invalid page number 1/0
at org.bukkit.craftbukkit.v1_8_R1.inventory.CraftMetaBook.setPage(CraftMetaBook.java:213) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
at de.prog_kid.first_plugin.listeners.JoinListener.handlePlayerJoin(JoinListener.java:47) ~[?:?]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader.execute(JavaPluginLoader.java:301) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
... 14 more
[12:50:26 INFO]: Flatuss[/127.0.0.1:51052] logged in with entity id 29 at ([world] 0.5, 66.0, 0.5)
这是一个本地服务器,所以我无法测试多个玩家。播放和加入正常。
错误是什么意思,我该如何解决?
您可以在此处查看导致错误的原因
Caused by: java.lang.IllegalArgumentException: Invalid page number 1/0
在这种情况下,错误出在第 47 行的 JoinListener.java 中
at de.prog_kid.first_plugin.listeners.JoinListener.handlePlayerJoin(JoinListener.java:47)