diff --git a/mods/building/LICENSE.txt b/mods/building/LICENSE.txt new file mode 100644 index 0000000..6f6a256 --- /dev/null +++ b/mods/building/LICENSE.txt @@ -0,0 +1,16 @@ +License for Code +---------------- + +Copyright (C) 2016 cd2 (cdqwertz) + +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) diff --git a/mods/building/init.lua b/mods/building/init.lua new file mode 100644 index 0000000..066cc47 --- /dev/null +++ b/mods/building/init.lua @@ -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) diff --git a/mods/building/init.lua~ b/mods/building/init.lua~ new file mode 100644 index 0000000..066cc47 --- /dev/null +++ b/mods/building/init.lua~ @@ -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) diff --git a/mods/building/schematics/farm.mts b/mods/building/schematics/farm.mts new file mode 100644 index 0000000..454ab09 Binary files /dev/null and b/mods/building/schematics/farm.mts differ diff --git a/mods/building/schematics/house.mts b/mods/building/schematics/house.mts new file mode 100644 index 0000000..42291b7 Binary files /dev/null and b/mods/building/schematics/house.mts differ diff --git a/mods/building/schematics/house_with_garden.mts b/mods/building/schematics/house_with_garden.mts new file mode 100644 index 0000000..db2f222 Binary files /dev/null and b/mods/building/schematics/house_with_garden.mts differ diff --git a/mods/building/schematics/latern.mts b/mods/building/schematics/latern.mts new file mode 100644 index 0000000..78338c5 Binary files /dev/null and b/mods/building/schematics/latern.mts differ diff --git a/mods/building/schematics/road.mts b/mods/building/schematics/road.mts new file mode 100644 index 0000000..31ecdb0 Binary files /dev/null and b/mods/building/schematics/road.mts differ diff --git a/mods/building/schematics/tower.mts b/mods/building/schematics/tower.mts new file mode 100644 index 0000000..3a1410a Binary files /dev/null and b/mods/building/schematics/tower.mts differ diff --git a/mods/building/textures/building_stick.png b/mods/building/textures/building_stick.png new file mode 100644 index 0000000..5ee70a0 Binary files /dev/null and b/mods/building/textures/building_stick.png differ