MCTCP / TerrainControl

Minecraft Terrain Generator for SpigotMC and Forge
https://www.spigotmc.org/threads/terraincontrol.37980/
MIT License
230 stars 163 forks source link

MCPC+ (MinecraftForge v7.7.1.656) with Terrain Control crashes randomly #155

Closed whisper2shade closed 11 years ago

whisper2shade commented 11 years ago

I suspet this has something to do with TC, as it happens sometimes when i tweak config values (at first terrain generation - start of server) or while traveling somewhere to explore new chunks. After that crash, the player is unable to login with this exception. I'll try to reproduce the exception that is thrown at the server start and add it later.

09:22:11 [WARNING] Failed to handle packet: java.lang.ArrayIndexOutOfBoundsException java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at net.minecraft.crash.CrashReportCategory.func_85073_a(Unknown Source) at net.minecraft.crash.CrashReport.func_85057_a(CrashReport.java:235) at net.minecraft.crash.CrashReport.func_85058_a(CrashReport.java:223) at net.minecraft.world.gen.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:182) at net.minecraft.server.management.PlayerInstance.(PlayerInstance.java:38) at net.minecraft.server.management.PlayerManager.func_72690_a(PlayerManager.java:116) at net.minecraft.server.management.PlayerManager.func_72683_a(PlayerManager.java:175) at net.minecraft.server.management.ServerConfigurationManager.func_72375_a(ServerConfigurationManager.java:259) at net.minecraft.server.management.ServerConfigurationManager.func_72377_c(ServerConfigurationManager.java:325) at net.minecraft.server.management.ServerConfigurationManager.func_72355_a(ServerConfigurationManager.java:170) at net.minecraft.network.NetLoginHandler.completeConnection(NetLoginHandler.java:229) at cpw.mods.fml.common.network.FMLNetworkHandler.handleClientConnection(FMLNetworkHandler.java:169) at cpw.mods.fml.common.network.FMLNetworkHandler.onConnectionReceivedFromClient(FMLNetworkHandler.java:123) at net.minecraft.network.NetLoginHandler.func_72529_d(NetLoginHandler.java:210) at net.minecraft.network.NetLoginHandler.func_72532_c(NetLoginHandler.java:101) at org.spigotmc.netty.NettyServerConnection.func_71747_b(NettyServerConnection.java:73) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:968) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:323) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:836) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:720) at net.minecraft.server.ThreadMinecraftServer.run(Unknown Source)

Edit: fixed the forge version in the title

whisper2shade commented 11 years ago

The exception at world initialization is as follows:

09:29:01 [INFO] [TerrainControl] World world is now enabled! 09:29:05 [SEVERE] net.minecraft.util.ReportedException: Exception initializing level 09:29:05 [SEVERE] at net.minecraft.world.World.(World.java:366) 09:29:05 [SEVERE] at net.minecraft.world.WorldServer.(WorldServer.java:136) 09:29:05 [SEVERE] at net.minecraft.server.MinecraftServer.initOverWorld(MinecraftServer.java:424) 09:29:05 [SEVERE] at net.minecraft.server.MinecraftServer.func_71247_a(MinecraftServer.java:314) 09:29:05 [SEVERE] at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:217) 09:29:05 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:694) 09:29:05 [SEVERE] at net.minecraft.server.ThreadMinecraftServer.run(Unknown Source) 09:29:05 [SEVERE] Caused by: java.lang.ArrayIndexOutOfBoundsException 09:29:05 [SEVERE] at java.lang.System.arraycopy(Native Method) 09:29:05 [SEVERE] at net.minecraft.crash.CrashReportCategory.func_85073_a(Unknown Source) 09:29:05 [SEVERE] at net.minecraft.crash.CrashReport.func_85057_a(CrashReport.java:235) 09:29:05 [SEVERE] at net.minecraft.crash.CrashReport.func_85058_a(CrashReport.java:223) 09:29:05 [SEVERE] at net.minecraft.world.gen.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:182) 09:29:05 [SEVERE] at net.minecraft.world.gen.ChunkProviderServer.func_73158_c(ChunkProviderServer.java:138) 09:29:05 [SEVERE] at org.bukkit.craftbukkit.v1_5_R2.CraftWorld.loadChunk(CraftWorld.java:367) 09:29:05 [SEVERE] at org.bukkit.craftbukkit.v1_5_R2.CraftWorld.loadChunk(CraftWorld.java:263) 09:29:05 [SEVERE] at org.bukkit.craftbukkit.v1_5_R2.CraftWorld.getHighestBlockYAt(CraftWorld.java:212) 09:29:05 [SEVERE] at org.bukkit.craftbukkit.v1_5_R2.CraftWorld.getHighestBlockAt(CraftWorld.java:632) 09:29:05 [SEVERE] at com.khorn.terraincontrol.bukkit.TCChunkGenerator.canSpawn(Unknown Source) 09:29:05 [SEVERE] at net.minecraft.world.WorldServer.canSpawn(WorldServer.java:307) 09:29:05 [SEVERE] at net.minecraft.world.WorldServer.func_73052_b(WorldServer.java:1125) 09:29:05 [SEVERE] at net.minecraft.world.WorldServer.func_72963_a(WorldServer.java:1066) 09:29:05 [SEVERE] at net.minecraft.world.World.(World.java:351) 09:29:05 [SEVERE] ... 6 more

whisper2shade commented 11 years ago

Don't know if it is related, but quite often the generator generates spawn points in solid rock (resulting in the death of the player unless creative mode is turned on)

rutgerkok commented 11 years ago

It indeed looks like it cannot find the spawn point. It searches for a good point, loads a new chunk and then crashes:

at net.minecraft.world.gen.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:182)
at net.minecraft.world.gen.ChunkProviderServer.func_73158_c(ChunkProviderServer.java:138)
at org.bukkit.craftbukkit.v1_5_R2.CraftWorld.loadChunk(CraftWorld.java:367)
whisper2shade commented 11 years ago

These two exceptions might not be related, but i suspect the first one is related to TC as well. (Still, at least i can tweak the world settings now)

rutgerkok commented 11 years ago

The fist one also happens during world generation. But because MCPC+'s error handler is broken, I can't see where it happens.

As this only happens with a certain combination of settings, it is important to know hich one crashes the server.

whisper2shade commented 11 years ago

I removed multiverse plugin just to see whether the combination isn't the culprit, because i wasn't able to generate a second world with TC as a generator, and also removed industrialcraft to see, whether the new ores weren't the problem. CaveOresVeins were removed previously, as flying around rapidly crashed the server (1000+ pending requests for ore generation). The server configuration is basically default. I didn't tweak bukkit.yml (only adding the generator TerrainControl)

Oh, i forgot to mention, it's a newer forge build: 7.7.1.656 (the title is wrong)

rutgerkok commented 11 years ago

Thanks, I'll test it soon.

rutgerkok commented 11 years ago

Forge fixed the crash reporter (https://github.com/MinecraftForge/MinecraftForge/commit/2d84dcd44eb4315a776bdb5899d3d8e3ef65de24), so once this is pushed to MCPC+ I can finally debug in a sane manner. :smile:

whisper2shade commented 11 years ago

Well, that could take a while :)

rutgerkok commented 11 years ago

Every now and then, I also get the error. I can't find a way to reproduce it constantly, it seems to only happen when it has problems finding a spawn point. I also don't know what causes the error, without a proper stack trace.

whisper2shade commented 11 years ago

Anything i can do to help?

rutgerkok commented 11 years ago

If only there would be a way to constantly reproduce this...

But in a few days, MCPC+ should have the stack traces fixed, so it will be easy to solve then.

Maybe you can pregenerate the terrain on a pure CraftBukkit server?

whisper2shade commented 11 years ago

That's unfortunately not possible, because i can generate custom ores after the world is created, but not custom flora.

By the way...can TC identify and work with custom biomes from LCTrees+ or other mods? I can see their IDs, so if TC could work with that....but i suppose it's not that easy.

rutgerkok commented 11 years ago

TC's mod support goes as far as "create lots BO2/BO3 and custom biomes to replicate the mod", unfortunality. Mods are theoretically able to register their own trees/objects/resources in TC, but I haven't seen a mod yet that does this. And there isn't even a biome registry at the moment.

whisper2shade commented 11 years ago

Well, that's why i can't really use clean craftbukkit. There's a lot of work i have to do to add the rest f the flora to appropriate biomes.

whisper2shade commented 11 years ago

There are some new MCPC builds. Can't test right now, but i suppose the crash reporter is fixed already in those builds.

rutgerkok commented 11 years ago

Downloaded the latest MCPC+ version (359). No errors yet with Multiverse 2.5-665.

whisper2shade commented 11 years ago

Will give it a go when i get back home. I can reproduce the error quite easily (unless i get a really good seed :D)

whisper2shade commented 11 years ago

There it is:

net.minecraft.util.ReportedException: Exception generating new chunk at net.minecraft.world.gen.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:186) at net.minecraft.server.management.PlayerInstance.(PlayerInstance.java:38) at net.minecraft.server.management.PlayerManager.func_72690_a(PlayerManager.java:116) at net.minecraft.server.management.PlayerManager.func_72691_b(PlayerManager.java:215) at net.minecraft.server.management.PlayerManager.func_72685_d(PlayerManager.java:314) at net.minecraft.server.management.ServerConfigurationManager.func_72358_d(ServerConfigurationManager.java:363) at net.minecraft.network.NetServerHandler.func_72498_a(NetServerHandler.java:597) at net.minecraft.network.packet.Packet10Flying.func_73279_a(Unknown Source) at org.spigotmc.netty.NettyNetworkManager.func_74428_b(NettyNetworkManager.java:189) at net.minecraft.network.NetServerHandler.func_72570_d(NetServerHandler.java:213) at net.minecraft.network.NetworkListenThread.func_71747_b(Unknown Source) at org.spigotmc.netty.NettyServerConnection.func_71747_b(NettyServerConnection.java:68) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:968) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:323) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:836) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:720) at net.minecraft.server.ThreadMinecraftServer.run(Unknown Source) Caused by: java.lang.NullPointerException at net.minecraft.crash.CrashReportCategory.func_85069_a(Unknown Source) at net.minecraft.crash.CrashReport.func_85057_a(CrashReport.java:250) at net.minecraft.crash.CrashReport.func_85058_a(CrashReport.java:223) at net.minecraft.world.gen.structure.MapGenStructure.func_75037_a(Unknown Source) at net.minecraft.world.gen.MapGenBase.func_75036_a(Unknown Source) at com.khorn.terraincontrol.bukkit.structuregens.StrongholdGen.prepare(Unknown Source) at com.khorn.terraincontrol.bukkit.BukkitWorld.PrepareTerrainObjects(Unknown Source) at com.khorn.terraincontrol.generator.ChunkProviderTC.generate(Unknown Source) at com.khorn.terraincontrol.bukkit.TCChunkGenerator.generateBlockSections(Unknown Source) at org.bukkit.craftbukkit.v1_5_R2.generator.CustomChunkGenerator.func_73154_d(CustomChunkGenerator.java:95) at net.minecraft.world.gen.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:177) ... 16 more

rutgerkok commented 11 years ago

Sigh, again the crash reporter crashed. But now at least I know that I should look in the structure generation again.

whisper2shade commented 11 years ago

The good/bad news is, that it took a longer while to reproduce. I actually had my hopes up after the first two successful teleports to random coordinates.

rutgerkok commented 11 years ago

The problem was in the stronghold generator. I hope that there are no more issues.

Download 2.4.10-MCPC-Plus-test2

whisper2shade commented 11 years ago

Testing... Did you check the other structure generators as well for the same problem?

whisper2shade commented 11 years ago

Looks like it's fixed...will need to fly around a bit more in after i get to and back from work, but seems solid now.

rutgerkok commented 11 years ago

In the first commit (https://github.com/Wickth/TerrainControl/commit/67a36a5de29c871e42e6994f79bd499201de7ce4), 4 days ago, I tried to fix all structures. There was one method in the stronghold generator which I forgot. There is of course a chance that more errors pop up, but I could fly around the world for ten minutes without problems.

whisper2shade commented 11 years ago

I was able to fly around for a few minutes as well with no problems. I even nuked half of the world and she server was stable :D Looks like i can deploy it. Thanks.

rutgerkok commented 11 years ago

Thanks for helping to test this.