21 public const NETWORK_ID = ProtocolInfo::UNLOCKED_RECIPES_PACKET;
23 public const TYPE_EMPTY = 0;
24 public const TYPE_INITIALLY_UNLOCKED = 1;
25 public const TYPE_NEWLY_UNLOCKED = 2;
26 public const TYPE_REMOVE = 3;
27 public const TYPE_REMOVE_ALL = 4;
31 private array $recipes;
37 public static function create(
int $type, array $recipes) : self{
39 $result->type = $type;
40 $result->recipes = $recipes;
44 public function getType() : int{ return $this->type; }
49 public function getRecipes() : array{ return $this->recipes; }
52 $this->type = $in->getLInt();
55 $this->recipes[] = $in->getString();
60 $out->putLInt($this->type);
62 foreach($this->recipes as $recipe){
63 $out->putString($recipe);
68 return $handler->handleUnlockedRecipes($this);