aboutsummaryrefslogtreecommitdiff
path: root/src/v1_15_2.rs
diff options
context:
space:
mode:
authorJoey Sacchini <joey@sacchini.net>2020-10-20 10:58:24 -0400
committerJoey Sacchini <joey@sacchini.net>2020-10-20 10:58:24 -0400
commit51d00fef7da09ae99bcd66f260ef37719dbf8878 (patch)
tree971d992a1f3a0b9aaafb610455e86434cfb7152e /src/v1_15_2.rs
parent3d9c565fa8a09b010695396082d4875586ad05bc (diff)
downloadmcproto-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.rs10
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 {