menu
#7034435 Call to a member function getInventory() on null

Submitted by PocketMine-MP 4.5.2+dev

General information

Version: 4.5.2+dev
Git commit: e6a3107b
Plugin involvement: Direct
Report date: 2022-06-23 11:46:11 +0000 UTC
Server uptime: 0 days 6 hours 10 minutes 7 seconds

System Information

PHP version: 8.0.19
Operating system: linux
System banner: Linux Hypixtrystore 5.4.0-1083-azure #87~18.04.1-Ubuntu SMP Fri Jun 3 13:19:07 UTC 2022 x86_64

Error information

Warning: the ChestShop plugin was directly involved in this crash. Please contact the plugin author.
Message: Call to a member function getInventory() on null
File: plugins/ChestShop_v3.0.1-PM4.phar/src/ChestShop/EventListener
Line: #65
Error level: Error
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
                if ($buyerMoney < $shopInfo['price']) {
$player->sendMessage("Your money is not enough!");
return;
}
/** @var Chest $chest */
$chest = $player->getWorld()->getTile(new Vector3($shopInfo['chestX'], $shopInfo['chestY'], $shopInfo['chestZ']));
$itemNum = 0;
$pID = $shopInfo['productID'];
$pMeta = $shopInfo['productMeta'];
for ($i = 0; $i < $chest->getInventory()->getSize(); $i++) {
$item = $chest->getInventory()->getItem($i);
// use getDamage() method to get metadata of item
if ($item->getID() === $pID and $item->getMeta() === $pMeta) $itemNum += $item->getCount();
}
if ($itemNum < $shopInfo['saleNum']) {
$player->sendMessage("This shop is out of stock!");
if (($p = $this->plugin->getServer()->getPlayerExact($shopInfo['shopOwner'])) !== null) {
$p->sendMessage("Your ChestShop is out of stock! Replenish Item: " . ItemFactory::getInstance()->get($pID, $pMeta)->getName());
}
return;
#0 pmsrc/src/event/RegisteredListener(60): ChestShop\EventListener->onPlayerInteract(object pocketmine\event\player\PlayerInteractEvent#844853)
#1 pmsrc/src/event/Event(62): pocketmine\event\RegisteredListener->callEvent(object pocketmine\event\player\PlayerInteractEvent#844853)
#2 pmsrc/src/world/World(1861): pocketmine\event\Event->call()
#3 pmsrc/src/player/Player(1683): pocketmine\world\World->useItemOn(object pocketmine\math\Vector3#696904, object pocketmine\item\Shovel#1111145, int 2, object pocketmine\math\Vector3#942591, object ipad54\netherblocks\player\Player#830402, true)
#4 pmsrc/src/network/mcpe/handler/InGamePacketHandler(445): pocketmine\player\Player->interactBlock(object pocketmine\math\Vector3#696904, int 2, object pocketmine\math\Vector3#942591)
#5 pmsrc/src/network/mcpe/handler/InGamePacketHandler(303): pocketmine\network\mcpe\handler\InGamePacketHandler->handleUseItemTransaction(object pocketmine\network\mcpe\protocol\types\inventory\UseItemTransactionData#905878)
#6 pmsrc/vendor/nethergamesmc/bedrock-protocol/src/InventoryTransactionPacket(105): pocketmine\network\mcpe\handler\InGamePacketHandler->handleInventoryTransaction(object pocketmine\network\mcpe\protocol\InventoryTransactionPacket#743408)
#7 pmsrc/src/network/mcpe/NetworkSession(434): pocketmine\network\mcpe\protocol\InventoryTransactionPacket->handle(object pocketmine\network\mcpe\handler\InGamePacketHandler#1177317)
#8 pmsrc/src/network/mcpe/NetworkSession(394): pocketmine\network\mcpe\NetworkSession->handleDataPacket(object pocketmine\network\mcpe\protocol\InventoryTransactionPacket#743408, int 527, string[182] ......A.......P.............DamageP......PiggyCEItemVersion.......display...Name)
#9 pmsrc/src/network/mcpe/raklib/RakLibInterface(192): pocketmine\network\mcpe\NetworkSession->handleEncoded(string[224] c.a...x........#....NF....N..........\.s..S.b..B.........%[email protected])
#10 pmsrc/vendor/pocketmine/raklib-ipc/src/RakLibToUserThreadMessageReceiver(42): pocketmine\network\mcpe\raklib\RakLibInterface->onPacketReceive(int 287, string[225] .c.a...x........#....NF....N..........\.s..S.b..B.........%[email protected])
#11 pmsrc/src/network/mcpe/raklib/RakLibInterface(122): raklib\server\ipc\RakLibToUserThreadMessageReceiver->handle(object pocketmine\network\mcpe\raklib\RakLibInterface#525310)
#12 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\raklib\RakLibInterface->pocketmine\network\mcpe\raklib\{closure}()
#13 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(82): pocketmine\snooze\SleeperHandler->processNotifications()
#14 pmsrc/src/Server(1709): pocketmine\snooze\SleeperHandler->sleepUntil(float 1655984771.8681)
#15 pmsrc/src/Server(1068): pocketmine\Server->tickProcessor()
#16 pmsrc/src/PocketMine(304): pocketmine\Server->__construct(object BaseClassLoader#3, object pocketmine\utils\MainLogger#2, string[11] /root/acid/, string[19] /root/acid/plugins/)
#17 pmsrc/src/PocketMine(327): pocketmine\server()
#18 pmsrc(11): require(string[55] phar:///root/acid/PocketMine-MP.phar/src/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show

Installed PHP Extensions

  • Show