From bfc9200dc7983fca0dadabf3fa7ac381fc22ab1e Mon Sep 17 00:00:00 2001 From: j502647092 Date: Sat, 3 Oct 2015 11:00:20 +0800 Subject: [PATCH] add new Command Ping... Signed-off-by: j502647092 --- .../SimpleEssential/SimpleEssential.java | 2 + .../SimpleEssential/command/CommandPing.java | 37 +++++++++++++++++++ src/main/resources/language.yml | 5 ++- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 src/main/java/cn/citycraft/SimpleEssential/command/CommandPing.java diff --git a/src/main/java/cn/citycraft/SimpleEssential/SimpleEssential.java b/src/main/java/cn/citycraft/SimpleEssential/SimpleEssential.java index 4e3695f..7a420e0 100644 --- a/src/main/java/cn/citycraft/SimpleEssential/SimpleEssential.java +++ b/src/main/java/cn/citycraft/SimpleEssential/SimpleEssential.java @@ -21,6 +21,7 @@ import cn.citycraft.SimpleEssential.command.CommandEnchantBench; import cn.citycraft.SimpleEssential.command.CommandGc; import cn.citycraft.SimpleEssential.command.CommandHat; import cn.citycraft.SimpleEssential.command.CommandHome; +import cn.citycraft.SimpleEssential.command.CommandPing; import cn.citycraft.SimpleEssential.command.CommandSetHome; import cn.citycraft.SimpleEssential.command.CommandSetSpawn; import cn.citycraft.SimpleEssential.command.CommandSpawn; @@ -122,6 +123,7 @@ public class SimpleEssential extends JavaPlugin { registerCommand(new CommandSpawn(this)); registerCommand(new CommandGc(this)); registerCommand(new CommandWorld(this)); + registerCommand(new CommandPing(this)); } /** diff --git a/src/main/java/cn/citycraft/SimpleEssential/command/CommandPing.java b/src/main/java/cn/citycraft/SimpleEssential/command/CommandPing.java new file mode 100644 index 0000000..36ffdc4 --- /dev/null +++ b/src/main/java/cn/citycraft/SimpleEssential/command/CommandPing.java @@ -0,0 +1,37 @@ +/** + * + */ +package cn.citycraft.SimpleEssential.command; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandException; +import org.bukkit.command.CommandSender; + +import cn.citycraft.PluginHelper.commands.BaseCommand; +import cn.citycraft.SimpleEssential.SimpleEssential; +import cn.citycraft.SimpleEssential.config.I18n; + +/** + * 传送到顶部命令 + * + * @author 蒋天蓓 + * 2015年8月12日下午2:04:05 + * + */ +public class CommandPing extends BaseCommand { + SimpleEssential plugin; + + /** + * @param name + */ + public CommandPing(final SimpleEssential main) { + super("ping"); + this.plugin = main; + setDescription("检测网络延时"); + } + + @Override + public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException { + sender.sendMessage(I18n.p("Ping")); + } +} diff --git a/src/main/resources/language.yml b/src/main/resources/language.yml index a89e8ff..7e1900c 100644 --- a/src/main/resources/language.yml +++ b/src/main/resources/language.yml @@ -1,5 +1,5 @@ #本文件为基础插件的语言配置文件 -version: 1.3 +version: 1.4 #基础语言配置 Base: offline: "§c玩家 %s 不存在或不在线!" @@ -42,4 +42,5 @@ World: title: '§6当前服务器的启用的世界如下' info: '§a%s §3- §a%s §6区块: §a%s §6实体: §a%s §6tiles: §a%s §6玩家: §a%s' unknow: '§c未知的世界 §a%s' -Sudo: '§6玩家: §a%s §6已执行命令 §b%s' \ No newline at end of file +Sudo: '§6玩家: §a%s §6已执行命令 §b%s' +Ping: '§6啪!' \ No newline at end of file