mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Lots of new things added
This commit is contained in:
parent
ccec74076b
commit
f789e6e6e3
@ -23,9 +23,7 @@ namespace PocketMine;
|
||||
|
||||
class ChatAPI{
|
||||
|
||||
/**
|
||||
* @var Server
|
||||
*/
|
||||
/** @var Server */
|
||||
private $server;
|
||||
|
||||
function __construct(){
|
||||
@ -33,12 +31,9 @@ class ChatAPI{
|
||||
}
|
||||
|
||||
public function init(){
|
||||
$this->server->api->console->register("tell", "<player> <private message ...>", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("me", "<action ...>", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("say", "<message ...>", array($this, "commandHandler"));
|
||||
$this->server->api->ban->cmdWhitelist("tell");
|
||||
$this->server->api->ban->cmdWhitelist("me");
|
||||
$this->server->api->console->alias("msg", "tell");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -61,18 +56,6 @@ class ChatAPI{
|
||||
$sender = ($issuer instanceof Player) ? "Server" : ucfirst($issuer);
|
||||
Player::broadcastMessage("[$sender] " . $s);
|
||||
break;
|
||||
case "me":
|
||||
if(!($issuer instanceof Player)){
|
||||
if($issuer === "rcon"){
|
||||
$sender = "Rcon";
|
||||
}else{
|
||||
$sender = ucfirst($issuer);
|
||||
}
|
||||
}else{
|
||||
$sender = $issuer->getDisplayName();
|
||||
}
|
||||
Player::broadcastMessage("* $sender " . implode(" ", $params));
|
||||
break;
|
||||
case "tell":
|
||||
if(!isset($params[0]) or !isset($params[1])){
|
||||
$output .= "Usage: /$cmd <player> <message>\n";
|
||||
|
@ -31,7 +31,6 @@ class LevelAPI{
|
||||
}
|
||||
|
||||
public function init(){
|
||||
$this->server->api->console->register("seed", "[world]", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("save-all", "", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("save-on", "", array($this, "commandHandler"));
|
||||
$this->server->api->console->register("save-off", "", array($this, "commandHandler"));
|
||||
@ -52,16 +51,6 @@ class LevelAPI{
|
||||
case "save-off":
|
||||
$this->server->saveEnabled = false;
|
||||
break;
|
||||
case "seed":
|
||||
if(!isset($params[0]) and ($issuer instanceof Player)){
|
||||
$output .= "Seed: " . $issuer->level->getSeed() . "\n";
|
||||
}elseif(isset($params[0])){
|
||||
if(($lv = Level::get(trim(implode(" ", $params)))) !== false){
|
||||
$output .= "Seed: " . $lv->getSeed() . "\n";
|
||||
}
|
||||
}else{
|
||||
$output .= "Seed: " . Level::getDefault()->getSeed() . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
@ -63,6 +63,7 @@ use PocketMine\Network\RakNet\Info;
|
||||
use PocketMine\Network\RakNet\Packet;
|
||||
use PocketMine\PMF\LevelFormat;
|
||||
use PocketMine\Recipes\Crafting;
|
||||
use PocketMine\Scheduler\CallbackTask;
|
||||
use PocketMine\Tile\Chest;
|
||||
use PocketMine\Tile\Furnace;
|
||||
use PocketMine\Tile\Sign;
|
||||
@ -79,7 +80,7 @@ use PocketMine\Utils\Utils;
|
||||
* Class Player
|
||||
* @package PocketMine
|
||||
*/
|
||||
class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
class Player extends RealHuman/* implements CommandSender*/{
|
||||
const BROADCAST_CHANNEL_ADMINISTRATIVE = "pocketmine.broadcast.admin";
|
||||
const BROADCAST_CHANNEL_USERS = "pocketmine.broadcast.user";
|
||||
|
||||
@ -154,6 +155,11 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
private $chunkCount = array();
|
||||
private $received = array();
|
||||
|
||||
/**
|
||||
* @var \PocketMine\Scheduler\TaskHandler[]
|
||||
*/
|
||||
private $tasks = array();
|
||||
|
||||
/**
|
||||
* @param integer $clientID
|
||||
* @param string $ip
|
||||
@ -166,7 +172,6 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$this->server = Server::getInstance();
|
||||
$this->lastBreak = microtime(true);
|
||||
$this->clientID = $clientID;
|
||||
$this->CID = Server::clientID($ip, $port);
|
||||
Player::$list[$this->CID] = $this;
|
||||
$this->ip = $ip;
|
||||
$this->port = $port;
|
||||
@ -180,9 +185,9 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$this->packetStats = array(0, 0);
|
||||
$this->buffer = new Packet(Info::DATA_PACKET_0);
|
||||
$this->buffer->data = array();
|
||||
$this->server->schedule(2, array($this, "handlePacketQueues"), array(), true);
|
||||
$this->server->schedule(20 * 60, array($this, "clearQueue"), array(), true);
|
||||
$this->evid[] = $this->server->event("server.close", array($this, "close"));
|
||||
$this->tasks[] = $this->server->getScheduler()->scheduleRepeatingTask(new CallbackTask(array($this, "handlePacketQueues")), 1);
|
||||
$this->tasks[] = $this->server->getScheduler()->scheduleRepeatingTask(new CallbackTask(array($this, "clearQueue")), 20 * 60);
|
||||
|
||||
console("[DEBUG] New Session started with " . $ip . ":" . $port . ". MTU " . $this->MTU . ", Client ID " . $this->clientID, true, true, 2);
|
||||
}
|
||||
|
||||
@ -244,16 +249,16 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
* Sends, if available, the next ordered chunk to the client
|
||||
*
|
||||
* @param bool $force
|
||||
* @param null $ev
|
||||
* @param bool $ev
|
||||
*
|
||||
* @return bool|void
|
||||
*/
|
||||
public function getNextChunk($force = false, $ev = null){
|
||||
if($this->connected === false){
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if($ev === "server.schedule"){
|
||||
if($ev === true){
|
||||
--$this->chunkScheduled;
|
||||
if($this->chunkScheduled < 0){
|
||||
$this->chunkScheduled = 0;
|
||||
@ -263,10 +268,9 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
foreach($this->chunkCount as $count => $t){
|
||||
if(isset($this->recoveryQueue[$count]) or isset($this->resendQueue[$count])){
|
||||
if($this->chunkScheduled === 0){
|
||||
$this->server->schedule(MAX_CHUNK_RATE, array($this, "getNextChunk"));
|
||||
$this->server->getScheduler()->scheduleDelayedTask(new CallbackTask(array($this, "getNextChunk"), array(false, true)), MAX_CHUNK_RATE);
|
||||
++$this->chunkScheduled;
|
||||
}
|
||||
|
||||
return;
|
||||
}else{
|
||||
unset($this->chunkCount[$count]);
|
||||
@ -291,7 +295,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$distance = @$this->chunksOrder[$index];
|
||||
if($index === null or $distance === null){
|
||||
if($this->chunkScheduled === 0){
|
||||
$this->server->schedule(40, array($this, "getNextChunk"));
|
||||
$this->server->getScheduler()->scheduleDelayedTask(new CallbackTask(array($this, "getNextChunk")), 60);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -302,7 +306,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
if(!$this->level->isChunkPopulated($X, $Z)){
|
||||
$this->orderChunks();
|
||||
if($this->chunkScheduled === 0 or $force === true){
|
||||
$this->server->schedule(MAX_CHUNK_RATE, array($this, "getNextChunk"));
|
||||
$this->server->getScheduler()->scheduleDelayedTask(new CallbackTask(array($this, "getNextChunk")), MAX_CHUNK_RATE);
|
||||
++$this->chunkScheduled;
|
||||
}
|
||||
|
||||
@ -331,7 +335,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$this->lastChunk = array($X, $Z);
|
||||
|
||||
if($this->chunkScheduled === 0 or $force === true){
|
||||
$this->server->schedule(MAX_CHUNK_RATE, array($this, "getNextChunk"));
|
||||
$this->server->getScheduler()->scheduleDelayedTask(new CallbackTask(array($this, "getNextChunk")), MAX_CHUNK_RATE);
|
||||
++$this->chunkScheduled;
|
||||
}
|
||||
}
|
||||
@ -501,7 +505,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$this->updateMetadata();
|
||||
}*/
|
||||
$this->setSpawn($pos);
|
||||
$this->server->schedule(60, array($this, "checkSleep"));
|
||||
$this->server->getScheduler()->scheduleDelayedTask(new CallbackTask(array($this, "checkSleep")), 60);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -534,6 +538,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
|
||||
public function checkSleep(){
|
||||
if($this->sleeping !== false){
|
||||
//TODO
|
||||
if($this->server->api->time->getPhase($this->level) === "night"){
|
||||
foreach($this->level->getPlayers() as $p){
|
||||
if($p->sleeping === false){
|
||||
@ -554,6 +559,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
*/
|
||||
public function eventHandler($data, $event){
|
||||
switch($event){
|
||||
//TODO, obsolete
|
||||
case "tile.update":
|
||||
if($data->level === $this->level){
|
||||
if($data instanceof Furnace){
|
||||
@ -688,12 +694,13 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
|
||||
if(($this->gamemode & 0x01) === ($gm & 0x01)){
|
||||
$this->gamemode = $gm;
|
||||
$this->sendMessage("Your gamemode has been changed to " . $this->getGamemode() . ".\n");
|
||||
$this->sendMessage("Your gamemode has been changed to " . Server::getGamemodeString($this->getGamemode()) . ".\n");
|
||||
}else{
|
||||
$this->blocked = true;
|
||||
$this->gamemode = $gm;
|
||||
$this->sendMessage("Your gamemode has been changed to " . $this->getGamemode() . ", you've to do a forced reconnect.\n");
|
||||
$this->server->schedule(30, array($this, "close"), "gamemode change"); //Forces a kick
|
||||
$this->sendMessage("Your gamemode has been changed to " . Server::getGamemodeString($this->getGamemode()) . ", you've to do a forced reconnect.\n");
|
||||
$this->server->getScheduler()->scheduleDelayedTask(new CallbackTask(array($this, "close"), array($this->username . " has left the game", "gamemode change")), 30);
|
||||
|
||||
}
|
||||
$this->sendSettings();
|
||||
|
||||
@ -750,19 +757,6 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
|
||||
public function getGamemodeString(){
|
||||
switch($this->gamemode){
|
||||
case 0:
|
||||
return "survival";
|
||||
case 1:
|
||||
return "creative";
|
||||
case 2:
|
||||
return "adventure";
|
||||
case 3:
|
||||
return "view";
|
||||
}
|
||||
}
|
||||
|
||||
public function measureLag(){
|
||||
if($this->connected === false){
|
||||
return false;
|
||||
@ -949,7 +943,9 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$this->username = $packet->username;
|
||||
$this->iusername = strtolower($this->username);
|
||||
$this->loginData = array("clientId" => $packet->clientId, "loginData" => $packet->loginData);
|
||||
if(count(Player::$list) > $this->server->maxClients and !$this->server->api->ban->isOp($this->iusername)){
|
||||
|
||||
//TODO: op things
|
||||
if(count(Player::$list) > $this->server->getMaxPlayers() and !$this->server->api->ban->isOp($this->iusername)){
|
||||
$this->kick("server full");
|
||||
|
||||
return;
|
||||
@ -981,10 +977,12 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO: whitelist things
|
||||
if($this->server->whitelist === true and !$this->server->api->ban->inWhitelist($this->iusername)){
|
||||
$this->close($this->username . " has left the game", "Server is white-listed");
|
||||
|
||||
return;
|
||||
//TODO: ban things
|
||||
}elseif($this->server->api->ban->isBanned($this->iusername) or $this->server->api->ban->isIPBanned($this->ip)){
|
||||
$this->close($this->username . " has left the game", "You are banned");
|
||||
|
||||
@ -1071,14 +1069,16 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
|
||||
$this->evid[] = $this->server->event("entity.animate", array($this, "eventHandler"));
|
||||
$this->evid[] = $this->server->event("entity.event", array($this, "eventHandler"));
|
||||
$this->evid[] = $this->server->event("entity.metadata", array($this, "eventHandler"));
|
||||
$this->evid[] = $this->server->event("player.pickup", array($this, "eventHandler"));
|
||||
$this->evid[] = $this->server->event("tile.container.slot", array($this, "eventHandler"));
|
||||
$this->evid[] = $this->server->event("tile.update", array($this, "eventHandler"));
|
||||
//TODO: new events, or remove them!
|
||||
//$this->evid[] = $this->server->event("entity.animate", array($this, "eventHandler"));
|
||||
//$this->evid[] = $this->server->event("entity.event", array($this, "eventHandler"));
|
||||
//$this->evid[] = $this->server->event("entity.metadata", array($this, "eventHandler"));
|
||||
//$this->evid[] = $this->server->event("player.pickup", array($this, "eventHandler"));
|
||||
//$this->evid[] = $this->server->event("tile.container.slot", array($this, "eventHandler"));
|
||||
//$this->evid[] = $this->server->event("tile.update", array($this, "eventHandler"));
|
||||
$this->lastMeasure = microtime(true);
|
||||
$this->server->schedule(50, array($this, "measureLag"), array(), true);
|
||||
$this->tasks[] = $this->server->getScheduler()->scheduleRepeatingTask(new CallbackTask(array($this, "measureLag")), 50);
|
||||
|
||||
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"));
|
||||
@ -1096,12 +1096,13 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
//$this->heal($this->data->get("health"), "spawn", true);
|
||||
$this->spawned = true;
|
||||
$this->spawnToAll();
|
||||
$this->sendMessage($this->server->motd . "\n");
|
||||
$this->sendMessage($this->server->getMotd() . "\n");
|
||||
|
||||
$this->sendInventory();
|
||||
$this->sendSettings();
|
||||
$this->sendArmor();
|
||||
$this->server->schedule(30, array($this, "orderChunks"), array(), true);
|
||||
$this->tasks[] = $this->server->getScheduler()->scheduleDelayedTask(new CallbackTask(array($this, "orderChunks")), 30);
|
||||
|
||||
$this->blocked = false;
|
||||
|
||||
$pk = new SetTimePacket;
|
||||
@ -1111,9 +1112,11 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
|
||||
$pos = new Position($this->x, $this->y, $this->z, $this->level);
|
||||
$pos = $this->level->getSafeSpawn($pos);
|
||||
$this->teleport($pos);
|
||||
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerRespawnEvent($this, $pos));
|
||||
|
||||
$this->teleport($ev->getRespawnPosition());
|
||||
$this->sendBuffer();
|
||||
$this->server->handle("player.spawn", $this);
|
||||
|
||||
break;
|
||||
case 2: //Chunk loaded?
|
||||
break;
|
||||
@ -1273,7 +1276,8 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$pk->meta = $block->getMetadata();
|
||||
$this->dataPacket($pk);
|
||||
break;
|
||||
}elseif($packet->face === 0xff and $this->server->handle("player.action", $data) !== false){
|
||||
}elseif($packet->face === 0xff){
|
||||
//TODO: add event
|
||||
$this->inAction = true;
|
||||
$this->startAction = microtime(true);
|
||||
//$this->updateMetadata();
|
||||
@ -1532,15 +1536,15 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$this->server->api->dhandle("entity.animate", array("eid" => $packet->eid, "entity" => $this->entity, "action" => $packet->action));
|
||||
break;*/
|
||||
case ProtocolInfo::RESPAWN_PACKET:
|
||||
if($this->spawned === false){
|
||||
break;
|
||||
}
|
||||
if(@$this->entity->dead === false){
|
||||
if($this->spawned === false or $this->dead === false){
|
||||
break;
|
||||
}
|
||||
$this->craftingItems = array();
|
||||
$this->toCraft = array();
|
||||
$this->teleport($this->spawnPosition);
|
||||
|
||||
$this->server->getPluginManager()->callEvent($ev = new Event\Player\PlayerRespawnEvent($this, $this->spawnPosition));
|
||||
|
||||
$this->teleport($ev->getRespawnPosition());
|
||||
//$this->entity->fire = 0;
|
||||
//$this->entity->air = 300;
|
||||
//$this->entity->setHealth(20, "respawn", true);
|
||||
@ -1548,7 +1552,6 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
|
||||
$this->sendInventory();
|
||||
$this->blocked = false;
|
||||
$this->server->handle("player.respawn", $this);
|
||||
break;
|
||||
case ProtocolInfo::SET_HEALTH_PACKET: //Not used
|
||||
break;
|
||||
@ -1637,10 +1640,14 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$packet->message = TextFormat::clean($packet->message);
|
||||
if(trim($packet->message) != "" and strlen($packet->message) <= 255){
|
||||
$message = $packet->message;
|
||||
if($message{0} === "/"){ //Command
|
||||
$this->server->api->console->run(substr($message, 1), $this);
|
||||
$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, $message));
|
||||
$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());
|
||||
}
|
||||
@ -1757,7 +1764,8 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$item = Item::get($packet->item->getID(), $packet->item->getMetadata(), $packet->item->getCount());
|
||||
|
||||
$slot = $tile->getSlot($slotn);
|
||||
if($this->server->api->dhandle("player.container.slot", array(
|
||||
//TODO: container access events?
|
||||
/*if($this->server->api->dhandle("player.container.slot", array(
|
||||
"tile" => $tile,
|
||||
"slot" => $packet->slot,
|
||||
"offset" => $offset,
|
||||
@ -1772,7 +1780,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$pk->item = $slot;
|
||||
$this->dataPacket($pk);
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
if($item->getID() !== Item::AIR and $slot->getID() == $item->getID()){
|
||||
if($slot->getCount() < $item->getCount()){
|
||||
$it = clone $item;
|
||||
@ -1811,7 +1819,8 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$item = Item::get($packet->item->getID(), $packet->item->getMetadata(), $packet->item->getCount());
|
||||
|
||||
$slot = $tile->getSlot($packet->slot);
|
||||
if($this->server->api->dhandle("player.container.slot", array(
|
||||
//TODO: container access events?
|
||||
/*if($this->server->api->dhandle("player.container.slot", array(
|
||||
"tile" => $tile,
|
||||
"slot" => $packet->slot,
|
||||
"slotdata" => $slot,
|
||||
@ -1825,7 +1834,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$pk->item = $slot;
|
||||
$this->dataPacket($pk);
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
if($tile instanceof Furnace and $packet->slot == 2){
|
||||
switch($slot->getID()){
|
||||
@ -1885,7 +1894,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
}
|
||||
break;
|
||||
default:
|
||||
console("[DEBUG] Unhandled 0x" . dechex($packet->pid()) . " data packet for " . $this->username . " (" . $this->clientID . "): " . print_r($packet, true), true, true, 2);
|
||||
console("[DEBUG] Unhandled " . $packet->pid() . " data packet for " . $this->username . " (" . $this->clientID . "): " . print_r($packet, true), true, true, 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2098,7 +2107,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
public static function getOffline($name){
|
||||
$server = Server::getInstance();
|
||||
$iname = strtolower($name);
|
||||
if(!file_exists(\PocketMine\DATA . "players/" . $iname . ".dat")){
|
||||
if(!file_exists(Server::getInstance()->getDataPath() . "players/" . $iname . ".dat")){
|
||||
$spawn = Level::getDefault()->getSafeSpawn();
|
||||
$nbt = new Compound(false, array(
|
||||
new Enum("Pos", array(
|
||||
@ -2114,7 +2123,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
new Byte("SpawnForced", 1), //TODO
|
||||
new Enum("Inventory", array()),
|
||||
new Compound("Achievements", array()),
|
||||
new Int("playerGameType", $server->gamemode),
|
||||
new Int("playerGameType", $server->getGamemode()),
|
||||
new Enum("Motion", array(
|
||||
new Double(0, 0.0),
|
||||
new Double(1, 0.0),
|
||||
@ -2135,8 +2144,8 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
$nbt->Inventory->setTagType(NBT::TAG_Compound);
|
||||
$nbt->Motion->setTagType(NBT::TAG_Double);
|
||||
$nbt->Rotation->setTagType(NBT::TAG_Float);
|
||||
if(file_exists(\PocketMine\DATA . "players/" . $iname . ".yml")){
|
||||
$data = new Config(\PocketMine\DATA . "players/" . $iname . ".yml", Config::YAML, array());
|
||||
if(file_exists(Server::getInstance()->getDataPath() . "players/" . $iname . ".yml")){
|
||||
$data = new Config(Server::getInstance()->getDataPath() . "players/" . $iname . ".yml", Config::YAML, array());
|
||||
$nbt["playerGameType"] = (int) $data->get("gamemode");
|
||||
$nbt["Level"] = $data->get("position")["level"];
|
||||
$nbt["Pos"][0] = $data->get("position")["x"];
|
||||
@ -2183,7 +2192,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
foreach($data->get("achievements") as $achievement => $status){
|
||||
$nbt->Achievements[$achievement] = new Byte($achievement, $status == true ? 1 : 0);
|
||||
}
|
||||
unlink(\PocketMine\DATA . "players/" . $iname . ".yml");
|
||||
unlink(Server::getInstance()->getDataPath() . "players/" . $iname . ".yml");
|
||||
}else{
|
||||
console("[NOTICE] Player data not found for \"" . $iname . "\", creating new profile");
|
||||
Player::saveOffline($name, $nbt);
|
||||
@ -2191,7 +2200,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
|
||||
}else{
|
||||
$nbt = new NBT(NBT::BIG_ENDIAN);
|
||||
$nbt->readCompressed(file_get_contents(\PocketMine\DATA . "players/" . $iname . ".dat"));
|
||||
$nbt->readCompressed(file_get_contents(Server::getInstance()->getDataPath() . "players/" . $iname . ".dat"));
|
||||
$nbt = $nbt->getData();
|
||||
}
|
||||
|
||||
@ -2207,7 +2216,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
public static function saveOffline($name, Compound $nbtTag){
|
||||
$nbt = new NBT(NBT::BIG_ENDIAN);
|
||||
$nbt->setData($nbtTag);
|
||||
file_put_contents(\PocketMine\DATA . "players/" . strtolower($name) . ".dat", $nbt->writeCompressed());
|
||||
file_put_contents(Server::getInstance()->getDataPath() . "players/" . strtolower($name) . ".dat", $nbt->writeCompressed());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2234,7 +2243,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
/**
|
||||
* Broadcasts a Minecraft packet to a list of players
|
||||
*
|
||||
* @param array $players
|
||||
* @param Player[] $players
|
||||
* @param DataPacket $packet
|
||||
*/
|
||||
public static function broadcastPacket(array $players, DataPacket $packet){
|
||||
@ -2244,16 +2253,16 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $craft
|
||||
* @param array $recipe
|
||||
* @param $type
|
||||
* @param Item[] $craft
|
||||
* @param Item[] $recipe
|
||||
* @param int $type
|
||||
*
|
||||
* @return array|bool
|
||||
*/
|
||||
public function craftItems(array $craft, array $recipe, $type){
|
||||
$craftItem = array(0, true, 0);
|
||||
unset($craft[-1]);
|
||||
foreach($craft as $slot => $item){
|
||||
foreach($craft as $item){
|
||||
if($item instanceof Item){
|
||||
$craftItem[0] = $item->getID();
|
||||
if($item->getMetadata() !== $craftItem[1] and $craftItem[1] !== true){
|
||||
@ -2267,7 +2276,7 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
}
|
||||
|
||||
$recipeItems = array();
|
||||
foreach($recipe as $slot => $item){
|
||||
foreach($recipe as $item){
|
||||
if(!isset($recipeItems[$item->getID()])){
|
||||
$recipeItems[$item->getID()] = array($item->getID(), $item->getMetadata(), $item->getCount());
|
||||
}else{
|
||||
@ -2288,10 +2297,12 @@ class Player extends RealHuman /*TODO: implements CommandSender*/{
|
||||
}
|
||||
|
||||
if(is_array($res)){
|
||||
//TODO: CraftItemEvent
|
||||
//$this->server->getPluginManager($ev = new CraftItemEvent($this, $recipe, $craft, $type));
|
||||
//if($ev->isCancelled()){
|
||||
// return false;
|
||||
//}
|
||||
|
||||
if($this->server->api->dhandle("player.craft", array("player" => $this, "recipe" => $recipe, "craft" => $craft, "type" => $type)) === false){
|
||||
return false;
|
||||
}
|
||||
foreach($recipe as $slot => $item){
|
||||
$s = $this->getSlot($slot);
|
||||
$s->setCount($s->getCount() - $item->getCount());
|
||||
|
@ -35,6 +35,7 @@ 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;
|
||||
@ -57,49 +58,31 @@ use PocketMine\Utils\Utils;
|
||||
use PocketMine\Utils\VersionString;
|
||||
|
||||
class Server{
|
||||
/**
|
||||
* @var Server
|
||||
*/
|
||||
/** @var Server */
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
/** @var bool */
|
||||
private $isRunning = true;
|
||||
|
||||
/**
|
||||
* @var PluginManager
|
||||
*/
|
||||
/** @var PluginManager */
|
||||
private $pluginManager = null;
|
||||
|
||||
/**
|
||||
* @var ServerScheduler
|
||||
*/
|
||||
/** @var ServerScheduler */
|
||||
private $scheduler = null;
|
||||
|
||||
/**
|
||||
* @var TickScheduler
|
||||
*/
|
||||
/** @var TickScheduler */
|
||||
private $tickScheduler = null;
|
||||
|
||||
/**
|
||||
* @var CommandReader
|
||||
*/
|
||||
/** @var CommandReader */
|
||||
private $console = null;
|
||||
|
||||
/**
|
||||
* @var SimpleCommandMap
|
||||
*/
|
||||
/** @var SimpleCommandMap */
|
||||
private $commandMap = null;
|
||||
|
||||
/**
|
||||
* @var ConsoleCommandSender
|
||||
*/
|
||||
/** @var ConsoleCommandSender */
|
||||
private $consoleSender;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
private $maxPlayers;
|
||||
|
||||
/**
|
||||
@ -110,9 +93,7 @@ class Server{
|
||||
private $tickCounter;
|
||||
private $inTick = false;
|
||||
|
||||
/**
|
||||
* @var ThreadedHandler
|
||||
*/
|
||||
/** @var ThreadedHandler */
|
||||
private $interface;
|
||||
|
||||
private $serverID;
|
||||
@ -122,14 +103,10 @@ class Server{
|
||||
private $dataPath;
|
||||
private $pluginPath;
|
||||
|
||||
/**
|
||||
* @var QueryHandler
|
||||
*/
|
||||
/** @var QueryHandler */
|
||||
private $queryHandler;
|
||||
|
||||
/**
|
||||
* @var Config
|
||||
*/
|
||||
/** @var Config */
|
||||
private $properties;
|
||||
|
||||
/**
|
||||
@ -251,6 +228,61 @@ class Server{
|
||||
return $this->getConfigInt("gamemode", 0) & 0b11;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the gamemode text name
|
||||
*
|
||||
* @param int $mode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getGamemodeString($mode){
|
||||
switch((int) $mode){
|
||||
case Player::SURVIVAL:
|
||||
return "SURVIVAL";
|
||||
case Player::CREATIVE:
|
||||
return "CREATIVE";
|
||||
case Player::ADVENTURE:
|
||||
return "ADVENTURE";
|
||||
case Player::SPECTATOR:
|
||||
return "SPECTATOR";
|
||||
}
|
||||
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a string and returns a gamemode integer, -1 if not found
|
||||
*
|
||||
* @param string $str
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function getGamemodeFromString($str){
|
||||
switch(strtolower(trim($str))){
|
||||
case (string) Player::SURVIVAL:
|
||||
case "survival":
|
||||
case "s":
|
||||
return Player::SURVIVAL;
|
||||
|
||||
case (string) Player::CREATIVE:
|
||||
case "creative":
|
||||
case "c":
|
||||
return Player::CREATIVE;
|
||||
|
||||
case (string) Player::ADVENTURE:
|
||||
case "adventure":
|
||||
case "a":
|
||||
return Player::ADVENTURE;
|
||||
|
||||
case (string) Player::SPECTATOR:
|
||||
case "spectator":
|
||||
case "view":
|
||||
case "v":
|
||||
return Player::SPECTATOR;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
@ -614,7 +646,8 @@ class Server{
|
||||
|
||||
public function checkConsole(){
|
||||
if(($line = $this->console->getLine()) !== null){
|
||||
$this->dispatchCommand($this->consoleSender, $line);
|
||||
$this->pluginManager->callEvent($ev = new ServerCommandEvent($this->consoleSender, $line));
|
||||
$this->dispatchCommand($this->consoleSender, $ev->getCommand());
|
||||
}
|
||||
}
|
||||
|
||||
@ -668,7 +701,7 @@ class Server{
|
||||
pcntl_signal(SIGHUP, array($this, "close"));
|
||||
}
|
||||
*/
|
||||
console("[INFO] Default game type: " . strtoupper($this->getGamemode())); //TODO: string name
|
||||
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 "?"');
|
||||
if(Utils::getOS() === "win"){ //Workaround less usleep() waste
|
||||
@ -691,6 +724,8 @@ class Server{
|
||||
$this->scheduler->cancelAllTasks();
|
||||
$this->scheduler->mainThreadHeartbeat(PHP_INT_MAX);
|
||||
|
||||
$this->properties->save();
|
||||
|
||||
$this->tickScheduler->kill();
|
||||
$this->console->kill();
|
||||
|
||||
|
@ -44,39 +44,25 @@ class ServerAPI{
|
||||
|
||||
//TODO: Instead of hard-coding functions, use PHPDoc-compatible methods to load APIs.
|
||||
|
||||
/**
|
||||
* @var ConsoleAPI
|
||||
*/
|
||||
/** @var ConsoleAPI */
|
||||
public $console;
|
||||
|
||||
/**
|
||||
* @var LevelAPI
|
||||
*/
|
||||
/** @var LevelAPI */
|
||||
public $level;
|
||||
|
||||
/**
|
||||
* @var BlockAPI
|
||||
*/
|
||||
/** @var BlockAPI */
|
||||
public $block;
|
||||
|
||||
/**
|
||||
* @var ChatAPI
|
||||
*/
|
||||
/** @var ChatAPI */
|
||||
public $chat;
|
||||
|
||||
/**
|
||||
* @var BanAPI
|
||||
*/
|
||||
/** @var BanAPI */
|
||||
public $ban;
|
||||
|
||||
/**
|
||||
* @var TimeAPI
|
||||
*/
|
||||
/** @var TimeAPI */
|
||||
public $time;
|
||||
|
||||
/**
|
||||
* @var PlayerAPI
|
||||
*/
|
||||
/** @var PlayerAPI */
|
||||
public $player;
|
||||
|
||||
/**
|
||||
|
@ -35,9 +35,7 @@ use PocketMine\Utils\Utils;
|
||||
use PocketMine\Utils\VersionString;
|
||||
|
||||
class ServerOld{
|
||||
/**
|
||||
* @var Server
|
||||
*/
|
||||
/** @var Server */
|
||||
private static $instance;
|
||||
|
||||
public $tCnt;
|
||||
|
@ -29,19 +29,13 @@ use PocketMine\Server;
|
||||
use PocketMine\Utils\TextFormat;
|
||||
|
||||
abstract class Command{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $nextLabel;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $label;
|
||||
|
||||
/**
|
||||
@ -54,29 +48,19 @@ abstract class Command{
|
||||
*/
|
||||
private $activeAliases = array();
|
||||
|
||||
/**
|
||||
* @var CommandMap
|
||||
*/
|
||||
/** @var CommandMap */
|
||||
private $commandMap = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $description = "";
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $usageMessage;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $permission = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $permissionMessage = null;
|
||||
|
||||
/**
|
||||
|
@ -24,15 +24,11 @@ namespace PocketMine\Command;
|
||||
class CommandReader extends \Thread{
|
||||
|
||||
private $stream;
|
||||
/**
|
||||
* @var resource
|
||||
*/
|
||||
/** @var resource */
|
||||
private $fp;
|
||||
private $readline;
|
||||
|
||||
/**
|
||||
* @var \Threaded
|
||||
*/
|
||||
/** @var \Threaded */
|
||||
private $buffer;
|
||||
|
||||
/**
|
||||
|
@ -25,14 +25,10 @@ use PocketMine\Plugin\Plugin;
|
||||
|
||||
class PluginCommand extends Command{
|
||||
|
||||
/**
|
||||
* @var Plugin
|
||||
*/
|
||||
/** @var Plugin */
|
||||
private $owningPlugin;
|
||||
|
||||
/**
|
||||
* @var CommandExecutor
|
||||
*/
|
||||
/** @var CommandExecutor */
|
||||
private $executor;
|
||||
|
||||
/**
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
namespace PocketMine\Command;
|
||||
|
||||
use PocketMine\Command\Defaults\DefaultGamemodeCommand;
|
||||
use PocketMine\Command\Defaults\HelpCommand;
|
||||
use PocketMine\Command\Defaults\PluginsCommand;
|
||||
use PocketMine\Command\Defaults\SeedCommand;
|
||||
@ -37,9 +38,7 @@ class SimpleCommandMap implements CommandMap{
|
||||
*/
|
||||
protected $knownCommands = array();
|
||||
|
||||
/**
|
||||
* @var Server
|
||||
*/
|
||||
/** @var Server */
|
||||
private $server;
|
||||
|
||||
public function __construct(Server $server){
|
||||
@ -55,6 +54,7 @@ class SimpleCommandMap implements CommandMap{
|
||||
$this->register("pocketmine", new HelpCommand("help"));
|
||||
$this->register("pocketmine", new StopCommand("stop"));
|
||||
$this->register("pocketmine", new TellCommand("tell"));
|
||||
$this->register("pocketmine", new DefaultGamemodeCommand("defaultgamemode"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,21 +22,19 @@
|
||||
namespace PocketMine\Command\Defaults;
|
||||
|
||||
use PocketMine\Command\CommandSender;
|
||||
use PocketMine\Network\Protocol\Info;
|
||||
use PocketMine\Plugin\Plugin;
|
||||
use PocketMine\Player;
|
||||
use PocketMine\Server;
|
||||
use PocketMine\Utils\TextFormat;
|
||||
|
||||
class VersionCommand extends VanillaCommand{
|
||||
class DefaultGamemodeCommand extends VanillaCommand{
|
||||
|
||||
public function __construct($name){
|
||||
parent::__construct(
|
||||
$name,
|
||||
"Gets the version of this server including any plugins in use",
|
||||
"/version [plugin name]",
|
||||
["ver", "about"]
|
||||
"Set the default gamemode",
|
||||
"/defaultgamemode <mode>"
|
||||
);
|
||||
$this->setPermission("pocketmine.command.version");
|
||||
$this->setPermission("pocketmine.command.defaultgamemode");
|
||||
}
|
||||
|
||||
public function execute(CommandSender $sender, $currentAlias, array $args){
|
||||
@ -45,56 +43,18 @@ class VersionCommand extends VanillaCommand{
|
||||
}
|
||||
|
||||
if(count($args) === 0){
|
||||
$output = "This server is running PocketMine-MP version " . Server::getInstance()->getPocketMineVersion() . " 「" . Server::getInstance()->getCodename() . "」 (Implementing API version " . Server::getInstance()->getApiVersion() . " for Minecraft: PE " . Server::getInstance()->getVersion() . " protocol version " . Info::CURRENT_PROTOCOL . ")";
|
||||
if(\PocketMine\GIT_COMMIT !== str_repeat("00", 20)){
|
||||
$output .= " [git " . \PocketMine\GIT_COMMIT . "]";
|
||||
}
|
||||
$sender->sendMessage($output);
|
||||
}else{
|
||||
$pluginName = implode(" ", $args);
|
||||
$exactPlugin = Server::getInstance()->getPluginManager()->getPlugin($pluginName);
|
||||
|
||||
if($exactPlugin instanceof Plugin){
|
||||
$this->describeToSender($exactPlugin, $sender);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
$found = false;
|
||||
$pluginName = strtolower($pluginName);
|
||||
foreach(Server::getInstance()->getPluginManager()->getPlugins() as $plugin){
|
||||
if(stripos($plugin->getName(), $pluginName) !== false){
|
||||
$this->describeToSender($plugin, $sender);
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$found){
|
||||
$sender->sendMessage("This server is not running any plugin by that name.\nUse /plugins to get a list of plugins.");
|
||||
}
|
||||
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
$gameMode = Server::getGamemodeFromString($args[0]);
|
||||
|
||||
if($gameMode !== -1){
|
||||
Server::getInstance()->setConfigInt("gamemode", $gameMode);
|
||||
$sender->sendMessage("Default game mode set to ". strtolower(Server::getGamemodeString($gameMode)));
|
||||
}else{
|
||||
$sender->sendMessage("Unknown game mode");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private function describeToSender(Plugin $plugin, CommandSender $sender){
|
||||
$desc = $plugin->getDescription();
|
||||
$sender->sendMessage(TextFormat::DARK_GREEN . $desc->getName() . TextFormat::WHITE . " version " . TextFormat::DARK_GREEN . $desc->getVersion());
|
||||
|
||||
if($desc->getDescription() != null){
|
||||
$sender->sendMessage($desc->getDescription());
|
||||
}
|
||||
|
||||
if($desc->getWebsite() != null){
|
||||
$sender->sendMessage("Website: " . $desc->getWebsite());
|
||||
}
|
||||
|
||||
if(count($authors = $desc->getAuthors()) > 0){
|
||||
if(count($authors) === 1){
|
||||
$sender->sendMessage("Author: " . implode(", ", $authors));
|
||||
}else{
|
||||
$sender->sendMessage("Authors: " . implode(", ", $authors));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -29,19 +29,13 @@ use PocketMine\Player;
|
||||
class BlockBreakEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var \PocketMine\Player
|
||||
*/
|
||||
/** @var \PocketMine\Player */
|
||||
protected $player;
|
||||
|
||||
/**
|
||||
* @var \PocketMine\Item\Item
|
||||
*/
|
||||
/** @var \PocketMine\Item\Item */
|
||||
protected $item;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
/** @var bool */
|
||||
protected $instaBreak = false;
|
||||
|
||||
public function __construct(Player $player, Block $block, Item $item, $instaBreak = false){
|
||||
|
@ -27,9 +27,7 @@ namespace PocketMine\Event\Block;
|
||||
use PocketMine\Event\Event;
|
||||
|
||||
abstract class BlockEvent extends Event{
|
||||
/**
|
||||
* @var \PocketMine\Block\Block
|
||||
*/
|
||||
/** @var \PocketMine\Block\Block */
|
||||
protected $block;
|
||||
|
||||
public function getBlock(){
|
||||
|
@ -32,14 +32,10 @@ use PocketMine\Player;
|
||||
class BlockPlaceEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var \PocketMine\Player
|
||||
*/
|
||||
/** @var \PocketMine\Player */
|
||||
protected $player;
|
||||
|
||||
/**
|
||||
* @var \PocketMine\Item\Item
|
||||
*/
|
||||
/** @var \PocketMine\Item\Item */
|
||||
protected $item;
|
||||
|
||||
|
||||
|
@ -27,9 +27,7 @@ namespace PocketMine\Event\Entity;
|
||||
use PocketMine\Event\Event;
|
||||
|
||||
abstract class EntityEvent extends Event{
|
||||
/**
|
||||
* @var \PocketMine\Entity\Entity
|
||||
*/
|
||||
/** @var \PocketMine\Entity\Entity */
|
||||
protected $entity;
|
||||
|
||||
public function getEntity(){
|
||||
|
@ -32,9 +32,7 @@ use PocketMine\Level\Position;
|
||||
class EntityExplodeEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var Position
|
||||
*/
|
||||
/** @var Position */
|
||||
protected $position;
|
||||
|
||||
/**
|
||||
@ -42,9 +40,7 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{
|
||||
*/
|
||||
protected $blocks;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
/** @var float */
|
||||
protected $yield;
|
||||
|
||||
/**
|
||||
|
@ -29,9 +29,7 @@ use PocketMine\Math\Vector3 as Vector3;
|
||||
class EntityMoveEvent extends EntityEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var \PocketMine\Math\Vector3
|
||||
*/
|
||||
/** @var \PocketMine\Math\Vector3 */
|
||||
private $pos;
|
||||
|
||||
public function __construct(Entity $entity, Vector3 $pos){
|
||||
|
47
src/PocketMine/event/inventory/InventoryEvent.php
Normal file
47
src/PocketMine/event/inventory/InventoryEvent.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Inventory related events
|
||||
*/
|
||||
namespace PocketMine\Event\Player;
|
||||
|
||||
use PocketMine\Event\Event;
|
||||
|
||||
abstract class InventoryEvent extends Event{
|
||||
|
||||
/** @var Inventory */
|
||||
protected $inventory;
|
||||
|
||||
/**
|
||||
* @return Inventory
|
||||
*/
|
||||
public function getInventory(){
|
||||
return $this->inventory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \PocketMine\Entity\Human[]
|
||||
*/
|
||||
public function getViewers(){
|
||||
return $this->inventory->getViewers();
|
||||
}
|
||||
}
|
@ -30,9 +30,7 @@ use PocketMine\Player;
|
||||
class PlayerAchievementAwardedEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $achievement;
|
||||
|
||||
/**
|
||||
|
@ -30,14 +30,10 @@ use PocketMine\Player;
|
||||
class PlayerChatEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $message;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $format;
|
||||
|
||||
/**
|
||||
|
73
src/PocketMine/event/player/PlayerCommandPreprocessEvent.php
Normal file
73
src/PocketMine/event/player/PlayerCommandPreprocessEvent.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace PocketMine\Event\Player;
|
||||
|
||||
use PocketMine\Event\Cancellable;
|
||||
use PocketMine\Player;
|
||||
use PocketMine\Server;
|
||||
|
||||
/**
|
||||
* Called when a player runs a command or chats, early in the process
|
||||
*
|
||||
* You don't want to use this except for a few cases like logging commands,
|
||||
* blocking commands on certain places, or applying modifiers.
|
||||
*
|
||||
* The message contains a slash at the start
|
||||
*/
|
||||
class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/** @var string */
|
||||
protected $message;
|
||||
|
||||
|
||||
/**
|
||||
* @param Player $player
|
||||
* @param string $message
|
||||
*/
|
||||
public function __construct(Player $player, $message){
|
||||
$this->player = $player;
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage(){
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*/
|
||||
public function setMessage($message){
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Player $player
|
||||
*/
|
||||
public function setPlayer(Player $player){
|
||||
$this->player = $player;
|
||||
}
|
||||
|
||||
}
|
@ -27,9 +27,7 @@ namespace PocketMine\Event\Player;
|
||||
use PocketMine\Event\Event;
|
||||
|
||||
abstract class PlayerEvent extends Event{
|
||||
/**
|
||||
* @var \PocketMine\Player
|
||||
*/
|
||||
/** @var \PocketMine\Player */
|
||||
protected $player;
|
||||
|
||||
public function getPlayer(){
|
||||
|
@ -30,9 +30,7 @@ use PocketMine\Player;
|
||||
class PlayerGameModeChangeEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
protected $gamemode;
|
||||
|
||||
public function __construct(Player $player, $newGamemode){
|
||||
|
@ -37,14 +37,10 @@ class PlayerInteractEvent extends PlayerEvent implements Cancellable{
|
||||
*/
|
||||
protected $blockTouched;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
protected $blockFace;
|
||||
|
||||
/**
|
||||
* @var \PocketMine\Item\Item
|
||||
*/
|
||||
/** @var \PocketMine\Item\Item */
|
||||
protected $item;
|
||||
|
||||
public function __construct(Player $player, Item $item, Block $block, $face){
|
||||
|
@ -29,9 +29,7 @@ use PocketMine\Player;
|
||||
class PlayerJoinEvent extends PlayerEvent{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $joinMessage;
|
||||
|
||||
public function __construct(Player $player, $joinMessage){
|
||||
|
@ -30,14 +30,10 @@ use PocketMine\Player;
|
||||
class PlayerKickEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $quitMessage;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $reason;
|
||||
|
||||
public function __construct(Player $player, $reason, $quitMessage){
|
||||
|
@ -30,9 +30,7 @@ use PocketMine\Player;
|
||||
class PlayerLoginEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $kickMessage;
|
||||
|
||||
public function __construct(Player $player, $kickMessage){
|
||||
|
@ -30,9 +30,7 @@ use PocketMine\Player;
|
||||
class PlayerPreLoginEvent extends PlayerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $kickMessage;
|
||||
|
||||
public function __construct(Player $player, $kickMessage){
|
||||
|
@ -29,9 +29,7 @@ use PocketMine\Player;
|
||||
class PlayerQuitEvent extends PlayerEvent{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected $quitMessage;
|
||||
|
||||
public function __construct(Player $player, $quitMessage){
|
||||
|
@ -24,45 +24,38 @@ namespace PocketMine\Event\Player;
|
||||
use PocketMine\Block\Block;
|
||||
use PocketMine\Event\Cancellable;
|
||||
use PocketMine\Item\Item;
|
||||
use PocketMine\Level\Position;
|
||||
use PocketMine\Player;
|
||||
|
||||
/**
|
||||
* Called when a player interacts or touches a block (including air?)
|
||||
* Called when a player is respawned (or first time spawned)
|
||||
*/
|
||||
class PlayerInteractEvent extends PlayerEvent implements Cancellable{
|
||||
class PlayerRespawnEvent extends PlayerEvent{
|
||||
public static $handlerList = null;
|
||||
|
||||
/**
|
||||
* @var \PocketMine\Block\Block;
|
||||
*/
|
||||
protected $blockTouched;
|
||||
/** @var Position */
|
||||
protected $position;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @param Player $player
|
||||
* @param Position $position
|
||||
*/
|
||||
protected $blockFace;
|
||||
|
||||
/**
|
||||
* @var \PocketMine\Item\Item
|
||||
*/
|
||||
protected $item;
|
||||
|
||||
public function __construct(Player $player, Item $item, Block $block, $face){
|
||||
$this->blockTouched = $block;
|
||||
public function __construct(Player $player, Position $position){
|
||||
$this->player = $player;
|
||||
$this->item = $item;
|
||||
$this->blockFace = (int) $face;
|
||||
$this->position = $position;
|
||||
}
|
||||
|
||||
public function getItem(){
|
||||
return $this->item;
|
||||
/**
|
||||
* @return Position
|
||||
*/
|
||||
public function getRespawnPosition(){
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function getBlock(){
|
||||
return $this->blockTouched;
|
||||
}
|
||||
|
||||
public function getFace(){
|
||||
return $this->blockFace;
|
||||
/**
|
||||
* @param Position $position
|
||||
*/
|
||||
public function setRespawnPosition(Position $position){
|
||||
$this->position = $position;
|
||||
}
|
||||
}
|
@ -30,9 +30,7 @@ use PocketMine\Plugin\Plugin;
|
||||
|
||||
abstract class PluginEvent extends Event{
|
||||
|
||||
/**
|
||||
* @var Plugin
|
||||
*/
|
||||
/** @var Plugin */
|
||||
private $plugin;
|
||||
|
||||
/**
|
||||
|
69
src/PocketMine/event/server/ServerCommandEvent.php
Normal file
69
src/PocketMine/event/server/ServerCommandEvent.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace PocketMine\Event\Server;
|
||||
|
||||
use PocketMine\Command\CommandSender;
|
||||
use PocketMine\Event\Cancellable;
|
||||
use PocketMine\Player;
|
||||
use PocketMine\Server;
|
||||
|
||||
/**
|
||||
* Called when the console runs a command, early in the process
|
||||
*
|
||||
* You don't want to use this except for a few cases like logging commands,
|
||||
* blocking commands on certain places, or applying modifiers.
|
||||
*
|
||||
* The message contains a slash at the start
|
||||
*/
|
||||
class ServerCommandEvent extends ServerEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
|
||||
/** @var string */
|
||||
protected $command;
|
||||
|
||||
/** @var CommandSender */
|
||||
protected $sender;
|
||||
|
||||
/**
|
||||
* @param CommandSender $sender
|
||||
* @param string $command
|
||||
*/
|
||||
public function __construct(CommandSender $sender, $command){
|
||||
$this->sender = $sender;
|
||||
$this->command = $command;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCommand(){
|
||||
return $this->command;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $command
|
||||
*/
|
||||
public function setCommand($command){
|
||||
$this->command = $command;
|
||||
}
|
||||
|
||||
}
|
@ -74,9 +74,7 @@ class Level{
|
||||
*/
|
||||
public static $list = array();
|
||||
|
||||
/**
|
||||
* @var Level
|
||||
*/
|
||||
/** @var Level */
|
||||
public static $default = null;
|
||||
|
||||
/**
|
||||
@ -106,15 +104,11 @@ class Level{
|
||||
|
||||
public $nextSave;
|
||||
|
||||
/**
|
||||
* @var LevelFormat
|
||||
*/
|
||||
/** @var LevelFormat */
|
||||
public $level;
|
||||
public $stopTime;
|
||||
private $time, $startCheck, $startTime;
|
||||
/**
|
||||
* @var Server
|
||||
*/
|
||||
/** @var Server */
|
||||
private $server;
|
||||
private $name, $usedChunks, $changedBlocks, $changedCount, $generator;
|
||||
|
||||
@ -976,7 +970,7 @@ class Level{
|
||||
* @param int $X
|
||||
* @param int $Z
|
||||
*
|
||||
* @return array
|
||||
* @return Entity[]
|
||||
*/
|
||||
public function getChunkEntities($X, $Z){
|
||||
$index = LevelFormat::getIndex($X, $Z);
|
||||
@ -993,7 +987,7 @@ class Level{
|
||||
* @param int $X
|
||||
* @param int $Z
|
||||
*
|
||||
* @return array
|
||||
* @return Tile[]
|
||||
*/
|
||||
public function getChunkTiles($X, $Z){
|
||||
$index = LevelFormat::getIndex($X, $Z);
|
||||
|
@ -25,9 +25,7 @@ use PocketMine\Math\Vector3 as Vector3;
|
||||
|
||||
class Position extends Vector3{
|
||||
|
||||
/**
|
||||
* @var Level
|
||||
*/
|
||||
/** @var Level */
|
||||
public $level = null;
|
||||
|
||||
/**
|
||||
|
@ -28,9 +28,7 @@ use PocketMine\Math\Vector3 as Vector3;
|
||||
use PocketMine\Utils\Random;
|
||||
|
||||
class TallGrass extends Populator{
|
||||
/**
|
||||
* @var Level
|
||||
*/
|
||||
/** @var Level */
|
||||
private $level;
|
||||
private $randomAmount;
|
||||
private $baseAmount;
|
||||
|
@ -25,14 +25,10 @@ use PocketMine\Plugin\Plugin;
|
||||
use PocketMine\Server;
|
||||
|
||||
class PermissibleBase implements Permissible{
|
||||
/**
|
||||
* @var ServerOperator
|
||||
*/
|
||||
/** @var ServerOperator */
|
||||
private $opable = null;
|
||||
|
||||
/**
|
||||
* @var Permissible
|
||||
*/
|
||||
/** @var Permissible */
|
||||
private $parent;
|
||||
|
||||
/**
|
||||
|
@ -63,14 +63,10 @@ class Permission{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $description;
|
||||
|
||||
/**
|
||||
@ -78,9 +74,7 @@ class Permission{
|
||||
*/
|
||||
private $children = array();
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $defaultValue;
|
||||
|
||||
/**
|
||||
|
@ -24,9 +24,7 @@ namespace PocketMine\Permission;
|
||||
use PocketMine\Plugin\Plugin;
|
||||
|
||||
class PermissionAttachment{
|
||||
/**
|
||||
* @var PermissionRemovedExecutor
|
||||
*/
|
||||
/** @var PermissionRemovedExecutor */
|
||||
private $removed = null;
|
||||
|
||||
/**
|
||||
@ -34,14 +32,10 @@ class PermissionAttachment{
|
||||
*/
|
||||
private $permissions = array();
|
||||
|
||||
/**
|
||||
* @var Permissible
|
||||
*/
|
||||
/** @var Permissible */
|
||||
private $permissible;
|
||||
|
||||
/**
|
||||
* @var Plugin
|
||||
*/
|
||||
/** @var Plugin */
|
||||
private $plugin;
|
||||
|
||||
/**
|
||||
|
@ -23,24 +23,16 @@ namespace PocketMine\Permission;
|
||||
|
||||
|
||||
class PermissionAttachmentInfo{
|
||||
/**
|
||||
* @var Permissible
|
||||
*/
|
||||
/** @var Permissible */
|
||||
private $permissible;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $permission;
|
||||
|
||||
/**
|
||||
* @var PermissionAttachment
|
||||
*/
|
||||
/** @var PermissionAttachment */
|
||||
private $attachment;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
/** @var bool */
|
||||
private $value;
|
||||
|
||||
/**
|
||||
|
@ -30,9 +30,7 @@ use PocketMine\Server;
|
||||
*/
|
||||
class FolderPluginLoader implements PluginLoader{
|
||||
|
||||
/**
|
||||
* @var Server
|
||||
*/
|
||||
/** @var Server */
|
||||
private $server;
|
||||
|
||||
/**
|
||||
|
@ -35,19 +35,13 @@ use PocketMine\Server;
|
||||
*/
|
||||
class PluginManager{
|
||||
|
||||
/**
|
||||
* @var PluginManager
|
||||
*/
|
||||
/** @var PluginManager */
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
* @var Server
|
||||
*/
|
||||
/** @var Server */
|
||||
private $server;
|
||||
|
||||
/**
|
||||
* @var SimpleCommandMap
|
||||
*/
|
||||
/** @var SimpleCommandMap */
|
||||
private $commandMap;
|
||||
|
||||
/**
|
||||
|
@ -27,29 +27,19 @@ use PocketMine\Event\Listener;
|
||||
|
||||
class RegisteredListener{
|
||||
|
||||
/**
|
||||
* @var Listener
|
||||
*/
|
||||
/** @var Listener */
|
||||
private $listener;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
private $priority;
|
||||
|
||||
/**
|
||||
* @var Plugin
|
||||
*/
|
||||
/** @var Plugin */
|
||||
private $plugin;
|
||||
|
||||
/**
|
||||
* @var EventExecutor
|
||||
*/
|
||||
/** @var EventExecutor */
|
||||
private $executor;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
/** @var bool */
|
||||
private $ignoreCancelled;
|
||||
|
||||
/**
|
||||
|
@ -29,21 +29,17 @@ namespace PocketMine\Scheduler;
|
||||
*/
|
||||
class CallbackTask extends Task{
|
||||
|
||||
/**
|
||||
* @var callable
|
||||
*/
|
||||
/** @var callable */
|
||||
protected $callable;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
/** @var array */
|
||||
protected $args;
|
||||
|
||||
/**
|
||||
* @param callable $callable
|
||||
* @param array $args
|
||||
*/
|
||||
public function __construct(callable $callable, array $args){
|
||||
public function __construct(callable $callable, array $args = array()){
|
||||
$this->callable = $callable;
|
||||
$this->args = $args;
|
||||
$this->args[] = $this;
|
||||
|
@ -28,9 +28,7 @@ use PocketMine\Plugin\Plugin;
|
||||
*/
|
||||
abstract class PluginTask extends Task{
|
||||
|
||||
/**
|
||||
* @var Plugin
|
||||
*/
|
||||
/** @var Plugin */
|
||||
protected $owner;
|
||||
|
||||
/**
|
||||
|
@ -38,14 +38,10 @@ class ServerScheduler{
|
||||
*/
|
||||
protected $tasks = array();
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
private $ids = 1;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
protected $currentTick = 0;
|
||||
|
||||
public function __construct(){
|
||||
|
@ -23,9 +23,7 @@ namespace PocketMine\Scheduler;
|
||||
|
||||
abstract class Task{
|
||||
|
||||
/**
|
||||
* @var TaskHandler
|
||||
*/
|
||||
/** @var TaskHandler */
|
||||
private $taskHandler = null;
|
||||
|
||||
/**
|
||||
|
@ -23,34 +23,22 @@ namespace PocketMine\Scheduler;
|
||||
|
||||
class TaskHandler{
|
||||
|
||||
/**
|
||||
* @var Task
|
||||
*/
|
||||
/** @var Task */
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
protected $taskId;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
protected $delay;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
protected $period;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
protected $nextRun;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
/** @var bool */
|
||||
protected $cancelled = false;
|
||||
|
||||
/**
|
||||
@ -130,7 +118,9 @@ class TaskHandler{
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
$this->task->onCancel();
|
||||
if(!$this->isCancelled()){
|
||||
$this->task->onCancel();
|
||||
}
|
||||
$this->remove();
|
||||
}
|
||||
|
||||
|
@ -38,21 +38,13 @@ class Config{
|
||||
const ENUM = 5; // .txt, .list, .enum
|
||||
const ENUMERATION = Config::ENUM;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
/** @var array */
|
||||
private $config;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $file;
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
/** @var boolean */
|
||||
private $correct;
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
/** @var integer */
|
||||
private $type = Config::DETECT;
|
||||
|
||||
public static $formats = array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user