Skip to content

Instantly share code, notes, and snippets.

@daboross
Last active August 29, 2015 14:07
Show Gist options
  • Save daboross/6545111b7eb0eba7ae88 to your computer and use it in GitHub Desktop.
Save daboross/6545111b7eb0eba7ae88 to your computer and use it in GitHub Desktop.

Error:

java.lang.ArrayIndexOutOfBoundsException: -1
         at net.glowstone.constants.GlowBiome.getBiome(GlowBiome.java:36)

https://github.com/GlowstoneMC/Glowstone/blob/master/src/main/java/net/glowstone/GlowChunk.java#L567 returns -1 when chunk isn't initialized.

Then https://github.com/GlowstoneMC/Glowstone/blob/master/src/main/java/net/glowstone/GlowWorld.java#L1065 calls GlowBiome.getBiome with -1.

https://github.com/GlowstoneMC/Glowstone/blob/master/src/main/java/net/glowstone/constants/GlowBiome.java#L35 throws ArrayIndexOutOfBoundsException when passed -1.

This causes GlowWorld.getBiome(int x, int z) to fail from inside chunk generators.

Perhaps a fix would be to have GlowChunk to return a default biome number instead of -1 when uninitialized?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment