From 51d00fef7da09ae99bcd66f260ef37719dbf8878 Mon Sep 17 00:00:00 2001 From: Joey Sacchini Date: Tue, 20 Oct 2020 10:58:24 -0400 Subject: add get_mut to entity metadata --- src/v1_15_2.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/v1_15_2.rs') 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 { -- cgit