|
|
|
@ -245,7 +245,7 @@ void LuaEmergeAreaCallback(v3s16 blockpos, EmergeAction action, void *param)
|
|
|
|
|
|
|
|
|
|
// set_node(pos, node)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_set_node(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_set_node(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -260,7 +260,7 @@ int ModApiEnvMod::l_set_node(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// bulk_set_node([pos1, pos2, ...], node)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_bulk_set_node(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_bulk_set_node(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -290,14 +290,14 @@ int ModApiEnvMod::l_bulk_set_node(lua_State *L)
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ModApiEnvMod::l_add_node(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_add_node(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
return l_set_node(L);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// remove_node(pos)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_remove_node(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_remove_node(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -311,7 +311,7 @@ int ModApiEnvMod::l_remove_node(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// swap_node(pos, node)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_swap_node(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_swap_node(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -326,7 +326,7 @@ int ModApiEnvMod::l_swap_node(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// get_node(pos)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_get_node(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_node(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -341,7 +341,7 @@ int ModApiEnvMod::l_get_node(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// get_node_or_nil(pos)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_get_node_or_nil(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_node_or_nil(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -362,7 +362,7 @@ int ModApiEnvMod::l_get_node_or_nil(lua_State *L)
|
|
|
|
|
// get_node_light(pos, timeofday)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
// timeofday: nil = current time, 0 = night, 0.5 = day
|
|
|
|
|
int ModApiEnvMod::l_get_node_light(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_node_light(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_PLAIN_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -389,7 +389,7 @@ int ModApiEnvMod::l_get_node_light(lua_State *L)
|
|
|
|
|
// get_natural_light(pos, timeofday)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
// timeofday: nil = current time, 0 = night, 0.5 = day
|
|
|
|
|
int ModApiEnvMod::l_get_natural_light(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_natural_light(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -427,7 +427,7 @@ int ModApiEnvMod::l_get_natural_light(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// place_node(pos, node)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_place_node(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_place_node(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -460,7 +460,7 @@ int ModApiEnvMod::l_place_node(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// dig_node(pos)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_dig_node(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_dig_node(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -483,7 +483,7 @@ int ModApiEnvMod::l_dig_node(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// punch_node(pos)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_punch_node(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_punch_node(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -506,7 +506,7 @@ int ModApiEnvMod::l_punch_node(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// get_node_max_level(pos)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_get_node_max_level(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_node_max_level(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_PLAIN_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -518,7 +518,7 @@ int ModApiEnvMod::l_get_node_max_level(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// get_node_level(pos)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_get_node_level(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_node_level(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_PLAIN_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -531,7 +531,7 @@ int ModApiEnvMod::l_get_node_level(lua_State *L)
|
|
|
|
|
// set_node_level(pos, level)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
// level: 0..63
|
|
|
|
|
int ModApiEnvMod::l_set_node_level(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_set_node_level(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -548,7 +548,7 @@ int ModApiEnvMod::l_set_node_level(lua_State *L)
|
|
|
|
|
// add_node_level(pos, level)
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
// level: -127..127
|
|
|
|
|
int ModApiEnvMod::l_add_node_level(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_add_node_level(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -563,7 +563,7 @@ int ModApiEnvMod::l_add_node_level(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// find_nodes_with_meta(pos1, pos2)
|
|
|
|
|
int ModApiEnvMod::l_find_nodes_with_meta(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_find_nodes_with_meta(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_PLAIN_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -580,7 +580,7 @@ int ModApiEnvMod::l_find_nodes_with_meta(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get_meta(pos)
|
|
|
|
|
int ModApiEnvMod::l_get_meta(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_meta(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -591,7 +591,7 @@ int ModApiEnvMod::l_get_meta(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get_node_timer(pos)
|
|
|
|
|
int ModApiEnvMod::l_get_node_timer(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_node_timer(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -603,7 +603,7 @@ int ModApiEnvMod::l_get_node_timer(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// add_entity(pos, entityname, [staticdata]) -> ObjectRef or nil
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_add_entity(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_add_entity(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -626,7 +626,7 @@ int ModApiEnvMod::l_add_entity(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// add_item(pos, itemstack or itemstring or table) -> ObjectRef or nil
|
|
|
|
|
// pos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_add_item(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_add_item(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -655,7 +655,7 @@ int ModApiEnvMod::l_add_item(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get_connected_players()
|
|
|
|
|
int ModApiEnvMod::l_get_connected_players(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_connected_players(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
ServerEnvironment *env = (ServerEnvironment *) getEnv(L);
|
|
|
|
|
if (!env) {
|
|
|
|
@ -680,7 +680,7 @@ int ModApiEnvMod::l_get_connected_players(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get_player_by_name(name)
|
|
|
|
|
int ModApiEnvMod::l_get_player_by_name(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_player_by_name(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -698,7 +698,7 @@ int ModApiEnvMod::l_get_player_by_name(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get_objects_inside_radius(pos, radius)
|
|
|
|
|
int ModApiEnvMod::l_get_objects_inside_radius(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_objects_inside_radius(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
ScriptApiBase *script = getScriptApiBase(L);
|
|
|
|
@ -722,7 +722,7 @@ int ModApiEnvMod::l_get_objects_inside_radius(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get_objects_in_area(pos, minp, maxp)
|
|
|
|
|
int ModApiEnvMod::l_get_objects_in_area(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_objects_in_area(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
ScriptApiBase *script = getScriptApiBase(L);
|
|
|
|
@ -748,7 +748,7 @@ int ModApiEnvMod::l_get_objects_in_area(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// set_timeofday(val)
|
|
|
|
|
// val = 0...1
|
|
|
|
|
int ModApiEnvMod::l_set_timeofday(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_set_timeofday(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -766,7 +766,7 @@ int ModApiEnvMod::l_set_timeofday(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get_timeofday() -> 0...1
|
|
|
|
|
int ModApiEnvMod::l_get_timeofday(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_timeofday(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_PLAIN_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -778,7 +778,7 @@ int ModApiEnvMod::l_get_timeofday(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get_day_count() -> int
|
|
|
|
|
int ModApiEnvMod::l_get_day_count(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_day_count(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_PLAIN_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -787,7 +787,7 @@ int ModApiEnvMod::l_get_day_count(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get_gametime()
|
|
|
|
|
int ModApiEnvMod::l_get_gametime(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_gametime(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -833,7 +833,7 @@ int ModApiEnvBase::findNodeNear(lua_State *L, v3s16 pos, int radius,
|
|
|
|
|
|
|
|
|
|
// find_node_near(pos, radius, nodenames, [search_center]) -> pos or nil
|
|
|
|
|
// nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
|
|
|
|
|
int ModApiEnvMod::l_find_node_near(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_find_node_near(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_PLAIN_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -948,7 +948,7 @@ int ModApiEnvBase::findNodesInArea(lua_State *L, const NodeDefManager *ndef,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// find_nodes_in_area(minp, maxp, nodenames, [grouped])
|
|
|
|
|
int ModApiEnvMod::l_find_nodes_in_area(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_find_nodes_in_area(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_PLAIN_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1006,7 +1006,7 @@ int ModApiEnvBase::findNodesInAreaUnderAir(lua_State *L, v3s16 minp, v3s16 maxp,
|
|
|
|
|
|
|
|
|
|
// find_nodes_in_area_under_air(minp, maxp, nodenames) -> list of positions
|
|
|
|
|
// nodenames: e.g. {"ignore", "group:tree"} or "default:dirt"
|
|
|
|
|
int ModApiEnvMod::l_find_nodes_in_area_under_air(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_find_nodes_in_area_under_air(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
/* TODO: A similar but generalized (and therefore slower) version of this
|
|
|
|
|
* function could be created -- e.g. find_nodes_in_area_under -- which
|
|
|
|
@ -1041,7 +1041,7 @@ int ModApiEnvMod::l_find_nodes_in_area_under_air(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// get_perlin(seeddiff, octaves, persistence, scale)
|
|
|
|
|
// returns world-specific PerlinNoise
|
|
|
|
|
int ModApiEnvMod::l_get_perlin(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_perlin(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR_NO_MAP_LOCK;
|
|
|
|
|
|
|
|
|
@ -1067,7 +1067,7 @@ int ModApiEnvMod::l_get_perlin(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// get_perlin_map(noiseparams, size)
|
|
|
|
|
// returns world-specific PerlinNoiseMap
|
|
|
|
|
int ModApiEnvMod::l_get_perlin_map(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_perlin_map(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR_NO_MAP_LOCK;
|
|
|
|
|
|
|
|
|
@ -1086,7 +1086,7 @@ int ModApiEnvMod::l_get_perlin_map(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// get_voxel_manip()
|
|
|
|
|
// returns voxel manipulator
|
|
|
|
|
int ModApiEnvMod::l_get_voxel_manip(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_get_voxel_manip(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
return LuaVoxelManip::create_object(L);
|
|
|
|
|
}
|
|
|
|
@ -1094,14 +1094,14 @@ int ModApiEnvMod::l_get_voxel_manip(lua_State *L)
|
|
|
|
|
// clear_objects([options])
|
|
|
|
|
// clear all objects in the environment
|
|
|
|
|
// where options = {mode = "full" or "quick"}
|
|
|
|
|
int ModApiEnvMod::l_clear_objects(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_clear_objects(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
|
ClearObjectsMode mode = CLEAR_OBJECTS_MODE_QUICK;
|
|
|
|
|
if (lua_istable(L, 1)) {
|
|
|
|
|
mode = (ClearObjectsMode)getenumfield(L, 1, "mode",
|
|
|
|
|
ModApiEnvMod::es_ClearObjectsMode, mode);
|
|
|
|
|
ModApiEnv::es_ClearObjectsMode, mode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
env->clearObjects(mode);
|
|
|
|
@ -1109,7 +1109,7 @@ int ModApiEnvMod::l_clear_objects(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// line_of_sight(pos1, pos2) -> true/false, pos
|
|
|
|
|
int ModApiEnvMod::l_line_of_sight(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_line_of_sight(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_PLAIN_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1130,7 +1130,7 @@ int ModApiEnvMod::l_line_of_sight(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// fix_light(p1, p2)
|
|
|
|
|
int ModApiEnvMod::l_fix_light(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_fix_light(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1157,14 +1157,14 @@ int ModApiEnvMod::l_fix_light(lua_State *L)
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ModApiEnvMod::l_raycast(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_raycast(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
return LuaRaycast::create_object(L);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// load_area(p1, [p2])
|
|
|
|
|
// load mapblocks in area p1..p2, but do not generate map
|
|
|
|
|
int ModApiEnvMod::l_load_area(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_load_area(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
MAP_LOCK_REQUIRED;
|
|
|
|
@ -1188,7 +1188,7 @@ int ModApiEnvMod::l_load_area(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// emerge_area(p1, p2, [callback, context])
|
|
|
|
|
// emerge mapblocks in area p1..p2, calls callback with context upon completion
|
|
|
|
|
int ModApiEnvMod::l_emerge_area(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_emerge_area(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1234,7 +1234,7 @@ int ModApiEnvMod::l_emerge_area(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// delete_area(p1, p2)
|
|
|
|
|
// delete mapblocks in area p1..p2
|
|
|
|
|
int ModApiEnvMod::l_delete_area(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_delete_area(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1267,7 +1267,7 @@ int ModApiEnvMod::l_delete_area(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// find_path(pos1, pos2, searchdistance,
|
|
|
|
|
// max_jump, max_drop, algorithm) -> table containing path
|
|
|
|
|
int ModApiEnvMod::l_find_path(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_find_path(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1346,7 +1346,7 @@ static bool read_tree_def(lua_State *L, int idx,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// spawn_tree(pos, treedef)
|
|
|
|
|
int ModApiEnvMod::l_spawn_tree(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_spawn_tree(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1373,7 +1373,7 @@ int ModApiEnvMod::l_spawn_tree(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// transforming_liquid_add(pos)
|
|
|
|
|
int ModApiEnvMod::l_transforming_liquid_add(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_transforming_liquid_add(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1384,7 +1384,7 @@ int ModApiEnvMod::l_transforming_liquid_add(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// forceload_block(blockpos)
|
|
|
|
|
// blockpos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_forceload_block(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_forceload_block(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1394,7 +1394,7 @@ int ModApiEnvMod::l_forceload_block(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// compare_block_status(nodepos)
|
|
|
|
|
int ModApiEnvMod::l_compare_block_status(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_compare_block_status(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1413,7 +1413,7 @@ int ModApiEnvMod::l_compare_block_status(lua_State *L)
|
|
|
|
|
|
|
|
|
|
// forceload_free_block(blockpos)
|
|
|
|
|
// blockpos = {x=num, y=num, z=num}
|
|
|
|
|
int ModApiEnvMod::l_forceload_free_block(lua_State *L)
|
|
|
|
|
int ModApiEnv::l_forceload_free_block(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
|
|
|
|
@ -1423,7 +1423,7 @@ int ModApiEnvMod::l_forceload_free_block(lua_State *L)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get_translated_string(lang_code, string)
|
|
|
|
|
int ModApiEnvMod::l_get_translated_string(lua_State * L)
|
|
|
|
|
int ModApiEnv::l_get_translated_string(lua_State * L)
|
|
|
|
|
{
|
|
|
|
|
GET_ENV_PTR;
|
|
|
|
|
std::string lang_code = luaL_checkstring(L, 1);
|
|
|
|
@ -1435,7 +1435,7 @@ int ModApiEnvMod::l_get_translated_string(lua_State * L)
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ModApiEnvMod::Initialize(lua_State *L, int top)
|
|
|
|
|
void ModApiEnv::Initialize(lua_State *L, int top)
|
|
|
|
|
{
|
|
|
|
|
API_FCT(set_node);
|
|
|
|
|
API_FCT(bulk_set_node);
|
|
|
|
@ -1488,7 +1488,7 @@ void ModApiEnvMod::Initialize(lua_State *L, int top)
|
|
|
|
|
API_FCT(get_translated_string);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ModApiEnvMod::InitializeClient(lua_State *L, int top)
|
|
|
|
|
void ModApiEnv::InitializeClient(lua_State *L, int top)
|
|
|
|
|
{
|
|
|
|
|
API_FCT(get_node_light);
|
|
|
|
|
API_FCT(get_timeofday);
|
|
|
|
|