added building mod

This commit is contained in:
cale 2016-01-17 16:07:11 +01:00
parent 6c81c4ec21
commit 2893e0ef63
10 changed files with 60 additions and 0 deletions

16
mods/building/LICENSE.txt Normal file
View File

@ -0,0 +1,16 @@
License for Code
----------------
Copyright (C) 2016 cd2 (cdqwertz) <cdqwertz@gmail.com>
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.
http://www.gnu.org/licenses/lgpl-2.1.html
License for Media
-----------------
CC-BY-SA 3.0 UNPORTED. Created by cd2 (cdqwertz)

22
mods/building/init.lua Normal file
View File

@ -0,0 +1,22 @@
building = {}
function building.register_schematic(name, f)
minetest.register_craftitem("building:".. name, {
description = "Schematic : " .. name,
inventory_image = "building_stick.png",
on_place = function(itemstack, placer, pointed_thing)
if f and pointed_thing.above then
minetest.place_schematic(pointed_thing.above, minetest.get_modpath("building").."/schematics/"..name..".mts", "0", {}, true)
elseif pointed_thing.under then
minetest.place_schematic(pointed_thing.under, minetest.get_modpath("building").."/schematics/"..name..".mts", "0", {}, true)
end
return itemstack
end,
})
end
building.register_schematic("house", true)
building.register_schematic("house_with_garden", true)
building.register_schematic("farm", true)
building.register_schematic("latern", true)
building.register_schematic("tower", false)
building.register_schematic("road", false)

22
mods/building/init.lua~ Normal file
View File

@ -0,0 +1,22 @@
building = {}
function building.register_schematic(name, f)
minetest.register_craftitem("building:".. name, {
description = "Schematic : " .. name,
inventory_image = "building_stick.png",
on_place = function(itemstack, placer, pointed_thing)
if f and pointed_thing.above then
minetest.place_schematic(pointed_thing.above, minetest.get_modpath("building").."/schematics/"..name..".mts", "0", {}, true)
elseif pointed_thing.under then
minetest.place_schematic(pointed_thing.under, minetest.get_modpath("building").."/schematics/"..name..".mts", "0", {}, true)
end
return itemstack
end,
})
end
building.register_schematic("house", true)
building.register_schematic("house_with_garden", true)
building.register_schematic("farm", true)
building.register_schematic("latern", true)
building.register_schematic("tower", false)
building.register_schematic("road", false)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B