mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
Merge remote-tracking branch 'origin/mcpe-0.12' into php7
This commit is contained in:
commit
8768b7fdbd
@ -1680,6 +1680,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
|
||||
$pk = new StartGamePacket();
|
||||
$pk->seed = -1;
|
||||
$pk->dimension = 0;
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
@ -1783,7 +1784,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->setNameTag($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;
|
||||
}
|
||||
|
||||
|
@ -383,10 +383,17 @@ class PlayerInventory extends BaseInventory{
|
||||
}
|
||||
|
||||
$pk = new ContainerSetContentPacket();
|
||||
$pk;
|
||||
$pk->slots = [];
|
||||
for($i = 0; $i < $this->getSize(); ++$i){ //Do not send armor by error here
|
||||
$pk->slots[$i] = $this->getItem($i);
|
||||
$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
|
||||
$pk->slots[$i] = $this->getItem($i);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($target as $player){
|
||||
@ -416,7 +423,6 @@ class PlayerInventory extends BaseInventory{
|
||||
}
|
||||
|
||||
$pk = new ContainerSetSlotPacket();
|
||||
$pk;
|
||||
$pk->slot = $index;
|
||||
$pk->item = clone $this->getItem($index);
|
||||
|
||||
|
@ -26,6 +26,7 @@ use pocketmine\Server;
|
||||
use pocketmine\utils\Utils;
|
||||
use pocketmine\utils\UUID;
|
||||
use pocketmine\utils\VersionString;
|
||||
use pocketmine\utils\UUID;
|
||||
|
||||
class SendUsageTask extends AsyncTask{
|
||||
|
||||
@ -40,9 +41,9 @@ class SendUsageTask extends AsyncTask{
|
||||
$endpoint = "http://" . $server->getProperty("anonymous-statistics.host", "stats.pocketmine.net") . "/";
|
||||
|
||||
$data = [];
|
||||
$data["uniqueServerId"] = $server->getServerUniqueId();
|
||||
$data["uniqueMachineId"] = Utils::getMachineUniqueId();
|
||||
$data["uniqueRequestId"] = UUID::fromData($server->getServerUniqueId(), microtime(true));
|
||||
$data["uniqueServerId"] = $server->getServerUniqueId()->toString();
|
||||
$data["uniqueMachineId"] = Utils::getMachineUniqueId()->toString();
|
||||
$data["uniqueRequestId"] = UUID::fromData($server->getServerUniqueId(), microtime(true))->toString();
|
||||
|
||||
switch($type){
|
||||
case self::TYPE_OPEN:
|
||||
|
@ -29,7 +29,7 @@ class EnchantTable extends Spawnable implements Nameable{
|
||||
|
||||
|
||||
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(){
|
||||
|
@ -71,7 +71,7 @@ class Furnace extends Tile implements InventoryHolder, Container, Nameable{
|
||||
}
|
||||
|
||||
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(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user