3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Merge pull request #76 from kashike/mrn

ServerPreConnectEvent#getInfo -> getServer
Dieser Commit ist enthalten in:
Andrew Steinborn 2018-09-14 00:17:25 -04:00 committet von GitHub
Commit d028c281c9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 7 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -50,11 +50,11 @@ public class ServerPreConnectEvent implements ResultedEvent<ServerPreConnectEven
private static final ServerResult DENIED = new ServerResult(false, null); private static final ServerResult DENIED = new ServerResult(false, null);
private final boolean allowed; private final boolean allowed;
private final ServerInfo info; private final ServerInfo server;
private ServerResult(boolean allowed, @Nullable ServerInfo info) { private ServerResult(boolean allowed, @Nullable ServerInfo server) {
this.allowed = allowed; this.allowed = allowed;
this.info = info; this.server = server;
} }
@Override @Override
@ -62,8 +62,8 @@ public class ServerPreConnectEvent implements ResultedEvent<ServerPreConnectEven
return allowed; return allowed;
} }
public Optional<ServerInfo> getInfo() { public Optional<ServerInfo> getServer() {
return Optional.ofNullable(info); return Optional.ofNullable(server);
} }
@Override @Override
@ -71,7 +71,7 @@ public class ServerPreConnectEvent implements ResultedEvent<ServerPreConnectEven
if (!allowed) { if (!allowed) {
return "denied"; return "denied";
} }
return "allowed: connect to " + info.getName(); return "allowed: connect to " + server.getName();
} }
public static ServerResult denied() { public static ServerResult denied() {

Datei anzeigen

@ -284,7 +284,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
); );
} }
return new VelocityServerConnection(newEvent.getResult().getInfo().get(), this, server).connect(); return new VelocityServerConnection(newEvent.getResult().getServer().get(), this, server).connect();
}); });
} }