mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Added more APIs to Skull
setRotation() is conditionally useless, but there's not much we can do about this right now; and exposing it like this is better than having plugins interacting with tiles.
This commit is contained in:
parent
c9cf33b21b
commit
ed80490234
@ -91,6 +91,12 @@ class Skull extends Flowable{
|
||||
return $this->skullType;
|
||||
}
|
||||
|
||||
/** @return $this */
|
||||
public function setSkullType(SkullType $skullType) : self{
|
||||
$this->skullType = $skullType;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFacing() : int{ return $this->facing; }
|
||||
|
||||
/** @return $this */
|
||||
@ -102,6 +108,17 @@ class Skull extends Flowable{
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRotation() : int{ return $this->rotation; }
|
||||
|
||||
/** @return $this */
|
||||
public function setRotation(int $rotation) : self{
|
||||
if($rotation < 0 || $rotation > 15){
|
||||
throw new \InvalidArgumentException("Rotation must be a value between 0 and 15");
|
||||
}
|
||||
$this->rotation = $rotation;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isNoDrops() : bool{ return $this->noDrops; }
|
||||
|
||||
/** @return $this */
|
||||
|
Loading…
x
Reference in New Issue
Block a user