Skip to content

Commit 576a2b9

Browse files
committed
cleanup
1 parent 43479e7 commit 576a2b9

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

pomme-client/src/entity/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -815,12 +815,13 @@ impl EntityStore {
815815
entity.is_tame = f & 0x04 != 0;
816816
}
817817
(EntityKind::Wolf, 20, Bool(b)) => entity.is_interested = b,
818-
(EntityKind::Wolf, 21, Int(c)) => entity.collar_color = c as u8 & 0x0F,
818+
(EntityKind::Wolf, 21, Int(c)) | (EntityKind::Cat, 23, Int(c)) => {
819+
entity.collar_color = c as u8 & 0x0F
820+
}
819821
(EntityKind::Cat, 21, Bool(b)) => entity.is_lying = b,
820822
// Vanilla persistent-anger end time (game-time tick).
821823
(EntityKind::Wolf, 22, Long(t)) => entity.anger_end_time = t,
822824
(EntityKind::Cat, 22, Bool(b)) => entity.relax_state_one = b,
823-
(EntityKind::Cat, 23, Int(c)) => entity.collar_color = c as u8 & 0x0F,
824825
_ => {}
825826
}
826827
}
@@ -838,9 +839,6 @@ impl EntityStore {
838839
if let Some(entity) = self.living.get_mut(&id)
839840
&& entity.entity_type == kind
840841
{
841-
// Holder-backed indices (cow/chicken/wolf/cat) are pre-resolved
842-
// by the net handler; the rabbit's raw-int map lives in
843-
// `apply_entity_data`.
844842
entity.variant = raw;
845843
}
846844
}

pomme-client/src/net/handler.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,24 +519,22 @@ pub fn handle_game_packet(
519519
if item.index == 20
520520
&& let azalea_entity::EntityDataValue::CatVariant(variant) = &item.value
521521
{
522-
use azalea_registry::DataRegistry;
523522
let _ = event_tx.try_send(variant_event(
524523
registry_holder,
525524
p.id.0,
526525
EntityKind::Cat,
527-
variant.protocol_id(),
526+
variant,
528527
));
529528
}
530529
// Index 23 on wolves = WolfVariant Holder.
531530
if item.index == 23
532531
&& let azalea_entity::EntityDataValue::WolfVariant(variant) = &item.value
533532
{
534-
use azalea_registry::DataRegistry;
535533
let _ = event_tx.try_send(variant_event(
536534
registry_holder,
537535
p.id.0,
538536
EntityKind::Wolf,
539-
variant.protocol_id(),
537+
variant,
540538
));
541539
}
542540
// Index 19 on villagers / 20 on zombie villagers = VillagerData

0 commit comments

Comments
 (0)