public function writeNumber($number) { if ($number >= -268435456 && $number <= 268435455 && !is_double($number)) { parent::write(Datatypes::INTEGER_DATATYPE_V3); parent::writeVarInt((int) $number & 0x1fffffff); } else { parent::write(Datatypes::DOUBLE_DATATYPE_V3); parent::writeDouble($number); } }
public function writeNumber($value) { parent::write(0); parent::writeDouble(floatval($value)); }