mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Removed redundant count parameter from item constructors, added some documentation and tightened safety checks
the count parameter is useless since Item ctor should now only be used for constructing item _types_, not actual items. All item creations for inventories etc, should go through the ItemFactory.
This commit is contained in:
@ -31,7 +31,7 @@ class Fish extends Food{
|
||||
const FISH_CLOWNFISH = 2;
|
||||
const FISH_PUFFERFISH = 3;
|
||||
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
public function __construct(int $meta = 0){
|
||||
$name = "Raw Fish";
|
||||
if($this->meta === self::FISH_SALMON){
|
||||
$name = "Raw Salmon";
|
||||
@ -40,7 +40,7 @@ class Fish extends Food{
|
||||
}elseif($this->meta === self::FISH_PUFFERFISH){
|
||||
$name = "Pufferfish";
|
||||
}
|
||||
parent::__construct(self::RAW_FISH, $meta, $count, $name);
|
||||
parent::__construct(self::RAW_FISH, $meta, $name);
|
||||
}
|
||||
|
||||
public function getFoodRestore() : int{
|
||||
|
Reference in New Issue
Block a user