CraftingDataPacket: Fixed uncaught exception in decode

this is not exploitable because it's not a serverbound packet, but it should be fixed nonetheless.
This commit is contained in:
Dylan K. Taylor 2019-05-18 17:19:44 +01:00
parent cd8645ff20
commit b11d3b0401

View File

@ -110,7 +110,11 @@ class CraftingDataPacket extends DataPacket implements ClientboundPacket{
$inputData = -1;
}
}
$entry["input"] = ItemFactory::get($inputId, $inputData);
try{
$entry["input"] = ItemFactory::get($inputId, $inputData);
}catch(\InvalidArgumentException $e){
throw new BadPacketException($e->getMessage(), 0, $e);
}
$entry["output"] = $this->getSlot();
$entry["block"] = $this->getString();