Terrain Control

Terrain Control

235k Downloads

Error occurred while enabling TerrainControl v2.5.0

oloflarsson opened this issue ยท 4 comments

commented

Using: 2978b9f

2013-08-26 01:56:36 [SEVERE] Error occurred while enabling TerrainControl v2.5.0 (Is it up to date?)
java.lang.NullPointerException

  at com.khorn.terraincontrol.bukkit.TCPlugin.log(TCPlugin.java:265)
  at com.khorn.terraincontrol.TerrainControl.log(TerrainControl.java:208)
  at com.khorn.terraincontrol.configuration.ConfigFile.logSettingNotFound(ConfigFile.java:133)
  at com.khorn.terraincontrol.configuration.ConfigFile.readModSettings(ConfigFile.java:374)
  at com.khorn.terraincontrol.configuration.ConfigFile.readSettings(ConfigFile.java:402)
  at com.khorn.terraincontrol.configuration.PluginConfig.readConfigSettings(PluginConfig.java:98)
  at com.khorn.terraincontrol.configuration.PluginConfig.init(PluginConfig.java:62)
  at com.khorn.terraincontrol.configuration.PluginConfig.<init>(PluginConfig.java:52)
  at com.khorn.terraincontrol.TerrainControl.setEngine(TerrainControl.java:134)
  at com.khorn.terraincontrol.bukkit.TCPlugin.onEnable(TCPlugin.java:66)
  at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
  at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457)
  at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:382)
  at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugin(CraftServer.java:286)
  at org.bukkit.craftbukkit.v1_6_R2.CraftServer.enablePlugins(CraftServer.java:268)
  at net.minecraft.server.v1_6_R2.DedicatedServer.init(DedicatedServer.java:118)
  at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:397)
  at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
commented

This is an interesting error.

In the onEnable method, first the PluginConfig.ini is loaded, then the logging thing is started. This causes a problem, as hte PluginConfig.ini needs to be able to log (syntax) errors, so the logging thing must be started before the PluginConfig.ini file is loaded. However, to start the logging engine, some settings in the PluginConfig.ini file must be known.

The solution is probably to start the loggin thing with the default settings, then load the PluginConfig.ini, then apply the settings on the logging thing.

commented

This commit (acc8910) should fix the issue, pretty sure I fixed this in another branch already ๐Ÿ˜„

commented

@Timethor You code wizard. ๐Ÿ˜„

And @oloflarsson, thanks for all the time you put in testing TC.

commented

@Timethor and @rutgerkok thanks for responding so quickly :)