TARDIS

TARDIS

228k Downloads

Archive scan fails on consoles with no beacon

Technoguyfication opened this issue ยท 0 comments

commented

Problem:
When using /tardis archive scan with a console that doesn't have a beacon, it generates an IndexOutOfBoundsException. It looks like the code is splitting the returned beacon string but doesn't account for that string being null or empty.

Relevant section of the code:

bx = TARDISNumberParsers.parseInt(split[1]);

Exception generated:

[07:47:41 INFO]: Xalili issued server command: /tardis archive scan
[07:47:41 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'tardis' in plugin TARDIS v4.6.3-b2279
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.16.5.jar:git-Paper-739]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.5.jar:git-Paper-739]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:827) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2185) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:2000) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1953) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:50) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:8) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:35) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1265) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1258) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeAll(IAsyncTaskHandler.java:95) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1394) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1129) ~[patched_1.16.5.jar:git-Paper-739]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:290) ~[patched_1.16.5.jar:git-Paper-739]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
        at me.eccentric_nz.TARDIS.schematic.TARDISSchematicBuilder.build(TARDISSchematicBuilder.java:106) ~[?:?]
        at me.eccentric_nz.TARDIS.commands.tardis.TARDISArchiveCommand.zip(TARDISArchiveCommand.java:212) ~[?:?]
        at me.eccentric_nz.TARDIS.commands.tardis.TARDISCommands.onCommand(TARDISCommands.java:110) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.16.5.jar:git-Paper-739]
        ... 19 more

Version:

[07:54:42 INFO]: [TARDIS] Server version: git-Paper-739 (MC: 1.16.5)
[07:54:42 INFO]: [TARDIS] TARDIS version: 4.6.3-b2279
[07:54:42 INFO]: [TARDIS] TARDISChunkGenerator version: 4.6.3
[07:54:42 INFO]: [TARDIS] Multiverse-Core version: 4.2.2-b812
[07:54:42 INFO]: [TARDIS] Essentials version: 2.18.2.0
[07:54:42 INFO]: [TARDIS] WorldGuard version: 7.0.4+f7ff984
[07:54:42 INFO]: [TARDIS] GriefPrevention version: 16.17.1-2b69191