命名空间 MyPlot;使用 pocketmineutilsTextFormat;使用 MyPlotsubcommandSubCommand;使用 MyPlotsubcommandAddHelperSubCommand;使用 MyPlotsubcommandClaimSubCommand;使用 MyPlotsubcommandClearSubCommand;使用 MyPlotsubcommandDisposeSubCommand;使用 MyPlotsubcommandGenerateSubCommand;使用 MyPlotsubcommandHelpSubCommand;使用 MyPlotsubcommandHomeSubCommand;使用 MyPlotsubcommandInfoSubCommand;使用 MyPlotsubcommandHomesSubCommand;使用 MyPlotsubcommandResetSubCommand;使用 pocketminecommandPluginCommand;使用 pocketminecommandCommandSender;使用 MyPlotsubcommandRemoveHelperSubCommand;使用 MyPlotsubcommandAutoSubCommand;使用 MyPlotsubcommandBiomeSubCommand;使用 MyPlotsubcommandNameSubCommand;使用 MyPlotsubcommandGiveSubCommand;使用 MyPlotsubcommandWarpSubCommand;类的命令扩展 PluginCommand{私营 $subCommands = [];私营 $aliasSubCommands = [];公共函数 __construct (MyPlot $plugin) {parent::__construct ($plugin-> getLanguage()-> get("command.name"),$plugin);$this-> setPermission("myplot.command");$this-> setAliases ([$plugin-> getLanguage()-> get("command.alias")]);$this-> setDescription ($plugin-> getLanguage()-> get("command.desc"));$this-> loadSubCommand (新 HelpSubCommand ($plugin,"帮助"));$this-> loadSubCommand (新 ClaimSubCommand ($plugin,"索赔"));$this-> loadSubCommand (新 GenerateSubCommand ($plugin,"生成"));$this-> loadSubCommand (新 InfoSubCommand ($plugin,"信息"));$this-> loadSubCommand (新 AddHelperSubCommand ($plugin,"addhelper"));$this-> loadSubCommand (新 RemoveHelperSubCommand ($plugin,"removehelper"));$this-> loadSubCommand (新 AutoSubCommand ($plugin,"auto"));$this-> loadSubCommand (新 ClearSubCommand ($plugin,"清除"));$this-> loadSubCommand (新 DisposeSubCommand ($plugin,"处置"));$this-> loadSubCommand (新 ResetSubCommand ($plugin,"重置"));$this-> loadSubCommand (新 BiomeSubCommand ($plugin,"生物群落"));$this-> loadSubCommand (新 HomeSubCommand ($plugin,"家"));$this-> loadSubCommand (新 HomesSubCommand ($plugin,"家园"));$this-> loadSubCommand (新 NameSubCommand ($plugin,"名称"));$this-> loadSubCommand (新 GiveSubCommand ($plugin,"给"));$this-> loadSubCommand (新 WarpSubCommand ($plugin,"warp")); }公共函数 getCommands() {返回 $this-> 子命令; }私有函数 loadSubCommand (子命令 $command) {$this-> 子命令 [$command-> getName()] = $command;如果 ($command-> getAlias() ! ="") {$this-> aliasSubCommands [$command-> getAlias()] = $command; } }公共函数执行 (CommandSender $sender,$alias,$args 数组) {如果 (! isset($args[0])) {$sender-> sendMessage(MyPlot::getInstance()-> getLanguage()-> get("command.usage"));返回 true; }$subCommand = strtolower(array_shift($args));如果 (设定 ($这-> subCommands[$subCommand])) {$command = $this-> 子 [$subCommand];} elseif (设定 ($这-> aliasSubCommands[$subCommand])) {$command = $this-> aliasSubCommands [$subCommand];} {其他$sender-> 留言板 (TextFormat::RED。MyPlot::getInstance()-> getLanguage()-> get("command.unknown"));返回 true; }如果 ($command-> canUse($sender)) {如果 (! $command-> 执行 ($sender,$args)) {$usage = MyPlot::getInstance()-> getLanguage()-> translateString ("subcommand.usage"[$command-> getUsage()]);$sender-> sendMessage($usage); }} {其他$sender-> 留言板 (TextFormat::RED。MyPlot::getInstance()-> getLanguage()-> get("command.unknown")); }返回 true; }}
正在翻譯中..