Jannyboy11 / ScalaPluginLoader

PluginLoader for Bukkit that provides Scala runtime classes and enhanced APIs.
https://www.spigotmc.org/resources/scalaloader.59568/
GNU Lesser General Public License v3.0
26 stars 10 forks source link

[BUG] Plugin can access to ScalaLoader resources #2

Closed EpiCanard closed 4 years ago

EpiCanard commented 4 years ago

Plugin version: 0.11.1 Issue type: Bug

Description: When you use saveResource or getResource, the Plugin and ScalaLoader resources are shared. If I try saveResource("config.yml") or saveConfig() it will save inside Plugin folder the config of ScalaLoader.

You can more explicitly see this issue by using getClassLoader.getResources(), it will give you an Enumeration with path of ScalaLoader config and Plugin config.

I can use a "temporary" fix by using getClassLoader.findResources() and recreate myself the saveResource method. But it will be great if Plugin can only access its resources or if its resources can be saved first.

Thanks for your answer

Jannyboy11 commented 4 years ago

Thank you! I don't have much time to fix this right now, it'll be be somewhere after tuesday. If you manage to write a PR in the meantime I'll have a look and merge if it's good.

EpiCanard commented 4 years ago

I don't know enough your plugin to fix this mysterious bug otherwise I would not open this issue. :) I'm not in a hurry, take all the time you need.

Jannyboy11 commented 4 years ago

Fixed as of https://github.com/Jannyboy11/ScalaPluginLoader/commit/3b69cc57d2204114aa0a6f863b3fabf6478cb309

EpiCanard commented 4 years ago

Thanks a lot for this fix :)