Fix server name to use MOTD on 1.14.x

This commit is contained in:
Mike Primm 2019-06-08 21:58:00 -05:00
parent 7f8dcf0eb3
commit 9746dc19f4

View File

@ -250,13 +250,16 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
else
return null;
}
private boolean noservername = false;
@Override
public String getServerName() {
try {
return getServer().getServerName();
if (!noservername)
return getServer().getServerName();
} catch (NoSuchMethodError x) { // Missing in 1.14 spigot - no idea why removed...
return getServer().getName();
noservername = true;
}
return getServer().getMotd();
}
@Override
public boolean isPlayerBanned(String pid) {