From bec642310a5658d9721e3dadf331ff38d8053c22 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Wed, 2 Apr 2014 06:07:21 +0200 Subject: [PATCH] Removed BlockAPI --- src/pocketmine/BlockAPI.php | 81 ------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 src/pocketmine/BlockAPI.php diff --git a/src/pocketmine/BlockAPI.php b/src/pocketmine/BlockAPI.php deleted file mode 100644 index f9a5789f5..000000000 --- a/src/pocketmine/BlockAPI.php +++ /dev/null @@ -1,81 +0,0 @@ -server = Server::getInstance(); - } - - public function init(){ - $this->server->schedule(1, array($this, "blockUpdateTick"), array(), true); - $this->server->api->console->register("give", " [amount]", array($this, "commandHandler")); - } - - public function commandHandler($cmd, $params, $issuer, $alias){ - $output = ""; - switch($cmd){ - case "give": - if(!isset($params[0]) or !isset($params[1])){ - $output .= "Usage: /give [amount]\n"; - break; - } - $player = Player::get($params[0]); - $item = Item::fromString($params[1]); - - if(!isset($params[2])){ - $item->setCount($item->getMaxStackSize()); - }else{ - $item->setCount((int) $params[2]); - } - - if($player instanceof Player){ - if(($player->gamemode & 0x01) === 0x01){ - $output .= "Player is in creative mode.\n"; - break; - } - if($item->getID() == 0){ - $output .= "You cannot give an air block to a player.\n"; - break; - } - $player->addItem(clone $item); - $output .= "Giving " . $item->getCount() . " of " . $item->getName() . " (" . $item->getID() . ":" . $item->getMetadata() . ") to " . $player->getName() . "\n"; - }else{ - $output .= "Unknown player.\n"; - } - - break; - } - - return $output; - } - -}