geforkt von Mirrors/Velocity
Misc code cleanup
Dieser Commit ist enthalten in:
Ursprung
a66246b83c
Commit
be9547612f
@ -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.
|
||||
|
@ -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 {
|
||||
|
@ -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() {
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren