13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
23 public const NETWORK_ID = ProtocolInfo::TRIM_DATA_PACKET;
29 private array $trimPatterns;
34 private array $trimMaterials;
43 public static function create(array $trimPatterns, array $trimMaterials) : self{
45 $result->trimPatterns = $trimPatterns;
46 $result->trimMaterials = $trimMaterials;
63 $this->trimPatterns = [];
65 $this->trimPatterns[] = TrimPattern::read($in);
67 $this->trimMaterials = [];
69 $this->trimMaterials[] = TrimMaterial::read($in);
74 $out->putUnsignedVarInt(count($this->trimPatterns));
75 foreach($this->trimPatterns as $trimPattern){
76 $trimPattern->write($out);
79 foreach($this->trimMaterials as $trimMaterial){
80 $trimMaterial->write($out);
85 return $handler->handleTrimData($this);
encodePayload(PacketSerializer $out)
static create(array $trimPatterns, array $trimMaterials)
handle(PacketHandlerInterface $handler)
decodePayload(PacketSerializer $in)
putUnsignedVarInt(int $v)