NetworkBinaryStream: simplify read of canPlaceOn and canDestroy lists

This commit is contained in:
Dylan K. Taylor 2018-03-30 11:07:29 +01:00
parent 56328f66a7
commit 49622cc2a5

View File

@ -84,19 +84,13 @@ class NetworkBinaryStream extends BinaryStream{
}
//TODO
$canPlaceOn = $this->getVarInt();
if($canPlaceOn > 0){
for($i = 0; $i < $canPlaceOn; ++$i){
$this->getString();
}
for($i = 0, $canPlaceOn = $this->getVarInt(); $i < $canPlaceOn; ++$i){
$this->getString();
}
//TODO
$canDestroy = $this->getVarInt();
if($canDestroy > 0){
for($i = 0; $i < $canDestroy; ++$i){
$this->getString();
}
for($i = 0, $canDestroy = $this->getVarInt(); $i < $canDestroy; ++$i){
$this->getString();
}
return ItemFactory::get($id, $data, $cnt, $nbt);