diff options
| author | mat <github@matdoes.dev> | 2022-04-26 22:15:07 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-26 22:15:07 -0500 |
| commit | f859dbbba06278f52517b0096b92ff3a6932ee28 (patch) | |
| tree | 66f72298eb041f77afd4cff75e39e41caf91a7b0 /azalea-protocol/src/mc_buf/write.rs | |
| parent | 9c69d7d5f2f704b1de37e1a102bf4390cdd879a5 (diff) | |
| download | azalea-drasl-f859dbbba06278f52517b0096b92ff3a6932ee28.tar.xz | |
update brigadier
Diffstat (limited to 'azalea-protocol/src/mc_buf/write.rs')
| -rwxr-xr-x | azalea-protocol/src/mc_buf/write.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/azalea-protocol/src/mc_buf/write.rs b/azalea-protocol/src/mc_buf/write.rs index 2c46157b..b57ad786 100755 --- a/azalea-protocol/src/mc_buf/write.rs +++ b/azalea-protocol/src/mc_buf/write.rs @@ -42,6 +42,7 @@ pub trait Writable { location: &ResourceLocation, ) -> Result<(), std::io::Error>; fn write_float(&mut self, n: f32) -> Result<(), std::io::Error>; + fn write_double(&mut self, n: f64) -> Result<(), std::io::Error>; } #[async_trait] @@ -152,6 +153,10 @@ impl Writable for Vec<u8> { WriteBytesExt::write_f32::<BigEndian>(self, n) } + fn write_double(&mut self, n: f64) -> Result<(), std::io::Error> { + WriteBytesExt::write_f64::<BigEndian>(self, n) + } + fn write_resource_location( &mut self, location: &ResourceLocation, @@ -291,6 +296,13 @@ impl McBufWritable for f32 { } } +// f64 +impl McBufWritable for f64 { + fn write_into(&self, buf: &mut Vec<u8>) -> Result<(), std::io::Error> { + buf.write_double(*self) + } +} + // GameType impl McBufWritable for GameType { fn write_into(&self, buf: &mut Vec<u8>) -> Result<(), std::io::Error> { |
