aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets
diff options
context:
space:
mode:
authorUbuntu <github@matdoes.dev>2022-08-31 18:50:59 +0000
committerUbuntu <github@matdoes.dev>2022-08-31 18:50:59 +0000
commitcbc0a13d9b19552976bc7177567cbaab9993127a (patch)
treefc5715569e679002b8ecc5c68a66364b4b7f4049 /azalea-protocol/src/packets
parentefb1f3f2d59af4dc44304d1f23678ac667c5cae2 (diff)
downloadazalea-drasl-cbc0a13d9b19552976bc7177567cbaab9993127a.tar.xz
fix a couple more possible panics
Diffstat (limited to 'azalea-protocol/src/packets')
-rw-r--r--azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs4
1 files changed, 3 insertions, 1 deletions
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 };