Djorr / TranslateX

A Spigot Plugin that translates languages in minecraft.
MIT License
4 stars 0 forks source link

Internal error when running commands #3

Closed DarkChromaMC closed 6 months ago

DarkChromaMC commented 6 months ago

Running /translate setlang gives an internal error in-game

[12:35:34 INFO]: DarkChroma issued server command: /translate setlang
[12:35:34 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'translate' in plugin TranslateX v0.3-BETA
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.CraftServer.dispatchCommand(CraftServer.java:1013) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at org.bukkit.craftbukkit.v1_20_R3.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:32) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.commands.execution.CommandQueueEntry.a(CommandQueueEntry.java:5) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:101) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:442) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:344) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:331) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2301) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$15(ServerGamePacketListenerImpl.java:2261) ~[?:?]
        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) ~[purpur-1.20.4.jar:git-Purpur-2160]
        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:1498) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:194) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1475) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1398) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1376) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1265) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
        at nl.rubixstudios.translate.command.TranslatorCommand.onCommand(TranslatorCommand.java:123) ~[TranslateX-0.3-BETA.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        ... 29 more
Djorr commented 6 months ago

Issue has been solved

DarkChromaMC commented 6 months ago

I unfortunately still seem to get this error. Is it possible that 1.20.4 is not supported? I'm using the latest protocol lib version:

[02:57:21 INFO]: DarkChroma issued server command: /translate setlang en
[02:57:21 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'translate' in plugin TranslateX v0.4-BETA
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.CraftServer.dispatchCommand(CraftServer.java:1013) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at org.bukkit.craftbukkit.v1_20_R3.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:32) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.commands.execution.CommandQueueEntry.a(CommandQueueEntry.java:5) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:101) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:442) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:344) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:331) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2301) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$15(ServerGamePacketListenerImpl.java:2261) ~[?:?]
        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) ~[purpur-1.20.4.jar:git-Purpur-2160]
        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:1498) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:194) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1475) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1398) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1376) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1265) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.4.jar:git-Purpur-2160]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "com.deepl.api.Language.getName()" because "language" is null
        at nl.rubixstudios.translate.translate.TranslateController.setPlayerLanguage(TranslateController.java:197) ~[TranslateX-0.4-BETA.jar:?]
        at nl.rubixstudios.translate.command.TranslatorCommand.onCommand(TranslatorCommand.java:129) ~[TranslateX-0.4-BETA.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        ... 29 more
Djorr commented 6 months ago

Hi,

Thank you for reporting. Can you test it with paperspigot or spigot 1.20.4.

For so far as i know, purpur isn't supported.