aboutsummaryrefslogtreecommitdiff
path: root/stairsplus
Commit message (Collapse)AuthorAge
* Add size information to slab description (by est31).Calinou2015-03-03
|
* Check for ndef before registering Stairs+ nodes.Calinou2015-02-11
|
* More informative and shorter headers.Calinou2015-01-12
|
* Add licensing headers to all files, fix intllib global variable warnings.Calinou2015-01-11
|
* Add support for minetest game pine tree.Olivier Samyn2015-01-06
|
* Add compressed cobblestone, crafted with 9 cobblestone.Calinou2014-12-27
|
* Add some more recipes for slopes.Calinou2014-10-30
|
* Add inner, outer, outer-cut slopes and their half and half-raised ↵Calinou2014-10-29
| | | | variations, with crafting recipes for them. Code cleanup is ongoing.
* Add slopes and their crafting.Calinou2014-10-28
|
* Fix issue #1: “stairsplus_in_creative_inventory not being honored”.Calinou2014-10-19
|
* Make Stairs+ recipes mod-agnostic.Calinou2014-07-28
|
* Code cleanup, new Stairs+ recipes.Calinou2014-07-21
|
* New recipes, code cleanup.Calinou2014-07-03
|
* Code cleanup. Add tar and more stone types.Calinou2014-06-27
|
* Put comment before the line.Calinou2014-05-10
|
* Stairs+ nodes are not in wood and stone groups anymore to not make them ↵Calinou2014-05-10
| | | | usable in crafting.
* Stairs+ nodes let light pass through.Calinou2014-05-04
|
* New recipes for Stairs+ nodes. Allows crafting most useful Stairs+ nodes. ↵Calinou2014-05-04
| | | | More accurate nodes still require the usage of the circular saw.
* Disable desert cobblestone Stairs+ nodes because it doesn't work with ↵Calinou2014-05-04
| | | | minetest_game.
* Added desert cobblestone Stairs+ nodes, circular saw cosmetic changes, ↵Calinou2014-05-03
| | | | remove obsolete code.
* Remove unused stairsplus_convert.lua, code cleanup.Calinou2014-05-02
|
* Compressed textures, glass uses glasslike_framed drawtype, new texture for ↵Calinou2014-04-30
| | | | glow glass, added texture for trap glow glass and trap super glow glass.
* Merge ShadowNinja's rewrite.Calinou2014-03-09
|
* Big update: new stair types, code looks better.Calinou2014-01-20
|
* Rewrite slightly to use the new 6d facedir prediction code in builtin.Vanessa Ezekowitz2013-11-07
| | | | | | | | | | | | | Keeps the old behavior of sneak == force wall (rather than invert). Add protection/ownership checking. Can be phased out later after protection mods start taking advantage of the engine's built-in ownershi-checking functions. Got rid of the /st command, since it didn't work anyway. Minor re-arrangement of init.lua to put the mod's title block at the top where it belongs :-)
* Fix dropsCalinou2013-10-27
|
* Added new aliases for screwdriver and circular saw, new microblocks/panels, ↵Calinou2013-10-27
| | | | circular saw now has 4 rows with 8 items each
* New slab types: 1/16, 1/8, 7/8, 15/16 slabs (suggested by VanessaE), ↵Calinou2013-10-26
| | | | reorganized circular saw
* Allow stair/slab crafting by default, can be disabled in _config.txtCalinou2013-09-15
|
* More BlocksCalinou2013-07-11
='n449' href='#n449'>449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485
/*
Minetest
Copyright (C) 2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/


#include "lua_api/l_vmanip.h"
#include "lua_api/l_internal.h"
#include "common/c_content.h"
#include "common/c_converter.h"
#include "emerge.h"
#include "environment.h"
#include "map.h"
#include "server.h"
#include "mapgen.h"

// garbage collector
int LuaVoxelManip::gc_object(lua_State *L)
{
	LuaVoxelManip *o = *(LuaVoxelManip **)(lua_touserdata(L, 1));
	delete o;

	return 0;
}

int LuaVoxelManip::l_read_from_map(lua_State *L)
{
	MAP_LOCK_REQUIRED;

	LuaVoxelManip *o = checkobject(L, 1);
	MMVManip *vm = o->vm;

	v3s16 bp1 = getNodeBlockPos(check_v3s16(L, 2));
	v3s16 bp2 = getNodeBlockPos(check_v3s16(L, 3));
	sortBoxVerticies(bp1, bp2);

	vm->initialEmerge(bp1, bp2);

	push_v3s16(L, vm->m_area.MinEdge);
	push_v3s16(L, vm->m_area.MaxEdge);

	return 2;
}

int LuaVoxelManip::l_get_data(lua_State *L)
{
	NO_MAP_LOCK_REQUIRED;

	LuaVoxelManip *o = checkobject(L, 1);
	bool use_buffer  = lua_istable(L, 2);

	MMVManip *vm = o->vm;

	u32 volume = vm->m_area.getVolume();

	if (use_buffer)
		lua_pushvalue(L, 2);
	else
		lua_newtable(L);

	for (u32 i = 0; i != volume; i++) {
		lua_Integer cid = vm->m_data[i].getContent();
		lua_pushinteger(L, cid);
		lua_rawseti(L, -2, i + 1);
	}

	return 1;
}

int LuaVoxelManip::l_set_data(lua_State *L)
{
	NO_MAP_LOCK_REQUIRED;

	LuaVoxelManip *o = checkobject(L, 1);
	MMVManip *vm = o->vm;

	if (!lua_istable(L, 2))
		return 0;

	u32 volume = vm->m_area.getVolume();
	for (u32 i = 0; i != volume; i++) {
		lua_rawgeti(L, 2, i + 1);
		content_t c = lua_tointeger(L, -1);

		vm->m_data[i].setContent(c);

		lua_pop(L, 1);
	}

	return 0;
}

int LuaVoxelManip::l_write_to_map(lua_State *L)
{
	MAP_LOCK_REQUIRED;