命名空间 MyPlotsubcommand;使用 pocketminecommandCommandSender;使用 pocketminePlayer;使用 pocketmineutilsTextFormat;使用 MyPlotPlot;HomesSubCommand 类扩展子命令{公共职能跨越 (CommandSender $sender) {返回 ($sender 举例球员) 和 $sender-> hasPermission("myplot.command.homes"); }公共函数执行 (CommandSender $sender,$args 数组) {如果 (! empty($args)) {返回 false; }$plots = $this-> getPlugin()-> getProvider()-> getPlotsByOwner ($sender-> getName());如果 (empty($plots)) {$sender-> 给我们留言 (TextFormat::RED.$this-> translateString("homes.noplots"));返回 true; }$sender-> 给我们留言 (TextFormat::DARK_GREEN.$this-> translateString("homes.header"));为 ($i = 0; $i < count($plots); $i + +) {$plot = $plots [$i];$message = TextFormat::DARK_GREEN。($i + 1) .") ";$message.= TextFormat::WHITE。$plot-> levelName。" " .$plot如果 ($plot-> 名称 ! = ="") {$message.="="。$plot-> 名称; }$sender-> sendMessage($message); }返回 true; }}
正在翻譯中..
