Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumberFormatException when enabling BedWars plugin #977

Open
WitheredWinter opened this issue Feb 6, 2024 · 1 comment
Open

NumberFormatException when enabling BedWars plugin #977

WitheredWinter opened this issue Feb 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@WitheredWinter
Copy link

WitheredWinter commented Feb 6, 2024

Description:
When starting up the server with the BedWars plugin installed, I encountered a NumberFormatException related to an invalid input string "0-SNAPSHOT". This error prevents the plugin from being loaded properly.

Steps to Reproduce:

  1. Update the BedWars plugin (to me it's from 23.2.2-BETA4 to 23.12.2(newest)) on a server running PaperSpigot 1.8.8.
  2. Restart the server.
  3. Observe the error in the server logs during startup.

Expected Behavior:
The plugin should load every existing map without any errors, allowing for normal operation of its features.

Actual Behavior:
The server log displays a NumberFormatException, pointing to an issue with parsing the string "0-SNAPSHOT" as an integer. The error stack trace indicates that the issue occurs in the handleWorldAdapter method of the BedWars plugin. And after that the console shows errors like [Server thread/WARN]: [BedWars1058] There isn't any map called gateway

Error Message:

[22:35:48 WARN]: java.lang.NumberFormatException: For input string: "0-SNAPSHOT"
[22:35:48 WARN]:        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
[22:35:48 WARN]:        at java.base/java.lang.Integer.parseInt(Integer.java:652)
[22:35:48 WARN]:        at java.base/java.lang.Integer.parseInt(Integer.java:770)
[22:35:48 WARN]:        at com.andrei1058.bedwars.BedWars.handleWorldAdapter(BedWars.java:546)
[22:35:48 WARN]:        at com.andrei1058.bedwars.BedWars.onEnable(BedWars.java:221)
[22:35:48 WARN]:        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321)
[22:35:48 WARN]:        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332)
[22:35:48 WARN]:        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:454)
[22:35:48 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:393)
[22:35:48 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:352)
[22:35:48 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:439)
[22:35:48 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:403)
[22:35:48 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:358)
[22:35:48 WARN]:        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:301)
[22:35:48 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:603)
[22:35:48 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.lambda$spin$0(MinecraftServer.java:133)
[22:35:48 WARN]:        at java.base/java.lang.Thread.run(Thread.java:829)

Possible Cause:
It appears that the plugin is attempting to parse a configuration value or similar input as an integer, but is receiving a string that cannot be directly converted ("0-SNAPSHOT").

Suggested Fix:
It might be necessary to review the plugin code, specifically around the handleWorldAdapter method, to ensure that only valid integers are parsed from the configuration or input sources. Additionally, checking the configuration files for incorrect values that might lead to this error could help.

Environment:

  • BedWars plugin version: 23.12.2
  • Server version: PaperSpigot 1.8.8
  • Java version: Java 11
@WitheredWinter WitheredWinter added the bug Something isn't working label Feb 6, 2024
@WitheredWinter
Copy link
Author

WitheredWinter commented Feb 6, 2024

This bug starts from version 23.3(23.3 doesn't have this bug)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant