mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
refactor: extract method placeBlock and move some code from PlayerController to BlocksController
This commit is contained in:
parent
7c6d620560
commit
4a0bc016ce
5 changed files with 60 additions and 49 deletions
|
|
@ -22,7 +22,7 @@ LevelFrontend::LevelFrontend(LevelController* controller, Assets* assets)
|
|||
BlocksPreview::build(contentCache.get(), assets, level->content),
|
||||
"block-previews"
|
||||
);
|
||||
controller->getPlayerController()->listenBlockInteraction(
|
||||
controller->getBlocksController()->listenBlockInteraction(
|
||||
[=](Player*, glm::ivec3 pos, const Block* def, BlockInteraction type) {
|
||||
auto material = level->content->findBlockMaterial(def->material);
|
||||
if (material == nullptr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue