mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Fix wrong flag names
This commit is contained in:
parent
bfc77a772a
commit
d9e6676176
@ -1165,7 +1165,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
public function sendSettings(){
|
||||
$pk = new AdventureSettingsPacket();
|
||||
$pk->flags = 0;
|
||||
$pk->worldInmutable = $this->isAdventure();
|
||||
$pk->worldImmutable = $this->isAdventure();
|
||||
$pk->autoJump = $this->autoJump;
|
||||
$pk->allowFlight = $this->allowFlight;
|
||||
$pk->noClip = $this->isSpectator();
|
||||
|
@ -27,10 +27,10 @@ namespace pocketmine\network\protocol;
|
||||
class AdventureSettingsPacket extends DataPacket{
|
||||
const NETWORK_ID = Info::ADVENTURE_SETTINGS_PACKET;
|
||||
|
||||
public $worldInmutable;
|
||||
public $allowPvp;
|
||||
public $allowPvm;
|
||||
public $allowMvp;
|
||||
public $worldImmutable;
|
||||
public $noPvp;
|
||||
public $noPvm;
|
||||
public $noMvp;
|
||||
|
||||
public $autoJump;
|
||||
public $allowFlight;
|
||||
@ -39,7 +39,7 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
|
||||
/*
|
||||
bit mask | flag name
|
||||
0x00000001 world_inmutable
|
||||
0x00000001 world_immutable
|
||||
0x00000002 no_pvp
|
||||
0x00000004 no_pvm
|
||||
0x00000008 no_mvp
|
||||
@ -58,10 +58,10 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
$this->flags = $this->getUnsignedVarInt();
|
||||
$this->userPermission = $this->getUnsignedVarInt();
|
||||
|
||||
$this->worldInmutable = (bool) ($this->flags & 1);
|
||||
$this->allowPvp = (bool) ($this->flags & (1 << 1));
|
||||
$this->allowPvm = (bool) ($this->flags & (1 << 2));
|
||||
$this->allowMvp = (bool) ($this->flags & (1 << 3));
|
||||
$this->worldImmutable = (bool) ($this->flags & 1);
|
||||
$this->noPvp = (bool) ($this->flags & (1 << 1));
|
||||
$this->noPvm = (bool) ($this->flags & (1 << 2));
|
||||
$this->noMvp = (bool) ($this->flags & (1 << 3));
|
||||
|
||||
$this->autoJump = (bool) ($this->flags & (1 << 5));
|
||||
$this->allowFlight = (bool) ($this->flags & (1 << 6));
|
||||
@ -73,10 +73,10 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
|
||||
$this->flags |= ((int) $this->worldInmutable);
|
||||
$this->flags |= ((int) $this->allowPvp) << 1;
|
||||
$this->flags |= ((int) $this->allowPvm) << 2;
|
||||
$this->flags |= ((int) $this->allowMvp) << 3;
|
||||
$this->flags |= ((int) $this->worldImmutable);
|
||||
$this->flags |= ((int) $this->noPvp) << 1;
|
||||
$this->flags |= ((int) $this->noPvm) << 2;
|
||||
$this->flags |= ((int) $this->noMvp) << 3;
|
||||
|
||||
$this->flags |= ((int) $this->autoJump) << 5;
|
||||
$this->flags |= ((int) $this->allowFlight) << 6;
|
||||
|
Loading…
x
Reference in New Issue
Block a user