From d9e667617612c9121492d9bb5c6a3b142be33623 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 25 Oct 2016 21:21:39 +0100 Subject: [PATCH] Fix wrong flag names --- src/pocketmine/Player.php | 2 +- .../protocol/AdventureSettingsPacket.php | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index f45aa31ed..0a788686f 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -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(); diff --git a/src/pocketmine/network/protocol/AdventureSettingsPacket.php b/src/pocketmine/network/protocol/AdventureSettingsPacket.php index 21f13844a..cc02240bc 100644 --- a/src/pocketmine/network/protocol/AdventureSettingsPacket.php +++ b/src/pocketmine/network/protocol/AdventureSettingsPacket.php @@ -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;