Flectone / FlectoneChat

FlectoneChat - personalize your minecraft server!
https://chat.flectone.net
GNU General Public License v3.0
23 stars 10 forks source link

Could not pass event PlayerJoinEvent and error with /flectonechat command #3

Closed Vinellon closed 1 year ago

Vinellon commented 1 year ago

При заходе на сервер или использовании /flectonechat в консоли появляются ошибки. Ядро: pufferfish-paperclip-1.20.1-R0.1-SNAPSHOT Конфиги не тронуты.

[19:50:57 ERROR]: Could not pass event PlayerJoinEvent to FlectoneChat v3.3.0
java.lang.NullPointerException: Cannot invoke "String.replace(java.lang.CharSequence, java.lang.CharSequence)" because "string" is null
        at ru.flectone.utils.Utils.translateColor(Utils.java:114) ~[FlectoneChat-3.3.0.jar:?]
        at ru.flectone.utils.FileResource.getFormatString(FileResource.java:99) ~[FlectoneChat-3.3.0.jar:?]
        at ru.flectone.FPlayer.setName(FPlayer.java:65) ~[FlectoneChat-3.3.0.jar:?]
        at ru.flectone.FPlayer.<init>(FPlayer.java:25) ~[FlectoneChat-3.3.0.jar:?]
        at ru.flectone.FActions.joinPlayer(FActions.java:36) ~[FlectoneChat-3.3.0.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor178.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:git-Pufferfish-4]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.players.PlayerList.placeNewPlayer(PlayerList.java:339) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.server.network.ServerLoginPacketListenerImpl.placeNewPlayer(ServerLoginPacketListenerImpl.java:202) ~[?:?]
        at net.minecraft.server.network.ServerLoginPacketListenerImpl.handleAcceptedLogin(ServerLoginPacketListenerImpl.java:183) ~[?:?]
        at net.minecraft.server.network.ServerLoginPacketListenerImpl.tick(ServerLoginPacketListenerImpl.java:85) ~[?:?]
        at net.minecraft.network.Connection.tick(Connection.java:599) ~[?:?]
        at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:234) ~[?:?]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1575) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:450) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1396) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at java.lang.Thread.run(Thread.java:1589) ~[?:?]

Пример, при попытке перезагрузки:

[19:52:39 INFO]: Axeny_ issued server command: /flectonechat reload
[19:52:39 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'flectonechat' in plugin FlectoneChat v3.3.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:933) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at org.bukkit.craftbukkit.v1_20_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[pufferfish-1.20.1.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:324) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:308) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2299) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$20(ServerGamePacketListenerImpl.java:2259) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1341) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1318) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1311) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1289) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1177) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[pufferfish-1.20.1.jar:git-Pufferfish-4]
        at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "String.replace(java.lang.CharSequence, java.lang.CharSequence)" because "string" is null
        at ru.flectone.utils.Utils.translateColor(Utils.java:114) ~[FlectoneChat-3.3.0.jar:?]
        at ru.flectone.utils.FileResource.getFormatString(FileResource.java:99) ~[FlectoneChat-3.3.0.jar:?]
        at ru.flectone.FPlayer.setName(FPlayer.java:65) ~[FlectoneChat-3.3.0.jar:?]
        at ru.flectone.FPlayer.<init>(FPlayer.java:25) ~[FlectoneChat-3.3.0.jar:?]
        at ru.flectone.commands.Commands.onCommand(Commands.java:300) ~[FlectoneChat-3.3.0.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        ... 23 more
Vinellon commented 1 year ago

Нашёл причину этой ошибки. Оказывается, что она возникает, когда название папки мира не "world", а любое другое (в моём случае было "net") Честно, хотелось бы, чтобы такого не было)

TheFaser commented 1 year ago

Спасибо, что нашёл ошибку и в чём она заключается) Привязка к названию мира и правда странная, в следующей версии будет фикс на проверку мира по типу

TheFaser commented 1 year ago

Исправлено в релизе 3.3.1