mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-11-22 11:55:24 +01:00
Merge remote-tracking branch 'origin/main'
# Conflicts: # src/main/java/net/raphimc/viaproxy/proxy/client2proxy/Client2ProxyHandler.java
This commit is contained in:
commit
50c117dd6a
@ -18,7 +18,7 @@
|
||||
package java.lang;
|
||||
|
||||
/**
|
||||
* Dummy class to make IntelliJ able to access records in Java 8 code
|
||||
* Dummy class to make IntelliJ able to access records in Java 8 code.
|
||||
*/
|
||||
public abstract class Record {
|
||||
|
||||
|
@ -43,10 +43,10 @@ public abstract class MixinAbstractFenceConnectionHandler {
|
||||
public byte getStates(UserConnection user, Position position, int blockState) {
|
||||
byte states = 0;
|
||||
boolean pre1_12 = VersionEnum.fromUserConnection(user).isOlderThan(VersionEnum.r1_12);
|
||||
if (connects(BlockFace.EAST, getBlockData(user, position.getRelative(BlockFace.EAST)), pre1_12)) states |= 1;
|
||||
if (connects(BlockFace.NORTH, getBlockData(user, position.getRelative(BlockFace.NORTH)), pre1_12)) states |= 2;
|
||||
if (connects(BlockFace.SOUTH, getBlockData(user, position.getRelative(BlockFace.SOUTH)), pre1_12)) states |= 4;
|
||||
if (connects(BlockFace.WEST, getBlockData(user, position.getRelative(BlockFace.WEST)), pre1_12)) states |= 8;
|
||||
if (this.connects(BlockFace.EAST, this.getBlockData(user, position.getRelative(BlockFace.EAST)), pre1_12)) states |= 1;
|
||||
if (this.connects(BlockFace.NORTH, this.getBlockData(user, position.getRelative(BlockFace.NORTH)), pre1_12)) states |= 2;
|
||||
if (this.connects(BlockFace.SOUTH, this.getBlockData(user, position.getRelative(BlockFace.SOUTH)), pre1_12)) states |= 4;
|
||||
if (this.connects(BlockFace.WEST, this.getBlockData(user, position.getRelative(BlockFace.WEST)), pre1_12)) states |= 8;
|
||||
return states;
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ import io.netty.channel.ChannelHandler;
|
||||
public class Client2ProxyHandlerCreationEvent {
|
||||
|
||||
/**
|
||||
* The handler which will be used to handle Client<->Proxy packets
|
||||
* The handler which will be used to handle Client<->Proxy packets.
|
||||
*/
|
||||
private ChannelHandler handler;
|
||||
|
||||
|
@ -22,7 +22,7 @@ import io.netty.channel.ChannelHandler;
|
||||
public class Proxy2ServerHandlerCreationEvent {
|
||||
|
||||
/**
|
||||
* The handler which will be used to handle Proxy<->Server packets
|
||||
* The handler which will be used to handle Proxy<->Server packets.
|
||||
*/
|
||||
private ChannelHandler handler;
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class ResolveSrvEvent extends EventCancellable {
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
return this.host;
|
||||
}
|
||||
|
||||
public void setHost(final String host) {
|
||||
@ -45,7 +45,7 @@ public class ResolveSrvEvent extends EventCancellable {
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
return this.port;
|
||||
}
|
||||
|
||||
public void setPort(final int port) {
|
||||
|
@ -31,7 +31,7 @@ public class ViaProxyTransferProvider extends TransferProvider {
|
||||
public void connectToServer(UserConnection user, InetSocketAddress newAddress) {
|
||||
ViaBedrockTransferHolder.addTempRedirect(user.getChannel(), newAddress);
|
||||
try {
|
||||
ProxyConnection.fromUserConnection(user).kickClient("§aThe server transferred you to another server §7(§e"+ newAddress.getHostName() + ":" + newAddress.getPort() + "§7)§a. Please reconnect to ViaProxy.");
|
||||
ProxyConnection.fromUserConnection(user).kickClient("§aThe server transferred you to another server §7(§e" + newAddress.getHostName() + ":" + newAddress.getPort() + "§7)§a. Please reconnect to ViaProxy.");
|
||||
} catch (CloseAndReturn ignored) {
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ public class UpdateCheckTask implements Runnable {
|
||||
boolean found = false;
|
||||
for (JsonElement asset : assets) {
|
||||
JsonObject assetObject = asset.getAsJsonObject();
|
||||
if (isViaProxyJar(object, assetObject)) {
|
||||
if (this.isViaProxyJar(object, assetObject)) {
|
||||
found = true;
|
||||
SwingUtilities.invokeLater(() -> this.showUpdateQuestion(assetObject.get("name").getAsString(), assetObject.get("browser_download_url").getAsString(), latestVersion));
|
||||
break;
|
||||
|
@ -82,7 +82,7 @@ public class ViaProxyUI extends JFrame {
|
||||
this.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
for (AUITab tab : tabs) tab.onClose();
|
||||
for (AUITab tab : ViaProxyUI.this.tabs) tab.onClose();
|
||||
}
|
||||
});
|
||||
this.setSize(500, 353);
|
||||
|
@ -94,24 +94,24 @@ public class AccountsTab extends AUITab {
|
||||
this.accountsList.addMouseListener(new MouseAdapter() {
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (SwingUtilities.isRightMouseButton(e)) {
|
||||
int row = accountsList.locationToIndex(e.getPoint());
|
||||
accountsList.setSelectedIndex(row);
|
||||
int row = AccountsTab.this.accountsList.locationToIndex(e.getPoint());
|
||||
AccountsTab.this.accountsList.setSelectedIndex(row);
|
||||
} else if (e.getClickCount() == 2) {
|
||||
int index = accountsList.getSelectedIndex();
|
||||
if (index != -1) markSelected(index);
|
||||
int index = AccountsTab.this.accountsList.getSelectedIndex();
|
||||
if (index != -1) AccountsTab.this.markSelected(index);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.accountsList.addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
int index = accountsList.getSelectedIndex();
|
||||
int index = AccountsTab.this.accountsList.getSelectedIndex();
|
||||
if (index == -1) return;
|
||||
if (e.getKeyCode() == KeyEvent.VK_UP) {
|
||||
moveUp(index);
|
||||
AccountsTab.this.moveUp(index);
|
||||
e.consume();
|
||||
} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
|
||||
moveDown(index);
|
||||
AccountsTab.this.moveDown(index);
|
||||
e.consume();
|
||||
}
|
||||
}
|
||||
@ -252,7 +252,7 @@ public class AccountsTab extends AUITab {
|
||||
}
|
||||
|
||||
Options.MC_ACCOUNT = ViaProxy.saveManager.accountsSave.getAccounts().get(index);
|
||||
accountsList.repaint();
|
||||
this.accountsList.repaint();
|
||||
}
|
||||
|
||||
private void moveUp(final int index) {
|
||||
|
@ -51,7 +51,7 @@ public class AddAccountPopup extends JDialog {
|
||||
this.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
if (!externalClose) closeListener.run();
|
||||
if (!AddAccountPopup.this.externalClose) closeListener.run();
|
||||
}
|
||||
});
|
||||
this.setTitle("Add Account");
|
||||
@ -74,7 +74,7 @@ public class AddAccountPopup extends JDialog {
|
||||
urlLabel.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
parent.openURL(deviceCode.verificationUri());
|
||||
AddAccountPopup.this.parent.openURL(AddAccountPopup.this.deviceCode.verificationUri());
|
||||
}
|
||||
});
|
||||
contentPane.add(urlLabel);
|
||||
|
Loading…
Reference in New Issue
Block a user