-
-
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
8 changed files
with
149 additions
and
15 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
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/en_US.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 Plugin configuration file | ||
footer: |- | ||
You have reached the bottom of the profile | ||
ConfigVersion: |- | ||
The version number of the configuration file | ||
Warning! Don't try to change this configuration unless you know exactly what you are doing! | ||
defaultLanguage: "Plugin default language settings. Optional: zh_CN | en_US | ko_KR | vi_VN | de_DE" | ||
languageMappingTable: "languageMappingTable" | ||
autoUpdateLanguage: "Automatically update language files" | ||
|
||
cmdUser: "plugin command" | ||
cmdUserAliases: "plugin command alias" | ||
cmdAdmin: "plugin management commands" | ||
cmdAdminAliases: "plugin management command alias" | ||
cmdWhitelist: "Commands that can be used in the game room" | ||
|
||
restoreWorld: |- | ||
Restore the map(world) after the game is over | ||
Note: The map(world) is only backed up when loading the room for the first time! | ||
autoCreateTemporaryRoom: "Automatically create a temporary room to ensure that there is at least one free room" | ||
|
||
AutomaticJoinGame: "Players automatically join the game room after entering the server (applicable to group service game sub-service scene)" | ||
QuitRoom.cmd: "Exit Room Execute Command" | ||
AutomaticNextRound: "After the game is over, it will automatically join the next round (it is recommended to open the autoCreateTemporaryRoom)" | ||
|
||
killerVictoryCmd: "Killer Triumph Execute Command (Killer Execute Only)" | ||
commonPeopleVictoryCmd: "Civilian and Detective Victory Execute Command (only executed by surviving players)" | ||
killKillerCmd: "The player who kills the killer executes the command." | ||
defeatCmd: "Failed to execute command" |
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
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