From f5a9fc1131d29939fbbe4e679cbf197ec4e8a490 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Fri, 30 Sep 2016 19:25:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- .../java/pw/yumc/YumCore/commands/CommandArgument.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/pw/yumc/YumCore/commands/CommandArgument.java b/src/main/java/pw/yumc/YumCore/commands/CommandArgument.java index 0fe138c..2547c07 100644 --- a/src/main/java/pw/yumc/YumCore/commands/CommandArgument.java +++ b/src/main/java/pw/yumc/YumCore/commands/CommandArgument.java @@ -2,6 +2,7 @@ package pw.yumc.YumCore.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; /** * 子命令参数类 @@ -43,6 +44,13 @@ public class CommandArgument { return command; } + /** + * @return 命令发送者(转换为Player) + */ + public Player getPlayer() { + return (Player) sender; + } + /** * @return 命令发送者 */