mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-23 19:34:15 +00:00
NetworkInventoryAction: additional validity checks
This commit is contained in:
parent
f704061618
commit
4975da2aae
@ -118,6 +118,8 @@ class NetworkInventoryAction{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
throw new \UnexpectedValueException("Unknown inventory action source type $this->sourceType");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->inventorySlot = $packet->getUnsignedVarInt();
|
$this->inventorySlot = $packet->getUnsignedVarInt();
|
||||||
@ -145,6 +147,8 @@ class NetworkInventoryAction{
|
|||||||
case self::SOURCE_TODO:
|
case self::SOURCE_TODO:
|
||||||
$packet->putVarInt($this->windowId);
|
$packet->putVarInt($this->windowId);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
throw new \UnexpectedValueException("Unknown inventory action source type $this->sourceType");
|
||||||
}
|
}
|
||||||
|
|
||||||
$packet->putUnsignedVarInt($this->inventorySlot);
|
$packet->putUnsignedVarInt($this->inventorySlot);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user