webbukkit/DynmapCore

Possible bug in BukkitVersionHelperGeneric?

Scopelabz opened this issue · 1 comments

Hey there!

I was trying to get Dynmap to render a biome overview and noticed some of the new (mutated) ones were just being grey as if they weren't properly recognized. I've traced the possible error back to BukkitVersionHelperGeneric - biomebasearray does not seem to have been initialized at all - which prevented getPrivateField(...) from accessing the "biome" property of CraftChunkSnapshot.

I was able to fix this by going to line 111

/* CraftChunkSnapshot */
craftchunksnapshot = getOBCClass("org.bukkit.craftbukkit.CraftChunkSnapshot");
ccss_biome = getPrivateField(craftchunksnapshot, new String[] { "biome" }, biomebasearray);

and adding a few lines of code as follows

/* CraftChunkSnapshot */
craftchunksnapshot = getOBCClass("org.bukkit.craftbukkit.CraftChunkSnapshot");

Class<?> bbaseClass = getNMSClass("net.minecraft.server.BiomeBase");
biomebasearray = (java.lang.reflect.Array.newInstance(bbaseClass, 1)).getClass();

ccss_biome = getPrivateFieldNoFail(craftchunksnapshot, new String[] { "biome" }, biomebasearray);

Dunno, maybe you can use this information somehow which is why I thought I'd open a ticket here. (:

Regards,
Matthias