mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-05 10:09:53 +01:00
commit
475db4a97c
@ -47,6 +47,8 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
|||||||
private Method cw_gethandle;
|
private Method cw_gethandle;
|
||||||
|
|
||||||
/** BiomeBase related helpers */
|
/** BiomeBase related helpers */
|
||||||
|
protected Class<?> biomestorage;
|
||||||
|
protected Field biomestoragebase;
|
||||||
protected Class<?> biomebase;
|
protected Class<?> biomebase;
|
||||||
protected Class<?> biomebasearray;
|
protected Class<?> biomebasearray;
|
||||||
protected Field biomebaselist;
|
protected Field biomebaselist;
|
||||||
@ -131,7 +133,12 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
|||||||
/* CraftChunkSnapshot */
|
/* CraftChunkSnapshot */
|
||||||
craftchunksnapshot = getOBCClass("org.bukkit.craftbukkit.CraftChunkSnapshot");
|
craftchunksnapshot = getOBCClass("org.bukkit.craftbukkit.CraftChunkSnapshot");
|
||||||
biomebasearray = getNMSClass("[Lnet.minecraft.server.BiomeBase;");
|
biomebasearray = getNMSClass("[Lnet.minecraft.server.BiomeBase;");
|
||||||
ccss_biome = getPrivateField(craftchunksnapshot, new String[] { "biome" }, biomebasearray);
|
ccss_biome = getPrivateFieldNoFail(craftchunksnapshot, new String[] { "biome" }, biomebasearray);
|
||||||
|
if(ccss_biome == null) {
|
||||||
|
biomestorage = getNMSClass("net.minecraft.server.BiomeStorage");
|
||||||
|
biomestoragebase = getPrivateField(biomestorage, new String[] { "f" }, biomebasearray);
|
||||||
|
ccss_biome = getPrivateField(craftchunksnapshot, new String[] { "biome" }, biomestorage);
|
||||||
|
}
|
||||||
/* CraftChunk */
|
/* CraftChunk */
|
||||||
craftchunk = getOBCClass("org.bukkit.craftbukkit.CraftChunk");
|
craftchunk = getOBCClass("org.bukkit.craftbukkit.CraftChunk");
|
||||||
cc_gethandle = getMethod(craftchunk, new String[] { "getHandle" }, new Class[0]);
|
cc_gethandle = getMethod(craftchunk, new String[] { "getHandle" }, new Class[0]);
|
||||||
@ -321,7 +328,11 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
|
|||||||
* Get list of defined biomebase objects
|
* Get list of defined biomebase objects
|
||||||
*/
|
*/
|
||||||
public Object[] getBiomeBaseList() {
|
public Object[] getBiomeBaseList() {
|
||||||
return (Object[]) getFieldValue(biomebase, biomebaselist, new Object[0]);
|
Object baselist = getFieldValue(biomebase, biomebaselist, new Object[0]);
|
||||||
|
if(biomestoragebase != null)
|
||||||
|
baselist = getFieldValue(baselist, biomestoragebase, new Object[0]);
|
||||||
|
|
||||||
|
return (Object[])baselist;
|
||||||
}
|
}
|
||||||
/** Get temperature from biomebase */
|
/** Get temperature from biomebase */
|
||||||
public float getBiomeBaseTemperature(Object bb) {
|
public float getBiomeBaseTemperature(Object bb) {
|
||||||
|
Loading…
Reference in New Issue
Block a user