Merge remote-tracking branch 'origin/mcpe-0.12' into php7

This commit is contained in:
Shoghi Cervantes 2015-09-17 12:25:05 +02:00
commit 8768b7fdbd
5 changed files with 18 additions and 10 deletions

View File

@ -1680,6 +1680,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$pk = new StartGamePacket(); $pk = new StartGamePacket();
$pk->seed = -1; $pk->seed = -1;
$pk->dimension = 0;
$pk->x = $this->x; $pk->x = $this->x;
$pk->y = $this->y; $pk->y = $this->y;
$pk->z = $this->z; $pk->z = $this->z;
@ -1783,7 +1784,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->setNameTag($this->username); $this->setNameTag($this->username);
$this->iusername = strtolower($this->username); $this->iusername = strtolower($this->username);
if(count($this->server->getOnlinePlayers()) > $this->server->getMaxPlayers() and $this->kick("disconnectionScreen.serverFull", false)){ if(count($this->server->getOnlinePlayers()) >= $this->server->getMaxPlayers() and $this->kick("disconnectionScreen.serverFull", false)){
break; break;
} }

View File

@ -383,11 +383,18 @@ class PlayerInventory extends BaseInventory{
} }
$pk = new ContainerSetContentPacket(); $pk = new ContainerSetContentPacket();
$pk;
$pk->slots = []; $pk->slots = [];
$holder = $this->getHolder();
if($holder instanceof Player and $holder->isCreative()){
//TODO: Remove this workaround because of broken client
foreach(Item::getCreativeItems() as $i => $item){
$pk->slots[$i] = Item::getCreativeItem($i);
}
}else{
for($i = 0; $i < $this->getSize(); ++$i){ //Do not send armor by error here for($i = 0; $i < $this->getSize(); ++$i){ //Do not send armor by error here
$pk->slots[$i] = $this->getItem($i); $pk->slots[$i] = $this->getItem($i);
} }
}
foreach($target as $player){ foreach($target as $player){
$pk->hotbar = []; $pk->hotbar = [];
@ -416,7 +423,6 @@ class PlayerInventory extends BaseInventory{
} }
$pk = new ContainerSetSlotPacket(); $pk = new ContainerSetSlotPacket();
$pk;
$pk->slot = $index; $pk->slot = $index;
$pk->item = clone $this->getItem($index); $pk->item = clone $this->getItem($index);

View File

@ -26,6 +26,7 @@ use pocketmine\Server;
use pocketmine\utils\Utils; use pocketmine\utils\Utils;
use pocketmine\utils\UUID; use pocketmine\utils\UUID;
use pocketmine\utils\VersionString; use pocketmine\utils\VersionString;
use pocketmine\utils\UUID;
class SendUsageTask extends AsyncTask{ class SendUsageTask extends AsyncTask{
@ -40,9 +41,9 @@ class SendUsageTask extends AsyncTask{
$endpoint = "http://" . $server->getProperty("anonymous-statistics.host", "stats.pocketmine.net") . "/"; $endpoint = "http://" . $server->getProperty("anonymous-statistics.host", "stats.pocketmine.net") . "/";
$data = []; $data = [];
$data["uniqueServerId"] = $server->getServerUniqueId(); $data["uniqueServerId"] = $server->getServerUniqueId()->toString();
$data["uniqueMachineId"] = Utils::getMachineUniqueId(); $data["uniqueMachineId"] = Utils::getMachineUniqueId()->toString();
$data["uniqueRequestId"] = UUID::fromData($server->getServerUniqueId(), microtime(true)); $data["uniqueRequestId"] = UUID::fromData($server->getServerUniqueId(), microtime(true))->toString();
switch($type){ switch($type){
case self::TYPE_OPEN: case self::TYPE_OPEN:

View File

@ -29,7 +29,7 @@ class EnchantTable extends Spawnable implements Nameable{
public function getName(){ public function getName(){
return isset($this->namedtag->CustomName) ? $this->namedtag->CustomName->getValue() : "Chest"; return isset($this->namedtag->CustomName) ? $this->namedtag->CustomName->getValue() : "Enchanting Table";
} }
public function hasName(){ public function hasName(){

View File

@ -71,7 +71,7 @@ class Furnace extends Tile implements InventoryHolder, Container, Nameable{
} }
public function getName(){ public function getName(){
return isset($this->namedtag->CustomName) ? $this->namedtag->CustomName->getValue() : "Chest"; return isset($this->namedtag->CustomName) ? $this->namedtag->CustomName->getValue() : "Furnace";
} }
public function hasName(){ public function hasName(){