Skip to content

Commit e28e665

Browse files
committed
feat: add xp gained msg on block breaking
1 parent fe0a8be commit e28e665

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

events/tag/src/module/block.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl Module for BlockModule {
212212
}
213213

214214
// replace with stone
215-
let Ok(previous) = blocks.set_block(event.position, BlockState::STONE) else {
215+
let Ok(..) = blocks.set_block(event.position, BlockState::STONE) else {
216216
return;
217217
};
218218

@@ -223,13 +223,12 @@ impl Module for BlockModule {
223223
**xp = xp.saturating_add(xp_amount);
224224

225225

226-
let previous_kind = previous.to_kind().to_item_kind();
227226
// Create a message about the broken block
228-
let msg = format!("previous {previous:?} → {previous_kind:?}");
227+
let msg = format!("{xp_amount}xp");
229228

230229
let pkt = play::GameMessageS2c {
231230
chat: msg.into_cow_text(),
232-
overlay: false,
231+
overlay: true,
233232
};
234233

235234
// Send the message to the player

0 commit comments

Comments
 (0)