Plugin does not work when online-mode is set to false
BizzyPizzy opened this issue · 10 comments
Describe the bug
Targeting a speedrunner leads to world spawn. Message in chat says "Compass is now targeting null" instead of player name.
Potential Causes
Changing online mode from true to false.
Environment Info
Plugin version: 1.2.4
Bukkit/Spigot server version: 1.16.3
Configuration file
Sending us your plugin config.yml
file may help in diagnosing the issue. Paste the contents of the plugin's config file here: (feel free to omit your Discord token for security reasons)
[config.txt](https://github.com/yummypasta/MinecraftManhunt/files/5468166/config.txt)
Server Logs
Please check your Server Console for any warnings or errors created by the plugin. If any are any, please copy and paste them here:
Anything else?
Add any other context about the problem here.
Hi @BizzyPizzy ,
I could not reproduce this error, but I may be able to help if you provide the logs in the console. When this error happens again, please go to your Minecraft server console and copy all of the logs that are printed. Thanks!
Potentially relevant info
online-mode
is set to false in server properties. This may be messing with player heads as they need to be queried from Mojang servers.- Server is on 1.16.3, not an issue with version
- Two relevant log errors:
Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_16_R2.inventory.CraftMetaItem cannot be cast to org.bukkit.inventory.meta.SkullMeta
at com.yoonicode.minecraftmanhunt.PluginListener.onInventoryClick(PluginListener.java:53) ~[?:?]
Caused by: java.lang.NullPointerException
at com.yoonicode.minecraftmanhunt.PluginListener.onInventoryClick(PluginListener.java:53) ~[?:?]
Hi @BizzyPizzy ,
I built a new .jar file and added more log info. Please replace your plugin .jar with the attached file:
MinecraftManhunt-1.2.4-debug.zip
- Could you try testing the plugin in online mode and see if it works? I tested the plugin with my server in offline mode, but it still worked— perhaps my server is caching player data from when it was in online mode.
- If this doesn't work, can you post:
- your full
server.properties
file - the server logs that the new .jar file above generates
- your full
Thank you!
Here are the logs.
Hello again,
I tested the plugin in both online and offline mode. First I tested it in offline mode and it didn't work, after that I changed the server to online mode and it worked perfectly. Then I tried offline mode again and just as you said it still worked.
Here are the logs from the first test in offline mode and the server.properties file:
2020-11-01-2.log
serverproperties.zip
Here are also the logs from the other 2 tests:
Online mode - 2020-11-01-3.log
Offline mode - latest.log
Thank you for your help with debugging! I'm leaving this issue open until I fix it in the next version.
I've looked into the issue and I think it's a problem with the Bukkit methods used to get information about players. Due to lack of a way to test this, I am going to close this issue for now, until I can find a way to fix it.
Potential fixes:
- Get which player head is clicked based on the item name rather than the SkullMeta owner
Support for offline mode has been added in version 1.3.3.4!