diff --git a/README.md b/README.md
index 229f6a8..bf44780 100644
--- a/README.md
+++ b/README.md
@@ -6,14 +6,16 @@
*Did I make it clear? DO, NOT, RELOAD*
### Configuration: `config.properties`
```properties
+language=en_US
token=
channel=
forwardJoinLeaveEvents=true
debug=false
```
-- `token`: your bot token
-- `channel`: target channel ID. All message forwarding occurs on this channel
-- `forwardJoinLeaveEvents`: whether forward player join/quit messages or not
+- `language`: the language to use for the plugin. Default: `en_US`.
+- `token`: your bot token.
+- `channel`: target channel ID. All message forwarding occurs in this channel.
+- `forwardJoinLeaveEvents`: whether forward player join/quit messages or not.
- `debug`: print the response after forwarding a message to Guilded.
### Binding your Guilded account:
1. Log into the Minecraft server and type `/mc2g mkbind` and you will get a 10-digit random binding code.
diff --git a/pom.xml b/pom.xml
index 9472e6e..f60eec3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
vip.floatationdevice
mc2gforward
- 1.0-SNAPSHOT7
+ 1.0-SNAPSHOT8
jar
MC2GForward
@@ -25,7 +25,7 @@
true
${basedir}/src/main/resources/
- plugin.yml
+ *
diff --git a/src/main/java/vip/floatationdevice/mc2gforward/BindManager.java b/src/main/java/vip/floatationdevice/mc2gforward/BindManager.java
index dcf9987..94b0b80 100644
--- a/src/main/java/vip/floatationdevice/mc2gforward/BindManager.java
+++ b/src/main/java/vip/floatationdevice/mc2gforward/BindManager.java
@@ -20,14 +20,13 @@
import java.util.UUID;
import static vip.floatationdevice.mc2gforward.MC2GForward.*;
+import static vip.floatationdevice.mc2gforward.I18nUtil.getLocalizedMessage;
@SuppressWarnings("UnstableApiUsage") public class BindManager implements Listener, CommandExecutor
{
- //TODO: cleanups and optimizations when im began to feel better
- //TODO: i18n
public static HashMap bindMap=new HashMap();// key: guilded userId; value: mc player uuid
public static HashMap pendingMap=new HashMap();// key: bind code; value: mc player uuid
- public static HashMap pendingPlayerMap =new HashMap();// key: mc player uuid; value: bind code
+ public static HashMap pendingPlayerMap =new HashMap();// pendingMap but with upside down
public static final Random r=new Random();
G4JWebSocketClient ws;
@@ -35,7 +34,7 @@ public BindManager()
{
loadBindMap();
ws=new G4JWebSocketClient(MC2GForward.token);
- instance.getLogger().info("Connecting to Guilded server");
+ instance.getLogger().info(getLocalizedMessage("connecting"));
ws.connect();
ws.eventBus.register(this);
}
@@ -43,7 +42,7 @@ public BindManager()
@Subscribe
public void onG4JConnectionOpened(GuildedWebsocketInitializedEvent event)
{
- instance.getLogger().info("Connection to Guilded server opened");
+ instance.getLogger().info(getLocalizedMessage("connected"));
}
@Subscribe
public void onG4JConnectionClosed(GuildedWebsocketClosedEvent event)
@@ -52,71 +51,73 @@ public void onG4JConnectionClosed(GuildedWebsocketClosedEvent event)
{
// if the plugin is running normally but the connection was closed
// then we can consider it as unexpected and do a reconnection
- instance.getLogger().warning("Connection to Guilded server lost. Reconnecting");
+ instance.getLogger().warning(getLocalizedMessage("disconnected-unexpected"));
ws=new G4JWebSocketClient(token);
ws.connect();
ws.eventBus.register(this);
}
else
// the plugin is being disabled or the server is stopping, so we can just ignore this
- instance.getLogger().info("Connection to Guilded server closed");
+ instance.getLogger().info(getLocalizedMessage("disconnected"));
}
@Subscribe
public void onGuildedChat(ChatMessageCreatedEvent event)
{
- if(event.getChatMessageObject().getContent().startsWith("/mc2g mkbind"))
- {
- String[] args=event.getChatMessageObject().getContent().split(" ");
- // args.length=3; args[0]="/mc2g", args[1]="bind", args[2]=""
- if(args.length!=3)// incorrect command format?
- {
- sendGuildedMsg("[X] Usage: /mc2g mkbind ", event.getChatMessageObject().getMsgId());
- }
- else// right usage?
+ ChatMessage msg=event.getChatMessageObject();// the received ChatMessage object
+ if(msg.getChannelId().equals(MC2GForward.channel))// in chat-forwarding channel?
+ if(msg.getContent().startsWith("/mc2g mkbind"))
{
- if(bindMap.containsKey(event.getChatMessageObject().getCreatorId()))// player already bound?
+ String[] args=msg.getContent().split(" ");
+ // args.length=3; args[0]="/mc2g", args[1]="bind", args[2]=""
+ if(args.length!=3)// incorrect command format?
{
- sendGuildedMsg("[X] Your account has been bound to "+getPlayerName(bindMap.get(event.getChatMessageObject().getCreatorId()))+" before", event.getChatMessageObject().getMsgId());
+ sendGuildedMsg(getLocalizedMessage("g-usage"), msg.getMsgId());
}
- else// player not bound?
+ else// right usage?
{
- if(pendingMap.containsKey(args[2]))// code matched?
+ if(bindMap.containsKey(msg.getCreatorId()))// player already bound?
{
- bindMap.put(event.getChatMessageObject().getCreatorId(), pendingMap.get(args[2]));
- pendingPlayerMap.remove(pendingMap.get(args[2]));
- pendingMap.remove(args[2]);
- try{Bukkit.getPlayer(bindMap.get(event.getChatMessageObject().getCreatorId())).sendMessage("[§6MC2GForward§f] §aSuccessfully bound your Guilded account\n §aNow you can send messages from Guilded server to Minecraft server");}catch(Exception ignored){}
- sendGuildedMsg("[i] Successfully bound your account to "+getPlayerName(bindMap.get(event.getChatMessageObject().getCreatorId())), event.getChatMessageObject().getMsgId());
- instance.getLogger().info(getPlayerName(bindMap.get(event.getChatMessageObject().getCreatorId()))+" successfully bound Guilded account");
- saveBindMap();
+ sendGuildedMsg(getLocalizedMessage("g-already-bound").replace("%PLAYER%",getPlayerName(bindMap.get(msg.getCreatorId()))), msg.getMsgId());
}
- else// code not in pending list?
+ else// player not bound?
{
- sendGuildedMsg("[X] Invalid bind code. Please check the code you typed or use \"/mc2g mkbind\" again in Minecraft to request a new code", event.getChatMessageObject().getMsgId());
+ if(pendingMap.containsKey(args[2]))// code matched?
+ {
+ bindMap.put(msg.getCreatorId(), pendingMap.get(args[2]));
+ pendingPlayerMap.remove(pendingMap.get(args[2]));
+ pendingMap.remove(args[2]);
+ try{Bukkit.getPlayer(bindMap.get(msg.getCreatorId())).sendMessage(getLocalizedMessage("m-bind-success"));}catch(Exception ignored){}
+ sendGuildedMsg(getLocalizedMessage("g-bind-success").replace("%PLAYER%",getPlayerName(bindMap.get(msg.getCreatorId()))), msg.getMsgId());
+ instance.getLogger().info(getLocalizedMessage("c-bind-success").replace("%PLAYER%",getPlayerName(bindMap.get(msg.getCreatorId()))));
+ saveBindMap();
+ }
+ else// code not in pending list?
+ {
+ sendGuildedMsg(getLocalizedMessage("invalid-code"), msg.getMsgId());
+ }
}
}
}
- }
- else if(event.getChatMessageObject().getContent().equals("/mc2g rmbind"))
- {
- if(bindMap.containsKey(event.getChatMessageObject().getCreatorId()))// player bound?
+ else if(msg.getContent().equals("/mc2g rmbind"))
{
- try{Bukkit.getPlayer(bindMap.get(event.getChatMessageObject().getCreatorId())).sendMessage("[§6MC2GForward§f] §aSuccessfully unbound your Guilded account");}catch(Exception ignored){}
- UUID removed=bindMap.remove(event.getChatMessageObject().getCreatorId());
- sendGuildedMsg("[i] Successfully unbound your Guilded account", event.getChatMessageObject().getMsgId());
- instance.getLogger().info(getPlayerName(removed)+" successfully unbound Guilded account");
- saveBindMap();
+ if(bindMap.containsKey(msg.getCreatorId()))// player bound?
+ {
+ try{Bukkit.getPlayer(bindMap.get(msg.getCreatorId())).sendMessage(getLocalizedMessage("m-unbind-success"));}catch(Exception ignored){}
+ UUID removed=bindMap.remove(msg.getCreatorId());
+ sendGuildedMsg(getLocalizedMessage("g-unbind-success"), msg.getMsgId());
+ instance.getLogger().info(getLocalizedMessage("c-unbind-success").replace("%PLAYER%",getPlayerName(removed)));
+ saveBindMap();
+ }
+ else// player not bound?
+ {
+ sendGuildedMsg(getLocalizedMessage("g-no-bind"), msg.getMsgId());
+ }
}
- else// player not bound?
+ else
{
- sendGuildedMsg("[X] You are not bound to any Minecraft account", event.getChatMessageObject().getMsgId());
+ if(!msg.getContent().startsWith("/")&&bindMap.containsKey(msg.getCreatorId()))
+ Bukkit.broadcastMessage("<"+getPlayerName(bindMap.get(msg.getCreatorId()))+"> "+msg.getContent());
}
- }
- else
- {
- if(!event.getChatMessageObject().getContent().startsWith("/")&&bindMap.containsKey(event.getChatMessageObject().getCreatorId()))
- Bukkit.broadcastMessage("<"+getPlayerName(bindMap.get(event.getChatMessageObject().getCreatorId()))+"> "+event.getChatMessageObject().getContent());
- }
}
@Override
@@ -124,7 +125,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
{
if(!(sender instanceof Player))
{
- sender.sendMessage("This command can only be used in-game");
+ sender.sendMessage(getLocalizedMessage("non-player-executor"));
return false;
}
@@ -132,12 +133,12 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
{
String code="";// 10-digit random bind code from ASCII x21(!) to x7E(~)
for(int i=0;i!=10;i++) code+=String.valueOf((char)(r.nextInt(94)+33));// StringBuilder not needed
- if(pendingPlayerMap.containsKey(((Player)sender).getUniqueId())) // update bind code
+ if(pendingPlayerMap.containsKey(((Player)sender).getUniqueId())) // remove old bind code if exists
pendingMap.remove(pendingPlayerMap.get(((Player)sender).getUniqueId()));
pendingMap.put(code, ((Player)sender).getUniqueId());
pendingPlayerMap.put(((Player)sender).getUniqueId(), code);
- sender.sendMessage("[§6MC2GForward§f] Your bind code is: §a"+code+"\n §fType \"§a/mc2g mkbind "+code+"§f\" in Guilded server to confirm the bind");
- instance.getLogger().info(sender.getName()+" requested a bind code: "+code);
+ sender.sendMessage(getLocalizedMessage("m-code-requested").replace("%CODE%",code));
+ instance.getLogger().info(getLocalizedMessage("c-code-requested").replace("%PLAYER%",sender.getName()).replace("%CODE%",code));
return true;
}
else if(args.length==1&&args[0].equals("rmbind"))
@@ -147,18 +148,18 @@ else if(args.length==1&&args[0].equals("rmbind"))
if(bindMap.get(u).equals(((Player)sender).getUniqueId()))
{
bindMap.remove(u);
- sender.sendMessage("[§6MC2GForward§f] §aSuccessfully unbound your Guilded account");
- instance.getLogger().info(sender.getName()+" successfully unbound Guilded account");
+ sender.sendMessage(getLocalizedMessage("m-unbind-success"));
+ instance.getLogger().info(getLocalizedMessage("c-unbind-success").replace("%PLAYER%",sender.getName()));
saveBindMap();
return true;
}
}
- sender.sendMessage("[§6MC2GForward§f] §cYou must bind a Guilded account first");
+ sender.sendMessage(getLocalizedMessage("m-no-bind"));
return false;
}
else
{
- sender.sendMessage("[§6MC2GForward§f] §eUsage: /mc2g ");
+ sender.sendMessage(getLocalizedMessage("m-usage"));
return false;
}
}
@@ -174,7 +175,7 @@ public void run()
{
ChatMessage result=null;
try {result=instance.g4JClient.createChannelMessage(MC2GForward.channel,msg,new String[]{replyTo},false);}
- catch(Exception e) {instance.getLogger().severe("Failed to send message to Guilded server: "+e);}
+ catch(Exception e) {instance.getLogger().severe(getLocalizedMessage("msg-send-failed").replace("%EXCEPTION%",e.toString()));}
if(instance.debug&&result!=null) instance.getLogger().info("\n"+new JSONObject(result.toString()).toStringPretty());
}
}
@@ -200,9 +201,9 @@ public void saveBindMap()
ObjectOutputStream o=new ObjectOutputStream(new FileOutputStream(cfgPath+"bindMap.dat"));
o.writeObject(new BindMapContainer(bindMap));
o.close();
- instance.getLogger().info("Bind map saved");
+ instance.getLogger().info(getLocalizedMessage("bindmap-save-success"));
}
- catch(Exception e) {instance.getLogger().severe("Failed to save bind map: "+e);}
+ catch(Exception e) {instance.getLogger().severe(getLocalizedMessage("bindmap-save-failure").replace("%EXCEPTION%",e.toString()));}
}
public void loadBindMap()
{
@@ -212,9 +213,9 @@ public void loadBindMap()
BindMapContainer temp=(BindMapContainer)o.readObject();
o.close();
bindMap=temp.saveBindMap;
- instance.getLogger().info("Bind map loaded");
+ instance.getLogger().info(getLocalizedMessage("bindmap-load-success"));
}
catch(FileNotFoundException ignored){}
- catch(Exception e) {instance.getLogger().severe("Failed to load bind map: "+e);}
+ catch(Exception e) {instance.getLogger().severe(getLocalizedMessage("bindmap-load-failure").replace("%EXCEPTION%",e.toString()));}
}
}
diff --git a/src/main/java/vip/floatationdevice/mc2gforward/I18nUtil.java b/src/main/java/vip/floatationdevice/mc2gforward/I18nUtil.java
new file mode 100644
index 0000000..7b63030
--- /dev/null
+++ b/src/main/java/vip/floatationdevice/mc2gforward/I18nUtil.java
@@ -0,0 +1,34 @@
+package vip.floatationdevice.mc2gforward;
+
+import org.bukkit.configuration.file.FileConfiguration;
+import org.bukkit.configuration.file.YamlConfiguration;
+
+import java.io.File;
+
+public class I18nUtil
+{
+ private static FileConfiguration l;
+ private static String lang = "en_US";
+
+ public static String setLanguage(String language)
+ {
+ if (language == null || language.equals("")) return lang;
+ lang = language;
+ File langFile = new File(MC2GForward.instance.getDataFolder(), "lang_" + lang + ".yml");
+ if (!langFile.exists()) MC2GForward.instance.saveResource("lang_" + lang + ".yml", false);
+ l = YamlConfiguration.loadConfiguration(langFile);
+ return lang;
+ }
+
+ public static String getLocalizedMessage(String key)
+ {
+ String msg = l.getString(key);
+ if (msg == null) return "[NO TRANSLATION: " + key + "]";
+ return msg;
+ }
+
+ public String getLanguage()
+ {
+ return lang;
+ }
+}
diff --git a/src/main/java/vip/floatationdevice/mc2gforward/MC2GForward.java b/src/main/java/vip/floatationdevice/mc2gforward/MC2GForward.java
index c81bfa7..65d4d36 100644
--- a/src/main/java/vip/floatationdevice/mc2gforward/MC2GForward.java
+++ b/src/main/java/vip/floatationdevice/mc2gforward/MC2GForward.java
@@ -11,6 +11,7 @@
import org.bukkit.plugin.java.JavaPlugin;
import vip.floatationdevice.guilded4j.G4JClient;
import vip.floatationdevice.guilded4j.object.ChatMessage;
+import static vip.floatationdevice.mc2gforward.I18nUtil.getLocalizedMessage;
import java.io.*;
import java.util.Properties;
@@ -39,7 +40,7 @@ public void onEnable()
{
getLogger().severe("Config file not found and a empty one will be created. Set the token and channel UUID and RESTART server.");
BufferedWriter bw = new BufferedWriter(new FileWriter(file));
- bw.write("token="+System.getProperty("line.separator")+"channel="+System.getProperty("line.separator")+"forwardJoinLeaveEvents=true"+System.getProperty("line.separator")+"debug=false"+System.getProperty("line.separator"));
+ bw.write("language=en_US\ntoken=\nchannel=\nforwardJoinLeaveEvents=true\ndebug=false\n");
bw.flush();
bw.close();
Bukkit.getPluginManager().disablePlugin(this);
@@ -52,9 +53,10 @@ public void onEnable()
channel=p.getProperty("channel");
forwardJoinLeaveEvents=Boolean.parseBoolean(p.getProperty("forwardJoinLeaveEvents"));
debug=Boolean.parseBoolean(p.getProperty("debug"));
+ getLogger().info("Language: "+I18nUtil.setLanguage(p.getProperty("language"))+" - "+getLocalizedMessage("language")+" by "+getLocalizedMessage("language-file-contributor"));
if(token==null||channel.length()!=36)
{
- getLogger().severe("Invalid config. Check the config file and RESTART the server.");
+ getLogger().severe(getLocalizedMessage("invalid-config"));
g4JClient=null;
Bukkit.getPluginManager().disablePlugin(this);
return;
@@ -66,12 +68,12 @@ public void onEnable()
public void run()
{
bindMgr=new BindManager();
- mc2gRunning=true;
Bukkit.getPluginManager().registerEvents(bindMgr, instance);
getCommand("mc2g").setExecutor(bindMgr);
+ mc2gRunning=true;
}
});
- sendGuildedMsg("`*** MC2GForward started ***`");
+ sendGuildedMsg(getLocalizedMessage("mc2g-started"));
}catch (Throwable e)
{
getLogger().severe("Failed to initialize plugin!");
@@ -93,8 +95,8 @@ public void onDisable()
if(g4JClient!=null)
{
ChatMessage result=null;
- try {result=g4JClient.createChannelMessage(channel,"`*** MC2GForward stopped ***`",null,null);}
- catch (Exception e) {getLogger().severe("Failed to send message to Guilded server: "+e);}
+ try {result=g4JClient.createChannelMessage(channel,getLocalizedMessage("mc2g-stopped"),null,null);}
+ catch (Exception e) {getLogger().severe(getLocalizedMessage("msg-send-failed").replace("%EXCEPTION%",e.toString()));}
g4JClient=null;
if(debug&&result!=null)
getLogger().info("\n"+new JSONObject(result.toString()).toStringPretty());
@@ -119,21 +121,21 @@ public void run()
public void onJoin(PlayerJoinEvent event)
{
if(forwardJoinLeaveEvents)
- sendGuildedMsg("`[+] "+event.getPlayer().getName()+" connected`");
+ sendGuildedMsg(getLocalizedMessage("player-connected").replace("%PLAYER%",event.getPlayer().getName()));
}
@EventHandler
public void onUnusualLeave(PlayerKickEvent event)
{
if(forwardJoinLeaveEvents)
- sendGuildedMsg("`("+event.getPlayer().getName()+" lost connection: "+event.getReason()+")`");
+ sendGuildedMsg(getLocalizedMessage("player-disconnected-unusual").replace("%PLAYER%",event.getPlayer().getName()).replace("%REASON%",event.getReason()));
}
@EventHandler
public void onLeave(PlayerQuitEvent event)
{
if(forwardJoinLeaveEvents)
- sendGuildedMsg("`[-] "+event.getPlayer().getName()+" disconnected`");
+ sendGuildedMsg(getLocalizedMessage("player-disconnected").replace("%PLAYER%",event.getPlayer().getName()));
}
public void sendGuildedMsg(String msg)
@@ -147,7 +149,7 @@ public void run()
{
ChatMessage result=null;
try {result=g4JClient.createChannelMessage(channel,msg,null,null);}
- catch(Exception e) {getLogger().severe("Failed to send message to Guilded server: "+e);}
+ catch(Exception e) {getLogger().severe(getLocalizedMessage("msg-send-failed").replace("%EXCEPTION%",e.toString()));}
if(debug&&result!=null) getLogger().info("\n"+new JSONObject(result.toString()).toStringPretty());
}
}
diff --git a/src/main/resources/lang_en_US.yml b/src/main/resources/lang_en_US.yml
new file mode 100644
index 0000000..db56b9a
--- /dev/null
+++ b/src/main/resources/lang_en_US.yml
@@ -0,0 +1,42 @@
+language: "English (US)"
+language-file-contributor: "MCUmbrella"
+
+# System messages
+invalid-config: "Invalid config. Check the config file and RESTART the server."
+non-player-executor: "This command can only be used in-game"
+msg-send-failed: "Failed to send message to Guilded server: %EXCEPTION%"
+
+connecting: "Connecting to Guilded server"
+connected: "Connection to Guilded server opened"
+disconnected: "Connection to Guilded server closed"
+disconnected-unexpected: "Connection to Guilded server lost. Reconnecting"
+
+bindmap-save-success: "Bind map saved"
+bindmap-save-failure: "Failed to save bind map: %EXCEPTION%"
+bindmap-load-success: "Bind map loaded"
+bindmap-load-failure: "Failed to load bind map: %EXCEPTION%"
+
+c-bind-success: "%PLAYER% successfully bound Guilded account"
+c-unbind-success: "%PLAYER% successfully unbound Guilded account"
+c-code-requested: "%PLAYER% requested a bind code: %CODE%"
+
+# Messages sent to Minecraft client
+m-usage: "[§6MC2GForward§f] §eUsage: /mc2g "
+m-bind-success: "[§6MC2GForward§f] §aSuccessfully bound your Guilded account\n §aNow you can send messages from Guilded server to Minecraft server"
+m-unbind-success: "[§6MC2GForward§f] §aSuccessfully unbound your Guilded account"
+m-no-bind: "[§6MC2GForward§f] §cYou must bind a Guilded account first"
+m-code-requested: "[§6MC2GForward§f] Your bind code is: §a%CODE%\n §fType \"§a/mc2g mkbind %CODE%§f\" in Guilded server's chat-forwarding channel to confirm the bind"
+
+# Messages sent to Guilded server
+g-usage: "[X] Usage: /mc2g mkbind "
+g-bind-success: "[i] Successfully bound your account to %PLAYER%"
+g-unbind-success: "[i] Successfully unbound your Guilded account"
+g-no-bind: "[X] You are not bound to any Minecraft account"
+invalid-code: "[X] Invalid bind code. Please check the code you typed or use \"/mc2g mkbind\" again in Minecraft to request a new code"
+g-already-bound: "[X] Your account has been bound to %PLAYER% before"
+
+mc2g-started: "`* MC2GForward started *`"
+mc2g-stopped: "`* MC2GForward stopped *`"
+player-connected: "`[+] %PLAYER% connected`"
+player-disconnected: "`[-] %PLAYER% disconnected`"
+player-disconnected-unusual: "`(%PLAYER% lost connection: %REASON%)`"
diff --git a/src/main/resources/lang_zh_CN.yml b/src/main/resources/lang_zh_CN.yml
new file mode 100644
index 0000000..d924376
--- /dev/null
+++ b/src/main/resources/lang_zh_CN.yml
@@ -0,0 +1,42 @@
+language: "中文(中国)"
+language-file-contributor: "MCUmbrella"
+
+# System messages
+invalid-config: "配置文件有误,请修正错误后重启服务器"
+non-player-executor: "此命令只能由玩家执行"
+msg-send-failed: "转发信息到Guilded失败:%EXCEPTION%"
+
+connecting: "连接Guilded服务器"
+connected: "成功连接到Guilded服务器"
+disconnected: "到Guilded服务器的连接已关闭"
+disconnected-unexpected: "到Guilded服务器的连接中断,重连中"
+
+bindmap-save-success: "保存绑定表"
+bindmap-save-failure: "保存绑定表失败:%EXCEPTION%"
+bindmap-load-success: "读取绑定表"
+bindmap-load-failure: "读取绑定表失败:%EXCEPTION%"
+
+c-bind-success: "%PLAYER%成功绑定Guilded账户"
+c-unbind-success: "%PLAYER%成功解绑Guilded账户"
+c-code-requested: "%PLAYER%请求绑定码:%CODE%"
+
+# Messages sent to Minecraft client
+m-usage: "[§6MC2GForward§f] §e用法:/mc2g "
+m-bind-success: "[§6MC2GForward§f] §a成功绑定Guilded账户\n §a你现在可以从Guilded发送信息到Minecraft了"
+m-unbind-success: "[§6MC2GForward§f] §a成功解绑Guilded账户"
+m-no-bind: "[§6MC2GForward§f] §c你还没有绑定Guilded账户"
+m-code-requested: "[§6MC2GForward§f] 你的绑定码为: §a%CODE%\n §f在Guilded的聊天转发频道输入“§a/mc2g mkbind %CODE%§f”确认绑定"
+
+# Messages sent to Guilded server
+g-usage: "[X] 用法:/mc2g mkbind "
+g-bind-success: "[i] 成功将Guilded账户绑定至%PLAYER%"
+g-unbind-success: "[i] 成功解绑Guilded账户"
+g-no-bind: "[X] 你的Guilded账户还没有绑定玩家"
+invalid-code: "[X] 绑定码错误,请检查拼写或在Minecraft中再次输入“/mc2g mkbind”生成一个新绑定码"
+g-already-bound: "[X] 你的Guilded账户已绑定至%PLAYER%"
+
+mc2g-started: "`* MC2GForward已启动 *`"
+mc2g-stopped: "`* MC2GForward已停止 *`"
+player-connected: "`[+] %PLAYER%加入了游戏`"
+player-disconnected: "`[-] %PLAYER%离开了游戏`"
+player-disconnected-unusual: "`(%PLAYER%连接中断:%REASON%)`"