27    use GetTypeIdFromConstTrait;
 
   29    public const ID = ItemStackRequestActionType::DROP;
 
   31    public function __construct(
 
   34        private bool $randomly
 
   37    public function getCount() : 
int{ 
return $this->count; }
 
   41    public function isRandomly() : 
bool{ 
return $this->randomly; }
 
   43    public static function read(ByteBufferReader $in) : 
self{
 
   44        $count = Byte::readUnsigned($in);
 
   45        $source = ItemStackRequestSlotInfo::read($in);
 
   46        $random = CommonTypes::getBool($in);
 
   47        return new self($count, $source, $random);
 
   50    public function write(ByteBufferWriter $out) : 
void{
 
   51        Byte::writeUnsigned($out, $this->count);
 
   52        $this->source->write($out);
 
   53        CommonTypes::putBool($out, $this->randomly);