mirror of
https://e.coding.net/circlecloud/Soulbound.git
synced 2025-11-24 21:36:20 +00:00
add reload lang and fix some bug...
This commit is contained in:
@@ -45,12 +45,12 @@ public class Soulbound extends JavaPlugin {
|
||||
public FileConfiguration msgConfig;
|
||||
|
||||
public void onLoad() {
|
||||
this.saveResource("message.yml", false);
|
||||
msgfile = new File(this.getDataFolder(), "message.yml");
|
||||
msgConfig = YamlConfiguration.loadConfiguration(msgfile);
|
||||
try {
|
||||
LoadConfig (msgConfig ,msgfile);
|
||||
} catch (FileNotFoundException e) {
|
||||
this.saveResource("message.yml", false);
|
||||
this.saveResource("message.yml", true);
|
||||
} catch (IOException e) {
|
||||
this.getLogger().info("语言文件读取错误...");
|
||||
} catch (InvalidConfigurationException e) {
|
||||
@@ -164,6 +164,18 @@ public class Soulbound extends JavaPlugin {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void reloadmessage(){
|
||||
try {
|
||||
LoadConfig (msgConfig ,msgfile);
|
||||
} catch (FileNotFoundException e) {
|
||||
this.saveResource("message.yml", true);
|
||||
} catch (IOException e) {
|
||||
this.getLogger().info("语言文件读取错误...");
|
||||
} catch (InvalidConfigurationException e) {
|
||||
this.saveResource("message.yml", true);
|
||||
}
|
||||
}
|
||||
|
||||
public String getlang(String type) {
|
||||
return this.getmessage("Message." + type);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.me.tft_02.soulbound.commands;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -42,7 +41,8 @@ public class SoulboundCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
Soulbound.p.reloadConfig();
|
||||
sender.sendMessage(ChatColor.GREEN + "Configuration reloaded.");
|
||||
|
||||
sender.sendMessage(Soulbound.p.getlang("RELOAD"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,4 +37,5 @@ Message:
|
||||
CMD_BIND_ON_USE: '&4* &a/bindonuse &7<><37><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>Ϊ &4ʹ<34>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD>'
|
||||
CMD_UNBIND: '&4* &a/unbind &7<><37><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD>İ<C4B0>'
|
||||
CMD_NEXT: '&6ʹ<36><CAB9> /soulbound help %nextPage% <20>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD>'
|
||||
CMD_USE: 'ʹ<><CAB9>: /soulbound [reload | help]'
|
||||
CMD_USE: 'ʹ<><CAB9>: /soulbound [reload | help]'
|
||||
RELOAD: '&a<><61><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...'
|
||||
Reference in New Issue
Block a user