Skip to content

Commit

Permalink
模式锁定应用后,到其他未设置世界恢复成服务器默认模式
Browse files Browse the repository at this point in the history
  • Loading branch information
glorydark committed Feb 20, 2024
1 parent 02d0dba commit 9fb7cea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>glorydark.nukkit</groupId>
<artifactId>DLevelEventPlus</artifactId>
<version>1.2.1.3</version>
<version>1.2.1.4</version>

<properties>
<maven.complier.sourceEncoding>UTF-8</maven.complier.sourceEncoding>
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/glorydark/DLevelEventPlus/CheckTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ public void onRun(int i) {
}
}
if (forceGamemode != -1) {
player.setGamemode(forceGamemode);
if (player.getGamemode() != forceGamemode) {
player.setGamemode(forceGamemode);
}
} else {
int defaultGamemode = Server.getInstance().getDefaultGamemode();
if (player.getGamemode() != defaultGamemode) {
player.setGamemode(defaultGamemode);
}
}
}
}
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: DLevelEventPlus
main: glorydark.DLevelEventPlus.LevelEventPlusMain
version: "1.2.1.3"
version: "1.2.1.4"
author: glorydark
api: ["1.0.0"]
description: DLevelEventPlus
Expand Down

0 comments on commit 9fb7cea

Please sign in to comment.