From 832ad0501a7322567be681fbf1d53644d77e2dc0 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 24 Feb 2019 12:19:15 +0000 Subject: [PATCH] Tripwire: added missing flag it's unclear what the purpose of this flag is. It appears to always be set on placement and is never changed at any other time. The result is that the hitbox becomes larger when it is set. --- src/pocketmine/block/Tripwire.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/block/Tripwire.php b/src/pocketmine/block/Tripwire.php index 58c45a065b..23764bb6b1 100644 --- a/src/pocketmine/block/Tripwire.php +++ b/src/pocketmine/block/Tripwire.php @@ -31,16 +31,19 @@ class Tripwire extends Flowable{ /** @var bool */ protected $triggered = false; /** @var bool */ + protected $suspended = false; //unclear usage, makes hitbox bigger if set + /** @var bool */ protected $connected = false; /** @var bool */ protected $disarmed = false; protected function writeStateToMeta() : int{ - return ($this->triggered ? 0x01 : 0) | ($this->connected ? 0x04 : 0) | ($this->disarmed ? 0x08 : 0); + return ($this->triggered ? 0x01 : 0) | ($this->suspended ? 0x02: 0) | ($this->connected ? 0x04 : 0) | ($this->disarmed ? 0x08 : 0); } public function readStateFromData(int $id, int $stateMeta) : void{ $this->triggered = ($stateMeta & 0x01) !== 0; + $this->suspended = ($stateMeta & 0x02) !== 0; $this->connected = ($stateMeta & 0x04) !== 0; $this->disarmed = ($stateMeta & 0x08) !== 0; }