-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
111 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/cn/lanink/murdermystery/utils/update/ConfigUpdateUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cn.lanink.murdermystery.utils.update; | ||
|
||
import cn.lanink.gamecore.utils.VersionUtils; | ||
import cn.lanink.murdermystery.MurderMystery; | ||
import cn.nukkit.utils.Config; | ||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* @author LT_Name | ||
*/ | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class ConfigUpdateUtils { | ||
|
||
public static void updateConfig() { | ||
update1_X_X_To_1_4_2(); | ||
} | ||
|
||
@NotNull | ||
private static Config getConfig() { | ||
return new Config(MurderMystery.getInstance().getDataFolder() + "/config.yml", Config.YAML); | ||
} | ||
|
||
private static void update1_X_X_To_1_4_2() { | ||
Config config = getConfig(); | ||
if (VersionUtils.compareVersion(config.getString("ConfigVersion", "1.0.0"), "1.4.2") >= 0) { | ||
return; | ||
} | ||
|
||
config.set("ConfigVersion", "1.4.2"); | ||
|
||
if (!config.exists("AutomaticJoinGame")) { | ||
config.set("AutomaticJoinGame", false); | ||
} | ||
|
||
config.save(); | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
src/main/resources/Resources/Language/ConfigDescription/zh_CN.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
header: |- | ||
MurderMystery 插件配置文件 | ||
footer: |- | ||
你已经到达配置文件的底部啦 | ||
ConfigVersion: |- | ||
配置文件的版本号 | ||
警告! 除非您明确知道您在干什么,否则不要尝试改动此项配置! | ||
defaultLanguage: "插件默认语言设置 可选 zh_CN | en_US | ko_KR | vi_VN | de_DE" | ||
languageMappingTable: "语言映射表" | ||
autoUpdateLanguage: "自动更新语言文件" | ||
|
||
cmdUser: "插件命令" | ||
cmdUserAliases: "插件命令别名" | ||
cmdAdmin: "插件管理命令" | ||
cmdAdminAliases: "插件管理命令别名" | ||
cmdWhitelist: "可以在游戏房间中使用的命令" | ||
|
||
restoreWorld: |- | ||
结束游戏后还原地图 | ||
注意:仅在首次加载房间时备份地图! | ||
autoCreateTemporaryRoom: "自动创建临时房间 保证至少有一个空闲房间" | ||
|
||
AutomaticJoinGame: "玩家进入服务器后自动加入游戏房间(适用于群组服游戏子服场景)" | ||
QuitRoom.cmd: "退出房间执行命令" | ||
AutomaticNextRound: "游戏结束后自动加入下一局 (建议开启autoCreateTemporaryRoom)" | ||
|
||
killerVictoryCmd: "杀手胜利执行命令(仅杀手执行)" | ||
commonPeopleVictoryCmd: "平民与侦探胜利执行命令(仅存活的玩家执行)" | ||
killKillerCmd: "击杀杀手的玩家执行命令" | ||
defeatCmd: "失败执行命令" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters