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:
Dylan K. Taylor 2021-04-27 19:31:08 +01:00
parent c9cf33b21b
commit ed80490234
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -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 */