mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-30 14:13:38 +01:00
Fix pre-1.13 helper problem (introduced by 1.13.1 support)
This commit is contained in:
parent
35a74cd0d0
commit
fb1026b60f
@ -22,6 +22,8 @@ public abstract class BukkitVersionHelper {
|
||||
|
||||
public static DynmapBlockState[] stateByID;
|
||||
|
||||
protected boolean blockidsneeded = true;
|
||||
|
||||
protected BukkitVersionHelper() {
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
||||
private Method getbiomefunc;
|
||||
private Method getidbybiome;
|
||||
private boolean isBadUnload = false;
|
||||
protected boolean blockidsneeded = true;
|
||||
|
||||
public BukkitVersionHelperCB() {
|
||||
|
||||
@ -70,11 +69,14 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
||||
nmsblock = getNMSClass("net.minecraft.server.Block");
|
||||
nmsblockarray = getNMSClass("[Lnet.minecraft.server.Block;");
|
||||
nmsmaterial = getNMSClass("net.minecraft.server.Material");
|
||||
Log.info("blockidsneeded=" + blockidsneeded);
|
||||
if (blockidsneeded) { // Not needed for 1.13+
|
||||
blockbyid = getFieldNoFail(nmsblock, new String[] { "byId" }, nmsblockarray);
|
||||
if (blockbyid == null) {
|
||||
blockbyidfunc = getMethod(nmsblock, new String[] { "getById", "e" }, new Class[] { int.class });
|
||||
Log.info("blockbyidfunc found = " + (blockbyidfunc != null));
|
||||
}
|
||||
Log.info("blockbyid found = " + (blockbyid != null));
|
||||
}
|
||||
material = getPrivateField(nmsblock, new String[] { "material" }, nmsmaterial);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user