3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-23 23:00:35 +01:00

Misc code cleanup

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-09-07 17:54:59 -04:00
Ursprung a66246b83c
Commit be9547612f
5 geänderte Dateien mit 11 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -70,8 +70,8 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
}
if (!connection.hasCompletedJoin() && pm.getChannel().equals(VelocityConstants.FORGE_LEGACY_HANDSHAKE_CHANNEL)) {
if (!connection.isModded()) {
connection.setModded(true);
if (!connection.isLegacyForge()) {
connection.setLegacyForge(true);
// We must always reset the handshake before a modded connection is established if
// we haven't done so already.

Datei anzeigen

@ -85,7 +85,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
} else {
// The previous server connection should become obsolete.
// Before we remove it, if the server we are departing is modded, we must always reset the client state.
if (existingConnection.isModded()) {
if (existingConnection.isLegacyForge()) {
connection.getPlayer().sendLegacyForgeHandshakeResetPacket();
}
existingConnection.disconnect();
@ -123,7 +123,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
}
}
static ByteBuf createForwardingData(byte[] hmacSecret, String address, GameProfile profile) {
private static ByteBuf createForwardingData(byte[] hmacSecret, String address, GameProfile profile) {
ByteBuf dataToForward = Unpooled.buffer();
ByteBuf finalData = Unpooled.buffer();
try {

Datei anzeigen

@ -43,7 +43,7 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
private final ConnectedPlayer proxyPlayer;
private final VelocityServer server;
private MinecraftConnection minecraftConnection;
private boolean isModded = false;
private boolean legacyForge = false;
private boolean hasCompletedJoin = false;
public VelocityServerConnection(ServerInfo target, ConnectedPlayer proxyPlayer, VelocityServer server) {
@ -159,12 +159,12 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
minecraftConnection.write(message);
}
public boolean isModded() {
return isModded;
public boolean isLegacyForge() {
return legacyForge;
}
public void setModded(boolean modded) {
isModded = modded;
public void setLegacyForge(boolean modded) {
legacyForge = modded;
}
public boolean hasCompletedJoin() {

Datei anzeigen

@ -243,7 +243,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
return;
}
if (player.getConnectedServer().isModded() && !player.getConnectedServer().hasCompletedJoin()) {
if (player.getConnectedServer().isLegacyForge() && !player.getConnectedServer().hasCompletedJoin()) {
// Ensure that the messages are forwarded
player.getConnectedServer().getMinecraftConnection().write(packet);
return;

Datei anzeigen

@ -12,7 +12,7 @@ public class ClientSettingsWrapper implements PlayerSettings {
private final SkinParts parts;
private Locale locale = null;
public ClientSettingsWrapper(ClientSettings settings) {
ClientSettingsWrapper(ClientSettings settings) {
this.settings = settings;
this.parts = new SkinParts((byte) settings.getSkinParts());
}