DevotedMC / HiddenOre

Allows after-map generation positive rebalance via fine-control over custom drops - Anti-Xray - Built for Minecraft and Paper 1.16.4
https://www.devotedmc.com/hiddenore.html
MIT License
11 stars 29 forks source link

Prevent reload from inadvertently closing the plugin class loader #41

Open Derongan opened 3 years ago

Derongan commented 3 years ago

Prevent reload from inadvertently closing the plugin class loader which causes config behaviour change between startup/reload.

When the plugin class loader is closed, calls to getResource will always return null. Because of this, the default config will always be null. If a section is left out of the config it is defaulted to the values in the default config. This means that if someone leaves out say the blocks section, startup will cause the blocks section to be populated with the blocks section from the default config. Reloading using hiddenore will then close the class loader, and when reading the config in a second time the defaults won't be applied leading to some very confusing behaviour.