Invalid item from Toolbox
NhanAZ opened this issue · 1 comments
NhanAZ commented
PocketMine-MP Crash Dump Fri Jan 27 19:39:06 WIB 2023
PocketMine-MP version: 4.12.12+dev [Protocol 560]
Git commit: b58d7fc82a8aecc45919f6cd15da256c1fe148f8-dirty
PHP version: 8.0.27
OS: WINNT, win
A PLUGIN WAS INVOLVED IN THIS CRASH
BAD PLUGIN: PiggyCustomEnchants
Error: pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper::__construct(): Argument #2 ($itemStack) must be of type pocketmine\network\mcpe\protocol\types\inventory\ItemStack, null given, called in C:\Users\Admin\Downloads\PocketMine-MP\plugins\PiggyCustomEnchants\src\DaPigGuy\PiggyCustomEnchants\EventListener.php on line 77
File: pmsrc/vendor/pocketmine/bedrock-protocol/src/types/inventory/ItemStackWrapper
Line: 20
Type: TypeError
Backtrace:
#0 plugins/PiggyCustomEnchants/src/DaPigGuy/PiggyCustomEnchants/EventListener(77): pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper->__construct(int 0, null)
#1 pmsrc/src/event/RegisteredListener(60): DaPigGuy\PiggyCustomEnchants\EventListener->onDataPacketReceive(object pocketmine\event\server\DataPacketReceiveEvent#150950)
#2 pmsrc/src/event/Event(62): pocketmine\event\RegisteredListener->callEvent(object pocketmine\event\server\DataPacketReceiveEvent#150950)
#3 pmsrc/src/network/mcpe/NetworkSession(449): pocketmine\event\Event->call()
#4 pmsrc/src/network/mcpe/NetworkSession(406): pocketmine\network\mcpe\NetworkSession->handleDataPacket(object pocketmine\network\mcpe\protocol\InventoryTransactionPacket#151571, string[58] .3.............@........................@.................)
#5 pmsrc/src/network/mcpe/raklib/RakLibInterface(189): pocketmine\network\mcpe\NetworkSession->handleEncoded(string[74] ..3f.ede`...........ph+#..2`.*a>..Dm.7p..(.,.}.C....`. .....&&.c, ......h.)
#6 pmsrc/vendor/pocketmine/raklib-ipc/src/RakLibToUserThreadMessageReceiver(42): pocketmine\network\mcpe\raklib\RakLibInterface->onPacketReceive(int 0, string[83] ..(.R.99.cw..............3.......{..61..z.q..!...Mrd.6..a..>z...J.FYm...r...#...)
#7 pmsrc/src/network/mcpe/raklib/RakLibInterface(116): raklib\server\ipc\RakLibToUserThreadMessageReceiver->handle(object pocketmine\network\mcpe\raklib\RakLibInterface#25006)
#8 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\raklib\RakLibInterface->pocketmine\network\mcpe\raklib\{closure}()
#9 pmsrc/src/TimeTrackingSleeperHandler(58): pocketmine\snooze\SleeperHandler->processNotifications()
#10 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(82): pocketmine\TimeTrackingSleeperHandler->processNotifications()
#11 pmsrc/src/Server(1703): pocketmine\snooze\SleeperHandler->sleepUntil(float 1674823146.1774)
#12 pmsrc/src/Server(1061): pocketmine\Server->tickProcessor()
#13 pmsrc/src/PocketMine(339): pocketmine\Server->__construct(object BaseClassLoader#5, object pocketmine\utils\MainLogger#4, string[39] C:\Users\Admin\Downloads\PocketMine-MP\, string[47] C:\Users\Admin\Downloads\PocketMine-MP\plugins\)
#14 pmsrc/src/PocketMine(362): pocketmine\server()
Code:
[11] */
[12]
[13] declare(strict_types=1);
[14]
[15] namespace pocketmine\network\mcpe\protocol\types\inventory;
[16]
[17] use pocketmine\network\mcpe\protocol\serializer\PacketSerializer;
[18]
[19] final class ItemStackWrapper{
[20] public function __construct(
[21] private int $stackId,
[22] private ItemStack $itemStack
[23] ){}
[24]
[25] public static function legacy(ItemStack $itemStack) : self{
[26] return new self($itemStack->getId() === 0 ? 0 : 1, $itemStack);
[27] }
[28]
[29] public function getStackId() : int{ return $this->stackId; }
[30]
Loaded plugins:
DEVirion 1.2.8 by poggit, SOFe for API(s) 4.0.0
DevTools 1.16.1 by PocketMine Team for API(s) 4.0.0
PiggyCustomEnchants 3.0.9 by DaPigGuy for API(s) 4.2.0
NhanAZ commented
This is caused by the ToolBox when the player gives an invalid item to their inventory.