mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Make decoding accessible
This commit is contained in:
parent
55e32424a0
commit
90edb8ebe7
@ -47,13 +47,16 @@ class CraftingDataPacket extends DataPacket{
|
||||
public $entries = [];
|
||||
public $cleanRecipes = false;
|
||||
|
||||
public $decodedEntries = [];
|
||||
|
||||
public function clean(){
|
||||
$this->entries = [];
|
||||
$this->decodedEntries = [];
|
||||
return parent::clean();
|
||||
}
|
||||
|
||||
public function decodePayload(){
|
||||
$entries = [];
|
||||
$this->decodedEntries = [];
|
||||
$recipeCount = $this->getUnsignedVarInt();
|
||||
for($i = 0; $i < $recipeCount; ++$i){
|
||||
$entry = [];
|
||||
@ -105,7 +108,7 @@ class CraftingDataPacket extends DataPacket{
|
||||
default:
|
||||
throw new \UnexpectedValueException("Unhandled recipe type $recipeType!"); //do not continue attempting to decode
|
||||
}
|
||||
$entries[] = $entry;
|
||||
$this->decodedEntries[] = $entry;
|
||||
}
|
||||
$this->getBool(); //cleanRecipes
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user