diff options
author | Joey Sacchini <joey@sacchini.net> | 2020-10-20 10:58:24 -0400 |
---|---|---|
committer | Joey Sacchini <joey@sacchini.net> | 2020-10-20 10:58:24 -0400 |
commit | 51d00fef7da09ae99bcd66f260ef37719dbf8878 (patch) | |
tree | 971d992a1f3a0b9aaafb610455e86434cfb7152e /src/v1_15_2.rs | |
parent | 3d9c565fa8a09b010695396082d4875586ad05bc (diff) | |
download | mcproto-rs-51d00fef7da09ae99bcd66f260ef37719dbf8878.tar.gz mcproto-rs-51d00fef7da09ae99bcd66f260ef37719dbf8878.tar.bz2 mcproto-rs-51d00fef7da09ae99bcd66f260ef37719dbf8878.zip |
add get_mut to entity metadata
Diffstat (limited to 'src/v1_15_2.rs')
-rw-r--r-- | src/v1_15_2.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/v1_15_2.rs b/src/v1_15_2.rs index c3ca3b2..150fbe6 100644 --- a/src/v1_15_2.rs +++ b/src/v1_15_2.rs @@ -3035,6 +3035,16 @@ impl EntityMetadata { None } + + pub fn get_mut(&mut self, index: u8) -> Option<&mut EntityMetadataFieldData> { + for field in &mut self.fields { + if field.index == index { + return Some(&mut field.data); + } + } + + None + } } impl<'a> core::iter::IntoIterator for &'a EntityMetadata { |