add player names display

This commit is contained in:
MihailRis
2024-11-23 07:41:44 +03:00
parent acc4d2540d
commit 65e5063326
10 changed files with 80 additions and 16 deletions
+2 -2
View File
@@ -351,7 +351,7 @@ static int l_place(lua::State* L) {
"there is no block with index " + std::to_string(id)
);
}
auto player = level->players->getPlayer(playerid);
auto player = level->players->get(playerid);
controller->getBlocksController()->placeBlock(
player, *def, int2blockstate(state), x, y, z
);
@@ -368,7 +368,7 @@ static int l_destruct(lua::State* L) {
return 0;
}
auto& def = level->content->getIndices()->blocks.require(voxel->id);
auto player = level->players->getPlayer(playerid);
auto player = level->players->get(playerid);
controller->getBlocksController()->breakBlock(player, def, x, y, z);
return 0;
}
+1 -1
View File
@@ -13,7 +13,7 @@
using namespace scripting;
inline Player* get_player(lua::State* L, int idx) {
return level->players->getPlayer(lua::tointeger(L, idx));
return level->players->get(lua::tointeger(L, idx));
}
static int l_get_pos(lua::State* L) {