Null Pointer Exception
ThemistoclesVonEckenbrecher opened this issue ยท 12 comments
I've been trying to set up a second world to use to test seeds for our server's new map. For a while, I got an internal server error when I went far enough out. I eventually realized that this was because I had not set Vanilla biomes to become the "official" F3 biomes of the custom biomes (Like how HotPineForest is really DesertHills with different generation). After adding Vanilla biomes in the ReplaceToBiome section of each custom config, I tried it again. This time instead of an internal server error, I was falling through air slowly as if in a chunk error. There was no land. A message popped up that said, "Error: null." After checking the console, I discovered that this was a null pointer error. Do you know what this is?
2013-06-07 16:38:02 [INFO] [TerrainControl] World TestWorld is now enabled
2013-06-07 16:38:02 [INFO] Preparing start region for level 3 (Seed: 66034482)
2013-06-07 16:38:03 [SEVERE] java.lang.NullPointerException
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.World.getMaterial(World.java:332)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.WorldGenDungeons.a(SourceFile:23)
2013-06-07 16:38:03 [SEVERE] at com.khorn.terraincontrol.bukkit.BukkitWorld.PlaceDungeons(BukkitWorld.java:204)
2013-06-07 16:38:03 [SEVERE] at com.khorn.terraincontrol.generator.resourcegens.DungeonGen.spawn(DungeonGen.java:30)
2013-06-07 16:38:03 [SEVERE] at com.khorn.terraincontrol.generator.resourcegens.Resource.spawnInChunk(Resource.java:89)
2013-06-07 16:38:03 [SEVERE] at com.khorn.terraincontrol.generator.resourcegens.Resource.process(Resource.java:69)
2013-06-07 16:38:03 [SEVERE] at com.khorn.terraincontrol.generator.ObjectSpawner.populate(ObjectSpawner.java:61)
2013-06-07 16:38:03 [SEVERE] at com.khorn.terraincontrol.bukkit.TCBlockPopulator.populate(TCBlockPopulator.java:27)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:238)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.Chunk.a(Chunk.java:800)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:142)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:84)
2013-06-07 16:38:03 [SEVERE] at org.bukkit.craftbukkit.v1_5_R3.CraftServer.createWorld(CraftServer.java:759)
2013-06-07 16:38:03 [SEVERE] at org.bukkit.Bukkit.createWorld(Bukkit.java:157)
2013-06-07 16:38:03 [SEVERE] at org.bukkit.WorldCreator.createWorld(WorldCreator.java:235)
2013-06-07 16:38:03 [SEVERE] at com.onarandombox.MultiverseCore.utils.WorldManager.doLoad(WorldManager.java:421)
2013-06-07 16:38:03 [SEVERE] at com.onarandombox.MultiverseCore.utils.WorldManager.doLoad(WorldManager.java:402)
2013-06-07 16:38:03 [SEVERE] at com.onarandombox.MultiverseCore.utils.WorldManager.doLoad(WorldManager.java:377)
2013-06-07 16:38:03 [SEVERE] at com.onarandombox.MultiverseCore.utils.WorldManager.loadWorlds(WorldManager.java:676)
2013-06-07 16:38:03 [SEVERE] at com.onarandombox.MultiverseCore.MultiverseCore.onEnable(MultiverseCore.java:303)
2013-06-07 16:38:03 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
2013-06-07 16:38:03 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457)
2013-06-07 16:38:03 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
2013-06-07 16:38:03 [SEVERE] at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugin(CraftServer.java:282)
2013-06-07 16:38:03 [SEVERE] at org.bukkit.craftbukkit.v1_5_R3.CraftServer.enablePlugins(CraftServer.java:264)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.j(MinecraftServer.java:304)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.e(MinecraftServer.java:283)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.a(MinecraftServer.java:243)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:151)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:382)
2013-06-07 16:38:03 [SEVERE] at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
2013-06-07 16:38:03 [SEVERE] [Multiverse-Core] The world 'TestWorld' could NOT be loaded because it contains errors!
It seems that the error occured on this line:
return l == 0 ? Material.AIR : Block.byId[l].material;
It looks like the dungeon was placed on a non-existant block type, which is strange. Are you running any mods/plugins that add new block types? Are you running plain CraftBukkit, or a fork like Spigot or MCPC+? Are the materials in the dungeon resource correctly spelled?
About your other problem: normally nothing should crash when using custom biomes, even when not using ReplaceToBiomeName
. That setting was added just so that the vanilla client would display things better.
No new blocks. Our server is mainly semi-Vanilla. We just use a custom generator to make the terrain not boring. Which files should I check to find out if something is misspelled?
Could it be that it's trying to generate a dungeon mid-air? Some of the configs have max height for dungeons as 180. Also, the dungeon resources part seems to just dictate where the dungeons spawn. If there were a nonexistent block somewhere, where would I it in the configs?
The dungeon resources in all the BiomeConfigs...
What is also worth trying is to add TerrainControl also to the bukkit.yml.
I don't know if the dungeon is trying to spawn in the air.
Terrain Control allows you to:
- Use the block names of vanilla blocks. Names are checked.
- Use the block id of any block, vanilla or modded. Ids aren't checked and may throw exceptions.
Maybe you have mixed up/omitted some parameters in a Dungeon resource, so that, for example, TC is using the rarity as a block id?
Dungeon(Frequency,Rarity,MinAltitude,MaxAltitude)
I don't see any block ids there. Here's what most of the configs have for the dungeon line:
Dungeon(8,100.0,0,128)
I can see two possible problems here. First is that maybe it's trying to generate dungeons on the Void since MinAltitude is 0 and maybe it's trying to generate dungeons mid-air since MaxAltitude is 128. But I don't know how the plugin works exactly. Could one of those be the problem?
Hmm, I thought that TC would have a setting for the material of the dungeon. Still, it can spawn on top of a block with an invalid id, generated by another resource. I should add a check to TC's setBlock to check this.
Honestly, I also don't know how the dungeon spawning works exactly. The dungeon resource calls native Minecraft code. I have only glanched over the obfuscated code.
It shoudn't throw exceptions when spawning in the air, since Minecraft checks for air: if the block id is 0, it returns the air material.
We have no new blocks. I don't understand why it would spawn on a new block. Any ideas for what I can do to fix this?
I'm sorry for doubleposting, but I really need help with this.
A little bit different approach: all the resources now check for invalid block ids once TC starts up. The surface/ground/waterblocks can still be invalid, though. Checking every time setBlock() is called would be a waste of time, since they are valid 99% of the time.