This commit is contained in:
ajgeiss0702
2021-07-12 21:05:08 -07:00
parent 5165185ff1
commit 00a1d1fd39
3 changed files with 4 additions and 4 deletions
@@ -44,9 +44,9 @@ public class PlatformMethodsImpl implements PlatformMethods {
@Override @Override
public String getPluginVersion() { public String getPluginVersion() {
Optional<PluginContainer> plugin = proxyServer.getPluginManager().getPlugin("ajqueue"); Optional<PluginContainer> plugin = proxyServer.getPluginManager().getPlugin("ajqueue");
if(plugin.isEmpty()) return "?E"; if(!plugin.isPresent()) return "?E";
Optional<String> version = plugin.get().getDescription().getVersion(); Optional<String> version = plugin.get().getDescription().getVersion();
if(version.isEmpty()) return "?V"; if(!version.isPresent()) return "?V";
return version.get(); return version.get();
} }
} }
@@ -50,7 +50,7 @@ public class VelocityPlayer implements AdaptedPlayer, Audience {
@Override @Override
public String getServerName() { public String getServerName() {
Optional<ServerConnection> serverConnection = handle.getCurrentServer(); Optional<ServerConnection> serverConnection = handle.getCurrentServer();
if(serverConnection.isEmpty()) return "none"; if(!serverConnection.isPresent()) return "none";
ServerConnection connection = serverConnection.get(); ServerConnection connection = serverConnection.get();
return connection.getServerInfo().getName(); return connection.getServerInfo().getName();
} }
@@ -38,7 +38,7 @@ public class ServerBuilderImpl implements ServerBuilder {
@Override @Override
public AdaptedServer getServer(String name) { public AdaptedServer getServer(String name) {
Optional<RegisteredServer> serverOptional = proxyServer.getServer(name); Optional<RegisteredServer> serverOptional = proxyServer.getServer(name);
if(serverOptional.isEmpty()) return null; if(!serverOptional.isPresent()) return null;
return new VelocityServer(serverOptional.get()); return new VelocityServer(serverOptional.get());
} }