Comments (2)
I fixed it with this code in the MineReset/src/falkirks/minereset/command/MineCommand.php file
<?php
namespace falkirks\minereset\command;
use falkirks\minereset\MineReset;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\command\PluginIdentifiableCommand;
use pocketmine\Player;
use pocketmine\plugin\Plugin;
class MineCommand extends Command implements PluginIdentifiableCommand {
/** @var MineReset */
protected $api;
/** @var SubCommand[] */
protected $subCommands;
public function __construct(MineReset $api){
parent::__construct("mine", "Mine reset command", "/mine <create|set|list|reset|reset-all|destroy|report> <name> [parameters]");
$this->setPermission("mine.command");
$this->api = $api;
$this->subCommands = [];
}
/**
* @param CommandSender $sender
* @param string $commandLabel
* @param string[] $args
*
* @return mixed
*/
public function execute(CommandSender $sender, string $commandLabel, array $args){
if(!$this->testPermission($sender)){
return true;
}
if(count($args) > 0 && array_key_exists($args[0], $this->subCommands)){
return $this->subCommands[array_shift($args)]->execute($sender, $commandLabel, $args);
}
else{
$sender->sendMessage($this->getUsage());
return null;
}
}
/**
* @return \pocketmine\plugin\Plugin
*/
public function getPlugin(): Plugin{
return $this->api;
}
public function registerSubCommand(string $name, SubCommand $command, $aliases = []){
$this->subCommands[$name] = $command;
foreach ($aliases as $alias){
if(!isset($this->subCommands[$alias])){
$this->registerSubCommand($alias, $command);
}
}
}
}
from minereset.
Thanks for sharing your fix
from minereset.
Related Issues (20)
- Config Issue HOT 1
- AsyncTask->onCompletion() & onProgressUpdate() broke 3.0.0 compatibility
- Fix mine reset-all and add to were they teleport to the mike warp there in on reset HOT 3
- New data storage format
- Double selection on one click HOT 3
- Could not queue reset for A HOT 14
- Bug HOT 2
- Error: "Cannot use object of type falkirks\minereset\Mine as array"
- Could not queue for reset A
- Custom message
- Is that a bug or did I something wrong?
- what is the version of this compilation?
- how you convert php for java? HOT 1
- unserialize(): Error on Mine reset command
- teleports player under mine HOT 1
- mine reset plugin sais Could not queue reset for (name of mine)
- Mine reset task
- Shovel Issue
- API4 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minereset.