PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
Tripwire.php
1<?php
2
3/*
4 *
5 * ____ _ _ __ __ _ __ __ ____
6 * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7 * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8 * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9 * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10 *
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * @author PocketMine Team
17 * @link http://www.pocketmine.net/
18 *
19 *
20 */
21
22declare(strict_types=1);
23
24namespace pocketmine\block;
25
29
30class Tripwire extends Flowable{
31 protected bool $triggered = false;
32 protected bool $suspended = false; //unclear usage, makes hitbox bigger if set
33 protected bool $connected = false;
34 protected bool $disarmed = false;
35
36 protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
37 $w->bool($this->triggered);
38 $w->bool($this->suspended);
39 $w->bool($this->connected);
40 $w->bool($this->disarmed);
41 }
42
43 public function isTriggered() : bool{ return $this->triggered; }
44
46 public function setTriggered(bool $triggered) : self{
47 $this->triggered = $triggered;
48 return $this;
49 }
50
51 public function isSuspended() : bool{ return $this->suspended; }
52
54 public function setSuspended(bool $suspended) : self{
55 $this->suspended = $suspended;
56 return $this;
57 }
58
59 public function isConnected() : bool{ return $this->connected; }
60
62 public function setConnected(bool $connected) : self{
63 $this->connected = $connected;
64 return $this;
65 }
66
67 public function isDisarmed() : bool{ return $this->disarmed; }
68
70 public function setDisarmed(bool $disarmed) : self{
71 $this->disarmed = $disarmed;
72 return $this;
73 }
74
75 public function asItem() : Item{
76 return VanillaItems::STRING();
77 }
78}
setDisarmed(bool $disarmed)
Definition Tripwire.php:70
setTriggered(bool $triggered)
Definition Tripwire.php:46
describeBlockOnlyState(RuntimeDataDescriber $w)
Definition Tripwire.php:36
setSuspended(bool $suspended)
Definition Tripwire.php:54
setConnected(bool $connected)
Definition Tripwire.php:62