EcoCityCraft/Spigot — pull request #46 by agaricusb (2013-01-13 11:53:24+00:00)
Title: Fix mcRegion-to-Anvil conversion

Since the lighter Nibble arrays commit, loading .mcr worlds crashes with:

03:40:19 [INFO] Starting minecraft server version 1.4.6
03:40:19 [INFO] Loading properties
03:40:19 [INFO] Default game type: SURVIVAL
03:40:19 [INFO] Generating keypair
03:40:20 [INFO] Starting Minecraft server on *:25565
03:40:20 [INFO] This server is running CraftBukkit version git-Spigot-1.4.6-R0.3-20-g59d777d (MC: 1.4.6) (Implementing API version 1.4.6-R0.4-SNAPSHOT)
03:40:20 [INFO] --------Setting up Storm Configuration--------
03:40:20 [INFO] Storm Type: strong-electrical-storm
03:40:20 [INFO] Chance: 5
03:40:20 [INFO] Lightning Delay Ticks: 10
03:40:20 [INFO] Lightning Random Delay Ticks: 20
03:40:20 [INFO] Storm Type: electrical-storm
03:40:20 [INFO] Chance: 15
03:40:20 [INFO] Lightning Delay Ticks: 40
03:40:20 [INFO] Lightning Random Delay Ticks: 150
03:40:20 [INFO] Storm Type: strong-thunderstorm
03:40:20 [INFO] Chance: 30
03:40:20 [INFO] Lightning Delay Ticks: 60
03:40:20 [INFO] Lightning Random Delay Ticks: 250
03:40:20 [INFO] Storm Type: thunderstorm
03:40:20 [INFO] Chance: 50
03:40:20 [INFO] Lightning Delay Ticks: 100
03:40:20 [INFO] Lightning Random Delay Ticks: 500
03:40:20 [INFO] Storm Type: weak-thunderstorm
03:40:20 [INFO] Chance: 75
03:40:20 [INFO] Lightning Delay Ticks: 300
03:40:20 [INFO] Lightning Random Delay Ticks: 1000
03:40:20 [INFO] Storm Type: rainstorm
03:40:20 [INFO] Chance: 100
03:40:20 [INFO] Lightning Delay Ticks: 500
03:40:20 [INFO] Lightning Random Delay Ticks: 2000
03:40:20 [INFO] --------Finished Storm Configuration--------
03:40:20 [INFO] Preparing level "world"
03:40:20 [INFO] Converting map!
03:40:20 [INFO] Scanning folders...
03:40:20 [INFO] Total conversion count is 4
03:40:20 [SEVERE] java.lang.IllegalAccessError: tried to access field net.minecraft.server.v1_4_6.NibbleArray.a from class net.minecraft.server.v1_4_6.OldChunkLoader
03:40:20 [SEVERE]	at net.minecraft.server.v1_4_6.OldChunkLoader.a(SourceFile:96)
03:40:20 [SEVERE]	at net.minecraft.server.v1_4_6.WorldLoaderServer.a(SourceFile:215)
03:40:20 [SEVERE]	at net.minecraft.server.v1_4_6.WorldLoaderServer.a(SourceFile:181)
03:40:20 [SEVERE]	at net.minecraft.server.v1_4_6.WorldLoaderServer.convert(SourceFile:140)
03:40:20 [SEVERE]	at net.minecraft.server.v1_4_6.MinecraftServer.b(MinecraftServer.java:155)
03:40:20 [SEVERE]	at net.minecraft.server.v1_4_6.MinecraftServer.a(MinecraftServer.java:164)
03:40:20 [SEVERE]	at net.minecraft.server.v1_4_6.DedicatedServer.init(DedicatedServer.java:149)
03:40:20 [SEVERE]	at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:404)
03:40:20 [SEVERE]	at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
03:40:20 [SEVERE] Encountered an unexpected exception IllegalAccessError
java.lang.IllegalAccessError: tried to access field net.minecraft.server.v1_4_6.NibbleArray.a from class net.minecraft.server.v1_4_6.OldChunkLoader
at net.minecraft.server.v1_4_6.OldChunkLoader.a(SourceFile:96)
at net.minecraft.server.v1_4_6.WorldLoaderServer.a(SourceFile:215)
at net.minecraft.server.v1_4_6.WorldLoaderServer.a(SourceFile:181)
at net.minecraft.server.v1_4_6.WorldLoaderServer.convert(SourceFile:140)
at net.minecraft.server.v1_4_6.MinecraftServer.b(MinecraftServer.java:155)
at net.minecraft.server.v1_4_6.MinecraftServer.a(MinecraftServer.java:164)
at net.minecraft.server.v1_4_6.DedicatedServer.init(DedicatedServer.java:149)
at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:404)
at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
03:40:20 [SEVERE] This crash report has been saved to: /private/tmp/old/./crash-reports/crash-2013-01-13_03.40.20-server.txt

Tested with Spigot build #387.

This PR updates OldChunkLoader to use getValueArray() instead of directly accessing the (now private) byte array on NibbleArray, allowing pre-Anvil world conversion and load to succeed without error.