mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Block: added a bunch of state manipulation APIs
This commit is contained in:
@ -48,6 +48,17 @@ class FrostedIce extends Ice{
|
||||
return 0b11;
|
||||
}
|
||||
|
||||
public function getAge() : int{ return $this->age; }
|
||||
|
||||
/** @return $this */
|
||||
public function setAge(int $age) : self{
|
||||
if($age < 0 || $age > 3){
|
||||
throw new \InvalidArgumentException("Age must be in range 0-3");
|
||||
}
|
||||
$this->age = $age;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function onNearbyBlockChange() : void{
|
||||
if(!$this->checkAdjacentBlocks(2)){
|
||||
$this->pos->getWorld()->useBreakOn($this->pos);
|
||||
|
Reference in New Issue
Block a user