Starting with remove Instance-Getter of ProtocolBridge
This commit is contained in:
@@ -31,13 +31,6 @@ import java.net.Proxy;
|
||||
* It manages the protocol settings, version, and side instances.
|
||||
*/
|
||||
public final class ProtocolBridge {
|
||||
|
||||
/**
|
||||
* The singleton instance of the ProtocolBridge class
|
||||
*/
|
||||
@Getter
|
||||
private static ProtocolBridge instance;
|
||||
|
||||
/**
|
||||
* The protocol settings for the current connection
|
||||
*/
|
||||
@@ -115,6 +108,7 @@ public final class ProtocolBridge {
|
||||
public ProtocolBridge(ProtocolDNSServer protocolDNSServer, ProtocolSettings protocolSettings, ProtocolVersion protocolVersion, File logFolder) throws Exception {
|
||||
// Assign the parameters to the class fields
|
||||
this.protocolDNSServer = protocolDNSServer;
|
||||
this.protocolDNSServer.setProtocolBridge(this);
|
||||
this.protocolSettings = protocolSettings;
|
||||
this.protocolVersion = protocolVersion;
|
||||
|
||||
@@ -125,9 +119,6 @@ public final class ProtocolBridge {
|
||||
// Register the appropriate listeners and packets
|
||||
registerListeners();
|
||||
registerPackets();
|
||||
|
||||
// Set the static instance to this instance
|
||||
instance = this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,6 +134,7 @@ public final class ProtocolBridge {
|
||||
public ProtocolBridge(ProtocolWebServer protocolWebServer, ProtocolSettings protocolSettings, ProtocolVersion protocolVersion, File logFolder) throws Exception {
|
||||
// Assign the parameters to the class fields
|
||||
this.protocolWebServer = protocolWebServer;
|
||||
this.protocolWebServer.setProtocolBridge(this);
|
||||
this.protocolSettings = protocolSettings;
|
||||
this.protocolVersion = protocolVersion;
|
||||
|
||||
@@ -153,9 +145,6 @@ public final class ProtocolBridge {
|
||||
// Register the appropriate listeners and packets
|
||||
registerListeners();
|
||||
registerPackets();
|
||||
|
||||
// Set the static instance to this instance
|
||||
instance = this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,6 +160,7 @@ public final class ProtocolBridge {
|
||||
public ProtocolBridge(ProtocolClient protocolClient, ProtocolSettings protocolSettings, ProtocolVersion protocolVersion, File logFolder) throws Exception {
|
||||
// Assign the parameters to the class fields
|
||||
this.protocolClient = protocolClient;
|
||||
this.protocolClient.setProtocolBridge(this);
|
||||
this.protocolSettings = protocolSettings;
|
||||
this.protocolVersion = protocolVersion;
|
||||
|
||||
@@ -181,9 +171,6 @@ public final class ProtocolBridge {
|
||||
// Register the appropriate listeners and packets
|
||||
registerListeners();
|
||||
registerPackets();
|
||||
|
||||
// Set the static instance to this instance
|
||||
instance = this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user