OldCombatMechanics

OldCombatMechanics

46.1k Downloads

Error On Command

itisgriff opened this issue ยท 3 comments

commented

Information

  • Server Version: PurPur 1.20.2
  • OldCombatMechanics version: Latest Jenkins # 201
  • Server Log File:
Server Log
[10:58:35 ERROR]: Exception when ItIsGriff attempted to tab complete oldcombatmechanics mode ol
org.bukkit.command.CommandException: Unhandled exception during tab completion for command '/oldcombatmechanics mode ol' in plugin OldCombatMechanics v2.0.1-beta
        at org.bukkit.command.PluginCommand.tabComplete(PluginCommand.java:150) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.Command.tabComplete(Command.java:93) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.tabComplete(SimpleCommandMap.java:253) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R2.CraftServer.tabCompleteCommand(CraftServer.java:2556) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at org.bukkit.craftbukkit.v1_20_R2.CraftServer.tabComplete(CraftServer.java:2528) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at org.bukkit.craftbukkit.v1_20_R2.command.BukkitCommandWrapper.getSuggestions(BukkitCommandWrapper.java:74) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at com.mojang.brigadier.tree.ArgumentCommandNode.listSuggestions(ArgumentCommandNode.java:71) ~[brigadier-1.1.8.jar:git-Purpur-2092]
        at com.mojang.brigadier.CommandDispatcher.getCompletionSuggestions(CommandDispatcher.java:602) ~[purpur-1.20.2.jar:?]
        at com.mojang.brigadier.CommandDispatcher.getCompletionSuggestions(CommandDispatcher.java:582) ~[purpur-1.20.2.jar:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleCustomCommandSuggestions$5(ServerGamePacketListenerImpl.java:831) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.2.jar:git-Purpur-2092]
        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:1351) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1328) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1321) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1299) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1187) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.LinkedHashSet.stream()" because the return value of "java.util.Map.get(Object)" is null
        at kernitus.plugin.OldCombatMechanics.commands.OCMCommandCompleter.onTabComplete(OCMCommandCompleter.java:48) ~[OldCombatMechanics.jar:?]
        at org.bukkit.command.PluginCommand.tabComplete(PluginCommand.java:138) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        ... 22 more
[10:58:35 ERROR]: Exception when ItIsGriff attempted to tab complete oldcombatmechanics mode old
org.bukkit.command.CommandException: Unhandled exception during tab completion for command '/oldcombatmechanics mode old' in plugin OldCombatMechanics v2.0.1-beta
        at org.bukkit.command.PluginCommand.tabComplete(PluginCommand.java:150) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.Command.tabComplete(Command.java:93) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.tabComplete(SimpleCommandMap.java:253) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R2.CraftServer.tabCompleteCommand(CraftServer.java:2556) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at org.bukkit.craftbukkit.v1_20_R2.CraftServer.tabComplete(CraftServer.java:2528) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at org.bukkit.craftbukkit.v1_20_R2.command.BukkitCommandWrapper.getSuggestions(BukkitCommandWrapper.java:74) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at com.mojang.brigadier.tree.ArgumentCommandNode.listSuggestions(ArgumentCommandNode.java:71) ~[brigadier-1.1.8.jar:git-Purpur-2092]
        at com.mojang.brigadier.CommandDispatcher.getCompletionSuggestions(CommandDispatcher.java:602) ~[purpur-1.20.2.jar:?]
        at com.mojang.brigadier.CommandDispatcher.getCompletionSuggestions(CommandDispatcher.java:582) ~[purpur-1.20.2.jar:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleCustomCommandSuggestions$5(ServerGamePacketListenerImpl.java:831) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.2.jar:git-Purpur-2092]
        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:1351) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1328) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1321) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1299) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1187) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.LinkedHashSet.stream()" because the return value of "java.util.Map.get(Object)" is null
        at kernitus.plugin.OldCombatMechanics.commands.OCMCommandCompleter.onTabComplete(OCMCommandCompleter.java:48) ~[OldCombatMechanics.jar:?]
        at org.bukkit.command.PluginCommand.tabComplete(PluginCommand.java:138) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        ... 22 more
  • OldCombatMechanics config file:
config.yml
Default config no changes

Problem Description

After adding the server to the plugin as a fresh install everytime you start typing the command /ocm mode anything after the word mode starts throwing an error in console and throws the "internal error has occurred" in chat.

To Reproduce

Steps to reproduce the behavior:

  1. Type /ocm mode
  2. Throws error

Expected Behaviour

No error

Actual Behaviour

Error

commented

Yea this gets rid of the spamming from the tab error but if the world is still not in the config and you try and run the command it still throws

issued server command: /oldcombatmechanics mode old
[14:17:27 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'oldcombatmechanics' in plugin OldCombatMechanics v2.0.1-beta
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R2.CraftServer.dispatchCommand(CraftServer.java:1005) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at org.bukkit.craftbukkit.v1_20_R2.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[purpur-1.20.2.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:338) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:322) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2279) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$20(ServerGamePacketListenerImpl.java:2239) ~[?:?]
        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.2.jar:git-Purpur-2092]
        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:1351) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1328) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1321) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1299) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1187) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.LinkedHashSet.contains(Object)" because "worldModesets" is null
        at kernitus.plugin.OldCombatMechanics.commands.OCMCommandHandler.mode(OCMCommandHandler.java:113) ~[OldCombatMechanics.jar:?]
        at kernitus.plugin.OldCombatMechanics.commands.OCMCommandHandler.onCommand(OCMCommandHandler.java:164) ~[OldCombatMechanics.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        ... 23 more

So maybe have some sort message saying this world is not enabled in the config instead of just throwing the error?

commented

Hm I think that happens if the world you are in is not configured in the config.yml. Please check if the fix in commit 2071fb0 helps.

commented

Yea this gets rid of the spamming from the tab error but if the world is still not in the config and you try and run the command it still throws

issued server command: /oldcombatmechanics mode old
[14:17:27 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'oldcombatmechanics' in plugin OldCombatMechanics v2.0.1-beta
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R2.CraftServer.dispatchCommand(CraftServer.java:1005) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at org.bukkit.craftbukkit.v1_20_R2.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[purpur-1.20.2.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:338) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:322) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2279) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$20(ServerGamePacketListenerImpl.java:2239) ~[?:?]
        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.2.jar:git-Purpur-2092]
        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:1351) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1328) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1321) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1299) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1187) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[purpur-1.20.2.jar:git-Purpur-2092]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.LinkedHashSet.contains(Object)" because "worldModesets" is null
        at kernitus.plugin.OldCombatMechanics.commands.OCMCommandHandler.mode(OCMCommandHandler.java:113) ~[OldCombatMechanics.jar:?]
        at kernitus.plugin.OldCombatMechanics.commands.OCMCommandHandler.onCommand(OCMCommandHandler.java:164) ~[OldCombatMechanics.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        ... 23 more

So maybe have some sort message saying this world is not enabled in the config instead of just throwing the error?

Ok I was able to replicate the issue and fix it. As explained in the config, if a world is not directly configured, then all modesets will be available in that world. Please try the newest test build.