/roguelike command giving NPE in 1.7.10
keenerb opened this issue ยท 5 comments
Multiple Forge builds, RLD 1.3.6
[B#301] java.lang.ArrayIndexOutOfBoundsException: 0
[B#301] at greymerk.roguelike.util.CommandSpawnDungeon.func_71515_b(CommandSpawnDungeon.java:41) ~[CommandSpawnDungeon.class:?]
[B#301] at net.minecraft.command.CommandHandler.func_71556_a(CommandHandler.java:94) [z.class:?]
[B#301] at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:739) [nh.class:?]
[B#301] at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:718) [nh.class:?]
[B#301] at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:37) [ir.class:?]
[B#301] at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:9) [ir.class:?]
[B#301] at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212) [ej.class:?]
[B#301] at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165) [nc.class:?]
[B#301] at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659) [MinecraftServer.class:?]
[B#301] at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547) [MinecraftServer.class:?]
[B#301] at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111) [bsx.class:?]
[B#301] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427) [MinecraftServer.class:?]
[B#301] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) [?:?]
[B#301] [19:36:49] [Client thread/INFO]: [CHAT] An unknown error occurred while attempting to perform this command
What were you doing? Based on the place where the index error happened it looks like the "roguelike" command was being called with no arguments.
That is correct. I simply typed /roguelike and it generated that error. I was attempting to view usage for the command.
Thanks for letting me know. I didn't spend a lot of time rigorously testing the command, and it's not as well made as it could be.
The command help page is here:
https://github.com/Greymerk/minecraft-roguelike/wiki/Commands
To build on this if you do "/roguelike dungeon" It throws
[03:03:01] [Server thread/ERROR]: Couldn't process command: 'roguelike dungeon'
java.lang.ArrayIndexOutOfBoundsException: 1
at greymerk.roguelike.util.CommandSpawnDungeon.func_71515_b(CommandSpawnDungeon.java:57) ~[CommandSpawnDungeon.class:?]
at net.minecraft.command.CommandHandler.func_71556_a(CommandHandler.java:94) [z.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:739) [nh.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:718) [nh.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:37) [ir.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:9) [ir.class:?]
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212) [ej.class:?]
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165) [nc.class:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547) [MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111) [bsx.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) [?:?]
Some options you could do with these is doing /roguelike will list off the options. Doing /roguelike dungeon will use the player's x/z to create a dungeon.
I've implemented most of these ideas, including the ability to type "roguelike dungoen here" to spawn a dungeon on top of the player's position. I didn't want to make it "roguelike dungeon" because I figured that was expected to show the usage.
Should be no more out of bounds exceptions, regardless of what's typed.
These changes will be included in 1.8+ versions going forward. I'm probably not going to release any more 1.7 versions.