mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-25 01:57:53 +01:00
Fix pre-1.13 startup problem without breaking 1.13.1...
This commit is contained in:
parent
7d72dc4bbd
commit
e41b1f9a54
@ -47,6 +47,11 @@ public class BukkitVersionHelperSpigot113_1 extends BukkitVersionHelperCB {
|
||||
protected Class<?> datapalettearray;
|
||||
private Field blockid_field;
|
||||
|
||||
@Override
|
||||
protected boolean isBlockIdNeeded() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public BukkitVersionHelperSpigot113_1() {
|
||||
datapalettearray = getNMSClass("[Lnet.minecraft.server.DataPaletteBlock;");
|
||||
blockid_field = getPrivateField(craftchunksnapshot, new String[] { "blockids" }, datapalettearray);
|
||||
|
@ -46,6 +46,11 @@ public class BukkitVersionHelperSpigot113 extends BukkitVersionHelperCB {
|
||||
protected Class<?> datapalettearray;
|
||||
private Field blockid_field;
|
||||
|
||||
@Override
|
||||
protected boolean isBlockIdNeeded() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public BukkitVersionHelperSpigot113() {
|
||||
datapalettearray = getNMSClass("[Lnet.minecraft.server.DataPaletteBlock;");
|
||||
blockid_field = getPrivateField(craftchunksnapshot, new String[] { "blockids" }, datapalettearray);
|
||||
|
@ -22,7 +22,9 @@ public abstract class BukkitVersionHelper {
|
||||
|
||||
public static DynmapBlockState[] stateByID;
|
||||
|
||||
protected boolean blockidsneeded = true;
|
||||
protected boolean isBlockIdNeeded() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected BukkitVersionHelper() {
|
||||
|
||||
|
@ -69,14 +69,11 @@ 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+
|
||||
if (isBlockIdNeeded()) { // 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