InventivetalentDev / BossBarAPI

MIT License
19 stars 23 forks source link

Enable operation on Linux and Mac #4

Open jwulf opened 7 years ago

jwulf commented 7 years ago

Error:

On Mac and Linux the plugin does not load, throwing an error:

[08:13:41 INFO]: [ReflectionHelper] Generating dynamic constant...
[08:13:41 INFO]: [ReflectionHelper] Version is UNKNOWN (-1)
[08:13:41 ERROR]: Could not load 'plugins/BossBarAPI_v2.4.1.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.ExceptionInInitializerError
...
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Could not resolve class for [ResolverQuery{name='org.bukkit.craftbukkit.UNKNOWN.entity.CraftEntity', types=[]}]
...
Caused by: java.lang.ClassNotFoundException: Could not resolve class for [ResolverQuery{name='org.bukkit.craftbukkit.UNKNOWN.entity.CraftEntity', types=[]}]

The Cause:

The trailing "." in the path returned by getVersion() is ignored on Windows, but causes a failure on Mac and Linux.

Fix:

This patch removes the trailing "." from getVersion() and adds it when adding the return value of getVersion() to classnames.