The plugin doesn't work
Skyslycer opened this issue ยท 7 comments
Ok, so first of all, im really sorry for beeing this rude to u. I shouldnt be taht rude. It was a mistake. When i take a look at other shop plugins, your is the best. And its free. But there is still the problem.
https://pastebin.com/m75Gs0Wr
Do u have like a thing that it could be?
Maybe i could investigate in this toox but i never had like a problem that is like server sided. On some servers it works, on some it doesnt. Thats really strange. Do u have a thing that it could be or do u have no idea like me. I looked intonthe code, specifically the class where the error comes from and i cant find any bads.
Also here is some info about my server system:
OpenJDK 11.0.9
PaperMC 1.16.5 i forgot the build...
Plugin version: 8.4
Do u need more, if yesy imma provide it.
Thanks for the comming help.
Sry again for beeing that rude again.
~Sky
So, bcs i didnt really find anything in the code, i looked further into the error. So i couldnt find any casts, but you wrote the code, so maybe u know where its casted. And if u cast it normally like "(object) objectToCast", then just remove the "object" if they are literaly the same. Im pretty sure that there isnt a cast to remove, but thats ehat i gor from the error.
Do you happen to have Discord? I could do some investigating and we can talk a bit faster.
Ok finally. I found whats the problem!
Il say what it is later, bcs its a little long. So. Basicly the plugin dies after u do /reload or /reload confirm or with PlugMan /plugman restart/reload GUIshop. Just do a restart and the plugin will be fine! So pablo, if u see this, and u see another issue with my errory just say that he/she should do a restart. Explanation comming right away!
Sounds good! Thank you so much for finding the problem and reporting back. I'll implement a fix that should fix reloading issues.
Ok cool! Im now on to say why it does this. Maybe it makes the process a lill faster.
Well basicly, its not that hard to understand. Oh boi here we go:
The same two classes cant cast, even if they r the same, bcs they r loaded in different PluginClassLoaders from Bukkit. So they arent the same, bcs they r loaded differently. This usually happens when u do a reload. Why? I dont know. I really dont know. It does what it does.
Solution: There is basicly no solution to this. It also wont be an issue on every reload. The only thing that you can do about it, is to put a text that is saying that you wont get support for doing a reload.
And i have discord too. Just dm me Skyslycer#9830 and we can talk about some other things that you can improve.
Great plugin!
Thank you for the write up. There is a solution I am working on to unregister the class from the command map when the plugin's onDisable is triggered. This should prevent the casting from happening on an already existing object in memory. An additional check will be made where a cast exception will be handled in the case that it is not registered for some reason, which will re-trigger the unregister method before trying again.