Updated compiler

This commit is contained in:
Shoghi Cervantes 2014-03-29 03:27:29 +01:00
parent 0d30dca5aa
commit e03c8ed32e
3 changed files with 173 additions and 3 deletions

View File

@ -0,0 +1,100 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace PocketMine\Command\Defaults;
use PocketMine\Command\CommandSender;
use PocketMine\Network\Protocol\Info;
use PocketMine\Plugin\Plugin;
use PocketMine\Server;
use PocketMine\Utils\TextFormat;
class VersionCommand extends VanillaCommand{
public function __construct($name){
parent::__construct(
$name,
"Gets the version of this server including any plugins in use",
"/version [plugin name]",
["ver", "about"]
);
$this->setPermission("pocketmine.command.version");
}
public function execute(CommandSender $sender, $currentAlias, array $args){
if(!$this->testPermission($sender)){
return true;
}
if(count($args) === 0){
$output = "This server is running PocketMine-MP version " . Server::getInstance()->getPocketMineVersion() . "" . Server::getInstance()->getCodename() . "」 (Implementing API version " . Server::getInstance()->getApiVersion() . " for Minecraft: PE " . Server::getInstance()->getVersion() . " protocol version " . Info::CURRENT_PROTOCOL . ")";
if(\PocketMine\GIT_COMMIT !== str_repeat("00", 20)){
$output .= " [git " . \PocketMine\GIT_COMMIT . "]";
}
$sender->sendMessage($output);
}else{
$pluginName = implode(" ", $args);
$exactPlugin = Server::getInstance()->getPluginManager()->getPlugin($pluginName);
if($exactPlugin instanceof Plugin){
$this->describeToSender($exactPlugin, $sender);
return true;
}
$found = false;
$pluginName = strtolower($pluginName);
foreach(Server::getInstance()->getPluginManager()->getPlugins() as $plugin){
if(stripos($plugin->getName(), $pluginName) !== false){
$this->describeToSender($plugin, $sender);
$found = true;
}
}
if(!$found){
$sender->sendMessage("This server is not running any plugin by that name.\nUse /plugins to get a list of plugins.");
}
}
return true;
}
private function describeToSender(Plugin $plugin, CommandSender $sender){
$desc = $plugin->getDescription();
$sender->sendMessage(TextFormat::DARK_GREEN . $desc->getName() . TextFormat::WHITE . " version " . TextFormat::DARK_GREEN . $desc->getVersion());
if($desc->getDescription() != null){
$sender->sendMessage($desc->getDescription());
}
if($desc->getWebsite() != null){
$sender->sendMessage("Website: " . $desc->getWebsite());
}
if(count($authors = $desc->getAuthors()) > 0){
if(count($authors) === 1){
$sender->sendMessage("Author: " . implode(", ", $authors));
}else{
$sender->sendMessage("Authors: " . implode(", ", $authors));
}
}
}
}

View File

@ -0,0 +1,68 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace PocketMine\Event\Player;
use PocketMine\Block\Block;
use PocketMine\Event\Cancellable;
use PocketMine\Item\Item;
use PocketMine\Player;
/**
* Called when a player interacts or touches a block (including air?)
*/
class PlayerInteractEvent extends PlayerEvent implements Cancellable{
public static $handlerList = null;
/**
* @var \PocketMine\Block\Block;
*/
protected $blockTouched;
/**
* @var int
*/
protected $blockFace;
/**
* @var \PocketMine\Item\Item
*/
protected $item;
public function __construct(Player $player, Item $item, Block $block, $face){
$this->blockTouched = $block;
$this->player = $player;
$this->item = $item;
$this->blockFace = (int) $face;
}
public function getItem(){
return $this->item;
}
public function getBlock(){
return $this->blockTouched;
}
public function getFace(){
return $this->blockFace;
}
}

View File

@ -214,9 +214,11 @@ elif [ "$COMPILE_TARGET" == "rpi" ]; then
OPENSSL_TARGET="linux-armv4"
echo "[INFO] Compiling for Raspberry Pi ARMv6zk hard float"
elif [ "$COMPILE_TARGET" == "mac" ] || [ "$COMPILE_TARGET" == "mac32" ]; then
[ -z "$march" ] && march=prescott;
#[ -z "$march" ] && march=prescott;
#[ -z "$mtune" ] && mtune=generic;
[ -z "$march" ] && march=i686;
[ -z "$mtune" ] && mtune=generic;
[ -z "$CFLAGS" ] && CFLAGS="-m32 -arch i386 -fomit-frame-pointer -mmacosx-version-min=10.5";
[ -z "$CFLAGS" ] && CFLAGS="-m32 -arch x86 -fomit-frame-pointer -mmacosx-version-min=10.5";
[ -z "$LDFLAGS" ] && LDFLAGS="-Wl,-rpath,@loader_path/../lib";
export DYLD_LIBRARY_PATH="@loader_path/../lib"
OPENSSL_TARGET="darwin-i386-cc"
@ -224,7 +226,7 @@ elif [ "$COMPILE_TARGET" == "mac" ] || [ "$COMPILE_TARGET" == "mac32" ]; then
elif [ "$COMPILE_TARGET" == "mac64" ]; then
[ -z "$march" ] && march=core2;
[ -z "$mtune" ] && mtune=generic;
[ -z "$CFLAGS" ] && CFLAGS="-m64 -arch x86_64 -fomit-frame-pointer -mmacosx-version-min=10.5";
[ -z "$CFLAGS" ] && CFLAGS="-m64 -arch x86-64 -fomit-frame-pointer -mmacosx-version-min=10.5";
[ -z "$LDFLAGS" ] && LDFLAGS="-Wl,-rpath,@loader_path/../lib";
export DYLD_LIBRARY_PATH="@loader_path/../lib"
OPENSSL_TARGET="darwin64-x86_64-cc"