Fixed namespaces paths

This commit is contained in:
Shoghi Cervantes 2014-04-01 04:47:04 +02:00
parent 3605bc36c5
commit 207c2c4aba
441 changed files with 1514 additions and 1525 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ bin/*
.idea/*
*.log
*.txt
*.phar
server.properties
# Windows image file caches

View File

@ -46,7 +46,7 @@ It is mainly [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accept
```php
<?php
namespace PocketMine\Example;
namespace pocketmine\Example;
class ExampleClass{
const EXAMPLE_CLASS_CONSTANT = 1;

View File

@ -19,8 +19,8 @@
*
*/
namespace PocketMine;
use PocketMine\Utils\TextFormat;
namespace pocketmine;
use pocketmine\utils\TextFormat;
/**
* Handles the achievement list and a bit more

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine;
namespace pocketmine;
use PocketMine\Level\Level;
use PocketMine\Math\Vector2;
use PocketMine\Utils\Config;
use pocketmine\level\Level;
use pocketmine\math\Vector2;
use pocketmine\utils\Config;
class BanAPI{
private $server;
@ -44,10 +44,10 @@ class BanAPI{
}
public function init(){
$this->whitelist = new Config(\PocketMine\DATA . "white-list.txt", Config::ENUM); //Open whitelist list file
$this->bannedIPs = new Config(\PocketMine\DATA . "banned-ips.txt", Config::ENUM); //Open Banned IPs list file
$this->banned = new Config(\PocketMine\DATA . "banned.txt", Config::ENUM); //Open Banned Usernames list file
$this->ops = new Config(\PocketMine\DATA . "ops.txt", Config::ENUM); //Open list of OPs
$this->whitelist = new Config(\pocketmine\DATA . "white-list.txt", Config::ENUM); //Open whitelist list file
$this->bannedIPs = new Config(\pocketmine\DATA . "banned-ips.txt", Config::ENUM); //Open Banned IPs list file
$this->banned = new Config(\pocketmine\DATA . "banned.txt", Config::ENUM); //Open Banned Usernames list file
$this->ops = new Config(\pocketmine\DATA . "ops.txt", Config::ENUM); //Open list of OPs
$this->server->api->console->register("banip", "<add|remove|list|reload> [IP|player]", array($this, "commandHandler"));
$this->server->api->console->register("ban", "<add|remove|list|reload> [username]", array($this, "commandHandler"));
$this->server->api->console->register("kick", "<player> [reason ...]", array($this, "commandHandler"));
@ -220,7 +220,7 @@ class BanAPI{
$output .= "Player \"$user\" added to white-list\n";
break;
case "reload":
$this->whitelist = new Config(\PocketMine\DATA . "white-list.txt", Config::ENUM);
$this->whitelist = new Config(\pocketmine\DATA . "white-list.txt", Config::ENUM);
break;
case "list":
$output .= "White-list: " . implode(", ", $this->whitelist->getAll(true)) . "\n";
@ -265,7 +265,7 @@ class BanAPI{
$output .= "IP \"$ip\" added to ban list\n";
break;
case "reload":
$this->bannedIPs = new Config(\PocketMine\DATA . "banned-ips.txt", Config::ENUM);
$this->bannedIPs = new Config(\pocketmine\DATA . "banned-ips.txt", Config::ENUM);
break;
case "list":
$output .= "IP ban list: " . implode(", ", $this->bannedIPs->getAll(true)) . "\n";
@ -303,7 +303,7 @@ class BanAPI{
$output .= "Player \"$user\" added to ban list\n";
break;
case "reload":
$this->banned = new Config(\PocketMine\DATA . "banned.txt", Config::ENUM);
$this->banned = new Config(\pocketmine\DATA . "banned.txt", Config::ENUM);
break;
case "list":
$output .= "Ban list: " . implode(", ", $this->banned->getAll(true)) . "\n";

View File

@ -19,12 +19,12 @@
*
*/
namespace PocketMine;
namespace pocketmine;
use PocketMine\Block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Level\Position;
use pocketmine\Block;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\level\Position;
class BlockAPI{
private $server;
@ -292,7 +292,7 @@ class BlockAPI{
}
public function blockUpdate(Position $pos, $type = Level::BLOCK_UPDATE_NORMAL){
if(!($pos instanceof BLock\Block)){
if(!($pos instanceof block\Block)){
$block = $pos->level->getBlock($pos);
}else{
$pos = new Position($pos->x, $pos->y, $pos->z, $pos->level);

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine;
namespace pocketmine;
use PocketMine\Level\Level;
use pocketmine\level\Level;
class LevelAPI{
private $server;

View File

@ -19,58 +19,58 @@
*
*/
namespace PocketMine;
namespace pocketmine;
use PocketMine\Command\CommandSender;
use PocketMine\Entity\Human;
use PocketMine\Event;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Level\Position;
use PocketMine\Math\Vector3 as Vector3;
use PocketMine\NBT\NBT;
use PocketMine\NBT\Tag\Byte;
use PocketMine\NBT\Tag\Compound;
use PocketMine\NBT\Tag\Double;
use PocketMine\NBT\Tag\Enum;
use PocketMine\NBT\Tag\Float;
use PocketMine\NBT\Tag\Int;
use PocketMine\NBT\Tag\Short;
use PocketMine\NBT\Tag\String;
use PocketMine\Network\Protocol\AdventureSettingsPacket;
use PocketMine\Network\Protocol\ChunkDataPacket;
use PocketMine\Network\Protocol\ContainerClosePacket;
use PocketMine\Network\Protocol\ContainerSetContentPacket;
use PocketMine\Network\Protocol\ContainerSetSlotPacket;
use PocketMine\Network\Protocol\DataPacket;
use PocketMine\Network\Protocol\DisconnectPacket;
use PocketMine\Network\Protocol\Info as ProtocolInfo;
use PocketMine\Network\Protocol\LoginStatusPacket;
use PocketMine\Network\Protocol\MessagePacket;
use PocketMine\Network\Protocol\PongPacket;
use PocketMine\Network\Protocol\ServerHandshakePacket;
use PocketMine\Network\Protocol\SetSpawnPositionPacket;
use PocketMine\Network\Protocol\SetTimePacket;
use PocketMine\Network\Protocol\StartGamePacket;
use PocketMine\Network\Protocol\TileEventPacket;
use PocketMine\Network\Protocol\UnknownPacket;
use PocketMine\Network\Protocol\UpdateBlockPacket;
use PocketMine\Network\RakNet\Info;
use PocketMine\Network\RakNet\Packet;
use PocketMine\Permission\PermissibleBase;
use PocketMine\Permission\PermissionAttachment;
use PocketMine\Plugin\Plugin;
use PocketMine\PMF\LevelFormat;
use PocketMine\Recipes\Crafting;
use PocketMine\Scheduler\CallbackTask;
use PocketMine\Tile\Chest;
use PocketMine\Tile\Furnace;
use PocketMine\Tile\Sign;
use PocketMine\Tile\Spawnable;
use PocketMine\Tile\Tile;
use PocketMine\Utils\Config;
use PocketMine\Utils\TextFormat;
use PocketMine\Utils\Utils;
use pocketmine\command\CommandSender;
use pocketmine\entity\Human;
use pocketmine\Event;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\level\Position;
use pocketmine\math\Vector3 as Vector3;
use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\Byte;
use pocketmine\nbt\tag\Compound;
use pocketmine\nbt\tag\Double;
use pocketmine\nbt\tag\Enum;
use pocketmine\nbt\tag\Float;
use pocketmine\nbt\tag\Int;
use pocketmine\nbt\tag\Short;
use pocketmine\nbt\tag\String;
use pocketmine\network\protocol\AdventureSettingsPacket;
use pocketmine\network\protocol\ChunkDataPacket;
use pocketmine\network\protocol\ContainerClosePacket;
use pocketmine\network\protocol\ContainerSetContentPacket;
use pocketmine\network\protocol\ContainerSetSlotPacket;
use pocketmine\network\protocol\DataPacket;
use pocketmine\network\protocol\DisconnectPacket;
use pocketmine\network\protocol\Info as ProtocolInfo;
use pocketmine\network\protocol\LoginStatusPacket;
use pocketmine\network\protocol\MessagePacket;
use pocketmine\network\protocol\PongPacket;
use pocketmine\network\protocol\ServerHandshakePacket;
use pocketmine\network\protocol\SetSpawnPositionPacket;
use pocketmine\network\protocol\SetTimePacket;
use pocketmine\network\protocol\StartGamePacket;
use pocketmine\network\protocol\TileEventPacket;
use pocketmine\network\protocol\UnknownPacket;
use pocketmine\network\protocol\UpdateBlockPacket;
use pocketmine\network\raknet\Info;
use pocketmine\network\raknet\Packet;
use pocketmine\permission\PermissibleBase;
use pocketmine\permission\PermissionAttachment;
use pocketmine\plugin\Plugin;
use pocketmine\pmf\LevelFormat;
use pocketmine\recipes\Crafting;
use pocketmine\scheduler\CallbackTask;
use pocketmine\tile\Chest;
use pocketmine\tile\Furnace;
use pocketmine\tile\Sign;
use pocketmine\tile\Spawnable;
use pocketmine\tile\Tile;
use pocketmine\utils\Config;
use pocketmine\utils\TextFormat;
use pocketmine\utils\Utils;
/**
* Main class that handles networking, recovery, and packet sending to the server part
@ -131,7 +131,7 @@ class Player extends Human implements CommandSender{
private $resendQueue = array();
private $ackQueue = array();
private $receiveCount = -1;
/** @var \PocketMine\Network\RakNet\Packet */
/** @var \pocketmine\network\raknet\Packet */
private $buffer;
private $bufferLen = 0;
private $nextBuffer = 0;
@ -154,7 +154,7 @@ class Player extends Human implements CommandSender{
private $received = array();
/**
* @var \PocketMine\Scheduler\TaskHandler[]
* @var \pocketmine\scheduler\TaskHandler[]
*/
private $tasks = array();
@ -255,7 +255,7 @@ class Player extends Human implements CommandSender{
}
/**
* @param Permission\Permission|string $name
* @param permission\Permission|string $name
*
* @return bool
*/
@ -264,7 +264,7 @@ class Player extends Human implements CommandSender{
}
/**
* @param Permission\Permission|string $name
* @param permission\Permission|string $name
*
* @return bool
*/
@ -277,7 +277,7 @@ class Player extends Human implements CommandSender{
* @param string $name
* @param bool $value
*
* @return Permission\PermissionAttachment
* @return permission\PermissionAttachment
*/
public function addAttachment(Plugin $plugin, $name = null, $value = null){
return $this->perm->addAttachment($plugin, $name, $value);
@ -295,7 +295,7 @@ class Player extends Human implements CommandSender{
}
/**
* @return Permission\PermissionAttachmentInfo[]
* @return permission\PermissionAttachmentInfo[]
*/
public function getEffectivePermissions(){
return $this->perm->getEffectivePermissions();
@ -603,7 +603,7 @@ class Player extends Human implements CommandSender{
if($this->connected === false){
return false;
}
$this->server->getPluginManager()->callEvent($ev = new Event\Server\DataPacketSendEvent($this, $packet));
$this->server->getPluginManager()->callEvent($ev = new event\server\DataPacketSendEvent($this, $packet));
if($ev->isCancelled()){
return false;
}
@ -884,7 +884,7 @@ class Player extends Human implements CommandSender{
return false;
}
}
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerAchievementAwardedEvent($this, $achievementId));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerAchievementAwardedEvent($this, $achievementId));
if(!$ev->isCancelled()){
$this->achievements[$achievementId] = true;
Achievement::broadcast($this, $achievementId);
@ -918,7 +918,7 @@ class Player extends Human implements CommandSender{
return false;
}
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerGameModeChangeEvent($this, (int) $gm));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerGameModeChangeEvent($this, (int) $gm));
if($ev->isCancelled()){
return false;
}
@ -1177,7 +1177,7 @@ class Player extends Human implements CommandSender{
return;
}
$this->server->getPluginManager()->callEvent($ev = new Event\Server\DataPacketReceiveEvent($this, $packet));
$this->server->getPluginManager()->callEvent($ev = new event\server\DataPacketReceiveEvent($this, $packet));
if($ev->isCancelled()){
return;
}
@ -1246,7 +1246,7 @@ class Player extends Human implements CommandSender{
return;
}
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerPreLoginEvent($this, "Plugin reason"));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerPreLoginEvent($this, "Plugin reason"));
if($ev->isCancelled()){
$this->close($ev->getKickMessage(), "Plugin reason");
@ -1311,7 +1311,7 @@ class Player extends Human implements CommandSender{
$this->slot = $this->hotbar[0];
}
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerLoginEvent($this, "Plugin reason"));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerLoginEvent($this, "Plugin reason"));
if($ev->isCancelled()){
$this->close($ev->getKickMessage(), "Plugin reason");
@ -1355,7 +1355,7 @@ class Player extends Human implements CommandSender{
console("[INFO] " . TextFormat::AQUA . $this->username . TextFormat::RESET . "[/" . $this->ip . ":" . $this->port . "] logged in with entity id " . $this->id . " at (" . $this->level->getName() . ", " . round($this->x, 4) . ", " . round($this->y, 4) . ", " . round($this->z, 4) . ")");
$this->server->getPluginManager()->callEvent(new Event\Player\PlayerJoinEvent($this, $this->username . " joined the game"));
$this->server->getPluginManager()->callEvent(new event\player\PlayerJoinEvent($this, $this->username . " joined the game"));
break;
case ProtocolInfo::READY_PACKET:
@ -1386,7 +1386,7 @@ class Player extends Human implements CommandSender{
$pos = new Position($this->x, $this->y, $this->z, $this->level);
$pos = $this->level->getSafeSpawn($pos);
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerRespawnEvent($this, $pos));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerRespawnEvent($this, $pos));
$this->teleport($ev->getRespawnPosition());
$this->sendBuffer();
@ -1457,7 +1457,7 @@ class Player extends Human implements CommandSender{
if($packet->slot === false){
$this->sendInventorySlot($packet->slot);
}else{
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerItemHeldEvent($this, $item, $packet->slot, 0));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerItemHeldEvent($this, $item, $packet->slot, 0));
if($ev->isCancelled()){
$this->sendInventorySlot($packet->slot);
}elseif($item instanceof Item){
@ -1816,7 +1816,7 @@ class Player extends Human implements CommandSender{
$this->craftingItems = array();
$this->toCraft = array();
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerRespawnEvent($this, $this->spawnPosition));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerRespawnEvent($this, $this->spawnPosition));
$this->teleport($ev->getRespawnPosition());
//$this->entity->fire = 0;
@ -1914,16 +1914,16 @@ class Player extends Human implements CommandSender{
$packet->message = TextFormat::clean($packet->message);
if(trim($packet->message) != "" and strlen($packet->message) <= 255){
$message = $packet->message;
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerCommandPreprocessEvent($this, $message));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerCommandPreprocessEvent($this, $message));
if($ev->isCancelled()){
break;
}
if(substr($ev->getMessage(), 0, 1) === "/"){ //Command
$this->server->dispatchCommand($ev->getPlayer(), substr($ev->getMessage(), 1));
}else{
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerChatEvent($this, $ev->getMessage()));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerChatEvent($this, $ev->getMessage()));
if(!$ev->isCancelled()){
Player::groupChat(sprintf($ev->getFormat(), $ev->getPlayer()->getDisplayName(), $ev->getMessage()), $ev->getRecipients());
$this->server->broadcastMessage(sprintf($ev->getFormat(), $ev->getPlayer()->getDisplayName(), $ev->getMessage()), $ev->getRecipients());
}
}
}
@ -2181,7 +2181,7 @@ class Player extends Human implements CommandSender{
* @return bool
*/
public function kick($reason = ""){
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerKickEvent($this, $reason, "Kicked player " . $this->username . "." . ($reason !== "" ? " With reason: $reason" : "")));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerKickEvent($this, $reason, "Kicked player " . $this->username . "." . ($reason !== "" ? " With reason: $reason" : "")));
if(!$ev->isCancelled()){
$this->sendMessage("You have been kicked. " . ($reason !== "" ? " Reason: $reason" : "") . "\n");
$this->close($ev->getQuitMessage(), $reason);
@ -2235,7 +2235,7 @@ class Player extends Human implements CommandSender{
if($this->connected === true){
unset($this->level->players[$this->CID]);
if($this->username != ""){
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerQuitEvent($this, $message));
$this->server->getPluginManager()->callEvent($ev = new event\player\PlayerQuitEvent($this, $message));
if($this->loggedIn === true){
parent::close();
$this->save();
@ -2312,7 +2312,7 @@ class Player extends Human implements CommandSender{
return false;
}
$this->server->getPluginManager()->callEvent($ev = new Event\Server\DataPacketSendEvent($this, $packet));
$this->server->getPluginManager()->callEvent($ev = new event\server\DataPacketSendEvent($this, $packet));
if($ev->isCancelled()){
return array();
}

View File

@ -19,12 +19,12 @@
*
*/
namespace PocketMine;
namespace pocketmine;
use PocketMine\Entity\Entity;
use PocketMine\Level\Level;
use PocketMine\Level\Position;
use PocketMine\Math\Vector3 as Vector3;
use pocketmine\entity\Entity;
use pocketmine\level\Level;
use pocketmine\level\Position;
use pocketmine\math\Vector3 as Vector3;
class PlayerAPI{
private $server;

View File

@ -29,7 +29,7 @@ namespace {
* @param int $level
*/
function console($message, $EOL = true, $log = true, $level = 1){
PocketMine\console($message, $EOL, $log, $level);
pocketmine\console($message, $EOL, $log, $level);
}
function safe_var_dump(){
@ -76,23 +76,27 @@ namespace {
}
}
namespace PocketMine {
namespace pocketmine {
use pocketmine\utils\TextFormat;
use pocketmine\utils\Utils;
use pocketmine\wizard\Installer;
const VERSION = "Alpha_1.4dev";
const API_VERSION = "1.0.0";
const CODENAME = "絶好(Zekkou)ケーキ(Cake)";
const MINECRAFT_VERSION = "v0.8.1 alpha";
const PHP_VERSION = "5.5";
@define("PocketMine\\PATH", \getcwd() . DIRECTORY_SEPARATOR);
@define("pocketmine\\PATH", \getcwd() . DIRECTORY_SEPARATOR);
if(!class_exists("SplClassLoader", false)){
require_once(\PocketMine\PATH . "src/SPL/SplClassLoader.php");
require_once(\pocketmine\PATH . "src/spl/SplClassLoader.php");
}
$autoloader = new \SplClassLoader();
$autoloader->add("PocketMine", array(
\PocketMine\PATH . "src"
$autoloader->add("pocketmine", array(
\pocketmine\PATH . "src"
));
$autoloader->register(true);
@ -138,21 +142,21 @@ namespace PocketMine {
ini_set("default_charset", "utf-8");
ini_set("memory_limit", "128M"); //Default
define("PocketMine\\START_TIME", microtime(true));
define("pocketmine\\START_TIME", microtime(true));
$opts = getopt("", array("enable-ansi", "disable-ansi", "data:", "plugins:", "no-wizard"));
define("PocketMine\\DATA", isset($opts["data"]) ? realpath($opts["data"]) . DIRECTORY_SEPARATOR : \getcwd() . DIRECTORY_SEPARATOR);
define("PocketMine\\PLUGIN_PATH", isset($opts["plugins"]) ? realpath($opts["plugins"]) . DIRECTORY_SEPARATOR : \getcwd() . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR);
define("pocketmine\\DATA", isset($opts["data"]) ? realpath($opts["data"]) . DIRECTORY_SEPARATOR : \getcwd() . DIRECTORY_SEPARATOR);
define("pocketmine\\PLUGIN_PATH", isset($opts["plugins"]) ? realpath($opts["plugins"]) . DIRECTORY_SEPARATOR : \getcwd() . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR);
if((strpos(strtoupper(php_uname("s")), "WIN") === false or isset($opts["enable-ansi"])) and !isset($opts["disable-ansi"])){
define("PocketMine\\ANSI", true);
define("pocketmine\\ANSI", true);
}else{
define("PocketMine\\ANSI", false);
define("pocketmine\\ANSI", false);
}
function kill($pid){
switch(Utils\Utils::getOS()){
switch(Utils::getOS()){
case "win":
exec("taskkill.exe /F /PID " . ((int) $pid) . " > NUL");
break;
@ -172,41 +176,41 @@ namespace PocketMine {
* @param int $level
*/
function console($message, $EOL = true, $log = true, $level = 1){
if(!defined("PocketMine\\DEBUG") or \PocketMine\DEBUG >= $level){
if(!defined("pocketmine\\DEBUG") or \pocketmine\DEBUG >= $level){
$message .= $EOL === true ? PHP_EOL : "";
if($message{0} !== "["){
$message = "[INFO] $message";
}
$time = (\PocketMine\ANSI === true ? Utils\TextFormat::AQUA . date("H:i:s") . Utils\TextFormat::RESET : date("H:i:s")) . " ";
$replaced = Utils\TextFormat::clean(preg_replace('/\x1b\[[0-9;]*m/', "", $time . $message));
$time = (\pocketmine\ANSI === true ? TextFormat::AQUA . date("H:i:s") . TextFormat::RESET : date("H:i:s")) . " ";
$replaced = TextFormat::clean(preg_replace('/\x1b\[[0-9;]*m/', "", $time . $message));
if($log === true and (!defined("LOG") or LOG === true)){
log(date("Y-m-d") . " " . $replaced, "server", false, $level);
}
if(\PocketMine\ANSI === true){
if(\pocketmine\ANSI === true){
$add = "";
if(preg_match("/^\\[([a-zA-Z0-9]*)\\]/", $message, $matches) > 0){
switch($matches[1]){
case "ERROR":
case "SEVERE":
$add .= Utils\TextFormat::RED;
$add .= TextFormat::RED;
break;
case "TRACE":
case "INTERNAL":
case "DEBUG":
$add .= Utils\TextFormat::GRAY;
$add .= TextFormat::GRAY;
break;
case "WARNING":
$add .= Utils\TextFormat::YELLOW;
$add .= TextFormat::YELLOW;
break;
case "NOTICE":
$add .= Utils\TextFormat::AQUA;
$add .= TextFormat::AQUA;
break;
default:
$add = "";
break;
}
}
$message = Utils\TextFormat::toANSI($time . $add . $message . Utils\TextFormat::RESET);
$message = TextFormat::toANSI($time . $add . $message . TextFormat::RESET);
}else{
$message = $replaced;
}
@ -265,13 +269,13 @@ namespace PocketMine {
function log($message, $name, $EOL = true, $level = 2, $close = false){
global $fpointers;
if((!defined("PocketMine\\DEBUG") or \PocketMine\DEBUG >= $level) and (!defined("PocketMine\\LOG") or \PocketMine\LOG === true)){
if((!defined("pocketmine\\DEBUG") or \pocketmine\DEBUG >= $level) and (!defined("pocketmine\\LOG") or \pocketmine\LOG === true)){
$message .= $EOL === true ? PHP_EOL : "";
if(!isset($fpointers)){
$fpointers = array();
}
if(!isset($fpointers[$name]) or $fpointers[$name] === false){
$fpointers[$name] = @fopen(\PocketMine\DATA . "/" . $name . ".log", "ab");
$fpointers[$name] = @fopen(\pocketmine\DATA . "/" . $name . ".log", "ab");
}
@fwrite($fpointers[$name], $message);
if($close === true){
@ -282,7 +286,7 @@ namespace PocketMine {
}
set_error_handler("\\PocketMine\\error_handler", E_ALL);
set_error_handler("\\pocketmine\\error_handler", E_ALL);
$errors = 0;
@ -340,20 +344,20 @@ namespace PocketMine {
exit(1); //Exit with error
}
if(file_exists(\PocketMine\PATH . ".git/refs/heads/master")){ //Found Git information!
define("PocketMine\\GIT_COMMIT", strtolower(trim(file_get_contents(\PocketMine\PATH . ".git/refs/heads/master"))));
if(file_exists(\pocketmine\PATH . ".git/refs/heads/master")){ //Found Git information!
define("pocketmine\\GIT_COMMIT", strtolower(trim(file_get_contents(\pocketmine\PATH . ".git/refs/heads/master"))));
}else{ //Unknown :(
define("PocketMine\\GIT_COMMIT", str_repeat("00", 20));
define("pocketmine\\GIT_COMMIT", str_repeat("00", 20));
}
@ini_set("opcache.mmap_base", bin2hex(Utils\Utils::getRandomBytes(8, false))); //Fix OPCache address errors
@ini_set("opcache.mmap_base", bin2hex(Utils::getRandomBytes(8, false))); //Fix OPCache address errors
if(!file_exists(\PocketMine\DATA . "server.properties") and !isset($opts["no-wizard"])){
new Wizard\Installer();
if(!file_exists(\pocketmine\DATA . "server.properties") and !isset($opts["no-wizard"])){
new Installer();
}
$server = new Server($autoloader, \PocketMine\PATH, \PocketMine\DATA, \PocketMine\PLUGIN_PATH);
$server = new Server($autoloader, \pocketmine\PATH, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
$server->start();
kill(getmypid());

View File

@ -23,43 +23,43 @@
* PocketMine-MP is the Minecraft: PE multiplayer server software
* Homepage: http://www.pocketmine.net/
*/
namespace PocketMine;
namespace pocketmine;
use PocketMine\Block\Block;
use PocketMine\Command\CommandReader;
use PocketMine\Command\CommandSender;
use PocketMine\Command\ConsoleCommandSender;
use PocketMine\Command\PluginCommand;
use PocketMine\Command\SimpleCommandMap;
use PocketMine\Entity\Entity;
use PocketMine\Event\HandlerList;
use PocketMine\Event\Server\PacketReceiveEvent;
use PocketMine\Event\Server\PacketSendEvent;
use PocketMine\Event\Server\ServerCommandEvent;
use PocketMine\Item\Item;
use PocketMine\Level\Generator\Generator;
use PocketMine\Level\Level;
use PocketMine\Network\Packet;
use PocketMine\Network\Query\QueryHandler;
use PocketMine\Network\Query\QueryPacket;
use PocketMine\Network\RakNet\Info as RakNetInfo;
use PocketMine\Network\RakNet\Packet as RakNetPacket;
use PocketMine\Network\ThreadedHandler;
use PocketMine\Network\UPnP\UPnP;
use PocketMine\Permission\BanList;
use PocketMine\Permission\DefaultPermissions;
use PocketMine\Plugin\Plugin;
use PocketMine\Plugin\PluginLoadOrder;
use PocketMine\Plugin\PluginManager;
use PocketMine\Recipes\Crafting;
use PocketMine\Scheduler\CallbackTask;
use PocketMine\Scheduler\ServerScheduler;
use PocketMine\Scheduler\TickScheduler;
use PocketMine\Tile\Tile;
use PocketMine\Utils\Config;
use PocketMine\Utils\TextFormat;
use PocketMine\Utils\Utils;
use PocketMine\Utils\VersionString;
use pocketmine\block\Block;
use pocketmine\command\CommandReader;
use pocketmine\command\CommandSender;
use pocketmine\command\ConsoleCommandSender;
use pocketmine\command\PluginCommand;
use pocketmine\command\SimpleCommandMap;
use pocketmine\entity\Entity;
use pocketmine\event\HandlerList;
use pocketmine\event\server\PacketReceiveEvent;
use pocketmine\event\server\PacketSendEvent;
use pocketmine\event\server\ServerCommandEvent;
use pocketmine\item\Item;
use pocketmine\level\generator\Generator;
use pocketmine\level\Level;
use pocketmine\network\Packet;
use pocketmine\network\query\QueryHandler;
use pocketmine\network\query\QueryPacket;
use pocketmine\network\raknet\Info as RakNetInfo;
use pocketmine\network\raknet\Packet as RakNetPacket;
use pocketmine\network\ThreadedHandler;
use pocketmine\network\upnp\UPnP;
use pocketmine\permission\BanList;
use pocketmine\permission\DefaultPermissions;
use pocketmine\plugin\Plugin;
use pocketmine\plugin\PluginLoadOrder;
use pocketmine\plugin\PluginManager;
use pocketmine\recipes\Crafting;
use pocketmine\scheduler\CallbackTask;
use pocketmine\scheduler\ServerScheduler;
use pocketmine\scheduler\TickScheduler;
use pocketmine\tile\Tile;
use pocketmine\utils\Config;
use pocketmine\utils\TextFormat;
use pocketmine\utils\Utils;
use pocketmine\utils\VersionString;
class Server{
const BROADCAST_CHANNEL_ADMINISTRATIVE = "pocketmine.broadcast.admin";
@ -146,28 +146,28 @@ class Server{
* @return string
*/
public function getPocketMineVersion(){
return \PocketMine\VERSION;
return \pocketmine\VERSION;
}
/**
* @return string
*/
public function getCodename(){
return \PocketMine\CODENAME;
return \pocketmine\CODENAME;
}
/**
* @return string
*/
public function getVersion(){
return \PocketMine\MINECRAFT_VERSION;
return \pocketmine\MINECRAFT_VERSION;
}
/**
* @return string
*/
public function getApiVersion(){
return \PocketMine\API_VERSION;
return \pocketmine\API_VERSION;
}
/**
@ -700,14 +700,14 @@ class Server{
$this->setConfigInt("difficulty", 3);
}
define("PocketMine\\DEBUG", $this->getConfigInt("debug", 1));
define("pocketmine\\DEBUG", $this->getConfigInt("debug", 1));
define("ADVANCED_CACHE", $this->getConfigBoolean("enable-advanced-cache", false));
define("MAX_CHUNK_RATE", 20 / $this->getConfigInt("max-chunks-per-second", 7)); //Default rate ~448 kB/s
if(ADVANCED_CACHE == true){
console("[INFO] Advanced cache enabled");
}
if(defined("PocketMine\\DEBUG") and \PocketMine\DEBUG >= 0 and function_exists("cli_set_process_title")){
if(defined("pocketmine\\DEBUG") and \pocketmine\DEBUG >= 0 and function_exists("cli_set_process_title")){
@cli_set_process_title("PocketMine-MP " . $this->getPocketMineVersion());
}
@ -723,8 +723,8 @@ class Server{
$this->commandMap = new SimpleCommandMap($this);
$this->pluginManager = new PluginManager($this, $this->commandMap);
$this->pluginManager->subscribeToPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE, $this->consoleSender);
$this->pluginManager->registerInterface("PocketMine\\Plugin\\FolderPluginLoader");
$this->pluginManager->registerInterface("PocketMine\\Plugin\\PharPluginLoader");
$this->pluginManager->registerInterface("pocketmine\\plugin\\FolderPluginLoader");
$this->pluginManager->registerInterface("pocketmine\\plugin\\PharPluginLoader");
$this->pluginManager->loadPlugins($this->pluginPath);
//TODO: update checking (async)
@ -734,9 +734,9 @@ class Server{
Item::init();
Crafting::init();
Generator::addGenerator("PocketMine\\Level\\Generator\\Flat", "flat");
Generator::addGenerator("PocketMine\\Level\\Generator\\Normal", "normal");
Generator::addGenerator("PocketMine\\Level\\Generator\\Normal", "default");
Generator::addGenerator("pocketmine\\level\\generator\\Flat", "flat");
Generator::addGenerator("pocketmine\\level\\generator\\Normal", "normal");
Generator::addGenerator("pocketmine\\level\\generator\\Normal", "default");
Level::init();
$this->properties->save();
@ -748,7 +748,7 @@ class Server{
if(!defined("NO_THREADS") and $this->getProperty("enable-rcon") === true){
$this->rcon = new RCON($this->getProperty("rcon.password", ""), $this->getProperty("rcon.port", $this->getProperty("server-port")), ($ip = $this->getProperty("server-ip")) != "" ? $ip : "0.0.0.0", $this->getProperty("rcon.threads", 1), $this->getProperty("rcon.clients-per-thread", 50));
}*/
$this->scheduler->scheduleRepeatingTask(new CallbackTask("PocketMine\\Utils\\Cache::cleanup"), 20 * 45);
$this->scheduler->scheduleRepeatingTask(new CallbackTask("pocketmine\\utils\\Cache::cleanup"), 20 * 45);
if($this->getConfigBoolean("auto-save", true) === true){
$this->scheduler->scheduleRepeatingTask(new CallbackTask(array($this, "doAutoSave")), 18000);
}
@ -874,7 +874,7 @@ class Server{
*/
console("[INFO] Default game type: " . self::getGamemodeString($this->getGamemode())); //TODO: string name
//$this->trigger("server.start", microtime(true));
console('[INFO] Done (' . round(microtime(true) - \PocketMine\START_TIME, 3) . 's)! For help, type "help" or "?"');
console('[INFO] Done (' . round(microtime(true) - \pocketmine\START_TIME, 3) . 's)! For help, type "help" or "?"');
if(Utils::getOS() === "win"){ //Workaround less usleep() waste
$this->tickProcessorWindows();
}else{
@ -1076,7 +1076,7 @@ class Server{
}
public function titleTick(){
if(defined("PocketMine\\DEBUG") and \PocketMine\DEBUG >= 0 and \PocketMine\ANSI === true){
if(defined("pocketmine\\DEBUG") and \pocketmine\DEBUG >= 0 and \pocketmine\ANSI === true){
echo "\x1b]0;PocketMine-MP " . $this->getPocketMineVersion() . " | Online " . count(Player::$list) . "/" . $this->getMaxPlayers() . " | RAM " . round((memory_get_usage() / 1024) / 1024, 2) . "/" . round((memory_get_usage(true) / 1024) / 1024, 2) . " MB | U " . round($this->interface->getUploadSpeed() / 1024, 2) . " D " . round($this->interface->getDownloadSpeed() / 1024, 2) . " kB/s | TPS " . $this->getTicksPerSecond() . "\x07";
}
}

View File

@ -19,16 +19,16 @@
*
*/
namespace PocketMine;
namespace pocketmine;
use PocketMine\Network\Query\QueryHandler;
use PocketMine\Network\RCON\RCON;
use PocketMine\Network\UPnP\UPnP;
use PocketMine\Plugin\PluginManager;
use PocketMine\Utils\Config;
use PocketMine\Utils\TextFormat;
use PocketMine\Utils\Utils;
use PocketMine\Utils\VersionString;
use pocketmine\network\query\QueryHandler;
use pocketmine\network\rcon\RCON;
use pocketmine\network\upnp\UPnP;
use pocketmine\plugin\PluginManager;
use pocketmine\utils\Config;
use pocketmine\utils\TextFormat;
use pocketmine\utils\Utils;
use pocketmine\utils\VersionString;
class ServerAPI{
public $restart = false;
@ -83,15 +83,15 @@ class ServerAPI{
}
public function load(){
@mkdir(\PocketMine\DATA . "players/", 0755);
@mkdir(\PocketMine\DATA . "worlds/", 0755);
@mkdir(\PocketMine\DATA . "plugins/", 0755);
@mkdir(\pocketmine\DATA . "players/", 0755);
@mkdir(\pocketmine\DATA . "worlds/", 0755);
@mkdir(\pocketmine\DATA . "plugins/", 0755);
$version = new VersionString();
console("[INFO] Starting Minecraft: PE server version " . TextFormat::AQUA . MINECRAFT_VERSION);
console("[INFO] Loading properties...");
$this->config = new Config(\PocketMine\DATA . "server.properties", Config::PROPERTIES, array(
$this->config = new Config(\pocketmine\DATA . "server.properties", Config::PROPERTIES, array(
"server-name" => "Minecraft: PE Server",
"description" => "Server made using PocketMine-MP",
"motd" => "Welcome @player to this server!",
@ -124,7 +124,7 @@ class ServerAPI{
$this->parseProperties();
//Load advanced properties
define("PocketMine\\DEBUG", $this->getProperty("debug", 1));
define("pocketmine\\DEBUG", $this->getProperty("debug", 1));
define("ADVANCED_CACHE", $this->getProperty("enable-advanced-cache", false));
define("MAX_CHUNK_RATE", 20 / $this->getProperty("max-chunks-per-second", 7)); //Default rate ~448 kB/s
if(ADVANCED_CACHE == true){
@ -150,7 +150,7 @@ class ServerAPI{
}else{
$last = new \DateTime($info[0]["commit"]["committer"]["date"]);
$last = $last->getTimestamp();
if($last >= $this->getProperty("last-update") and $this->getProperty("last-update") !== false and \PocketMine\GIT_COMMIT != $info[0]["sha"]){
if($last >= $this->getProperty("last-update") and $this->getProperty("last-update") !== false and \pocketmine\GIT_COMMIT != $info[0]["sha"]){
console("[NOTICE] " . TextFormat::YELLOW . "A new DEVELOPMENT version of PocketMine-MP has been released!");
console("[NOTICE] " . TextFormat::YELLOW . "Commit \"" . $info[0]["commit"]["message"] . "\" [" . substr($info[0]["sha"], 0, 10) . "] by " . $info[0]["commit"]["committer"]["name"]);
console("[NOTICE] " . TextFormat::YELLOW . "Get it at PocketMine.net or at https://github.com/PocketMine/PocketMine-MP/archive/" . $info[0]["sha"] . ".zip");
@ -200,7 +200,7 @@ class ServerAPI{
}
}
console("[INFO] Loaded " . count(PluginManager::loadPlugins(\PocketMine\DATA . "plugins/")) . " plugin(s).");
console("[INFO] Loaded " . count(PluginManager::loadPlugins(\pocketmine\DATA . "plugins/")) . " plugin(s).");
}

View File

@ -23,16 +23,16 @@
* PocketMine-MP is the Minecraft: PE multiplayer server software
* Homepage: http://www.pocketmine.net/
*/
namespace PocketMine;
namespace pocketmine;
use PocketMine\Entity\Entity;
use PocketMine\Network\Packet;
use PocketMine\Network\Protocol\Info;
use PocketMine\Network\RakNet\Info as RakNetInfo;
use PocketMine\Network\RakNet\Packet as RakNetPacket;
use PocketMine\Plugin\PluginManager;
use PocketMine\Utils\Utils;
use PocketMine\Utils\VersionString;
use pocketmine\entity\Entity;
use pocketmine\network\Packet;
use pocketmine\network\protocol\Info;
use pocketmine\network\raknet\Info as RakNetInfo;
use pocketmine\network\raknet\Packet as RakNetPacket;
use pocketmine\plugin\PluginManager;
use pocketmine\utils\Utils;
use pocketmine\utils\VersionString;
class ServerOld{
/** @var Server */
@ -93,8 +93,8 @@ class ServerOld{
private function load(){
$this->version = new VersionString();
if(defined("PocketMine\\DEBUG") and \PocketMine\DEBUG >= 0 and function_exists("cli_set_process_title")){
@cli_set_process_title("PocketMine-MP " . \PocketMine\VERSION);
if(defined("pocketmine\\DEBUG") and \pocketmine\DEBUG >= 0 and function_exists("cli_set_process_title")){
@cli_set_process_title("PocketMine-MP " . \pocketmine\VERSION);
}
console("[INFO] Starting Minecraft PE server on " . ($this->serverip === "0.0.0.0" ? "*" : $this->serverip) . ":" . $this->port);
define("BOOTUP_RANDOM", Utils::getRandomBytes(16));
@ -155,19 +155,19 @@ class ServerOld{
public function titleTick(){
$time = microtime(true);
if(defined("PocketMine\\DEBUG") and \PocketMine\DEBUG >= 0 and \PocketMine\ANSI === true){
if(defined("pocketmine\\DEBUG") and \pocketmine\DEBUG >= 0 and \pocketmine\ANSI === true){
echo "\x1b]0;PocketMine-MP " . VERSION . " | Online " . count(Player::$list) . "/" . $this->maxClients . " | RAM " . round((memory_get_usage() / 1024) / 1024, 2) . "MB | U " . round(($this->interface->bandwidth[1] / max(1, $time - $this->interface->bandwidth[2])) / 1024, 2) . " D " . round(($this->interface->bandwidth[0] / max(1, $time - $this->interface->bandwidth[2])) / 1024, 2) . " kB/s | TPS " . $this->getTPS() . "\x07";
}
$this->interface->bandwidth = array(0, 0, $time);
}
public function loadEvents(){
if(\PocketMine\ANSI === true){
if(\pocketmine\ANSI === true){
$this->schedule(30, array($this, "titleTick"), array(), true);
}
$this->schedule(20 * 15, array($this, "checkTicks"), array(), true);
$this->schedule(20 * 60, array($this, "checkMemory"), array(), true);
$this->schedule(20 * 45, "PocketMine\\Utils\\Cache::cleanup", array(), true);
$this->schedule(20 * 45, "pocketmine\\utils\\Cache::cleanup", array(), true);
$this->schedule(20, array($this, "asyncOperationChecker"), array(), true);
}
@ -435,7 +435,7 @@ class ServerOld{
}
console("[INFO] Default game type: " . strtoupper($this->getGamemode()));
$this->trigger("server.start", microtime(true));
console('[INFO] Done (' . round(microtime(true) - \PocketMine\START_TIME, 3) . 's)! For help, type "help" or "?"');
console('[INFO] Done (' . round(microtime(true) - \pocketmine\START_TIME, 3) . 's)! For help, type "help" or "?"');
$this->process();
}
@ -496,7 +496,7 @@ class ServerOld{
$p["rcon.password"] = "******";
}
$dump .= "server.properties: " . var_export($p, true) . "\r\n\r\n\r\n";
if(class_exists("PocketMine\\Plugin\\PluginManager", false)){
if(class_exists("pocketmine\\plugin\\PluginManager", false)){
$dump .= "Loaded plugins:\r\n";
foreach(PluginManager::getPlugins() as $p){
$d = $p->getDescription();

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine;
namespace pocketmine;
use PocketMine\Level\Level;
use pocketmine\level\Level;
class TimeAPI{
public static $phases = array(

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
/**

View File

@ -19,12 +19,12 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Network\Protocol\ChatPacket;
use PocketMine\Player;
use PocketMine\Server;
use pocketmine\item\Item;
use pocketmine\network\protocol\ChatPacket;
use pocketmine\Player;
use pocketmine\Server;
class Bed extends Transparent{
public function __construct($type = 0){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Bedrock extends Solid{
public function __construct(){

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class Beetroot extends Flowable{
public function __construct($meta = 0){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class BirchWoodStairs extends Stair{
public function __construct($meta = 0){

View File

@ -22,12 +22,12 @@
/**
* All Block classes are in here
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Level\Position;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\level\Position;
use pocketmine\Player;
abstract class Block extends Position{
const AIR = 0;

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class Bookshelf extends Solid{

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class BrickStairs extends Stair{

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Bricks extends Solid{
public function __construct(){

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class BrownMushroom extends Flowable{
public function __construct(){

View File

@ -19,17 +19,17 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\NBT\NBT;
use PocketMine\NBT\Tag\Compound;
use PocketMine\NBT\Tag\Enum;
use PocketMine\NBT\Tag\Int;
use PocketMine\NBT\Tag\String;
use PocketMine\Player;
use PocketMine\Tile\Furnace;
use PocketMine\Tile\Tile;
use pocketmine\item\Item;
use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\Compound;
use pocketmine\nbt\tag\Enum;
use pocketmine\nbt\tag\Int;
use pocketmine\nbt\tag\String;
use pocketmine\Player;
use pocketmine\tile\Furnace;
use pocketmine\tile\Tile;
class BurningFurnace extends Solid{
public function __construct($meta = 0){

View File

@ -19,13 +19,13 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Math\Vector3 as Vector3;
use PocketMine\Player;
use PocketMine\Server;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\math\Vector3 as Vector3;
use pocketmine\Player;
use pocketmine\Server;
class Cactus extends Transparent{
public function __construct($meta = 0){

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class Cake extends Transparent{
public function __construct($meta = 0){

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class Carpet extends Flowable{
public function __construct($meta = 0){

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class Carrot extends Flowable{
public function __construct($meta = 0){

View File

@ -19,17 +19,17 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\NBT\NBT;
use PocketMine\NBT\Tag\Compound;
use PocketMine\NBT\Tag\Enum;
use PocketMine\NBT\Tag\Int;
use PocketMine\NBT\Tag\String;
use PocketMine\Player;
use PocketMine\Tile\Chest as TileChest;
use PocketMine\Tile\Tile;
use pocketmine\item\Item;
use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\Compound;
use pocketmine\nbt\tag\Enum;
use pocketmine\nbt\tag\Int;
use pocketmine\nbt\tag\String;
use pocketmine\Player;
use pocketmine\tile\Chest as TileChest;
use pocketmine\tile\Tile;
class Chest extends Transparent{

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Clay extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Coal extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class CoalOre extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Cobblestone extends Solid{
public function __construct(){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class CobblestoneStairs extends Stair{

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Cobweb extends Flowable{
public function __construct(){

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class CyanFlower extends Flowable{
public function __construct(){

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class Dandelion extends Flowable{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Level\Level;
use pocketmine\level\Level;
class DeadBush extends Flowable{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Diamond extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class DiamondOre extends Solid{
public function __construct(){

View File

@ -19,10 +19,10 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\Player;
class Dirt extends Solid{
public function __construct(){

View File

@ -19,12 +19,12 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Network\Protocol\LevelEventPacket;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\network\protocol\LevelEventPacket;
use pocketmine\Player;
abstract class Door extends Transparent{

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class DoubleSlab extends Solid{
public function __construct($meta = 0){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class DoubleWoodSlab extends Solid{
public function __construct($meta = 0){

View File

@ -19,12 +19,12 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use PocketMine\Server;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
use pocketmine\Server;
class Fallable extends Solid{

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Farmland extends Solid{
public function __construct($meta = 0){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class Fence extends Transparent{

View File

@ -19,10 +19,10 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\Player;
class FenceGate extends Transparent{
public function __construct($meta = 0){

View File

@ -19,10 +19,10 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use pocketmine\item\Item;
use pocketmine\level\Level;
class Fire extends Flowable{
public function __construct($meta = 0){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class Flowable extends Transparent{

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class Furnace extends BurningFurnace{

View File

@ -19,12 +19,12 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use PocketMine\Server;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
use pocketmine\Server;
class Generic extends Block{

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Glass extends Transparent{
public function __construct(){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class GlassPane extends Transparent{

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class GlowingObsidian extends Solid{

View File

@ -19,10 +19,10 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use pocketmine\item\Item;
use pocketmine\level\Level;
class GlowingRedstoneOre extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Glowstone extends Transparent{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Gold extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class GoldOre extends Solid{
public function __construct(){

View File

@ -19,12 +19,12 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Generator\Object\TallGrass;
use PocketMine\Player;
use PocketMine\Utils\Random;
use pocketmine\item\Item;
use pocketmine\level\generator\object\TallGrass;
use pocketmine\Player;
use pocketmine\utils\Random;
class Grass extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Gravel extends Fallable{
public function __construct(){

View File

@ -19,10 +19,10 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\Player;
class HayBale extends Solid{
public function __construct($meta = 0){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Ice extends Transparent{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Iron extends Solid{
public function __construct(){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class IronBars extends Transparent{

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class IronDoor extends Door{
public function __construct($meta = 0){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class IronOre extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class JungleWoodStairs extends Stair{
public function __construct($meta = 0){

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class Ladder extends Transparent{
public function __construct($meta = 0){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Lapis extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class LapisOre extends Solid{
public function __construct(){

View File

@ -19,13 +19,13 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Level\Position;
use PocketMine\Player;
use PocketMine\Server;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\level\Position;
use pocketmine\Player;
use pocketmine\Server;
class Lava extends Liquid{
public function __construct($meta = 0){

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class Leaves extends Transparent{
const OAK = 0;

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class Liquid extends Transparent{

View File

@ -19,10 +19,10 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\Player;
class LitPumpkin extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Melon extends Transparent{
public function __construct(){

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class MelonStem extends Flowable{
public function __construct($meta = 0){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class MossStone extends Solid{
public function __construct($meta = 0){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class NetherBrick extends Solid{
public function __construct(){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class NetherBrickStairs extends Stair{

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class NetherReactor extends Solid{

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Netherrack extends Solid{
public function __construct(){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Obsidian extends Solid{
public function __construct(){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class Planks extends Solid{

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class Potato extends Flowable{
public function __construct($meta = 0){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class Pumpkin extends Solid{

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class PumpkinStem extends Flowable{
public function __construct($meta = 0){

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Quartz extends Solid{
public function __construct($meta = 0){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class QuartzStairs extends Stair{

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class RedMushroom extends Flowable{
public function __construct(){

View File

@ -19,10 +19,10 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use pocketmine\item\Item;
use pocketmine\level\Level;
class RedstoneOre extends Solid{
public function __construct(){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class Sand extends Fallable{

View File

@ -19,9 +19,9 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use pocketmine\item\Item;
class Sandstone extends Solid{
public function __construct($meta = 0){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class SandstoneStairs extends Stair{

View File

@ -19,13 +19,13 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Generator\Object\Tree;
use PocketMine\Level\Level;
use PocketMine\Player;
use PocketMine\Utils\Random;
use pocketmine\item\Item;
use pocketmine\level\generator\object\Tree;
use pocketmine\level\Level;
use pocketmine\Player;
use pocketmine\utils\Random;
class Sapling extends Flowable{
const OAK = 0;

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class SignPost extends Transparent{
public function __construct($meta = 0){

View File

@ -19,10 +19,10 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\Player;
class Slab extends Transparent{
public function __construct($meta = 0){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class Snow extends Solid{

View File

@ -19,11 +19,11 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Player;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class SnowLayer extends Flowable{
public function __construct($meta = 0){

View File

@ -19,7 +19,7 @@
*
*/
namespace PocketMine\Block;
namespace pocketmine\block;
class Solid extends Generic{

Some files were not shown because too many files have changed in this diff Show More