27 public function __construct(
28 private ArmorSlot $slot,
32 public function getSlot() : ArmorSlot{
return $this->slot; }
34 public function getDamage() :
int{
return $this->damage; }
36 public static function read(ByteBufferReader $in) :
self{
37 $slot = ArmorSlot::fromPacket(Byte::readUnsigned($in));
38 $damage = LE::readUnsignedShort($in);
46 public function write(ByteBufferWriter $out) :
void{
47 Byte::writeUnsigned($out, $this->slot->value);
48 LE::writeUnsignedShort($out, $this->damage);