added building mod
This commit is contained in:
parent
6c81c4ec21
commit
2893e0ef63
16
mods/building/LICENSE.txt
Normal file
16
mods/building/LICENSE.txt
Normal 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
22
mods/building/init.lua
Normal 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
22
mods/building/init.lua~
Normal 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)
|
BIN
mods/building/schematics/farm.mts
Normal file
BIN
mods/building/schematics/farm.mts
Normal file
Binary file not shown.
BIN
mods/building/schematics/house.mts
Normal file
BIN
mods/building/schematics/house.mts
Normal file
Binary file not shown.
BIN
mods/building/schematics/house_with_garden.mts
Normal file
BIN
mods/building/schematics/house_with_garden.mts
Normal file
Binary file not shown.
BIN
mods/building/schematics/latern.mts
Normal file
BIN
mods/building/schematics/latern.mts
Normal file
Binary file not shown.
BIN
mods/building/schematics/road.mts
Normal file
BIN
mods/building/schematics/road.mts
Normal file
Binary file not shown.
BIN
mods/building/schematics/tower.mts
Normal file
BIN
mods/building/schematics/tower.mts
Normal file
Binary file not shown.
BIN
mods/building/textures/building_stick.png
Normal file
BIN
mods/building/textures/building_stick.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 267 B |
Loading…
x
Reference in New Issue
Block a user