BentoBoxWorld / BentoBox

Expandable Minecraft server plugin for island-type games like SkyBlock or AcidIsland.
https://bentobox.world
Eclipse Public License 2.0
334 stars 136 forks source link

language command causing exception error #883

Closed mrfloris closed 5 years ago

mrfloris commented 5 years ago

Description A clear and concise description of what the bug is.

[22:46:32 INFO]: the456gamer issued server command: /skyblock language
[22:46:32 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing 'skyblock language' in world.bentobox.bskyblock.commands.IslandCommand(skyblock)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:148) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at org.bukkit.craftbukkit.v1_13_R2.CraftServer.dispatchCommand(CraftServer.java:704) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at net.minecraft.server.v1_13_R2.PlayerConnection.handleCommand(PlayerConnection.java:1621) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at net.minecraft.server.v1_13_R2.PlayerConnection.a(PlayerConnection.java:1461) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at net.minecraft.server.v1_13_R2.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at net.minecraft.server.v1_13_R2.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at net.minecraft.server.v1_13_R2.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:9) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at net.minecraft.server.v1_13_R2.SystemUtils.a(SourceFile:199) [spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:896) [spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:417) [spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:831) [spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:729) [spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 1, length 0
        at java.lang.String.checkBoundsBeginEnd(String.java:3319) ~[?:?]
        at java.lang.String.substring(String.java:1874) ~[?:?]
        at world.bentobox.bentobox.panels.LanguagePanel.fancyLocaleDisplayName(LanguagePanel.java:82) ~[?:?]
        at world.bentobox.bentobox.panels.LanguagePanel.openPanel(LanguagePanel.java:46) ~[?:?]
        at world.bentobox.bentobox.api.commands.island.IslandLanguageCommand.execute(IslandLanguageCommand.java:27) ~[?:?]
        at world.bentobox.bentobox.api.commands.CompositeCommand.call(CompositeCommand.java:260) ~[?:?]
        at world.bentobox.bentobox.api.commands.CompositeCommand.execute(CompositeCommand.java:233) ~[?:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
        ... 14 more

Steps to reproduce the behavior:

  1. Go to '...'

  2. Click on '....'

  3. Scroll down to '....'

  4. See error

  5. Did not give the player group the permission for language, i dont want them to use it, but i did not negate the permission either (yet).

  6. the player types the skyblock command like /is language, and it causes in-game error msg and shows some text

  7. went to console, the error was spit out there

Expected behavior A clear and concise description of what you expected to happen. The player does not have the permission, or at least i did not give it specifically, so i expected them to get at least the notice that they cannot use that command. I did not expect an exception error.

Screenshots If applicable, add screenshots to help explain your problem. unknown

Server Information:

[Please complete the following information:]

>
>bentobox version
[23:06:20 INFO]: Running SPIGOT 1.13.2.
[23:06:20 INFO]: BentoBox version: 1.6.0-SNAPSHOT-b1306
[23:06:20 INFO]: Database: JSON
[23:06:20 INFO]: Loaded Game Worlds:
[23:06:20 INFO]: acid (acid): Overworld, Nether, End
[23:06:20 INFO]: cave (cave): Overworld, Nether, End
[23:06:20 INFO]: skyblock (skyblock): Overworld, Nether, End
[23:06:20 INFO]: skygrid (skygrid): Overworld, Nether, End
[23:06:20 INFO]: Loaded Addons:
[23:06:20 INFO]: AcidIsland 1.6.0-SNAPSHOT (ENABLED)
[23:06:20 INFO]: BSkyBlock 1.6.0-SNAPSHOT (ENABLED)
[23:06:20 INFO]: CaveBlock ${version}${build.number} (ENABLED)
[23:06:20 INFO]: IslandFly 0.2.0 (ENABLED)
[23:06:20 INFO]: Level 1.6.0-SNAPSHOT (ENABLED)
[23:06:20 INFO]: MagicCobblestoneGenerator 1.5.0.1 (ENABLED)
[23:06:20 INFO]: SkyGrid 1.6.0 (ENABLED)
[23:06:20 INFO]: WelcomeWarps 1.5.2-SNAPSHOT (ENABLED)
>

Additional context Add any other context about the problem here. issue reported by a player to me who was testing the plugin on my behalf. I haven't had time to reproduce it - but it looks like something that's easy to reproduce, and likely to happen again.

wellnesscookie commented 5 years ago

We are experiencing the same thing. I noticed this like a month ago, except I forgot to write it down

tastybento commented 5 years ago

Caused by polish language file having a wrong name in BSkyBlock. Workaround is to rename the file (or delete it) to use hyphen instead of underscore. I'll also add defensive code here.

mrfloris commented 5 years ago

I would never need polish :D So I guess I can just delete the file.