implement player ticks in headless mode & prevent on_player_tick call if player chunk does not exists

This commit is contained in:
MihailRis
2024-12-18 23:31:26 +03:00
parent 8e7dfe3e0b
commit 1cd85b6f77
9 changed files with 70 additions and 41 deletions
+3 -4
View File
@@ -31,11 +31,10 @@ class BlocksController {
util::Clock randTickClock;
util::Clock blocksTickClock;
util::Clock worldTickClock;
uint padding;
FastRandom random {};
std::vector<on_block_interaction> blockInteractionCallbacks;
public:
BlocksController(const Level& level, Lighting* lighting, uint padding);
BlocksController(const Level& level, Lighting* lighting);
void updateSides(int x, int y, int z);
void updateSides(int x, int y, int z, int w, int h, int d);
@@ -46,11 +45,11 @@ public:
Player* player, const Block& def, blockstate state, int x, int y, int z
);
void update(float delta);
void update(float delta, uint padding);
void randomTick(
const Chunk& chunk, int segments, const ContentIndices* indices
);
void randomTick(int tickid, int parts);
void randomTick(int tickid, int parts, uint padding);
void onBlocksTick(int tickid, int parts);
int64_t createBlockInventory(int x, int y, int z);
void bindInventory(int64_t invid, int x, int y, int z);