Skip to content

Commit cf21cd7

Browse files
authored
fix: remove PluginMessage (#820)
PluginMessage was never consumed anywhere and caused an abort because of this.
1 parent a1bb588 commit cf21cd7

File tree

3 files changed

+1
-41
lines changed

3 files changed

+1
-41
lines changed

crates/hyperion/src/simulation/event.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,6 @@ pub struct ReleaseUseItem {
9191
pub item: ItemKind,
9292
}
9393

94-
pub struct PluginMessage {
95-
pub channel: RuntimeLifetime<&'static str>,
96-
pub data: RuntimeLifetime<&'static [u8]>,
97-
}
98-
99-
impl std::fmt::Debug for PluginMessage {
100-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
101-
let bytes = bytes::Bytes::copy_from_slice(self.data.get());
102-
103-
f.debug_struct("PluginMessage")
104-
.field("channel", self.channel.get())
105-
.field("data", &bytes)
106-
.finish()
107-
}
108-
}
109-
11094
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
11195
#[repr(i32)]
11296
#[expect(missing_docs, reason = "self explanatory")]

crates/hyperion/src/simulation/handlers.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ use super::{
3636
use crate::{
3737
net::{Compose, ConnectionId, decoder::BorrowedPacketFrame},
3838
simulation::{
39-
Pitch, Yaw, aabb,
40-
event::{self, PluginMessage},
39+
Pitch, Yaw, aabb, event,
4140
metadata::{entity::Pose, living_entity::HandStates},
4241
packet::HandlerRegistry,
4342
},
@@ -510,27 +509,6 @@ pub fn creative_inventory_action(
510509
Ok(())
511510
}
512511

513-
pub fn custom_payload<'a>(
514-
packet: &play::CustomPayloadC2s<'a>,
515-
handle: &dyn LifetimeHandle<'a>,
516-
query: &mut PacketSwitchQuery<'_>,
517-
) -> anyhow::Result<()> {
518-
let channel = packet.channel.clone().into_inner();
519-
520-
let Cow::Borrowed(borrow) = channel else {
521-
bail!("NO")
522-
};
523-
524-
let event = PluginMessage {
525-
channel: RuntimeLifetime::new(borrow, handle),
526-
data: RuntimeLifetime::new(packet.data.0.0, handle),
527-
};
528-
529-
query.events.push(event, query.world);
530-
531-
Ok(())
532-
}
533-
534512
// keywords: inventory
535513
fn click_slot(
536514
pkt: &play::ClickSlotC2s<'_>,
@@ -649,7 +627,6 @@ pub fn add_builtin_handlers(registry: &mut HandlerRegistry) {
649627
registry.add_handler(Box::new(client_status));
650628
registry.add_handler(Box::new(chat_command));
651629
registry.add_handler(Box::new(creative_inventory_action));
652-
registry.add_handler(Box::new(custom_payload));
653630
registry.add_handler(Box::new(full));
654631
registry.add_handler(Box::new(hand_swing));
655632
registry.add_handler(Box::new(look_and_on_ground));

crates/hyperion/src/storage/event/queue/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ define_events! {
5353
event::DestroyBlock,
5454
event::ItemDropEvent,
5555
event::PlaceBlock,
56-
event::PluginMessage,
5756
event::PostureUpdate,
5857
event::SwingArm,
5958
event::ToggleDoor,

0 commit comments

Comments
 (0)