mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Merge branch 'master' of https://github.com/kotyaralih/NostalgiaCore
This commit is contained in:
commit
81af4a9b45
1 changed files with 10 additions and 0 deletions
|
|
@ -222,11 +222,21 @@ class BlockAPI{
|
|||
$this->server->schedule(1, [$this, "blockUpdateTick"], [], true);
|
||||
$this->server->api->console->register("setblock", "<x> <y> <z> <block[:damage]>", [$this, "commandHandler"]);
|
||||
$this->server->api->console->register("give", "<player> <item[:damage]> [amount]", [$this, "commandHandler"]);
|
||||
$this->server->api->console->register("id", "Check id of item", [$this, "commandHandler"]);
|
||||
$this->server->api->console->cmdWhitelist("id");
|
||||
}
|
||||
|
||||
public function commandHandler($cmd, $args, $issuer, $alias){
|
||||
$output = "";
|
||||
switch($cmd){
|
||||
case "id":
|
||||
if(!($issuer instanceof Player)){
|
||||
$output .= "Run this command in-game!";
|
||||
break;
|
||||
}
|
||||
$itemheld = $issuer->getSlot($issuer->slot);
|
||||
$output = self::getItem($itemheld->getID(), $itemheld->getMetadata())."";
|
||||
break;
|
||||
case "setblock":
|
||||
if(!($issuer instanceof Player)){
|
||||
if(count($args) < 5){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue