From 2893e0ef638bc22ad8abebc5df1c03356c202a6d Mon Sep 17 00:00:00 2001 From: cale Date: Sun, 17 Jan 2016 16:07:11 +0100 Subject: [PATCH] added building mod --- mods/building/LICENSE.txt | 16 +++++++++++++ mods/building/init.lua | 22 ++++++++++++++++++ mods/building/init.lua~ | 22 ++++++++++++++++++ mods/building/schematics/farm.mts | Bin 0 -> 157 bytes mods/building/schematics/house.mts | Bin 0 -> 252 bytes .../building/schematics/house_with_garden.mts | Bin 0 -> 342 bytes mods/building/schematics/latern.mts | Bin 0 -> 65 bytes mods/building/schematics/road.mts | Bin 0 -> 47 bytes mods/building/schematics/tower.mts | Bin 0 -> 284 bytes mods/building/textures/building_stick.png | Bin 0 -> 267 bytes 10 files changed, 60 insertions(+) create mode 100644 mods/building/LICENSE.txt create mode 100644 mods/building/init.lua create mode 100644 mods/building/init.lua~ create mode 100644 mods/building/schematics/farm.mts create mode 100644 mods/building/schematics/house.mts create mode 100644 mods/building/schematics/house_with_garden.mts create mode 100644 mods/building/schematics/latern.mts create mode 100644 mods/building/schematics/road.mts create mode 100644 mods/building/schematics/tower.mts create mode 100644 mods/building/textures/building_stick.png 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 0000000000000000000000000000000000000000..454ab097af4f232018a9a06d7d498e1085029d6a GIT binary patch literal 157 zcmeYb3HD`RX5eCAVc_@=1PrVULMf?fiKRIuR>dXxd8tW7naSA<%!!#r3_LK2l+2!7gab?xnhiJ3COb7NOg)n^ x!Q^wq1cfs;DYZ*xx#xcG)%ib(_kTZA7sIt53*>${B!4cv<)z=vIN#V=0RTk}J+A-& literal 0 HcmV?d00001 diff --git a/mods/building/schematics/house.mts b/mods/building/schematics/house.mts new file mode 100644 index 0000000000000000000000000000000000000000..42291b7fedd1fd8c8d827782da3adf88e5ea89a5 GIT binary patch literal 252 zcmeYb3HD`RX5e7pV&M7@2Mp{CLMf?fiKRIuR>dXxd8tW7naSA<%!!#r3_LK2^8EZ1 z23{C1Jtwiam_ZcA1xcpn#TVox=4BT%2qJ`wvXfHtk~0{@U_vEDsfopwi-D>EZfB-Dx#Ce-GNmuXtW8=ya#( OWxS$GI`iyviaG$1Q*X8a literal 0 HcmV?d00001 diff --git a/mods/building/schematics/house_with_garden.mts b/mods/building/schematics/house_with_garden.mts new file mode 100644 index 0000000000000000000000000000000000000000..db2f222e56c7bf9ece0b2a97cba40a92e5e85e2d GIT binary patch literal 342 zcmeYb3HD`RX5eGsWZ?P_0}NaYLMf?fiKRIuR>dXxd8tW7naSA<%!!#r47@Oj^rFP# zVg?=&>Tg+TzuOUubGPc4c!WDtgl6yzl4mBd3dAIVoGsDiDamUW zc0CsiPrWyP^XHA*QrJEReVy?4*5~BZ?K}Uj`@e7f?K5%CYt!7bJf7G7e_gl#vDfpP duVl^N>_4l=(PY4Ivp7zGWuY+N!8Pxu0|05%mb3r> literal 0 HcmV?d00001 diff --git a/mods/building/schematics/latern.mts b/mods/building/schematics/latern.mts new file mode 100644 index 0000000000000000000000000000000000000000..78338c566abcef79b4986f07b494c19bf96fe6af GIT binary patch literal 65 zcmeYb3HD`RW?%&2|Ns9pFfs6^q^2d7=9F0F*e literal 0 HcmV?d00001 diff --git a/mods/building/schematics/tower.mts b/mods/building/schematics/tower.mts new file mode 100644 index 0000000000000000000000000000000000000000..3a1410a7d61ea59ad6dea59736e9bd4d8c227a1d GIT binary patch literal 284 zcmeYb3HD`RW?*9wWnlY{4KT1X2&JT^C6?xtSQVG#=cOhUWhQ4c@W90q^HLa?6Elk# zL}5bZ`S~fSdGQ4~iFw(@47@Pmoc#27V}!<>#M}Y~KDcCJN=j-`#hka38u=O&I9vi( z|NsB^P!FT!+LfD4Yp=gZJM)B#!BC^$_2S;`{x5y~S3a0^`+WY@KmPN=EKJ)k`9IeB zy;HAK>-X*F57grW8+}uRs&6{a<9zM+R=B#Y{CsV()$DWIeEF2m+kLXv-}(Oj<>%+F m7sV~CHIn4{VI3Bex?|C;uKfFP&6dXIq9^N*FfO_B%^U!D%!RW6 literal 0 HcmV?d00001 diff --git a/mods/building/textures/building_stick.png b/mods/building/textures/building_stick.png new file mode 100644 index 0000000000000000000000000000000000000000..5ee70a0599c9e27f112d9db3357982ae2ceaf0ba GIT binary patch literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNqadFOlawy&3!so>iEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8afsr;B5V#p&b(i6Vu)XaCgSebeyYz)pDOtfQ`~l5zX$_{5V{ z+&`aLHMyYn%#n;Z>y?lGi~pN1F{`ua;4M$l|2ubDNJvP|l(;kbwZRqRphc4F8INQf z%VgL%YonAyR~iqq$JL%B2FqCw*(R)(oHym