diff --git a/client/src/store/turtleStore.js b/client/src/store/turtleStore.js index 68265bf..8c04173 100644 --- a/client/src/store/turtleStore.js +++ b/client/src/store/turtleStore.js @@ -134,6 +134,16 @@ export const useTurtleStore = create((set, get) => ({ } })); } + } else if (data.type === 'block_deleted') { + // Remove a block from the world map (turtle moved into it) + if (data.x !== undefined && data.y !== undefined && data.z !== undefined) { + set(state => { + const key = `${data.x},${data.y},${data.z}`; + return { + worldBlocks: state.worldBlocks.filter(b => `${b.x},${b.y},${b.z}` !== key) + }; + }); + } } } catch (error) { console.error('Error processing message:', error);