Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaljaz committed Jan 2, 2024
1 parent 8b45ffa commit d9de399
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
@SuppressWarnings("ResultOfMethodCallIgnored")
public class BungeeShopMCPlugin extends Plugin {
private Socket socket;
private ScheduledTask reconnectTask;
public static Config config;
private ScheduledTask reconnectTask;
private final ProxyServer proxyServer = ProxyServer.getInstance();
private final BungeeShopMCPlugin pluginInstance = this;
private final String pluginName = getDescription().getName();

@Override
public void onEnable() {
Expand All @@ -44,7 +42,7 @@ public void onEnable() {
config = new Config(new BungeeConfigLoader(getProvider(YamlConfiguration.class).load(configFile)));
} catch (EmptyConfigFieldException | IOException exception) {
getLogger().log(Level.SEVERE, exception.getMessage());
proxyServer.getPluginManager().unregisterCommands(pluginInstance);
proxyServer.getPluginManager().unregisterCommands(this);
return;
}

Expand All @@ -64,7 +62,7 @@ public void onCommand(String command) {
@Override
public void onClose(int code, String reason, boolean remote) {
getLogger().warning("Connection closed");
reconnectTask = proxyServer.getScheduler().schedule(pluginInstance, () -> {
reconnectTask = proxyServer.getScheduler().schedule(BungeeShopMCPlugin.this, () -> {
if (!socket.isOpen()) {
socket.reconnect();
} else {
Expand Down

0 comments on commit d9de399

Please sign in to comment.