mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Some protocol changes for 1.1.0.0
This commit is contained in:
@ -45,20 +45,7 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
public $noClip = false;
|
||||
public $worldBuilder = false;
|
||||
public $isFlying = false;
|
||||
|
||||
/*
|
||||
bit mask | flag name
|
||||
0x00000001 world_immutable
|
||||
0x00000002 no_pvp
|
||||
0x00000004 no_pvm
|
||||
0x00000008 no_mvp
|
||||
0x00000010 ?
|
||||
0x00000020 auto_jump
|
||||
0x00000040 allow_fly
|
||||
0x00000080 noclip
|
||||
0x00000100 world_builder (seems to allow building even if the world_immutable flag is set (???))
|
||||
0x00000200 is_flying
|
||||
*/
|
||||
public $muted = false;
|
||||
|
||||
public $flags = 0;
|
||||
public $userPermission;
|
||||
@ -77,6 +64,7 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
$this->noClip = (bool) ($this->flags & (1 << 7));
|
||||
$this->worldBuilder = (bool) ($this->flags & (1 << 8));
|
||||
$this->isFlying = (bool) ($this->flags & (1 << 9));
|
||||
$this->muted = (bool) ($this->flags & (1 << 10));
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
@ -92,6 +80,7 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
$this->flags |= ((int) $this->noClip) << 7;
|
||||
$this->flags |= ((int) $this->worldBuilder) << 8;
|
||||
$this->flags |= ((int) $this->isFlying) << 9;
|
||||
$this->flags |= ((int) $this->muted) << 10;
|
||||
|
||||
$this->putUnsignedVarInt($this->flags);
|
||||
$this->putUnsignedVarInt($this->userPermission);
|
||||
|
Reference in New Issue
Block a user