mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
0.11.0 build 5, removed chat format workaround, improved gamemode switch, send allowed creative blocks (TBI as API)
This commit is contained in:
@ -28,6 +28,10 @@ class ContainerSetContentPacket extends DataPacket{
|
||||
public static $pool = [];
|
||||
public static $next = 0;
|
||||
|
||||
const SPECIAL_INVENTORY = 0;
|
||||
const SPECIAL_ARMOR = 0x78;
|
||||
const SPECIAL_CREATIVE = 0x79;
|
||||
|
||||
public $windowid;
|
||||
public $slots = [];
|
||||
public $hotbar = [];
|
||||
@ -48,7 +52,7 @@ class ContainerSetContentPacket extends DataPacket{
|
||||
for($s = 0; $s < $count and !$this->feof(); ++$s){
|
||||
$this->slots[$s] = $this->getSlot();
|
||||
}
|
||||
if($this->windowid === 0){
|
||||
if($this->windowid === self::SPECIAL_INVENTORY){
|
||||
$count = $this->getShort();
|
||||
for($s = 0; $s < $count and !$this->feof(); ++$s){
|
||||
$this->hotbar[$s] = $this->getInt();
|
||||
@ -63,7 +67,7 @@ class ContainerSetContentPacket extends DataPacket{
|
||||
foreach($this->slots as $slot){
|
||||
$this->putSlot($slot);
|
||||
}
|
||||
if($this->windowid === 0 and count($this->hotbar) > 0){
|
||||
if($this->windowid === self::SPECIAL_INVENTORY and count($this->hotbar) > 0){
|
||||
$this->putShort(count($this->hotbar));
|
||||
foreach($this->hotbar as $slot){
|
||||
$this->putInt($slot);
|
||||
|
@ -30,7 +30,7 @@ interface Info{
|
||||
/**
|
||||
* Actual Minecraft: PE protocol version
|
||||
*/
|
||||
const CURRENT_PROTOCOL = 22;
|
||||
const CURRENT_PROTOCOL = 23;
|
||||
|
||||
const LOGIN_PACKET = 0x82;
|
||||
const PLAY_STATUS_PACKET = 0x83;
|
||||
|
Reference in New Issue
Block a user