A handful of minor fixes to various things
parent
c1b829077a
commit
4d77781ce7
|
@ -1334,15 +1334,6 @@ minetest.object_refs
|
||||||
minetest.luaentities
|
minetest.luaentities
|
||||||
^ List of lua entities, indexed by active object id
|
^ List of lua entities, indexed by active object id
|
||||||
|
|
||||||
Deprecated but defined for backwards compatibility:
|
|
||||||
minetest.digprop_constanttime(time)
|
|
||||||
minetest.digprop_stonelike(toughness)
|
|
||||||
minetest.digprop_dirtlike(toughness)
|
|
||||||
minetest.digprop_gravellike(toughness)
|
|
||||||
minetest.digprop_woodlike(toughness)
|
|
||||||
minetest.digprop_leaveslike(toughness)
|
|
||||||
minetest.digprop_glasslike(toughness)
|
|
||||||
|
|
||||||
Class reference
|
Class reference
|
||||||
----------------
|
----------------
|
||||||
NodeMetaRef: Node metadata - reference extra data and functionality stored
|
NodeMetaRef: Node metadata - reference extra data and functionality stored
|
||||||
|
@ -1751,6 +1742,7 @@ Node definition (register_node)
|
||||||
liquid_alternative_source = "", -- Source version of flowing liquid
|
liquid_alternative_source = "", -- Source version of flowing liquid
|
||||||
liquid_viscosity = 0, -- Higher viscosity = slower flow (max. 7)
|
liquid_viscosity = 0, -- Higher viscosity = slower flow (max. 7)
|
||||||
liquid_renewable = true, -- Can new liquid source be created by placing
|
liquid_renewable = true, -- Can new liquid source be created by placing
|
||||||
|
drowning = true, -- Player will drown in these
|
||||||
two or more sources nearly?
|
two or more sources nearly?
|
||||||
light_source = 0, -- Amount of light emitted by node
|
light_source = 0, -- Amount of light emitted by node
|
||||||
damage_per_second = 0, -- If player is inside node, this damage is caused
|
damage_per_second = 0, -- If player is inside node, this damage is caused
|
||||||
|
@ -1950,7 +1942,14 @@ Decoration definition (register_decoration)
|
||||||
^ If schematic is a string, it is the filepath relative to the current working directory of the
|
^ If schematic is a string, it is the filepath relative to the current working directory of the
|
||||||
^ specified Minetest schematic file.
|
^ specified Minetest schematic file.
|
||||||
^ - OR -, could instead be a table containing two fields, size and data:
|
^ - OR -, could instead be a table containing two fields, size and data:
|
||||||
schematic = {size = {x=4, y=6, z=4}, data = { {"cobble", 0, 0}, {"dirt_with_grass", 0, 0}, ...}},
|
schematic = {
|
||||||
|
size = {x=4, y=6, z=4},
|
||||||
|
data = {
|
||||||
|
{name="cobble", param1=0, param2=0},
|
||||||
|
{name="dirt_with_grass", param1=0, param2=0},
|
||||||
|
...
|
||||||
|
}
|
||||||
|
},
|
||||||
^ See 'Schematic specifier' for details.
|
^ See 'Schematic specifier' for details.
|
||||||
flags = "place_center_x, place_center_z",
|
flags = "place_center_x, place_center_z",
|
||||||
^ Flags for schematic decorations. See 'Schematic attributes'.
|
^ Flags for schematic decorations. See 'Schematic attributes'.
|
||||||
|
|
|
@ -47,10 +47,10 @@ BiomeDefManager::BiomeDefManager() {
|
||||||
b->c_filler = b->c_top;
|
b->c_filler = b->c_top;
|
||||||
b->filler_height = MAP_GENERATION_LIMIT;
|
b->filler_height = MAP_GENERATION_LIMIT;
|
||||||
|
|
||||||
b->height_min = -MAP_GENERATION_LIMIT;
|
b->height_min = -MAP_GENERATION_LIMIT;
|
||||||
b->height_max = MAP_GENERATION_LIMIT;
|
b->height_max = MAP_GENERATION_LIMIT;
|
||||||
b->heat_point = 0.0;
|
b->heat_point = 0.0;
|
||||||
b->humidity_point = 0.0;
|
b->humidity_point = 0.0;
|
||||||
|
|
||||||
biomes.push_back(b);
|
biomes.push_back(b);
|
||||||
}
|
}
|
||||||
|
@ -156,8 +156,8 @@ Biome *BiomeDefManager::getBiome(float heat, float humidity, s16 y) {
|
||||||
if (y > b->height_max || y < b->height_min)
|
if (y > b->height_max || y < b->height_min)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
float d_heat = heat - b->heat_point;
|
float d_heat = heat - b->heat_point;
|
||||||
float d_humidity = humidity - b->humidity_point;
|
float d_humidity = humidity - b->humidity_point;
|
||||||
float dist = (d_heat * d_heat) +
|
float dist = (d_heat * d_heat) +
|
||||||
(d_humidity * d_humidity);
|
(d_humidity * d_humidity);
|
||||||
if (dist < dist_min) {
|
if (dist < dist_min) {
|
||||||
|
|
|
@ -311,7 +311,7 @@ void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
generate(mg, &ps, max_y, 0, v3s16(x, y, z));
|
generate(mg, &ps, max_y, v3s16(x, y, z));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -409,8 +409,7 @@ void DecoSimple::resolveNodeNames(INodeDefManager *ndef) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DecoSimple::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y,
|
void DecoSimple::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) {
|
||||||
s16 start_y, v3s16 p) {
|
|
||||||
ManualMapVoxelManipulator *vm = mg->vm;
|
ManualMapVoxelManipulator *vm = mg->vm;
|
||||||
|
|
||||||
u32 vi = vm->m_area.index(p);
|
u32 vi = vm->m_area.index(p);
|
||||||
|
@ -451,7 +450,7 @@ void DecoSimple::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y,
|
||||||
height = MYMIN(height, max_y - p.Y);
|
height = MYMIN(height, max_y - p.Y);
|
||||||
|
|
||||||
v3s16 em = vm->m_area.getExtent();
|
v3s16 em = vm->m_area.getExtent();
|
||||||
for (int i = start_y; i < height; i++) {
|
for (int i = 0; i < height; i++) {
|
||||||
vm->m_area.add_y(em, vi, 1);
|
vm->m_area.add_y(em, vi, 1);
|
||||||
|
|
||||||
content_t c = vm->m_data[vi].getContent();
|
content_t c = vm->m_data[vi].getContent();
|
||||||
|
@ -520,8 +519,7 @@ void DecoSchematic::resolveNodeNames(INodeDefManager *ndef) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DecoSchematic::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y,
|
void DecoSchematic::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) {
|
||||||
s16 start_y, v3s16 p) {
|
|
||||||
ManualMapVoxelManipulator *vm = mg->vm;
|
ManualMapVoxelManipulator *vm = mg->vm;
|
||||||
|
|
||||||
if (flags & DECO_PLACE_CENTER_X)
|
if (flags & DECO_PLACE_CENTER_X)
|
||||||
|
|
|
@ -221,8 +221,7 @@ public:
|
||||||
void placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
|
void placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
|
||||||
void placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
|
void placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
|
||||||
|
|
||||||
virtual void generate(Mapgen *mg, PseudoRandom *pr, s16 max_y,
|
virtual void generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) = 0;
|
||||||
s16 start_y, v3s16 p) = 0;
|
|
||||||
virtual int getHeight() = 0;
|
virtual int getHeight() = 0;
|
||||||
virtual std::string getName() = 0;
|
virtual std::string getName() = 0;
|
||||||
};
|
};
|
||||||
|
@ -243,8 +242,7 @@ public:
|
||||||
~DecoSimple() {}
|
~DecoSimple() {}
|
||||||
|
|
||||||
void resolveNodeNames(INodeDefManager *ndef);
|
void resolveNodeNames(INodeDefManager *ndef);
|
||||||
virtual void generate(Mapgen *mg, PseudoRandom *pr, s16 max_y,
|
virtual void generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p);
|
||||||
s16 start_y, v3s16 p);
|
|
||||||
virtual int getHeight();
|
virtual int getHeight();
|
||||||
virtual std::string getName();
|
virtual std::string getName();
|
||||||
};
|
};
|
||||||
|
@ -264,8 +262,7 @@ public:
|
||||||
~DecoSchematic();
|
~DecoSchematic();
|
||||||
|
|
||||||
void resolveNodeNames(INodeDefManager *ndef);
|
void resolveNodeNames(INodeDefManager *ndef);
|
||||||
virtual void generate(Mapgen *mg, PseudoRandom *pr, s16 max_y,
|
virtual void generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p);
|
||||||
s16 start_y, v3s16 p);
|
|
||||||
virtual int getHeight();
|
virtual int getHeight();
|
||||||
virtual std::string getName();
|
virtual std::string getName();
|
||||||
|
|
||||||
|
|
|
@ -132,8 +132,6 @@ int MapgenV7::getGroundLevelAtPoint(v2s16 p) {
|
||||||
|
|
||||||
y--;
|
y--;
|
||||||
}
|
}
|
||||||
if (iters == 0)
|
|
||||||
printf("iters exhausted at %d %d\n", p.X, p.Y);
|
|
||||||
|
|
||||||
return y + b->top_depth;
|
return y + b->top_depth;
|
||||||
}
|
}
|
||||||
|
@ -442,7 +440,7 @@ void MapgenV7::addTopNodes() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// N.B. It is necessary to search downward since range_heightmap[i]
|
// N.B. It is necessary to search downward since ridge_heightmap[i]
|
||||||
// might not be the actual height, just the lowest part in the chunk
|
// might not be the actual height, just the lowest part in the chunk
|
||||||
// where a ridge had been carved
|
// where a ridge had been carved
|
||||||
u32 i = vm->m_area.index(x, y, z);
|
u32 i = vm->m_area.index(x, y, z);
|
||||||
|
|
|
@ -674,7 +674,7 @@ int ModApiBasic::l_register_ore(lua_State *L)
|
||||||
|
|
||||||
verbosestream << "register_ore: ore '" << ore->ore_name
|
verbosestream << "register_ore: ore '" << ore->ore_name
|
||||||
<< "' registered" << std::endl;
|
<< "' registered" << std::endl;
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// register_decoration({lots of stuff})
|
// register_decoration({lots of stuff})
|
||||||
|
@ -793,7 +793,7 @@ int ModApiBasic::l_register_decoration(lua_State *L)
|
||||||
|
|
||||||
verbosestream << "register_decoration: decoration '" << deco->getName()
|
verbosestream << "register_decoration: decoration '" << deco->getName()
|
||||||
<< "' registered" << std::endl;
|
<< "' registered" << std::endl;
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create_schematic(p1, p2, probability_list, filename)
|
// create_schematic(p1, p2, probability_list, filename)
|
||||||
|
@ -841,7 +841,8 @@ int ModApiBasic::l_create_schematic(lua_State *L)
|
||||||
dschem.applyProbabilities(&probability_list, p1);
|
dschem.applyProbabilities(&probability_list, p1);
|
||||||
|
|
||||||
dschem.saveSchematicFile(ndef);
|
dschem.saveSchematicFile(ndef);
|
||||||
actionstream << "create_schematic: saved schematic file '" << dschem.filename << "'." << std::endl;
|
actionstream << "create_schematic: saved schematic file '"
|
||||||
|
<< dschem.filename << "'." << std::endl;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue