Code cleanup

This commit is contained in:
Shoghi Cervantes 2014-08-21 17:26:41 +02:00
parent e1ef86074e
commit db7222976e
105 changed files with 932 additions and 896 deletions

View File

@ -164,7 +164,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
private $inAction = false; private $inAction = false;
private $needACK = []; private $needACK = [];
/** /**
@ -520,6 +519,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
return $this->spawnPosition; return $this->spawnPosition;
}else{ }else{
$level = $this->server->getDefaultLevel(); $level = $this->server->getDefaultLevel();
return $level->getSafeSpawn(); return $level->getSafeSpawn();
} }
} }
@ -1896,8 +1896,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$this->inventory->setItem($packet->slot, $packet->item); $this->inventory->setItem($packet->slot, $packet->item);
$this->inventory->setHotbarSlotIndex($packet->slot, $packet->slot); //links $hotbar[$packet->slot] to $slots[$packet->slot] $this->inventory->setHotbarSlotIndex($packet->slot, $packet->slot); //links $hotbar[$packet->slot] to $slots[$packet->slot]
} }
} }else{
else{
$this->inventory->setHeldItemSlot($packet->slot); $this->inventory->setHeldItemSlot($packet->slot);
} }
$transaction = new BaseTransaction($this->inventory, $packet->slot, $this->inventory->getItem($packet->slot), $packet->item); $transaction = new BaseTransaction($this->inventory, $packet->slot, $this->inventory->getItem($packet->slot), $packet->item);

View File

@ -68,7 +68,6 @@ namespace pocketmine {
use LogLevel; use LogLevel;
use pocketmine\utils\Binary; use pocketmine\utils\Binary;
use pocketmine\utils\MainLogger; use pocketmine\utils\MainLogger;
use pocketmine\utils\TextFormat;
use pocketmine\utils\Utils; use pocketmine\utils\Utils;
use pocketmine\wizard\Installer; use pocketmine\wizard\Installer;
use raklib\RakLib; use raklib\RakLib;

View File

@ -60,7 +60,6 @@ use pocketmine\nbt\tag\Long;
use pocketmine\nbt\tag\Short; use pocketmine\nbt\tag\Short;
use pocketmine\nbt\tag\String; use pocketmine\nbt\tag\String;
use pocketmine\network\protocol\DataPacket; use pocketmine\network\protocol\DataPacket;
use pocketmine\network\protocol\Info;
use pocketmine\network\query\QueryHandler; use pocketmine\network\query\QueryHandler;
use pocketmine\network\query\QueryPacket; use pocketmine\network\query\QueryPacket;
use pocketmine\network\RakLibInterface; use pocketmine\network\RakLibInterface;
@ -879,6 +878,7 @@ class Server{
public function unloadLevel(Level $level, $forceUnload = false){ public function unloadLevel(Level $level, $forceUnload = false){
if($level->unload($forceUnload) === true and $this->isLevelLoaded($level->getFolderName())){ if($level->unload($forceUnload) === true and $this->isLevelLoaded($level->getFolderName())){
unset($this->levels[$level->getID()]); unset($this->levels[$level->getID()]);
return true; return true;
} }
@ -924,6 +924,7 @@ class Server{
$level = new Level($this, $name, $path, $provider); $level = new Level($this, $name, $path, $provider);
}catch(\Exception $e){ }catch(\Exception $e){
$this->logger->error("Could not load level \"" . $name . "\": " . $e->getMessage()); $this->logger->error("Could not load level \"" . $name . "\": " . $e->getMessage());
return false; return false;
} }
@ -1575,6 +1576,7 @@ class Server{
if(!($this->getDefaultLevel() instanceof Level)){ if(!($this->getDefaultLevel() instanceof Level)){
$this->getLogger()->emergency("No default level has been loaded"); $this->getLogger()->emergency("No default level has been loaded");
$this->forceShutdown(); $this->forceShutdown();
return; return;
} }
@ -1621,6 +1623,7 @@ class Server{
foreach($recipients as $recipient){ foreach($recipients as $recipient){
$recipient->sendMessage($message); $recipient->sendMessage($message);
} }
return count($recipients); return count($recipients);
} }
@ -1693,6 +1696,7 @@ class Server{
}else{ }else{
$sender->sendMessage("Unknown command. Type \"help\" for help."); $sender->sendMessage("Unknown command. Type \"help\" for help.");
} }
return false; return false;
} }

View File

@ -28,6 +28,7 @@ abstract class Thread extends \Thread{
public final function start($options = PTHREADS_INHERIT_ALL){ public final function start($options = PTHREADS_INHERIT_ALL){
ThreadManager::getInstance()->add($this); ThreadManager::getInstance()->add($this);
return parent::start($options & ~PTHREADS_INHERIT_CLASSES); return parent::start($options & ~PTHREADS_INHERIT_CLASSES);
} }
} }

View File

@ -63,6 +63,7 @@ class ThreadManager extends \Threaded{
foreach($this as $key => $thread){ foreach($this as $key => $thread){
$array[$key] = $thread; $array[$key] = $thread;
} }
return $array; return $array;
} }
} }

View File

@ -28,6 +28,7 @@ abstract class Worker extends \Worker{
public final function start($options = PTHREADS_INHERIT_ALL){ public final function start($options = PTHREADS_INHERIT_ALL){
ThreadManager::getInstance()->add($this); ThreadManager::getInstance()->add($this);
return parent::start($options & ~PTHREADS_INHERIT_CLASSES); return parent::start($options & ~PTHREADS_INHERIT_CLASSES);
} }
} }

View File

@ -25,7 +25,6 @@ use pocketmine\item\Item;
use pocketmine\level\Level; use pocketmine\level\Level;
use pocketmine\math\Vector3 as Vector3; use pocketmine\math\Vector3 as Vector3;
use pocketmine\Player; use pocketmine\Player;
use pocketmine\Server;
class Cactus extends Transparent{ class Cactus extends Transparent{
public function __construct($meta = 0){ public function __construct($meta = 0){

View File

@ -24,7 +24,6 @@ namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\level\Level; use pocketmine\level\Level;
use pocketmine\Player; use pocketmine\Player;
use pocketmine\Server;
class Generic extends Block{ class Generic extends Block{

View File

@ -53,6 +53,7 @@ class TallGrass extends Flowable{
if(mt_rand(0, 15) === 0){ if(mt_rand(0, 15) === 0){
return [Item::WHEAT_SEEDS, 0, 1]; return [Item::WHEAT_SEEDS, 0, 1];
} }
return []; return [];
} }

View File

@ -163,6 +163,7 @@ abstract class Command{
if(!$this->isRegistered()){ if(!$this->isRegistered()){
$this->timings = new TimingsHandler("** Command: " . $name); $this->timings = new TimingsHandler("** Command: " . $name);
$this->label = $name; $this->label = $name;
return true; return true;
} }

View File

@ -50,6 +50,7 @@ class FormattedCommandAlias extends Command{
}else{ }else{
$sender->sendMessage(TextFormat::RED . "An internal error occurred while attempting to perform this command"); $sender->sendMessage(TextFormat::RED . "An internal error occurred while attempting to perform this command");
} }
return false; return false;
} }
} }

View File

@ -53,6 +53,7 @@ class GamemodeCommand extends VanillaCommand{
if($gameMode === -1){ if($gameMode === -1){
$sender->sendMessage("Unknown game mode"); $sender->sendMessage("Unknown game mode");
return true; return true;
} }

View File

@ -53,12 +53,9 @@ class KickCommand extends VanillaCommand{
if(($player = $sender->getServer()->getPlayer($name)) instanceof Player){ if(($player = $sender->getServer()->getPlayer($name)) instanceof Player){
$player->kick($reason); $player->kick($reason);
if(strlen($reason) >= 1) if(strlen($reason) >= 1){
{
Command::broadcastCommandMessage($sender, "Kicked " . $player->getName() . " from the game: '{$reason}'"); Command::broadcastCommandMessage($sender, "Kicked " . $player->getName() . " from the game: '{$reason}'");
} }else{
else
{
Command::broadcastCommandMessage($sender, "Kicked " . $player->getName() . " from the game."); Command::broadcastCommandMessage($sender, "Kicked " . $player->getName() . " from the game.");
} }
}else{ }else{

View File

@ -50,12 +50,14 @@ class SpawnpointCommand extends VanillaCommand{
$target = $sender; $target = $sender;
}else{ }else{
$sender->sendMessage(TextFormat::RED . "Please provide a player!"); $sender->sendMessage(TextFormat::RED . "Please provide a player!");
return true; return true;
} }
}else{ }else{
$target = $sender->getServer()->getPlayer($args[0]); $target = $sender->getServer()->getPlayer($args[0]);
if($target === null){ if($target === null){
$sender->sendMessage(TextFormat::RED . "Can't find player " . $args[0]); $sender->sendMessage(TextFormat::RED . "Can't find player " . $args[0]);
return true; return true;
} }
} }

View File

@ -58,12 +58,14 @@ class TeleportCommand extends VanillaCommand{
$target = $sender; $target = $sender;
}else{ }else{
$sender->sendMessage(TextFormat::RED . "Please provide a player!"); $sender->sendMessage(TextFormat::RED . "Please provide a player!");
return true; return true;
} }
if(count($args) === 1){ if(count($args) === 1){
$target = $sender->getServer()->getPlayer($args[0]); $target = $sender->getServer()->getPlayer($args[0]);
if($target === null){ if($target === null){
$sender->sendMessage(TextFormat::RED . "Can't find player " . $args[0]); $sender->sendMessage(TextFormat::RED . "Can't find player " . $args[0]);
return true; return true;
} }
} }
@ -71,6 +73,7 @@ class TeleportCommand extends VanillaCommand{
$target = $sender->getServer()->getPlayer($args[0]); $target = $sender->getServer()->getPlayer($args[0]);
if($target === null){ if($target === null){
$sender->sendMessage(TextFormat::RED . "Can't find player " . $args[0]); $sender->sendMessage(TextFormat::RED . "Can't find player " . $args[0]);
return true; return true;
} }
if(count($args) === 2){ if(count($args) === 2){
@ -78,6 +81,7 @@ class TeleportCommand extends VanillaCommand{
$target = $sender->getServer()->getPlayer($args[1]); $target = $sender->getServer()->getPlayer($args[1]);
if($target === null){ if($target === null){
$sender->sendMessage(TextFormat::RED . "Can't find player " . $args[1]); $sender->sendMessage(TextFormat::RED . "Can't find player " . $args[1]);
return true; return true;
} }
} }

View File

@ -39,12 +39,14 @@ class TimeCommand extends VanillaCommand{
public function execute(CommandSender $sender, $currentAlias, array $args){ public function execute(CommandSender $sender, $currentAlias, array $args){
if(count($args) < 2){ if(count($args) < 2){
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage); $sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
return false; return false;
} }
if($args[0] === "set"){ if($args[0] === "set"){
if(!$sender->hasPermission("pocketmine.command.time.set")){ if(!$sender->hasPermission("pocketmine.command.time.set")){
$sender->sendMessage(TextFormat::RED . "You don't have permission to set the time"); $sender->sendMessage(TextFormat::RED . "You don't have permission to set the time");
return true; return true;
} }
@ -65,6 +67,7 @@ class TimeCommand extends VanillaCommand{
}elseif($args[0] === "add"){ }elseif($args[0] === "add"){
if(!$sender->hasPermission("pocketmine.command.time.add")){ if(!$sender->hasPermission("pocketmine.command.time.add")){
$sender->sendMessage(TextFormat::RED . "You don't have permission to add the time"); $sender->sendMessage(TextFormat::RED . "You don't have permission to add the time");
return true; return true;
} }

View File

@ -22,12 +22,8 @@
namespace pocketmine\command\defaults; namespace pocketmine\command\defaults;
use pocketmine\command\CommandSender; use pocketmine\command\CommandSender;
use pocketmine\event\HandlerList;
use pocketmine\event\TimingsHandler; use pocketmine\event\TimingsHandler;
use pocketmine\Player;
use pocketmine\plugin\TimedRegisteredListener;
use pocketmine\utils\TextFormat; use pocketmine\utils\TextFormat;
use pocketmine\utils\Utils;
class TimingsCommand extends VanillaCommand{ class TimingsCommand extends VanillaCommand{
@ -49,6 +45,7 @@ class TimingsCommand extends VanillaCommand{
if(count($args) !== 1){ if(count($args) !== 1){
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage); $sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
return true; return true;
} }
@ -58,6 +55,7 @@ class TimingsCommand extends VanillaCommand{
$sender->getServer()->getPluginManager()->setUseTimings(true); $sender->getServer()->getPluginManager()->setUseTimings(true);
TimingsHandler::reload(); TimingsHandler::reload();
$sender->sendMessage("Enabled Timings & Reset"); $sender->sendMessage("Enabled Timings & Reset");
return true; return true;
}elseif($mode === "off"){ }elseif($mode === "off"){
$sender->getServer()->getPluginManager()->setUseTimings(false); $sender->getServer()->getPluginManager()->setUseTimings(false);
@ -66,6 +64,7 @@ class TimingsCommand extends VanillaCommand{
if(!$sender->getServer()->getPluginManager()->useTimings()){ if(!$sender->getServer()->getPluginManager()->useTimings()){
$sender->sendMessage("Please enable timings by typing /timings on"); $sender->sendMessage("Please enable timings by typing /timings on");
return true; return true;
} }
@ -74,13 +73,6 @@ class TimingsCommand extends VanillaCommand{
if($mode === "reset"){ if($mode === "reset"){
TimingsHandler::reload(); TimingsHandler::reload();
$sender->sendMessage("Timings reset"); $sender->sendMessage("Timings reset");
/*foreach(HandlerList::getHandlerLists() as $handlerList){
foreach($handlerList->getRegisteredListeners() as $listener){
if($listener instanceof TimedRegisteredListener){
$listener->reset();
}
}
}*/
}elseif($mode === "merged" or $mode === "report" or $paste){ }elseif($mode === "merged" or $mode === "report" or $paste){
$sampleTime = microtime(true) - self::$timingStart; $sampleTime = microtime(true) - self::$timingStart;
@ -126,6 +118,7 @@ class TimingsCommand extends VanillaCommand{
curl_close($ch); curl_close($ch);
if($data === false or $data === null or !isset($data->html_url)){ if($data === false or $data === null or !isset($data->html_url)){
$sender->sendMessage("An error happened while pasting the report"); $sender->sendMessage("An error happened while pasting the report");
return true; return true;
} }
$timings = $data->html_url; $timings = $data->html_url;

View File

@ -46,8 +46,6 @@ class Arrow extends Projectile{
} }
} }
public function onUpdate(){ public function onUpdate(){

View File

@ -26,7 +26,6 @@ namespace pocketmine\entity;
use pocketmine\block\Block; use pocketmine\block\Block;
use pocketmine\event\entity\EntityDamageEvent; use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\EntityDeathEvent;
use pocketmine\event\entity\EntityDespawnEvent; use pocketmine\event\entity\EntityDespawnEvent;
use pocketmine\event\entity\EntityLevelChangeEvent; use pocketmine\event\entity\EntityLevelChangeEvent;
use pocketmine\event\entity\EntityMotionEvent; use pocketmine\event\entity\EntityMotionEvent;
@ -48,12 +47,12 @@ use pocketmine\nbt\tag\Double;
use pocketmine\nbt\tag\Enum; use pocketmine\nbt\tag\Enum;
use pocketmine\nbt\tag\Float; use pocketmine\nbt\tag\Float;
use pocketmine\nbt\tag\Short; use pocketmine\nbt\tag\Short;
use pocketmine\Network;
use pocketmine\network\protocol\MoveEntityPacket; use pocketmine\network\protocol\MoveEntityPacket;
use pocketmine\network\protocol\MovePlayerPacket; use pocketmine\network\protocol\MovePlayerPacket;
use pocketmine\network\protocol\RemoveEntityPacket; use pocketmine\network\protocol\RemoveEntityPacket;
use pocketmine\network\protocol\SetEntityMotionPacket; use pocketmine\network\protocol\SetEntityMotionPacket;
use pocketmine\network\protocol\SetTimePacket; use pocketmine\network\protocol\SetTimePacket;
use pocketmine\Network;
use pocketmine\Player; use pocketmine\Player;
use pocketmine\plugin\Plugin; use pocketmine\plugin\Plugin;
use pocketmine\Server; use pocketmine\Server;
@ -1019,6 +1018,7 @@ abstract class Entity extends Position implements Metadatable{
if($this->setPositionAndRotation($pos, $yaw === null ? $this->yaw : $yaw, $pitch === null ? $this->pitch : $pitch, true) !== false){ if($this->setPositionAndRotation($pos, $yaw === null ? $this->yaw : $yaw, $pitch === null ? $this->pitch : $pitch, true) !== false){
$this->fallDistance = 0; $this->fallDistance = 0;
$this->onGround = true; $this->onGround = true;
return true; return true;
} }

View File

@ -21,7 +21,6 @@
namespace pocketmine\entity; namespace pocketmine\entity;
use pocketmine\inventory\Inventory;
use pocketmine\inventory\InventoryHolder; use pocketmine\inventory\InventoryHolder;
use pocketmine\inventory\PlayerInventory; use pocketmine\inventory\PlayerInventory;
use pocketmine\item\Item; use pocketmine\item\Item;
@ -30,10 +29,10 @@ use pocketmine\nbt\tag\Byte;
use pocketmine\nbt\tag\Compound; use pocketmine\nbt\tag\Compound;
use pocketmine\nbt\tag\Enum; use pocketmine\nbt\tag\Enum;
use pocketmine\nbt\tag\Short; use pocketmine\nbt\tag\Short;
use pocketmine\Network;
use pocketmine\network\protocol\AddPlayerPacket; use pocketmine\network\protocol\AddPlayerPacket;
use pocketmine\network\protocol\RemovePlayerPacket; use pocketmine\network\protocol\RemovePlayerPacket;
use pocketmine\network\protocol\SetEntityMotionPacket; use pocketmine\network\protocol\SetEntityMotionPacket;
use pocketmine\Network;
use pocketmine\Player; use pocketmine\Player;
use pocketmine\utils\TextFormat; use pocketmine\utils\TextFormat;
@ -91,6 +90,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
$drops[] = $item; $drops[] = $item;
} }
} }
return $drops; return $drops;
} }

View File

@ -27,11 +27,11 @@ use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\EntityDeathEvent; use pocketmine\event\entity\EntityDeathEvent;
use pocketmine\event\entity\EntityRegainHealthEvent; use pocketmine\event\entity\EntityRegainHealthEvent;
use pocketmine\event\Timings; use pocketmine\event\Timings;
use pocketmine\item\Item;
use pocketmine\math\Vector3; use pocketmine\math\Vector3;
use pocketmine\nbt\tag\Short; use pocketmine\nbt\tag\Short;
use pocketmine\network\protocol\EntityEventPacket; use pocketmine\network\protocol\EntityEventPacket;
use pocketmine\Server; use pocketmine\Server;
use pocketmine\item\Item;
abstract class Living extends Entity implements Damageable{ abstract class Living extends Entity implements Damageable{

View File

@ -95,6 +95,7 @@ class Zombie extends Monster{
} }
} }
} }
return $drops; return $drops;
} }
} }

View File

@ -53,6 +53,7 @@ abstract class Event{
if(!($this instanceof Cancellable)){ if(!($this instanceof Cancellable)){
throw new \BadMethodCallException("Event is not Cancellable"); throw new \BadMethodCallException("Event is not Cancellable");
} }
return $this->isCancelled === true; return $this->isCancelled === true;
} }

View File

@ -22,7 +22,6 @@
namespace pocketmine\event; namespace pocketmine\event;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;
use pocketmine\plugin\PluginManager; use pocketmine\plugin\PluginManager;
use pocketmine\scheduler\PluginTask; use pocketmine\scheduler\PluginTask;

View File

@ -23,7 +23,6 @@ namespace pocketmine\event\block;
use pocketmine\block\Block; use pocketmine\block\Block;
use pocketmine\event\Cancellable; use pocketmine\event\Cancellable;
use pocketmine\item\Item;
use pocketmine\Player; use pocketmine\Player;
/** /**

View File

@ -22,7 +22,6 @@
namespace pocketmine\event\entity; namespace pocketmine\event\entity;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;
use pocketmine\event\Cancellable;
class EntityDamageByEntityEvent extends EntityDamageEvent{ class EntityDamageByEntityEvent extends EntityDamageEvent{
public static $handlerList = null; public static $handlerList = null;

View File

@ -141,6 +141,7 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
foreach($this->modifiers as $type => $d){ foreach($this->modifiers as $type => $d){
$damage += $d; $damage += $d;
} }
return $damage; return $damage;
} }

View File

@ -21,12 +21,8 @@
namespace pocketmine\event\entity; namespace pocketmine\event\entity;
use pocketmine\block\Block;
use pocketmine\entity\Entity;
use pocketmine\entity\Living; use pocketmine\entity\Living;
use pocketmine\event\Cancellable;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\level\Position;
class EntityDeathEvent extends EntityEvent{ class EntityDeathEvent extends EntityEvent{
public static $handlerList = null; public static $handlerList = null;

View File

@ -36,6 +36,7 @@ class CraftItemEvent extends Event implements Cancellable{
/** /**
* @param CraftingTransactionGroup $ts * @param CraftingTransactionGroup $ts
* @param Recipe $recipe
*/ */
public function __construct(CraftingTransactionGroup $ts, Recipe $recipe){ public function __construct(CraftingTransactionGroup $ts, Recipe $recipe){
$this->ts = $ts; $this->ts = $ts;

View File

@ -20,6 +20,7 @@
*/ */
namespace pocketmine\event\level; namespace pocketmine\event\level;
use pocketmine\level\format\FullChunk; use pocketmine\level\format\FullChunk;
/** /**

View File

@ -20,6 +20,7 @@
*/ */
namespace pocketmine\event\level; namespace pocketmine\event\level;
use pocketmine\event\Cancellable; use pocketmine\event\Cancellable;
/** /**

View File

@ -20,6 +20,7 @@
*/ */
namespace pocketmine\event\level; namespace pocketmine\event\level;
use pocketmine\event\Cancellable; use pocketmine\event\Cancellable;
/** /**

View File

@ -21,9 +21,9 @@
namespace pocketmine\event\player; namespace pocketmine\event\player;
use pocketmine\event\entity\EntityDeathEvent;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\Player; use pocketmine\Player;
use pocketmine\event\entity\EntityDeathEvent;
class PlayerDeathEvent extends EntityDeathEvent{ class PlayerDeathEvent extends EntityDeathEvent{
public static $handlerList = null; public static $handlerList = null;

View File

@ -21,8 +21,8 @@
namespace pocketmine\event\player; namespace pocketmine\event\player;
use pocketmine\event\Cancellable;
use pocketmine\Event; use pocketmine\Event;
use pocketmine\event\Cancellable;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\Player; use pocketmine\Player;

View File

@ -32,6 +32,6 @@ class PluginDisableEvent extends PluginEvent{
* @param Plugin $plugin * @param Plugin $plugin
*/ */
public function __construct(Plugin $plugin){ public function __construct(Plugin $plugin){
$this->plugin = $plugin; parent::__construct($plugin);
} }
} }

View File

@ -32,6 +32,6 @@ class PluginEnableEvent extends PluginEvent{
* @param Plugin $plugin * @param Plugin $plugin
*/ */
public function __construct(Plugin $plugin){ public function __construct(Plugin $plugin){
$this->plugin = $plugin; parent::__construct($plugin);
} }
} }

View File

@ -21,8 +21,8 @@
namespace pocketmine\event\server; namespace pocketmine\event\server;
use pocketmine\event;
use pocketmine\event\Cancellable; use pocketmine\event\Cancellable;
use pocketmine\event;
use pocketmine\network\protocol\DataPacket; use pocketmine\network\protocol\DataPacket;
use pocketmine\Player; use pocketmine\Player;

View File

@ -21,8 +21,8 @@
namespace pocketmine\event\server; namespace pocketmine\event\server;
use pocketmine\event;
use pocketmine\event\Cancellable; use pocketmine\event\Cancellable;
use pocketmine\event;
use pocketmine\network\protocol\DataPacket; use pocketmine\network\protocol\DataPacket;
use pocketmine\Player; use pocketmine\Player;

View File

@ -88,6 +88,8 @@ class SimpleTransactionGroup implements TransactionGroup{
/** /**
* @param Item[] $needItems * @param Item[] $needItems
* @param Item[] $haveItems * @param Item[] $haveItems
*
* @return bool
*/ */
protected function matchItems(array &$needItems, array &$haveItems){ protected function matchItems(array &$needItems, array &$haveItems){
foreach($this->transactions as $key => $ts){ foreach($this->transactions as $key => $ts){
@ -120,6 +122,8 @@ class SimpleTransactionGroup implements TransactionGroup{
} }
} }
} }
return true;
} }
public function canExecute(){ public function canExecute(){

View File

@ -100,8 +100,10 @@ class SpawnEgg extends Item{
--$this->count; --$this->count;
} }
$entity->spawnToAll(); $entity->spawnToAll();
return true; return true;
} }
return false; return false;
} }
} }

View File

@ -1,6 +1,3 @@
default_gamemode = Normaali Peli Tila default_gamemode = Normaali Peli Tila

View File

@ -51,7 +51,6 @@ use pocketmine\math\Vector3;
use pocketmine\metadata\BlockMetadataStore; use pocketmine\metadata\BlockMetadataStore;
use pocketmine\metadata\Metadatable; use pocketmine\metadata\Metadatable;
use pocketmine\metadata\MetadataValue; use pocketmine\metadata\MetadataValue;
use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\Byte; use pocketmine\nbt\tag\Byte;
use pocketmine\nbt\tag\Compound; use pocketmine\nbt\tag\Compound;
use pocketmine\nbt\tag\Double; use pocketmine\nbt\tag\Double;
@ -67,12 +66,10 @@ use pocketmine\plugin\Plugin;
use pocketmine\scheduler\AsyncTask; use pocketmine\scheduler\AsyncTask;
use pocketmine\Server; use pocketmine\Server;
use pocketmine\tile\Sign; use pocketmine\tile\Sign;
use pocketmine\tile\Spawnable;
use pocketmine\tile\Tile; use pocketmine\tile\Tile;
use pocketmine\utils\Cache; use pocketmine\utils\Cache;
use pocketmine\utils\ReversePriorityQueue; use pocketmine\utils\ReversePriorityQueue;
use pocketmine\utils\TextFormat; use pocketmine\utils\TextFormat;
use raklib\Binary;
class Level implements ChunkManager, Metadatable{ class Level implements ChunkManager, Metadatable{
@ -925,6 +922,7 @@ class Level implements ChunkManager, Metadatable{
if($item->isActivable and $item->onActivate($this, $player, $block, $target, $face, $fx, $fy, $fz)){ if($item->isActivable and $item->onActivate($this, $player, $block, $target, $face, $fx, $fy, $fz)){
if($item->getCount() <= 0){ if($item->getCount() <= 0){
$item = Item::get(Item::AIR, 0, 0); $item = Item::get(Item::AIR, 0, 0);
return true; return true;
} }
} }
@ -937,6 +935,7 @@ class Level implements ChunkManager, Metadatable{
$hand->position($block); $hand->position($block);
}elseif($block->getID() === Item::FIRE){ }elseif($block->getID() === Item::FIRE){
$this->setBlock($block, new Air(), true, false, true); $this->setBlock($block, new Air(), true, false, true);
return false; return false;
}else{ }else{
return false; return false;
@ -957,7 +956,6 @@ class Level implements ChunkManager, Metadatable{
} }
if($player instanceof Player){ if($player instanceof Player){
$ev = new BlockPlaceEvent($player, $hand, $block, $target, $item); $ev = new BlockPlaceEvent($player, $hand, $block, $target, $item);
if(!$player->isOp() and ($distance = $this->server->getConfigInt("spawn-protection", 16)) > -1){ if(!$player->isOp() and ($distance = $this->server->getConfigInt("spawn-protection", 16)) > -1){
@ -1308,8 +1306,10 @@ class Level implements ChunkManager, Metadatable{
return $this->chunks[$index]; return $this->chunks[$index];
}elseif(($chunk = $this->provider->getChunk($x, $z, $create)) instanceof FullChunk){ }elseif(($chunk = $this->provider->getChunk($x, $z, $create)) instanceof FullChunk){
$this->chunks[$index] = $chunk; $this->chunks[$index] = $chunk;
return $chunk; return $chunk;
} }
return null; return null;
} }
@ -1564,6 +1564,7 @@ class Level implements ChunkManager, Metadatable{
} }
$this->server->getPluginManager()->callEvent(new ChunkLoadEvent($chunk, !$chunk->isGenerated())); $this->server->getPluginManager()->callEvent(new ChunkLoadEvent($chunk, !$chunk->isGenerated()));
return true; return true;
} }
@ -1678,6 +1679,7 @@ class Level implements ChunkManager, Metadatable{
* Sets the spawnpoint * Sets the spawnpoint
* *
* @param Vector3 $pos * @param Vector3 $pos
*
* @deprecated * @deprecated
*/ */
public function setSpawn(Vector3 $pos){ public function setSpawn(Vector3 $pos){

View File

@ -21,9 +21,6 @@
namespace pocketmine\level\format; namespace pocketmine\level\format;
use pocketmine\entity\Entity;
use pocketmine\tile\Tile;
interface Chunk extends FullChunk{ interface Chunk extends FullChunk{
const SECTION_COUNT = 8; const SECTION_COUNT = 8;

View File

@ -59,6 +59,7 @@ abstract class LevelProviderManager{
public static function getProviderByName($name){ public static function getProviderByName($name){
$name = trim(strtolower($name)); $name = trim(strtolower($name));
return isset(self::$providers[$name]) ? self::$providers[$name] : null; return isset(self::$providers[$name]) ? self::$providers[$name] : null;
} }
} }

View File

@ -60,6 +60,7 @@ class Anvil extends McRegion{
} }
} }
} }
return $isValid; return $isValid;
} }

View File

@ -193,6 +193,7 @@ class Chunk extends BaseChunk{
$writer = new NBT(NBT::BIG_ENDIAN); $writer = new NBT(NBT::BIG_ENDIAN);
$nbt->setName("Level"); $nbt->setName("Level");
$writer->setData(new Compound("", array("Level" => $nbt))); $writer->setData(new Compound("", array("Level" => $nbt)));
return $writer->writeCompressed(ZLIB_ENCODING_DEFLATE, RegionLoader::$COMPRESSION_LEVEL); return $writer->writeCompressed(ZLIB_ENCODING_DEFLATE, RegionLoader::$COMPRESSION_LEVEL);
} }
} }

View File

@ -115,6 +115,7 @@ class ChunkRequestTask extends AsyncTask{
for($y = 0; $y < 128; ++$y){ for($y = 0; $y < 128; ++$y){
$column .= $data{($y << 8) + $i}; $column .= $data{($y << 8) + $i};
} }
return $column; return $column;
} }
@ -130,6 +131,7 @@ class ChunkRequestTask extends AsyncTask{
$column .= chr((ord($data{($y << 7) + $i}) & 0xf0) >> 4) | ($data{(($y + 1) << 7) + $i} & "\xf0"); $column .= chr((ord($data{($y << 7) + $i}) & 0xf0) >> 4) | ($data{(($y + 1) << 7) + $i} & "\xf0");
} }
} }
return $column; return $column;
} }

View File

@ -157,6 +157,7 @@ class ChunkSection implements \pocketmine\level\format\ChunkSection{
for($y = 0; $y < 16; ++$y){ for($y = 0; $y < 16; ++$y){
$column .= $this->blocks{($y << 8) + $i}; $column .= $this->blocks{($y << 8) + $i};
} }
return $column; return $column;
} }

View File

@ -93,6 +93,7 @@ class RegionLoader extends \pocketmine\level\format\mcregion\RegionLoader{
$this->writeLocationIndex($index); $this->writeLocationIndex($index);
}elseif($compression !== self::COMPRESSION_ZLIB and $compression !== self::COMPRESSION_GZIP){ }elseif($compression !== self::COMPRESSION_ZLIB and $compression !== self::COMPRESSION_GZIP){
trigger_error("Invalid compression type", E_USER_WARNING); trigger_error("Invalid compression type", E_USER_WARNING);
return false; return false;
} }
@ -102,6 +103,7 @@ class RegionLoader extends \pocketmine\level\format\mcregion\RegionLoader{
}elseif($forward === false){ }elseif($forward === false){
trigger_error("Corrupted chunk detected", E_USER_WARNING); trigger_error("Corrupted chunk detected", E_USER_WARNING);
$this->generateChunk($x, $z); $this->generateChunk($x, $z);
return $this->readChunk($x, $z, $generate, true); return $this->readChunk($x, $z, $generate, true);
}else{ }else{
return null; return null;

View File

@ -24,7 +24,6 @@ namespace pocketmine\level\format\generic;
use pocketmine\entity\DroppedItem; use pocketmine\entity\DroppedItem;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;
use pocketmine\level\format\Chunk; use pocketmine\level\format\Chunk;
use pocketmine\level\format\FullChunk;
use pocketmine\level\format\ChunkSection; use pocketmine\level\format\ChunkSection;
use pocketmine\level\format\LevelProvider; use pocketmine\level\format\LevelProvider;
use pocketmine\nbt\tag\Compound; use pocketmine\nbt\tag\Compound;
@ -153,6 +152,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
}catch(\Exception $e){ }catch(\Exception $e){
$level = $this->getProvider(); $level = $this->getProvider();
$this->setInternalSection($Y = $y >> 4, $level::createChunkSection($Y)); $this->setInternalSection($Y = $y >> 4, $level::createChunkSection($Y));
return $this->setBlock($x, $y, $z, $blockId, $meta); return $this->setBlock($x, $y, $z, $blockId, $meta);
} }
} }
@ -218,6 +218,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){ for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$column .= $this->sections[$y]->getBlockIdColumn($x, $z); $column .= $this->sections[$y]->getBlockIdColumn($x, $z);
} }
return $column; return $column;
} }
@ -226,6 +227,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){ for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$column .= $this->sections[$y]->getBlockDataColumn($x, $z); $column .= $this->sections[$y]->getBlockDataColumn($x, $z);
} }
return $column; return $column;
} }
@ -234,6 +236,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){ for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$column .= $this->sections[$y]->getBlockSkyLightColumn($x, $z); $column .= $this->sections[$y]->getBlockSkyLightColumn($x, $z);
} }
return $column; return $column;
} }
@ -242,6 +245,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){ for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$column .= $this->sections[$y]->getBlockLightColumn($x, $z); $column .= $this->sections[$y]->getBlockLightColumn($x, $z);
} }
return $column; return $column;
} }
@ -274,6 +278,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){ for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$blocks .= $this->sections[$y]->getIdArray(); $blocks .= $this->sections[$y]->getIdArray();
} }
return $blocks; return $blocks;
} }
@ -282,6 +287,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){ for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$data .= $this->sections[$y]->getDataArray(); $data .= $this->sections[$y]->getDataArray();
} }
return $data; return $data;
} }
@ -290,6 +296,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){ for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$skyLight .= $this->sections[$y]->getSkyLightArray(); $skyLight .= $this->sections[$y]->getSkyLightArray();
} }
return $skyLight; return $skyLight;
} }
@ -298,6 +305,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){ for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$blockLight .= $this->sections[$y]->getLightArray(); $blockLight .= $this->sections[$y]->getLightArray();
} }
return $blockLight; return $blockLight;
} }

View File

@ -188,6 +188,7 @@ abstract class BaseFullChunk implements FullChunk{
public function getBiomeColor($x, $z){ public function getBiomeColor($x, $z){
$color = $this->biomeColors[($z << 4) + $x] & 0xFFFFFF; $color = $this->biomeColors[($z << 4) + $x] & 0xFFFFFF;
return [$color >> 16, ($color >> 8) & 0xFF, $color & 0xFF]; return [$color >> 16, ($color >> 8) & 0xFF, $color & 0xFF];
} }

View File

@ -299,6 +299,7 @@ class Chunk extends BaseFullChunk{
$writer = new NBT(NBT::BIG_ENDIAN); $writer = new NBT(NBT::BIG_ENDIAN);
$nbt->setName("Level"); $nbt->setName("Level");
$writer->setData(new Compound("", array("Level" => $nbt))); $writer->setData(new Compound("", array("Level" => $nbt)));
return $writer->writeCompressed(ZLIB_ENCODING_DEFLATE, RegionLoader::$COMPRESSION_LEVEL); return $writer->writeCompressed(ZLIB_ENCODING_DEFLATE, RegionLoader::$COMPRESSION_LEVEL);
} }

View File

@ -67,6 +67,7 @@ class McRegion extends BaseLevelProvider{
} }
} }
} }
return $isValid; return $isValid;
} }
@ -214,6 +215,7 @@ class McRegion extends BaseLevelProvider{
unset($this->chunks[$index]); unset($this->chunks[$index]);
} }
return true; return true;
} }
@ -252,6 +254,7 @@ class McRegion extends BaseLevelProvider{
return $this->chunks[$index]; return $this->chunks[$index];
}else{ }else{
$this->loadChunk($chunkX, $chunkZ, $create); $this->loadChunk($chunkX, $chunkZ, $create);
return isset($this->chunks[$index]) ? $this->chunks[$index] : null; return isset($this->chunks[$index]) ? $this->chunks[$index] : null;
} }
} }

View File

@ -31,7 +31,6 @@ use pocketmine\nbt\tag\Enum;
use pocketmine\nbt\tag\Int; use pocketmine\nbt\tag\Int;
use pocketmine\nbt\tag\IntArray; use pocketmine\nbt\tag\IntArray;
use pocketmine\nbt\tag\Long; use pocketmine\nbt\tag\Long;
use pocketmine\Player;
use pocketmine\utils\Binary; use pocketmine\utils\Binary;
class RegionLoader{ class RegionLoader{
@ -117,6 +116,7 @@ class RegionLoader{
$this->writeLocationIndex($index); $this->writeLocationIndex($index);
}elseif($compression !== self::COMPRESSION_ZLIB and $compression !== self::COMPRESSION_GZIP){ }elseif($compression !== self::COMPRESSION_ZLIB and $compression !== self::COMPRESSION_GZIP){
trigger_error("Invalid compression type", E_USER_WARNING); trigger_error("Invalid compression type", E_USER_WARNING);
return false; return false;
} }
@ -126,6 +126,7 @@ class RegionLoader{
}elseif($forward === false){ }elseif($forward === false){
trigger_error("Corrupted chunk detected", E_USER_WARNING); trigger_error("Corrupted chunk detected", E_USER_WARNING);
$this->generateChunk($x, $z); $this->generateChunk($x, $z);
return $this->readChunk($x, $z, $generate, true); return $this->readChunk($x, $z, $generate, true);
}else{ }else{
return null; return null;

View File

@ -21,7 +21,6 @@
namespace pocketmine\level\generator; namespace pocketmine\level\generator;
use pocketmine\level\format\FullChunk;
use pocketmine\block\CoalOre; use pocketmine\block\CoalOre;
use pocketmine\block\DiamondOre; use pocketmine\block\DiamondOre;
use pocketmine\block\Dirt; use pocketmine\block\Dirt;
@ -31,6 +30,7 @@ use pocketmine\block\IronOre;
use pocketmine\block\LapisOre; use pocketmine\block\LapisOre;
use pocketmine\block\RedstoneOre; use pocketmine\block\RedstoneOre;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\level\format\FullChunk;
use pocketmine\level\generator\populator\Ore; use pocketmine\level\generator\populator\Ore;
use pocketmine\level\generator\populator\Populator; use pocketmine\level\generator\populator\Populator;
use pocketmine\math\Vector3 as Vector3; use pocketmine\math\Vector3 as Vector3;

View File

@ -80,6 +80,7 @@ class GenerationChunkManager implements ChunkManager{
$index = Level::chunkHash($chunkX, $chunkZ); $index = Level::chunkHash($chunkX, $chunkZ);
$chunk = !isset($this->chunks[$index]) ? $this->requestChunk($chunkX, $chunkZ) : $this->chunks[$index]; $chunk = !isset($this->chunks[$index]) ? $this->requestChunk($chunkX, $chunkZ) : $this->chunks[$index];
$this->changes[$index] = $chunk; $this->changes[$index] = $chunk;
return $chunk; return $chunk;
} }
@ -153,6 +154,7 @@ class GenerationChunkManager implements ChunkManager{
protected function requestChunk($chunkX, $chunkZ){ protected function requestChunk($chunkX, $chunkZ){
$chunk = $this->manager->requestChunk($this->levelID, $chunkX, $chunkZ); $chunk = $this->manager->requestChunk($this->levelID, $chunkX, $chunkZ);
$this->chunks[$index = Level::chunkHash($chunkX, $chunkZ)] = $chunk; $this->chunks[$index = Level::chunkHash($chunkX, $chunkZ)] = $chunk;
return $chunk; return $chunk;
} }

View File

@ -238,6 +238,7 @@ class GenerationManager{
if(($len = Binary::readInt($len)) <= 0){ if(($len = Binary::readInt($len)) <= 0){
$this->shutdown = true; $this->shutdown = true;
$this->getLogger()->critical("Generation Thread found a stream error, shutting down"); $this->getLogger()->critical("Generation Thread found a stream error, shutting down");
return; return;
} }

View File

@ -22,7 +22,6 @@
namespace pocketmine\level\generator; namespace pocketmine\level\generator;
use pocketmine\level\format\FullChunk; use pocketmine\level\format\FullChunk;
use pocketmine\level\format\mcregion\Chunk;
use pocketmine\level\Level; use pocketmine\level\Level;
use pocketmine\Server; use pocketmine\Server;
use pocketmine\utils\Binary; use pocketmine\utils\Binary;

View File

@ -84,6 +84,7 @@ class Vector3{
* @param Vector3|int $x * @param Vector3|int $x
* @param int $y * @param int $y
* @param int $z * @param int $z
*
* @return Vector3 * @return Vector3
*/ */
public function add($x, $y = 0, $z = 0){ public function add($x, $y = 0, $z = 0){
@ -98,6 +99,7 @@ class Vector3{
* @param Vector3|int $x * @param Vector3|int $x
* @param int $y * @param int $y
* @param int $z * @param int $z
*
* @return Vector3 * @return Vector3
*/ */
public function subtract($x = 0, $y = 0, $z = 0){ public function subtract($x = 0, $y = 0, $z = 0){

View File

@ -42,6 +42,7 @@ class Enum extends NamedTag implements \ArrayAccess, \Countable{
$value[$k] = $v; $value[$k] = $v;
} }
} }
return $value; return $value;
} }
@ -84,6 +85,8 @@ class Enum extends NamedTag implements \ArrayAccess, \Countable{
} }
} }
} }
return $i;
} }
public function getType(){ public function getType(){

View File

@ -120,8 +120,10 @@ class RakLibInterface implements ServerInstance, SourceInterface{
$work = false; $work = false;
if($this->interface->handlePacket()){ if($this->interface->handlePacket()){
$work = true; $work = true;
while($this->interface->handlePacket()){} while($this->interface->handlePacket()){
} }
}
return $work; return $work;
} }

View File

@ -30,7 +30,7 @@ use pocketmine\utils\Binary;
use pocketmine\utils\Utils; use pocketmine\utils\Utils;
class QueryHandler{ class QueryHandler{
private $socket, $server, $lastToken, $token, $longData, $timeout; private $server, $lastToken, $token, $longData, $timeout;
const HANDSHAKE = 9; const HANDSHAKE = 9;
const STATISTICS = 0; const STATISTICS = 0;

View File

@ -29,7 +29,6 @@ use pocketmine\command\RemoteConsoleCommandSender;
use pocketmine\event\server\RemoteServerCommandEvent; use pocketmine\event\server\RemoteServerCommandEvent;
use pocketmine\scheduler\CallbackTask; use pocketmine\scheduler\CallbackTask;
use pocketmine\Server; use pocketmine\Server;
use pocketmine\utils\MainLogger;
use pocketmine\utils\TextFormat; use pocketmine\utils\TextFormat;

View File

@ -24,7 +24,6 @@ namespace pocketmine\plugin;
use pocketmine\event\plugin\PluginDisableEvent; use pocketmine\event\plugin\PluginDisableEvent;
use pocketmine\event\plugin\PluginEnableEvent; use pocketmine\event\plugin\PluginEnableEvent;
use pocketmine\Server; use pocketmine\Server;
use pocketmine\utils\MainLogger;
/** /**
* Handles different types of plugins * Handles different types of plugins

View File

@ -319,9 +319,11 @@ class PluginManager{
} }
TimingsCommand::$timingStart = microtime(true); TimingsCommand::$timingStart = microtime(true);
return $loadedPlugins; return $loadedPlugins;
}else{ }else{
TimingsCommand::$timingStart = microtime(true); TimingsCommand::$timingStart = microtime(true);
return []; return [];
} }
} }

View File

@ -47,7 +47,6 @@ class RegisteredListener{
private $timings; private $timings;
/** /**
* @param Listener $listener * @param Listener $listener
* @param EventExecutor $executor * @param EventExecutor $executor

View File

@ -20,6 +20,7 @@
*/ */
namespace pocketmine\scheduler; namespace pocketmine\scheduler;
use pocketmine\Server; use pocketmine\Server;
/** /**

View File

@ -243,8 +243,10 @@ class ServerScheduler{
$task->onCompletion(Server::getInstance()); $task->onCompletion(Server::getInstance());
$task->setCompleted(); $task->setCompleted();
unset($this->asyncTaskStorage[$task->getTaskId()]); unset($this->asyncTaskStorage[$task->getTaskId()]);
return true; return true;
} }
return false; return false;
} }

View File

@ -154,6 +154,7 @@ class TaskHandler{
if($this->timingName !== null){ if($this->timingName !== null){
return $this->timingName; return $this->timingName;
} }
return get_class($this->task); return get_class($this->task);
} }
} }

View File

@ -25,7 +25,6 @@ use pocketmine\inventory\ChestInventory;
use pocketmine\inventory\DoubleChestInventory; use pocketmine\inventory\DoubleChestInventory;
use pocketmine\inventory\InventoryHolder; use pocketmine\inventory\InventoryHolder;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\level\format\Chunk;
use pocketmine\level\format\FullChunk; use pocketmine\level\format\FullChunk;
use pocketmine\math\Vector3 as Vector3; use pocketmine\math\Vector3 as Vector3;
use pocketmine\nbt\NBT; use pocketmine\nbt\NBT;

View File

@ -26,7 +26,6 @@ use pocketmine\inventory\FurnaceInventory;
use pocketmine\inventory\FurnaceRecipe; use pocketmine\inventory\FurnaceRecipe;
use pocketmine\inventory\InventoryHolder; use pocketmine\inventory\InventoryHolder;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\level\format\Chunk;
use pocketmine\level\format\FullChunk; use pocketmine\level\format\FullChunk;
use pocketmine\nbt\NBT; use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\Byte; use pocketmine\nbt\tag\Byte;

View File

@ -21,7 +21,6 @@
namespace pocketmine\tile; namespace pocketmine\tile;
use pocketmine\level\format\Chunk;
use pocketmine\level\format\FullChunk; use pocketmine\level\format\FullChunk;
use pocketmine\nbt\tag\Compound; use pocketmine\nbt\tag\Compound;
use pocketmine\nbt\tag\Int; use pocketmine\nbt\tag\Int;

View File

@ -21,7 +21,6 @@
namespace pocketmine\tile; namespace pocketmine\tile;
use pocketmine\level\format\Chunk;
use pocketmine\level\format\FullChunk; use pocketmine\level\format\FullChunk;
use pocketmine\nbt\NBT; use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\Compound; use pocketmine\nbt\tag\Compound;

View File

@ -28,7 +28,6 @@ namespace pocketmine\tile;
use pocketmine\event\Timings; use pocketmine\event\Timings;
use pocketmine\level\format\Chunk; use pocketmine\level\format\Chunk;
use pocketmine\level\format\FullChunk; use pocketmine\level\format\FullChunk;
use pocketmine\level\format\LevelProvider;
use pocketmine\level\Level; use pocketmine\level\Level;
use pocketmine\level\Position; use pocketmine\level\Position;
use pocketmine\nbt\tag\Compound; use pocketmine\nbt\tag\Compound;

View File

@ -89,6 +89,7 @@ LICENSE;
if(strtolower($this->getInput("n")) != "y"){ if(strtolower($this->getInput("n")) != "y"){
echo "[!] " . $this->lang->you_have_to_accept_the_license . "\n"; echo "[!] " . $this->lang->you_have_to_accept_the_license . "\n";
sleep(5); sleep(5);
return false; return false;
} }