Skip to content

Commit

Permalink
FileUtil改为FileUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
lt-name committed Feb 9, 2024
1 parent b0ccaca commit 1117669
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/cn/lanink/murdermystery/MurderMystery.java
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/cn/lanink/murdermystery/room/base/BaseRoom.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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); //退出房间物品
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 1117669

Please sign in to comment.