From 111766996a0455c9f8ac5265f7643cc3d58c0c19 Mon Sep 17 00:00:00 2001 From: LT_Name <572413378@qq.com> Date: Fri, 9 Feb 2024 13:31:07 +0800 Subject: [PATCH] =?UTF-8?q?FileUtil=E6=94=B9=E4=B8=BAFileUtils?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lanink/murdermystery/MurderMystery.java | 2 +- .../cn/lanink/murdermystery/room/base/BaseRoom.java | 10 +++++----- src/main/resources/plugin.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/cn/lanink/murdermystery/MurderMystery.java b/src/main/java/cn/lanink/murdermystery/MurderMystery.java index e460b51..8707d13 100644 --- a/src/main/java/cn/lanink/murdermystery/MurderMystery.java +++ b/src/main/java/cn/lanink/murdermystery/MurderMystery.java @@ -267,7 +267,7 @@ public void onEnable() { //检查依赖版本 try { - String needGameCoreVersion = "1.5.6"; + String needGameCoreVersion = "1.6.13"; if (!VersionUtils.checkMinimumVersion(GameCore.getInstance(), needGameCoreVersion)) { throw new RuntimeException("[MemoriesOfTime-GameCore] plugin version is too low! At least version " + needGameCoreVersion + " is needed!"); } diff --git a/src/main/java/cn/lanink/murdermystery/room/base/BaseRoom.java b/src/main/java/cn/lanink/murdermystery/room/base/BaseRoom.java index 30896c6..3a54835 100644 --- a/src/main/java/cn/lanink/murdermystery/room/base/BaseRoom.java +++ b/src/main/java/cn/lanink/murdermystery/room/base/BaseRoom.java @@ -1,6 +1,6 @@ package cn.lanink.murdermystery.room.base; -import cn.lanink.gamecore.utils.FileUtil; +import cn.lanink.gamecore.utils.FileUtils; import cn.lanink.gamecore.utils.Language; import cn.lanink.gamecore.utils.PlayerDataUtils; import cn.lanink.gamecore.utils.Tips; @@ -100,7 +100,7 @@ public BaseRoom(@NotNull Level level, @NotNull Config config) throws RoomLoadExc this.murderMystery.getLogger().info(this.murderMystery.getLanguage(null) .translateString("roomLevelBackup").replace("%name%", this.getFullRoomName())); Server.getInstance().unloadLevel(this.level); - if (FileUtil.copyDir(Server.getInstance().getFilePath() + "/worlds/" + this.levelName, backup)) { + if (FileUtils.copyDir(Server.getInstance().getFilePath() + "/worlds/" + this.levelName, backup)) { Server.getInstance().loadLevel(this.levelName); this.level = Server.getInstance().getLevelByName(this.levelName); }else { @@ -970,7 +970,7 @@ protected void victory(int victoryMode) { if (this.players.size() >= this.getMinPlayers() && this.setGameTime - this.gameTime <= 20) { return; } - if (this.getStatus() != RoomStatus.VICTORY && this.getPlayers().size() > 0) { + if (this.getStatus() != RoomStatus.VICTORY && !this.getPlayers().isEmpty()) { this.setStatus(RoomStatus.VICTORY); for (Player player : this.players.keySet()) { Tools.giveItem(player, 10); //退出房间物品 @@ -1000,7 +1000,7 @@ protected void autoCreateTemporaryRoom() { } } } - if (x == 0 && cache.size() > 0) { + if (x == 0 && !cache.isEmpty()) { this.murderMystery.addTemporaryRoom(cache.get(MurderMystery.RANDOM.nextInt(cache.size()))); } }, MurderMystery.CHECK_ROOM_THREAD_POOL); @@ -1048,7 +1048,7 @@ protected void restoreWorld() { this.murderMystery.unloadRoom(this.levelName); } CompletableFuture.runAsync(() -> { - if (FileUtil.deleteFile(levelFile) && FileUtil.copyDir(backup, levelFile)) { + if (FileUtils.deleteFile(levelFile) && FileUtils.copyDir(backup, levelFile)) { Server.getInstance().loadLevel(this.levelName); this.level = Server.getInstance().getLevelByName(this.levelName); this.waitSpawn.setLevel(this.level); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 05f5907..d5933f7 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: MurderMystery main: cn.lanink.murdermystery.MurderMystery -version: "1.4.2" +version: "1.4.3-SNAPSHOT" api: ["1.0.9"] load: POSTWORLD author: "LT_Name"