1 #ifndef _SERVER_TERRAIN_H_
2 #define _SERVER_TERRAIN_H_
5 #include "server/server_player.h"
10 CHUNK_CREATED, // chunk exists but was not yet generated
11 CHUNK_GENERATING, // currently generating in a seperate thread
12 CHUNK_READY, // generation finished
16 STAGE_VOID, // initial air, can be overridden by anything
17 STAGE_TERRAIN, // basic terrain, can be overridden by anything except the void
18 STAGE_BOULDERS, // boulders, replace terrain
19 STAGE_TREES, // trees replace boulders
20 STAGE_PLAYER, // player-placed nodes or things placed after terrain generation
29 Blob data; // the big cum
30 TerrainChunkState state; // generation state of the chunk
31 pthread_t gen_thread; // thread that is generating chunk
32 TerrainGenStageBuffer tgsb; // buffer to make sure terraingen only overrides things it should
33 } TerrainChunkMeta; // OMG META VERSE WEB 3.0 VIRTUAL REALITY
35 extern Terrain *server_terrain; // terrain object, data is stored here
37 void server_terrain_init(); // called on server startup
38 void server_terrain_deinit(); // called on server shutdown
39 void server_terrain_requested_chunk(ServerPlayer *player, v3s32 pos); // handle chunk request from client (thread safe)
40 void server_terrain_prepare_spawn(); // prepare spawn region
41 void server_terrain_gen_node(v3s32 pos, TerrainNode node, TerrainGenStage tgs, List *changed_chunks); // set node with terraingen stage
42 s32 server_terrain_spawn_height(); // get the spawn height because idk
44 #endif // _SERVER_TERRAIN_H_