CortexPE / TeaSpoon

☕ A PLUGIN to Extend PMMP's Functionality without completely changing it.
GNU Affero General Public License v3.0
144 stars 100 forks source link

Error with Anvil #393

Closed ghost closed 5 years ago

ghost commented 5 years ago

When i interact with Anvil

Error: Declaration of CortexPE\inventory\AnvilInventory::onClose(CortexPE\inventory\Player $who): void must be compatible with pocketmine\inventory\AnvilInventory::onClose(pocketmine\Player $who): void
File: plugins/TeaSpoon - CortexPE/src/CortexPE/inventory/AnvilInventory
Line: 40
Type: E_COMPILE_ERROR

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: TeaSpoon v1.1.2

Code:
[31]  *
[32]  */
[33] 
[34] declare(strict_types = 1);
[35] 
[36] namespace CortexPE\inventory;
[37] 
[38] use pocketmine\inventory\AnvilInventory as PMAnvilInventory;
[39] 
[40] class AnvilInventory extends PMAnvilInventory {
[41]    public function getDefaultSize(): int{
[42]        return 3;
[43]    }
[44]    
[45]    public function onClose(Player $who): void{
[46]        foreach($this->getContents() as $item){
[47]            foreach($who->getInventory()->addItem($item) as $doesntFit){
[48]                $who->getLevel()->dropItem($this->holder, $doesntFit);
[49]            }
[50]        }