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