mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Merge remote-tracking branch 'upstream/stable' into stable
This commit is contained in:
@ -157,7 +157,11 @@ class NetworkBinaryStream extends BinaryStream{
|
||||
if($c !== 1){
|
||||
throw new \UnexpectedValueException("Unexpected NBT count $c");
|
||||
}
|
||||
$nbt = (new NetworkLittleEndianNBTStream())->read($this->buffer, false, $this->offset, 512);
|
||||
$decodedNBT = (new NetworkLittleEndianNBTStream())->read($this->buffer, false, $this->offset, 512);
|
||||
if(!($decodedNBT instanceof CompoundTag)){
|
||||
throw new \UnexpectedValueException("Unexpected root tag type for itemstack");
|
||||
}
|
||||
$nbt = $decodedNBT;
|
||||
}elseif($nbtLen !== 0){
|
||||
throw new \UnexpectedValueException("Unexpected fake NBT length $nbtLen");
|
||||
}
|
||||
|
@ -227,6 +227,7 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
$retval->aliases = $enums[$this->getLInt()] ?? null;
|
||||
|
||||
for($overloadIndex = 0, $overloadCount = $this->getUnsignedVarInt(); $overloadIndex < $overloadCount; ++$overloadIndex){
|
||||
$retval->overloads[$overloadIndex] = [];
|
||||
for($paramIndex = 0, $paramCount = $this->getUnsignedVarInt(); $paramIndex < $paramCount; ++$paramIndex){
|
||||
$parameter = new CommandParameter();
|
||||
$parameter->paramName = $this->getString();
|
||||
|
@ -140,7 +140,7 @@ class CraftingDataPacket extends DataPacket{
|
||||
}
|
||||
$this->decodedEntries[] = $entry;
|
||||
}
|
||||
$this->getBool(); //cleanRecipes
|
||||
$this->cleanRecipes = $this->getBool();
|
||||
}
|
||||
|
||||
private static function writeEntry($entry, NetworkBinaryStream $stream, int $pos){
|
||||
|
@ -135,7 +135,7 @@ abstract class DataPacket extends NetworkBinaryStream{
|
||||
abstract public function handle(NetworkSession $session) : bool;
|
||||
|
||||
public function clean(){
|
||||
$this->buffer = null;
|
||||
$this->buffer = "";
|
||||
$this->isEncoded = false;
|
||||
$this->offset = 0;
|
||||
return $this;
|
||||
|
Reference in New Issue
Block a user