You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to write a plugin in a file called visitors_log.rb (it could have been visitor_log.rb ) and a plugin called VisitorsLogPlugin. For some reason I couldn't get this to work in any way... finally I ended up removing all content and it still failed to load.
In the end I named it something different and it works fine. same code. different name
What are the limitations on names you can call your plugins?
Cheers
Nigel
The text was updated successfully, but these errors were encountered:
Yeah it took me a bit to remember how this works but there is no obvious naming issue I know of for this...unless you happen to be naming the plugin something that MAYBE is registered already via Spigot (if you happen to be using other Java plugins). Or perhaps you are loading multiple plugins across multiple threads (never really thought about people making user threads for that).
The way it works is a tiny bit wonky. We glob on plugins/*.rb and load all files in turn. If those files include Purugin::Plugin then it registers the class which includes it via Module#included. "registers" is the wonky part. It is saved via side-effect via global (since this happens before RubyPluginLoader is ready for it to be registered). Then immediately after it is loaded .new is called on it. It is likely somehow that name is blowing up lower within Java code itself and it is not a Purugin issue. Well it is in that it is crapping the bed and not telling you what went wrong, but I do not think Purugin is what is not loading the plugin.
If you can deduce it is some naming conflict with Java plugin then we can consider how we would deal with it:
Error message so we at least know there is a conflict
Adding some unique naming on our name so it will just load it with a slightly munged name
I tried to write a plugin in a file called visitors_log.rb (it could have been visitor_log.rb ) and a plugin called VisitorsLogPlugin. For some reason I couldn't get this to work in any way... finally I ended up removing all content and it still failed to load.
In the end I named it something different and it works fine. same code. different name
What are the limitations on names you can call your plugins?
Cheers
Nigel
The text was updated successfully, but these errors were encountered: