mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 00:55:14 +00:00
Typehinted up entity API
Did you guys think ALPHA7 changes were done?! Sone stuff still needs some work, most notably data-properties can't be typed yet because they are just mushed into a couple of methods.
This commit is contained in:
@ -49,7 +49,7 @@ class Squid extends WaterAnimal{
|
||||
parent::initEntity();
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
public function getName() : string{
|
||||
return "Squid";
|
||||
}
|
||||
|
||||
@ -73,12 +73,12 @@ class Squid extends WaterAnimal{
|
||||
}
|
||||
}
|
||||
|
||||
private function generateRandomDirection(){
|
||||
private function generateRandomDirection() : Vector3{
|
||||
return new Vector3(mt_rand(-1000, 1000) / 1000, mt_rand(-500, 500) / 1000, mt_rand(-1000, 1000) / 1000);
|
||||
}
|
||||
|
||||
|
||||
public function onUpdate($currentTick){
|
||||
public function onUpdate(int $currentTick) : bool{
|
||||
if($this->closed !== false){
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user