mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
NetworkBinaryStream: bail if finding unexpected trailing data on item extradata
this may help to discover additional bugs and/or missing data on items that we don't know about yet.
This commit is contained in:
parent
3433406cff
commit
6c351357ab
@ -260,6 +260,11 @@ class NetworkBinaryStream extends BinaryStream{
|
||||
if($netId === ItemTypeDictionary::getInstance()->fromStringId("minecraft:shield")){
|
||||
$extraData->getLLong(); //"blocking tick" (ffs mojang)
|
||||
}
|
||||
|
||||
if(!$extraData->feof()){
|
||||
throw new \UnexpectedValueException("Unexpected trailing extradata for network item $netId");
|
||||
}
|
||||
|
||||
if($nbt !== null){
|
||||
if($nbt->hasTag(self::DAMAGE_TAG, IntTag::class)){
|
||||
$meta = $nbt->getInt(self::DAMAGE_TAG);
|
||||
|
Loading…
x
Reference in New Issue
Block a user