diff --git a/README.txt b/README.txt index a47fb4f..344b014 100644 --- a/README.txt +++ b/README.txt @@ -13,6 +13,10 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU 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. +Textures: +deploy_nodes_blueprint.png - freeware - http://findicons.com/icon/178409/blueprint + + ---------------------------------- Description ---------------------------------- @@ -65,7 +69,7 @@ mauvebic - author of multinode which provided code for spheres and cylinders Echo - author of maze which provided code for spheres neko259 - author of livehouse which inspired building spawning VanessaE - contributed buildings +kddekadenz - contributed buildings ACDC - contributed buildings Nanuk - contributed buildings irksomeduck - contributed buildings -kddekadenz - contributed buildings diff --git a/deploy_building/init.lua b/deploy_building/init.lua index c57cd9e..b6b2e74 100644 --- a/deploy_building/init.lua +++ b/deploy_building/init.lua @@ -148,7 +148,7 @@ minetest.register_craft({ -- blueprint minetest.register_craftitem("deploy_building:blueprint", { description = "Building Blueprint", - inventory_image = "deploy_building_blueprint.png", + inventory_image = "deploy_nodes_blueprint.png^deploy_building_blueprint.png", }) minetest.register_craft({ output = "deploy_building:blueprint", diff --git a/deploy_building/textures/deploy_building_blueprint.png b/deploy_building/textures/deploy_building_blueprint.png index bbf393d..f5c8f6f 100644 Binary files a/deploy_building/textures/deploy_building_blueprint.png and b/deploy_building/textures/deploy_building_blueprint.png differ diff --git a/deploy_building/textures/deploy_building_large.png b/deploy_building/textures/deploy_building_large.png index bbf393d..812bd81 100644 Binary files a/deploy_building/textures/deploy_building_large.png and b/deploy_building/textures/deploy_building_large.png differ diff --git a/deploy_building/textures/deploy_building_medium.png b/deploy_building/textures/deploy_building_medium.png index bbf393d..6f0862c 100644 Binary files a/deploy_building/textures/deploy_building_medium.png and b/deploy_building/textures/deploy_building_medium.png differ diff --git a/deploy_building/textures/deploy_building_small.png b/deploy_building/textures/deploy_building_small.png index bbf393d..f4d1af1 100644 Binary files a/deploy_building/textures/deploy_building_small.png and b/deploy_building/textures/deploy_building_small.png differ diff --git a/deploy_cylinder_y/init.lua b/deploy_cylinder_y/init.lua index dcf1b2c..dbb6c86 100644 --- a/deploy_cylinder_y/init.lua +++ b/deploy_cylinder_y/init.lua @@ -128,7 +128,7 @@ deploy_cylinder_y.register("Glass","glass","default:glass","default_glass.png") -- blueprint minetest.register_craftitem("deploy_cylinder_y:blueprint", { description = "Cylinder Y Blueprint", - inventory_image = "deploy_cylinder_y_blueprint.png", + inventory_image = "deploy_nodes_blueprint.png^deploy_cylinder_y_blueprint.png", }) minetest.register_craft({ output = "deploy_cylinder_y:blueprint", diff --git a/deploy_cylinder_y/textures/deploy_cylinder_y_blueprint.png b/deploy_cylinder_y/textures/deploy_cylinder_y_blueprint.png index bbf393d..873b6f1 100644 Binary files a/deploy_cylinder_y/textures/deploy_cylinder_y_blueprint.png and b/deploy_cylinder_y/textures/deploy_cylinder_y_blueprint.png differ diff --git a/deploy_cylinder_y/textures/deploy_cylinder_y_large.png b/deploy_cylinder_y/textures/deploy_cylinder_y_large.png index bbf393d..9239f0c 100644 Binary files a/deploy_cylinder_y/textures/deploy_cylinder_y_large.png and b/deploy_cylinder_y/textures/deploy_cylinder_y_large.png differ diff --git a/deploy_cylinder_y/textures/deploy_cylinder_y_medium.png b/deploy_cylinder_y/textures/deploy_cylinder_y_medium.png index bbf393d..41f19b2 100644 Binary files a/deploy_cylinder_y/textures/deploy_cylinder_y_medium.png and b/deploy_cylinder_y/textures/deploy_cylinder_y_medium.png differ diff --git a/deploy_cylinder_y/textures/deploy_cylinder_y_small.png b/deploy_cylinder_y/textures/deploy_cylinder_y_small.png index bbf393d..9e25e61 100644 Binary files a/deploy_cylinder_y/textures/deploy_cylinder_y_small.png and b/deploy_cylinder_y/textures/deploy_cylinder_y_small.png differ diff --git a/deploy_maze/init.lua b/deploy_maze/init.lua index b2cd2e4..57a1cd3 100644 --- a/deploy_maze/init.lua +++ b/deploy_maze/init.lua @@ -248,7 +248,7 @@ deploy_maze.deploy = function(originpos, placer, material, size, floors) -- print(braid_pos.x.."/"..braid_pos.y.."/"..braid_pos.l.." "..braid_pos.dx.."/"..braid_pos.dy) x = braid_pos.x + braid_pos.dx * 2 y = braid_pos.y + braid_pos.dy * 2 - if math.random(5) == 1 and x > 0 and x < maze_size_x - 1 and y > 0 and y < maze_size_y - 1 and not maze[braid_pos.l][x][y] then + if math.random(5) == 1 and x > 0 and x < maze_size_x - 1 and y > 0 and y < maze_size_z - 1 and not maze[braid_pos.l][x][y] then -- remove wall if behind is corridor with 20% chance maze[braid_pos.l][braid_pos.x + braid_pos.dx][braid_pos.y + braid_pos.dy] = false -- print("removed "..braid_pos.l.."/"..braid_pos.x + braid_pos.dx.."/"..braid_pos.y + braid_pos.dy) @@ -426,7 +426,7 @@ deploy_maze.register("Glass","glass","default:glass","default_glass.png") -- blueprint minetest.register_craftitem("deploy_maze:blueprint", { description = "Maze Blueprint", - inventory_image = "deploy_maze_blueprint.png", + inventory_image = "deploy_nodes_blueprint.png^deploy_maze_blueprint.png", }) minetest.register_craft({ output = "deploy_maze:blueprint", diff --git a/deploy_maze/textures/deploy_maze_blueprint.png b/deploy_maze/textures/deploy_maze_blueprint.png index bbf393d..d05512e 100644 Binary files a/deploy_maze/textures/deploy_maze_blueprint.png and b/deploy_maze/textures/deploy_maze_blueprint.png differ diff --git a/deploy_maze/textures/deploy_maze_large.png b/deploy_maze/textures/deploy_maze_large.png index bbf393d..255adb4 100644 Binary files a/deploy_maze/textures/deploy_maze_large.png and b/deploy_maze/textures/deploy_maze_large.png differ diff --git a/deploy_maze/textures/deploy_maze_medium.png b/deploy_maze/textures/deploy_maze_medium.png index bbf393d..433a90d 100644 Binary files a/deploy_maze/textures/deploy_maze_medium.png and b/deploy_maze/textures/deploy_maze_medium.png differ diff --git a/deploy_maze/textures/deploy_maze_small.png b/deploy_maze/textures/deploy_maze_small.png index bbf393d..039d769 100644 Binary files a/deploy_maze/textures/deploy_maze_small.png and b/deploy_maze/textures/deploy_maze_small.png differ diff --git a/deploy_nodes/init.lua b/deploy_nodes/init.lua index 3dd37b4..713991c 100644 --- a/deploy_nodes/init.lua +++ b/deploy_nodes/init.lua @@ -14,12 +14,12 @@ MAIN LOADER deploy_nodes = {} -- check for non-air blocks before deploying structure -deploy_nodes.check_for_space = true +deploy_nodes.check_for_space = false -- blueprint minetest.register_craftitem("deploy_nodes:blueprint", { description = "Empty Blueprint", - inventory_image = "deploy_nodes_blueprint.png", + inventory_image = "deploy_nodes_blueprint.png^deploy_nodes_blueprint.png", }) minetest.register_craft({ output = "deploy_nodes:blueprint", diff --git a/deploy_nodes/textures/deploy_nodes_blueprint.png b/deploy_nodes/textures/deploy_nodes_blueprint.png index bbf393d..a526168 100644 Binary files a/deploy_nodes/textures/deploy_nodes_blueprint.png and b/deploy_nodes/textures/deploy_nodes_blueprint.png differ diff --git a/deploy_pyramid/depends.txt b/deploy_pyramid/depends.txt new file mode 100644 index 0000000..95307f3 --- /dev/null +++ b/deploy_pyramid/depends.txt @@ -0,0 +1 @@ +deploy_nodes \ No newline at end of file diff --git a/deploy_pyramid/init.lua b/deploy_pyramid/init.lua new file mode 100644 index 0000000..1c8015d --- /dev/null +++ b/deploy_pyramid/init.lua @@ -0,0 +1,144 @@ +--[[ + +Deploy Nodes for Minetest + +Copyright (c) 2012 cornernote, Brett O'Donnell +Source Code: https://github.com/cornernote/minetest-deploy_nodes +License: GPLv3 + +Shape based on WorldEdit mod by Temperest: http://minetest.net/forum/viewtopic.php?id=2398 + +PYRAMID + +]]-- + + +-- expose api +deploy_pyramid = {} + + +-- deploy +deploy_pyramid.deploy = function(pos,placer,nodename,height) + + -- check for space + if deploy_nodes.check_for_space==true then + for x=-height*0.5,height*0.5 do + for y=0,height do + for z=-height*0.5,height*0.5 do + if x~=0 or y~=0 or z~=0 then + local checkpos = {x=pos.x+x,y=pos.y+y,z=pos.z+z} + local checknode = minetest.env:get_node(checkpos).name + if checknode~="air" then + minetest.chat_send_player(placer:get_player_name(), "[deploy_pyramid] no room to build because "..checknode.." is in the way at "..dump(checkpos).."") + return + end + end + end + end + end + end + + -- remove pyramid node + minetest.env:remove_node(pos) + + -- build the pyramid + local pos1 = {x=pos.x-height, y=pos.y, z=pos.z-height} + local pos2 = {x=pos.x+height, y=pos.y+height, z=pos.z+height} + local np = {x=0, y=pos1.y, z=0} + local node = {name=nodename} + while np.y <= pos2.y do --each vertical level of the pyramid + np.x = pos1.x + while np.x <= pos2.x do + np.z = pos1.z + while np.z <= pos2.z do + minetest.env:add_node({x=np.x-height*0.5,y=np.y,z=np.z-height*0.5}, node) + np.z = np.z + 1 + end + np.x = np.x + 1 + end + np.y = np.y + 1 + pos1.x, pos2.x = pos1.x + 1, pos2.x - 1 + pos1.z, pos2.z = pos1.z + 1, pos2.z - 1 + end + +end + + +-- register +deploy_pyramid.register = function(label,name,material,texture) + + -- small + minetest.register_node("deploy_pyramid:"..name.."_small", { + description = "Small "..label.." Pyramid", + tiles = {texture.."^deploy_pyramid_small.png"}, + groups = {dig_immediate=3}, + after_place_node = function(pos,placer) + deploy_pyramid.deploy(pos,placer,material,3,1,1) + end, + }) + minetest.register_craft({ + output = "deploy_pyramid:"..name.."_small", + recipe = { + {"deploy_pyramid:blueprint", material, material}, + }, + }) + + -- medium + minetest.register_node("deploy_pyramid:"..name.."_medium", { + description = "Medium "..label.." Pyramid", + tiles = {texture.."^deploy_pyramid_medium.png"}, + groups = {dig_immediate=3}, + after_place_node = function(pos,placer) + deploy_pyramid.deploy(pos,placer,material,6,2,2) + end, + }) + minetest.register_craft({ + output = "deploy_pyramid:"..name.."_medium", + recipe = { + {"deploy_pyramid:blueprint", "deploy_pyramid:"..name.."_small", "deploy_pyramid:"..name.."_small"}, + }, + }) + + -- large + minetest.register_node("deploy_pyramid:"..name.."_large", { + description = "Large "..label.." Pyramid", + tiles = {texture.."^deploy_pyramid_large.png"}, + groups = {dig_immediate=3}, + after_place_node = function(pos,placer) + deploy_pyramid.deploy(pos,placer,material,12,4,3) + end, + }) + minetest.register_craft({ + output = "deploy_pyramid:"..name.."_large", + recipe = { + {"deploy_pyramid:blueprint", "deploy_pyramid:"..name.."_medium", "deploy_pyramid:"..name.."_medium"}, + }, + }) + +end + + +-- register pyramids +deploy_pyramid.register("Dirt","dirt","default:dirt","default_dirt.png") +deploy_pyramid.register("Wood","wood","default:wood","default_wood.png") +deploy_pyramid.register("Brick","brick","default:brick","default_brick.png") +deploy_pyramid.register("Cobble","cobble","default:cobble","default_cobble.png") +deploy_pyramid.register("Stone","stone","default:stone","default_stone.png") +deploy_pyramid.register("Glass","glass","default:glass","default_glass.png") + + +-- blueprint +minetest.register_craftitem("deploy_pyramid:blueprint", { + description = "Pyramid Blueprint", + inventory_image = "deploy_nodes_blueprint.png^deploy_pyramid_blueprint.png", +}) +minetest.register_craft({ + output = "deploy_pyramid:blueprint", + recipe = { + {"", "deploy_nodes:blueprint", ""}, + {"deploy_nodes:blueprint", "deploy_nodes:blueprint", "deploy_nodes:blueprint"}, + }, +}) + +-- log that we started +minetest.log("action", "[MOD]"..minetest.get_current_modname().." -- loaded from "..minetest.get_modpath(minetest.get_current_modname())) diff --git a/deploy_pyramid/textures/deploy_pyramid_blueprint.png b/deploy_pyramid/textures/deploy_pyramid_blueprint.png new file mode 100644 index 0000000..83b0682 Binary files /dev/null and b/deploy_pyramid/textures/deploy_pyramid_blueprint.png differ diff --git a/deploy_pyramid/textures/deploy_pyramid_large.png b/deploy_pyramid/textures/deploy_pyramid_large.png new file mode 100644 index 0000000..303447a Binary files /dev/null and b/deploy_pyramid/textures/deploy_pyramid_large.png differ diff --git a/deploy_pyramid/textures/deploy_pyramid_medium.png b/deploy_pyramid/textures/deploy_pyramid_medium.png new file mode 100644 index 0000000..6a4318e Binary files /dev/null and b/deploy_pyramid/textures/deploy_pyramid_medium.png differ diff --git a/deploy_pyramid/textures/deploy_pyramid_small.png b/deploy_pyramid/textures/deploy_pyramid_small.png new file mode 100644 index 0000000..25af199 Binary files /dev/null and b/deploy_pyramid/textures/deploy_pyramid_small.png differ diff --git a/deploy_sphere/init.lua b/deploy_sphere/init.lua index 4f44c45..b08afb8 100644 --- a/deploy_sphere/init.lua +++ b/deploy_sphere/init.lua @@ -129,7 +129,7 @@ deploy_sphere.register("Glass","glass","default:glass","default_glass.png") -- blueprint minetest.register_craftitem("deploy_sphere:blueprint", { description = "Sphere Blueprint", - inventory_image = "deploy_sphere_blueprint.png", + inventory_image = "deploy_nodes_blueprint.png^deploy_sphere_blueprint.png", }) minetest.register_craft({ output = "deploy_sphere:blueprint", diff --git a/deploy_sphere/textures/deploy_sphere_blueprint.png b/deploy_sphere/textures/deploy_sphere_blueprint.png index bbf393d..0020457 100644 Binary files a/deploy_sphere/textures/deploy_sphere_blueprint.png and b/deploy_sphere/textures/deploy_sphere_blueprint.png differ diff --git a/deploy_sphere/textures/deploy_sphere_large.png b/deploy_sphere/textures/deploy_sphere_large.png index bbf393d..5241dcb 100644 Binary files a/deploy_sphere/textures/deploy_sphere_large.png and b/deploy_sphere/textures/deploy_sphere_large.png differ diff --git a/deploy_sphere/textures/deploy_sphere_medium.png b/deploy_sphere/textures/deploy_sphere_medium.png index bbf393d..36832da 100644 Binary files a/deploy_sphere/textures/deploy_sphere_medium.png and b/deploy_sphere/textures/deploy_sphere_medium.png differ diff --git a/deploy_sphere/textures/deploy_sphere_small.png b/deploy_sphere/textures/deploy_sphere_small.png index bbf393d..46d95e9 100644 Binary files a/deploy_sphere/textures/deploy_sphere_small.png and b/deploy_sphere/textures/deploy_sphere_small.png differ diff --git a/deploy_spiral/init.lua b/deploy_spiral/init.lua index 655b322..e6673d6 100644 --- a/deploy_spiral/init.lua +++ b/deploy_spiral/init.lua @@ -176,7 +176,7 @@ deploy_spiral.register("Glass","glass","default:glass","default_glass.png") -- blueprint minetest.register_craftitem("deploy_spiral:blueprint", { description = "Spiral Blueprint", - inventory_image = "deploy_spiral_blueprint.png", + inventory_image = "deploy_nodes_blueprint.png^deploy_spiral_blueprint.png", }) minetest.register_craft({ output = "deploy_spiral:blueprint", diff --git a/deploy_spiral/textures/deploy_spiral_blueprint.png b/deploy_spiral/textures/deploy_spiral_blueprint.png index bbf393d..e13845f 100644 Binary files a/deploy_spiral/textures/deploy_spiral_blueprint.png and b/deploy_spiral/textures/deploy_spiral_blueprint.png differ diff --git a/deploy_spiral/textures/deploy_spiral_large.png b/deploy_spiral/textures/deploy_spiral_large.png index bbf393d..fe93998 100644 Binary files a/deploy_spiral/textures/deploy_spiral_large.png and b/deploy_spiral/textures/deploy_spiral_large.png differ diff --git a/deploy_spiral/textures/deploy_spiral_medium.png b/deploy_spiral/textures/deploy_spiral_medium.png index bbf393d..d1772d3 100644 Binary files a/deploy_spiral/textures/deploy_spiral_medium.png and b/deploy_spiral/textures/deploy_spiral_medium.png differ diff --git a/deploy_spiral/textures/deploy_spiral_small.png b/deploy_spiral/textures/deploy_spiral_small.png index bbf393d..2b747c4 100644 Binary files a/deploy_spiral/textures/deploy_spiral_small.png and b/deploy_spiral/textures/deploy_spiral_small.png differ