Skip to content

Commit

Permalink
misc: little code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MemencioPerez committed Nov 7, 2024
1 parent e2a6dbc commit b98c132
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void onProxyInitialize(ProxyInitializeEvent event) {
}

public void setupConfiguration() throws IOException {
this.configuration = Configuration.loadConfig(dataDirectory);
configuration = Configuration.loadConfig(dataDirectory);
}

private void forciblyDisableForceKeyAuthentication() throws NoSuchFieldException, IllegalAccessException {
Expand All @@ -125,11 +125,11 @@ private void forciblyDisableForceKeyAuthentication() throws NoSuchFieldException
}

public void setupConfigurablePacketListeners() {
if (this.packetListeners != null && !this.packetListeners.isEmpty()) {
if (packetListeners != null && !packetListeners.isEmpty()) {
packetListeners.forEach(ConfigurablePacketListener::unregister);
}

List<? extends ConfigurablePacketListener> packetListeners = Stream.of(
List<? extends ConfigurablePacketListener> loadablePacketListeners = Stream.of(
LoginListener.class,
CommandListener.class,
ClientChatListener.class,
Expand All @@ -143,7 +143,7 @@ public void setupConfigurablePacketListeners() {
.toList();

packetListeners.forEach(ConfigurablePacketListener::register);
this.packetListeners = packetListeners;
packetListeners = loadablePacketListeners;
}

public List<Component> getPluginStatusMessages() {
Expand All @@ -160,12 +160,4 @@ public List<Component> getPluginStatusMessages() {
"<#6892bd>Secure Chat Data: <aqua>" + configuration.sendSecureChatData() + " <dark_gray>|</dark_gray> <#6892bd>Safe Server Status: <aqua>" + configuration.sendSafeServerStatus())
);
}

public ProxyServer getServer() {
return server;
}

public Configuration getConfiguration() {
return configuration;
}
}

0 comments on commit b98c132

Please sign in to comment.