PrintBlockInfo();
}
break;
+ case SDLK_l:
+ if (event.state == SDL_PRESSED) {
+ PrintLightInfo();
+ }
+ break;
case SDLK_p:
if (event.state == SDL_PRESSED) {
PrintSelectionInfo();
Print(aim_chunk->BlockAt(aim_block));
}
+void Interface::PrintLightInfo() {
+ std::cout
+ << "light level " << world.PlayerChunk().GetLight(world.Player().Position())
+ << " at position " << world.Player().Position()
+ << std::endl;
+}
+
void Interface::PrintSelectionInfo() {
std::cout << std::endl;
Print(selection);
mod_chunk = &world.Next(*aim_chunk, aim_normal);
next_pos -= aim_normal * glm::vec3(Chunk::Extent());
}
- mod_chunk->BlockAt(next_pos) = selection;
+ mod_chunk->SetBlock(next_pos, selection);
mod_chunk->Invalidate();
}
void Interface::RemoveBlock() {
if (!aim_chunk) return;
- aim_chunk->BlockAt(aim_block) = remove;
+ aim_chunk->SetBlock(aim_block, remove);
aim_chunk->Invalidate();
}