diff --git a/plugin/build.gradle b/plugin/build.gradle index dd0e008d..bcc48b66 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -607,7 +607,7 @@ static Map>> getTags(File tagDir, Map List values = new JsonSlurper().parse(file).values Path relativePath = directoryFile.toPath().relativize(file.toPath()) - String name = FilenameUtils.removeExtension(relativePath.toString()).replace(File.pathSeparator, "/") + String name = FilenameUtils.removeExtension(relativePath.toString()).replace(File.separatorChar, '/' as char) typeTags.put("minecraft:" + name, values) }) diff --git a/plugin/src/main/java/net/elytrium/limboapi/server/LimboSessionHandlerImpl.java b/plugin/src/main/java/net/elytrium/limboapi/server/LimboSessionHandlerImpl.java index 3c31d5ee..358ac535 100644 --- a/plugin/src/main/java/net/elytrium/limboapi/server/LimboSessionHandlerImpl.java +++ b/plugin/src/main/java/net/elytrium/limboapi/server/LimboSessionHandlerImpl.java @@ -113,6 +113,10 @@ public LimboSessionHandlerImpl(LimboAPI plugin, LimboImpl limbo, ConnectedPlayer if (originalHandler instanceof LimboSessionHandlerImpl sessionHandler) { this.settings = sessionHandler.getSettings(); this.brand = sessionHandler.getBrand(); + this.keepAliveKey = sessionHandler.keepAliveKey; + this.keepAlivePending = sessionHandler.keepAlivePending; + this.keepAliveSentTime = sessionHandler.keepAliveSentTime; + this.ping = sessionHandler.ping; } } @@ -124,10 +128,6 @@ public void onConfig(LimboPlayer player) { Integer serverReadTimeout = this.limbo.getReadTimeout(); this.keepAliveTask = player.getScheduledExecutor().scheduleAtFixedRate(() -> { MinecraftConnection connection = this.player.getConnection(); - - // Sometimes there is a bug where player is kicked from the proxy by - // the limbo and this task is not cancelled in LimboSessionHandlerImpl#disconnected - // More info in issue #73 if (connection.isClosed()) { this.keepAliveTask.cancel(true); return; @@ -146,7 +146,7 @@ public void onConfig(LimboPlayer player) { this.keepAlivePending = true; this.keepAliveSentTime = System.currentTimeMillis(); } - }, 250, (serverReadTimeout == null ? this.plugin.getServer().getConfiguration().getReadTimeout() : serverReadTimeout) / 2, TimeUnit.MILLISECONDS); + }, 250, (serverReadTimeout == null ? this.plugin.getServer().getConfiguration().getReadTimeout() / 2 : serverReadTimeout), TimeUnit.MILLISECONDS); } public void onSpawn() {