mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-17 22:28:15 +01:00
Get gspigot 1.14 runnin
This commit is contained in:
parent
6f7ccbf7d9
commit
e8ec7da47d
1
bukkit-helper-114/bin/.gitignore
vendored
Normal file
1
bukkit-helper-114/bin/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/main/
|
@ -53,6 +53,11 @@ public class BukkitVersionHelperSpigot114 extends BukkitVersionHelperCB {
|
|||||||
protected boolean isBlockIdNeeded() {
|
protected boolean isBlockIdNeeded() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean isBiomeBaseListNeeded() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public BukkitVersionHelperSpigot114() {
|
public BukkitVersionHelperSpigot114() {
|
||||||
datapalettearray = getNMSClass("[Lnet.minecraft.server.DataPaletteBlock;");
|
datapalettearray = getNMSClass("[Lnet.minecraft.server.DataPaletteBlock;");
|
||||||
@ -94,6 +99,21 @@ public class BukkitVersionHelperSpigot114 extends BukkitVersionHelperCB {
|
|||||||
}
|
}
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of defined biomebase objects
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object[] getBiomeBaseList() {
|
||||||
|
if (biomelist == null) {
|
||||||
|
biomelist = new Object[1024];
|
||||||
|
for (int i = 0; i < 1024; i++) {
|
||||||
|
biomelist[i] = IRegistry.BIOME.fromId(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return biomelist;
|
||||||
|
}
|
||||||
|
|
||||||
/** Get ID from biomebase */
|
/** Get ID from biomebase */
|
||||||
@Override
|
@Override
|
||||||
public int getBiomeBaseID(Object bb) {
|
public int getBiomeBaseID(Object bb) {
|
||||||
|
@ -25,6 +25,9 @@ public abstract class BukkitVersionHelper {
|
|||||||
protected boolean isBlockIdNeeded() {
|
protected boolean isBlockIdNeeded() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
protected boolean isBiomeBaseListNeeded() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected BukkitVersionHelper() {
|
protected BukkitVersionHelper() {
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
|||||||
biomebase = getNMSClass("net.minecraft.server.BiomeBase");
|
biomebase = getNMSClass("net.minecraft.server.BiomeBase");
|
||||||
biomebasearray = getNMSClass("[Lnet.minecraft.server.BiomeBase;");
|
biomebasearray = getNMSClass("[Lnet.minecraft.server.BiomeBase;");
|
||||||
biomebaselist = getPrivateFieldNoFail(biomebase, new String[] { "biomes" }, biomebasearray);
|
biomebaselist = getPrivateFieldNoFail(biomebase, new String[] { "biomes" }, biomebasearray);
|
||||||
if (biomebaselist == null) {
|
if ((biomebaselist == null) && isBiomeBaseListNeeded()) {
|
||||||
getbiomefunc = getMethodNoFail(biomebase, new String[] { "getBiome" }, new Class[] { int.class, biomebase });
|
getbiomefunc = getMethodNoFail(biomebase, new String[] { "getBiome" }, new Class[] { int.class, biomebase });
|
||||||
if (getbiomefunc == null) {
|
if (getbiomefunc == null) {
|
||||||
getbiomebyid = getMethod(biomebase, new String[] { "a" }, new Class[] { int.class} );
|
getbiomebyid = getMethod(biomebase, new String[] { "a" }, new Class[] { int.class} );
|
||||||
@ -110,7 +110,7 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
|||||||
else {
|
else {
|
||||||
biomebasehumifunc = getMethod(biomebase, new String[] { "getHumidity" }, nulltypes);
|
biomebasehumifunc = getMethod(biomebase, new String[] { "getHumidity" }, nulltypes);
|
||||||
}
|
}
|
||||||
biomebaseidstring = getPrivateField(biomebase, new String[] { "y", "af", "ah", "z", "aS", "aR" }, String.class);
|
biomebaseidstring = getPrivateField(biomebase, new String[] { "y", "af", "ah", "z", "aS", "aR", "f" }, String.class);
|
||||||
biomebaseid = getFieldNoFail(biomebase, new String[] { "id" }, int.class);
|
biomebaseid = getFieldNoFail(biomebase, new String[] { "id" }, int.class);
|
||||||
if (biomebaseid == null) {
|
if (biomebaseid == null) {
|
||||||
getidbybiome = getMethod(biomebase, new String[] { "a" }, new Class[] { biomebase } );
|
getidbybiome = getMethod(biomebase, new String[] { "a" }, new Class[] { biomebase } );
|
||||||
@ -165,10 +165,18 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
|||||||
/** n.m.s.WorldBorder */
|
/** n.m.s.WorldBorder */
|
||||||
nmsworldborder = getNMSClassNoFail("net.minecraft.server.WorldBorder");
|
nmsworldborder = getNMSClassNoFail("net.minecraft.server.WorldBorder");
|
||||||
if (nmsworldborder != null) {
|
if (nmsworldborder != null) {
|
||||||
worldborderminx = getMethod(nmsworldborder, new String[] { "b" }, nulltypes);
|
worldbordermaxz = getMethodNoFail(nmsworldborder, new String[] { "f" }, nulltypes);
|
||||||
worldborderminz = getMethod(nmsworldborder, new String[] { "c" }, nulltypes);
|
if (worldbordermaxz == null) {
|
||||||
worldbordermaxx = getMethod(nmsworldborder, new String[] { "d" }, nulltypes);
|
worldborderminx = getMethod(nmsworldborder, new String[] { "b" }, nulltypes);
|
||||||
worldbordermaxz = getMethod(nmsworldborder, new String[] { "e" }, nulltypes);
|
worldborderminz = getMethod(nmsworldborder, new String[] { "c" }, nulltypes);
|
||||||
|
worldbordermaxx = getMethod(nmsworldborder, new String[] { "d" }, nulltypes);
|
||||||
|
worldbordermaxz = getMethod(nmsworldborder, new String[] { "e" }, nulltypes);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
worldborderminx = getMethod(nmsworldborder, new String[] { "c" }, nulltypes);
|
||||||
|
worldborderminz = getMethod(nmsworldborder, new String[] { "d" }, nulltypes);
|
||||||
|
worldbordermaxx = getMethod(nmsworldborder, new String[] { "e" }, nulltypes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** nbt classes */
|
/** nbt classes */
|
||||||
@ -334,7 +342,7 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric {
|
|||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
private Object[] biomelist = null;
|
protected Object[] biomelist = null;
|
||||||
/**
|
/**
|
||||||
* Get list of defined biomebase objects
|
* Get list of defined biomebase objects
|
||||||
*/
|
*/
|
||||||
|
@ -252,7 +252,11 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String getServerName() {
|
public String getServerName() {
|
||||||
return getServer().getServerName();
|
try {
|
||||||
|
return getServer().getServerName();
|
||||||
|
} catch (NoSuchMethodError x) { // Missing in 1.14 spigot - no idea why removed...
|
||||||
|
return getServer().getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean isPlayerBanned(String pid) {
|
public boolean isPlayerBanned(String pid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user