LAN: a trading screen a guest opens releases the chest it replaces

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-15 20:33:01 +02:00
parent 4718fef2ab
commit 8d6b8b3f03
2 changed files with 6 additions and 1 deletions
@@ -55,6 +55,8 @@ impl Game<'_> {
state.session.update_special_prices();
}
let title = self.merchant_display_name(&state);
// The container the trading screen replaces loses its opener.
self.guest_container_closed(host, conn);
let Some(window) = host.hub.open_merchant_window(conn, title) else {
self.merchant_closed(&mut state);
return;
+4 -1
View File
@@ -837,7 +837,10 @@ impl Game<'_> {
let state = self.world.block(p.pos[0], p.pos[1], p.pos[2]);
let block = &self.res.facts.get(state).name;
let named = self.remote.as_ref().and_then(|r| {
r.builtin.get("minecraft:block")?.name(p.block).map(str::to_owned)
r.builtin
.get("minecraft:block")?
.name(p.block)
.map(str::to_owned)
});
if named.as_deref() == Some(&**block) {
self.block_entity_event(p.pos, i32::from(p.b0), i32::from(p.b1));