mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
* Implemented InventoryEventProcessor, fixes #1986 Event processors can now be registered and unregistered at will. Entity inventory/armor change events are now handled by event processors instead of the inventories themselves, which allows enabling/disabling the calling of these events at will. This now avoids stupid things happening when initializing inventory contents, since the callers for those events are now registered _after_ the contents are initialized.
This commit is contained in:
@ -31,7 +31,7 @@ use pocketmine\network\mcpe\protocol\MobEquipmentPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\ContainerIds;
|
||||
use pocketmine\Player;
|
||||
|
||||
class PlayerInventory extends EntityInventory{
|
||||
class PlayerInventory extends BaseInventory{
|
||||
|
||||
/** @var Human */
|
||||
protected $holder;
|
||||
@ -43,7 +43,8 @@ class PlayerInventory extends EntityInventory{
|
||||
* @param Human $player
|
||||
*/
|
||||
public function __construct(Human $player){
|
||||
parent::__construct($player);
|
||||
$this->holder = $player;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getName() : string{
|
||||
@ -210,5 +211,4 @@ class PlayerInventory extends EntityInventory{
|
||||
public function getHolder(){
|
||||
return $this->holder;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user