/tc command not working after /reload
RetroMining opened this issue ยท 18 comments
It seems that whenever I run the command /tc nothing happens.
Updating to Java 8 fixes the problem.
No need to fix this, it takes ten more seconds to actually restart the server. Only do this if you are really bored. ๐
I doubt that the two are related, as I'm still using Java 6 for the test server.
Are there any errors in the console? How have you setup TC (bukkit.yml, Multiverse)?
Feel free to leave a comment here if you still have the issue, but I cannot reproduce it, so I'm just going to close this issue.
The problem came back, it is giving me this error in the console when I load the plugin: http://pastebin.com/gPACuJPD
What version of TC and what version of BukkitCraft are you using?? Java version(s) affected? Details help us pinpoint the problem ๐
Also, if you don't mind sharing your server folder, or a simplified version (without unneeded biome configs, extra worlds, etc) that still produces the same error that is really helpful :D
I am using Terrain Control v2.4.14, CraftBukkit 1.6.2-R0.2 #2865, and Java 8.
I don't get the error when I start up the server, but when I reload then it stops working/gives me that console error.
Yes, and I get this message after the reload too: http://pastebin.com/ijcdKXig
Cool, so... I know for a fact that Craftbukkit reload is buggy. You will find that it gives this error on the console:
The server was just /reloaded! Terrain Control has problems handling this,
as old parts from before the reload have not been cleaned up.
Unexpected things may happen! Please restart the server!
In the future, instead of /reloading, please restart the server,
or reload a plugin using it's built-in command (like /tc reload),
or use a plugin managing plugin that can reload one plugin at a time.
When I do what you describe, I get the error listed above and then the /tc command doesn't work but I was not able to get an error or exception to be produced (This may or may not be due to the fact you are using Java 8, I tested on 6 and 7). From the exception you posted, this is not something that originates for TC code, but rather a problem with the way TerrainControl is handled by bukkit.
I will look into what is causing this after I finish the current feature I am working on (unless @rutgerkok or @Wickth want take a look) as this is a more complicated bug than can be fixed in a sitting or two.
___The easiest solution for now is to do as the warning says and avoid the reload command when using TC, simply restart the server. ___
For now we should keep this issue open until we determine it as non-amendable or can establish a way to make TC and bukkit play nice when using /reload. Marked as bug outside TC.
@Timethor, the problem with reloading is in Bukkit. It still asks the old chunk generator of before the /reload to generate chunks, while the newly loaded plugin has to execute the commands. The old and new Terrain Control can't communicate with each other, static variables aren't shared (try it yourself)[1]. The commands won't work, as it thinks the world isn't loaded.
I'm afraid that this has to be closed as "won't fix" or "bug outside Terrain Control".
[1] Maybe you can find some workaround, but it is going to be very difficult. I have spent several hours on it without making any progress, so I just added a warning instead.
This is not going to be fixed as long as CraftBukkit isn't reloading the terrain generators.
I have the same problem with my HothGenerator plugin.
You seems to be able to get around the ChunkGenerator problem by calling Server.unload(world) on all worlds with the ChunkGenerator that you want to reload. Just add the unload() calls to the onDisable() function of the plugin.
When the world(s) gets reloaded the new instance of the ChunkGenerator will be used instead of the old stale one.
My code for getting the chuckgenerator to reload properly:
// Unload worlds to make sure the ChunkGenerator is reloaded properly
List<World> worlds = this.getServer().getWorlds();
for(int i=0;i<worlds.size();i++)
{
if(this.isHothWorld(worlds.get(i)))
{
World world = worlds.get(i);
List<Player> players = world.getPlayers();
for(int j=0;j<players.size();j++)
{
Player player = players.get(j);
player.kickPlayer("Server reloading");
}
this.getServer().unloadWorld(world, true);
}
}