From cbc0a13d9b19552976bc7177567cbaab9993127a Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 31 Aug 2022 18:50:59 +0000 Subject: fix a couple more possible panics --- azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'azalea-protocol/src/packets') diff --git a/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs index da1485d0..1b10b221 100644 --- a/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs @@ -209,7 +209,9 @@ impl McBufReadable for Recipe { } else if recipe_type == ResourceLocation::new("minecraft:smithing").unwrap() { RecipeData::Smithing(SmithingRecipe::read_from(buf)?) } else { - panic!("Unknown recipe type sent by server: {}", recipe_type); + return Err(BufReadError::UnexpectedStringEnumVariant { + id: recipe_type.to_string(), + }); }; let recipe = Recipe { identifier, data }; -- cgit v1.2.3