blob: ed26400615d0489ae0a0dce4aa1c853156558017 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
/* start css.sty */
.ecsx-1728{font-size:170%; font-weight: bold;}
.ecsx-1728{ font-weight: bold;}
.ecsx-1728{ font-weight: bold;}
.ecsx-1728{ font-weight: bold;}
.ecsx-1728{ font-weight: bold;}
.ecsx-1200{font-size:120%; font-weight
#include "main.h" // For g_profiler
#include "emerge.h"
//////////////////////// Mapgen Singlenode parameter read/write
bool MapgenSinglenodeParams::readParams(Settings *settings) {
return true;
}
void MapgenSinglenodeParams::writeParams(Settings *settings) {
}
///////////////////////////////////////////////////////////////////////////////
MapgenSinglenode::MapgenSinglenode(int mapgenid, MapgenSinglenodeParams *params) {
}
MapgenSinglenode::~MapgenSinglenode() {
}
//////////////////////// Map generator
void MapgenSinglenode::makeChunk(BlockMakeData *data) {
assert(data->vmanip);
assert(data->nodedef);
assert(data->blockpos_requested.X >= data->blockpos_min.X &&
data->blockpos_requested.Y >= data->blockpos_min.Y &&
data->blockpos_requested.Z >= data->blockpos_min.Z);
assert(data->blockpos_requested.X <= data->blockpos_max.X &&
data->blockpos_requested.Y <= data->blockpos_max.Y &&
data->blockpos_requested.Z <= data->blockpos_max.Z);
this->generating = true;
this->vm = data->vmanip;
this->ndef = data->nodedef;
v3s16 blockpos_min = data->blockpos_min;
v3s16 blockpos_max = data->blockpos_max;
// Area of central chunk
v3s16 node_min = blockpos_min*MAP_BLOCKSIZE;
v3s16 node_max = (blockpos_max+v3s16(1,1,1))*MAP_BLOCKSIZE-v3s16(1,1,1);
content_t c_node = ndef->getId("mapgen_singlenode");
if (c_node == CONTENT_IGNORE)
c_node = CONTENT_AIR;
MapNode n_node(c_node);
for (s16 z = node_min.Z; z <= node_max.Z; z++)
for (s16 y = node_min.Y; y <= node_max.Y; y++) {
u32 i = vm->m_area.index(node_min.X, y, z);
for (s16 x = node_min.X; x <= node_max.X; x++) {
if (vm->m_data[i].getContent() == CONTENT_IGNORE)
vm->m_data[i] = n_node;
i++;
}
}
// Add top and bottom side of water to transforming_liquid queue
updateLiquid(&data->transforming_liquid, node_min, node_max);
// Calculate lighting
calcLighting(node_min, node_max);
this->generating = false;
}
int MapgenSinglenode::getGroundLevelAtPoint(v2s16 p) {
return 0;
}
|