diff --git a/mdoors/README.txt b/mdoors/README.txt new file mode 100644 index 0000000..fbeab15 --- /dev/null +++ b/mdoors/README.txt @@ -0,0 +1,50 @@ +Due to the new doors mod I have copied the old code to make mydoors continue to work with the new Minetest Game. +All of the code in mdoors is a modified copy of the doors mod. None of it is my work. +Below is the original licence. + +Minetest Game mod: doors +======================== +version: 1.3 + +License of source code: +----------------------- +Copyright (C) 2012 PilzAdam +modified by BlockMen (added sounds, glassdoors[glass, obsidian glass], trapdoor) + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +and/or modify it under the terms of the Do What The Fuck You Want +To Public License, Version 2, as published by Sam Hocevar. See +http://sam.zoy.org/wtfpl/COPYING for more details. + +License of textures +-------------------------------------- +following Textures created by Fernando Zapata (CC BY-SA 3.0): + door_wood.png + door_wood_a.png + door_wood_a_r.png + door_wood_b.png + door_wood_b_r.png + +following Textures created by BlockMen (WTFPL): + door_trapdoor.png + door_obsidian_glass_side.png + +following textures created by celeron55 (CC BY-SA 3.0): + door_trapdoor_side.png + door_glass_a.png + door_glass_b.png + +following Textures created by PenguinDad (CC BY-SA 4.0): + door_glass.png + door_obsidian_glass.png + +All other textures (created by PilzAdam): WTFPL + + +License of sounds +-------------------------------------- +Opening-Sound created by CGEffex (CC BY 3.0), modified by BlockMen + door_open.ogg +Closing-Sound created by bennstir (CC BY 3.0) + door_close.ogg diff --git a/mdoors/depends.txt b/mdoors/depends.txt new file mode 100644 index 0000000..5e28bee --- /dev/null +++ b/mdoors/depends.txt @@ -0,0 +1,2 @@ +default +screwdriver? diff --git a/mdoors/init.lua b/mdoors/init.lua new file mode 100644 index 0000000..b4795ff --- /dev/null +++ b/mdoors/init.lua @@ -0,0 +1,503 @@ +mdoors = {} + +-- Registers a door +function mdoors.register_door(name, def) + def.groups.not_in_creative_inventory = 1 + + local box = {{-0.5, -0.5, -0.5, 0.5, 0.5, -0.5+1.5/16}} + + if not def.node_box_bottom then + def.node_box_bottom = box + end + if not def.node_box_top then + def.node_box_top = box + end + if not def.selection_box_bottom then + def.selection_box_bottom= box + end + if not def.selection_box_top then + def.selection_box_top = box + end + + if not def.sound_close_door then + def.sound_close_door = "doors_door_close" + end + if not def.sound_open_door then + def.sound_open_door = "doors_door_open" + end + + + minetest.register_craftitem(name, { + description = def.description, + inventory_image = def.inventory_image, + + on_place = function(itemstack, placer, pointed_thing) + if not pointed_thing.type == "node" then + return itemstack + end + + local ptu = pointed_thing.under + local nu = minetest.get_node(ptu) + if minetest.registered_nodes[nu.name].on_rightclick then + return minetest.registered_nodes[nu.name].on_rightclick(ptu, nu, placer, itemstack) + end + + local pt = pointed_thing.above + local pt2 = {x=pt.x, y=pt.y, z=pt.z} + pt2.y = pt2.y+1 + if + not minetest.registered_nodes[minetest.get_node(pt).name].buildable_to or + not minetest.registered_nodes[minetest.get_node(pt2).name].buildable_to or + not placer or + not placer:is_player() + then + return itemstack + end + + if minetest.is_protected(pt, placer:get_player_name()) or + minetest.is_protected(pt2, placer:get_player_name()) then + minetest.record_protection_violation(pt, placer:get_player_name()) + return itemstack + end + + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pt3 = {x=pt.x, y=pt.y, z=pt.z} + if p2 == 0 then + pt3.x = pt3.x-1 + elseif p2 == 1 then + pt3.z = pt3.z+1 + elseif p2 == 2 then + pt3.x = pt3.x+1 + elseif p2 == 3 then + pt3.z = pt3.z-1 + end + if minetest.get_item_group(minetest.get_node(pt3).name, "door") == 0 then + minetest.set_node(pt, {name=name.."_b_1", param2=p2}) + minetest.set_node(pt2, {name=name.."_t_1", param2=p2}) + else + minetest.set_node(pt, {name=name.."_b_2", param2=p2}) + minetest.set_node(pt2, {name=name.."_t_2", param2=p2}) + minetest.get_meta(pt):set_int("right", 1) + minetest.get_meta(pt2):set_int("right", 1) + end + + if def.only_placer_can_open then + local pn = placer:get_player_name() + local meta = minetest.get_meta(pt) + meta:set_string("doors_owner", pn) + meta:set_string("infotext", "Owned by "..pn) + meta = minetest.get_meta(pt2) + meta:set_string("doors_owner", pn) + meta:set_string("infotext", "Owned by "..pn) + end + + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + end, + }) + + local tt = def.tiles_top + local tb = def.tiles_bottom + + local function after_dig_node(pos, name, digger) + local node = minetest.get_node(pos) + if node.name == name then + minetest.node_dig(pos, node, digger) + end + end + + local function check_and_blast(pos, name) + local node = minetest.get_node(pos) + if node.name == name then + minetest.remove_node(pos) + end + end + + local function make_on_blast(base_name, dir, door_type, other_door_type) + if def.only_placer_can_open then + return function() end + else + return function(pos, intensity) + check_and_blast(pos, base_name .. door_type) + pos.y = pos.y + dir + check_and_blast(pos, base_name .. other_door_type) + end + end + end + + local function on_rightclick(pos, dir, check_name, replace, replace_dir, params) + pos.y = pos.y+dir + if minetest.get_node(pos).name ~= check_name then + return + end + local p2 = minetest.get_node(pos).param2 + p2 = params[p2+1] + + minetest.swap_node(pos, {name=replace_dir, param2=p2}) + + pos.y = pos.y-dir + minetest.swap_node(pos, {name=replace, param2=p2}) + + local snd_1 = def.sound_close_door + local snd_2 = def.sound_open_door + if params[1] == 3 then + snd_1 = def.sound_open_door + snd_2 = def.sound_close_door + end + + if minetest.get_meta(pos):get_int("right") ~= 0 then + minetest.sound_play(snd_1, {pos = pos, gain = 0.3, max_hear_distance = 10}) + else + minetest.sound_play(snd_2, {pos = pos, gain = 0.3, max_hear_distance = 10}) + end + end + + local function check_player_priv(pos, player) + if not def.only_placer_can_open then + return true + end + local meta = minetest.get_meta(pos) + local pn = player:get_player_name() + return meta:get_string("doors_owner") == pn + end + + local function on_rotate(pos, node, dir, user, check_name, mode, new_param2) + if not check_player_priv(pos, user) then + return false + end + if mode ~= screwdriver.ROTATE_FACE then + return false + end + + pos.y = pos.y + dir + if not minetest.get_node(pos).name == check_name then + return false + end + if minetest.is_protected(pos, user:get_player_name()) then + minetest.record_protection_violation(pos, user:get_player_name()) + return false + end + + local node2 = minetest.get_node(pos) + node2.param2 = (node2.param2 + 1) % 4 + minetest.swap_node(pos, node2) + + pos.y = pos.y - dir + node.param2 = (node.param2 + 1) % 4 + minetest.swap_node(pos, node) + return true + end + + minetest.register_node(name.."_b_1", { + tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + drop = name, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = def.node_box_bottom + }, + selection_box = { + type = "fixed", + fixed = def.selection_box_bottom + }, + groups = def.groups, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pos.y = pos.y+1 + after_dig_node(pos, name.."_t_1", digger) + end, + + on_rightclick = function(pos, node, clicker) + if check_player_priv(pos, clicker) then + on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0}) + end + end, + + on_rotate = function(pos, node, user, mode, new_param2) + return on_rotate(pos, node, 1, user, name.."_t_1", mode) + end, + + can_dig = check_player_priv, + sounds = def.sounds, + sunlight_propagates = def.sunlight, + on_blast = make_on_blast(name, 1, "_b_1", "_t_1") + }) + + minetest.register_node(name.."_t_1", { + tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + drop = "", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = def.node_box_top + }, + selection_box = { + type = "fixed", + fixed = def.selection_box_top + }, + groups = def.groups, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pos.y = pos.y-1 + after_dig_node(pos, name.."_b_1", digger) + end, + + on_rightclick = function(pos, node, clicker) + if check_player_priv(pos, clicker) then + on_rightclick(pos, -1, name.."_b_1", name.."_t_2", name.."_b_2", {1,2,3,0}) + end + end, + + on_rotate = function(pos, node, user, mode, new_param2) + return on_rotate(pos, node, -1, user, name.."_b_1", mode) + end, + + can_dig = check_player_priv, + sounds = def.sounds, + sunlight_propagates = def.sunlight, + on_blast = make_on_blast(name, -1, "_t_1", "_b_1") + }) + + minetest.register_node(name.."_b_2", { + tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + drop = name, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = def.node_box_bottom + }, + selection_box = { + type = "fixed", + fixed = def.selection_box_bottom + }, + groups = def.groups, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pos.y = pos.y+1 + after_dig_node(pos, name.."_t_2", digger) + end, + + on_rightclick = function(pos, node, clicker) + if check_player_priv(pos, clicker) then + on_rightclick(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2}) + end + end, + + on_rotate = function(pos, node, user, mode, new_param2) + return on_rotate(pos, node, 1, user, name.."_t_2", mode) + end, + + can_dig = check_player_priv, + sounds = def.sounds, + sunlight_propagates = def.sunlight, + on_blast = make_on_blast(name, 1, "_b_2", "_t_2") + }) + + minetest.register_node(name.."_t_2", { + tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + drop = "", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = def.node_box_top + }, + selection_box = { + type = "fixed", + fixed = def.selection_box_top + }, + groups = def.groups, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pos.y = pos.y-1 + after_dig_node(pos, name.."_b_2", digger) + end, + + on_rightclick = function(pos, node, clicker) + if check_player_priv(pos, clicker) then + on_rightclick(pos, -1, name.."_b_2", name.."_t_1", name.."_b_1", {3,0,1,2}) + end + end, + + on_rotate = function(pos, node, user, mode, new_param2) + return on_rotate(pos, node, -1, user, name.."_b_2", mode) + end, + + can_dig = check_player_priv, + sounds = def.sounds, + sunlight_propagates = def.sunlight, + on_blast = make_on_blast(name, -1, "_t_2", "_b_2") + }) + +end +--[[ +doors.register_door("doors:door_wood", { + description = "Wooden Door", + inventory_image = "doors_wood.png", + groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, + tiles_bottom = {"doors_wood_b.png", "doors_brown.png"}, + tiles_top = {"doors_wood_a.png", "doors_brown.png"}, + sounds = default.node_sound_wood_defaults(), + sunlight = false, +}) + +minetest.register_craft({ + output = "doors:door_wood", + recipe = { + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"} + } +}) + +doors.register_door("doors:door_steel", { + description = "Steel Door", + inventory_image = "doors_steel.png", + groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2,door=1}, + tiles_bottom = {"doors_steel_b.png", "doors_grey.png"}, + tiles_top = {"doors_steel_a.png", "doors_grey.png"}, + only_placer_can_open = true, + sounds = default.node_sound_wood_defaults(), + sunlight = false, +}) + +minetest.register_craft({ + output = "doors:door_steel", + recipe = { + {"default:steel_ingot", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot"} + } +}) + +doors.register_door("doors:door_glass", { + description = "Glass Door", + inventory_image = "doors_glass.png", + groups = {snappy=1,cracky=1,oddly_breakable_by_hand=3,door=1}, + tiles_bottom = {"doors_glass_b.png", "doors_glass_side.png"}, + tiles_top = {"doors_glass_a.png", "doors_glass_side.png"}, + sounds = default.node_sound_glass_defaults(), + sunlight = true, +}) + +minetest.register_craft({ + output = "doors:door_glass", + recipe = { + {"default:glass", "default:glass"}, + {"default:glass", "default:glass"}, + {"default:glass", "default:glass"} + } +}) + +doors.register_door("doors:door_obsidian_glass", { + description = "Obsidian Glass Door", + inventory_image = "doors_obsidian_glass.png", + groups = {snappy=1,cracky=1,oddly_breakable_by_hand=3,door=1}, + tiles_bottom = {"doors_obsidian_glass_b.png", "doors_obsidian_glass_side.png"}, + tiles_top = {"doors_obsidian_glass_a.png", "doors_obsidian_glass_side.png"}, + sounds = default.node_sound_glass_defaults(), + sunlight = true, +}) + +minetest.register_craft({ + output = "doors:door_obsidian_glass", + recipe = { + {"default:obsidian_glass", "default:obsidian_glass"}, + {"default:obsidian_glass", "default:obsidian_glass"}, + {"default:obsidian_glass", "default:obsidian_glass"} + } +}) + + +----trapdoor---- + +function doors.register_trapdoor(name, def) + local name_closed = name + local name_opened = name.."_open" + + def.on_rightclick = function (pos, node) + local newname = node.name == name_closed and name_opened or name_closed + local sound = false + if node.name == name_closed then sound = def.sound_open end + if node.name == name_opened then sound = def.sound_close end + if sound then + minetest.sound_play(sound, {pos = pos, gain = 0.3, max_hear_distance = 10}) + end + minetest.set_node(pos, {name = newname, param1 = node.param1, param2 = node.param2}) + end + + def.on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple + + -- Common trapdoor configuration + def.drawtype = "nodebox" + def.paramtype = "light" + def.paramtype2 = "facedir" + def.is_ground_content = false + + local def_opened = table.copy(def) + local def_closed = table.copy(def) + + def_closed.node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} + } + def_closed.selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} + } + def_closed.tiles = { def.tile_front, def.tile_front, def.tile_side, def.tile_side, + def.tile_side, def.tile_side } + + def_opened.node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5} + } + def_opened.selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5} + } + def_opened.tiles = { def.tile_side, def.tile_side, def.tile_side, def.tile_side, + def.tile_front, def.tile_front } + def_opened.drop = name_closed + def_opened.groups.not_in_creative_inventory = 1 + + minetest.register_node(name_opened, def_opened) + minetest.register_node(name_closed, def_closed) +end + + + +doors.register_trapdoor("doors:trapdoor", { + description = "Trapdoor", + inventory_image = "doors_trapdoor.png", + wield_image = "doors_trapdoor.png", + tile_front = "doors_trapdoor.png", + tile_side = "doors_trapdoor_side.png", + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=2, door=1}, + sounds = default.node_sound_wood_defaults(), + sound_open = "doors_door_open", + sound_close = "doors_door_close" +}) + +minetest.register_craft({ + output = 'doors:trapdoor 2', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + {'', '', ''}, + } +}) +--]] diff --git a/modpack.txt b/modpack.txt new file mode 100644 index 0000000..e69de29 diff --git a/my_castle_doors/depends.txt b/my_castle_doors/depends.txt new file mode 100644 index 0000000..bfb8e83 --- /dev/null +++ b/my_castle_doors/depends.txt @@ -0,0 +1,3 @@ +default +mdoors +my_door_wood diff --git a/my_castle_doors/init.lua b/my_castle_doors/init.lua new file mode 100644 index 0000000..d8b799a --- /dev/null +++ b/my_castle_doors/init.lua @@ -0,0 +1,4 @@ +dofile(minetest.get_modpath("my_castle_doors").."/locked.lua") +dofile(minetest.get_modpath("my_castle_doors").."/unlocked.lua") + + diff --git a/my_castle_doors/locked.lua b/my_castle_doors/locked.lua new file mode 100644 index 0000000..443fbb4 --- /dev/null +++ b/my_castle_doors/locked.lua @@ -0,0 +1,145 @@ +local cdoor_list = { --Number , Description , Inven Image , Image + { "1" , "Castle Door 1" , "door1", "door1"}, + { "2" , "Castle Door 2" , "door2" , "door2"}, +-- { "3", "Castle Door 3" , "door3" , "door3"}, +-- { "4", "Castle Door 4" , "door4" , "door4"}, +-- { "5", "Castle Door 5" , "door5" , "door5"}, + { "6", "Castle Door 6" , "door6" , "door6"}, + { "7", "Castle Door 7" , "door7" , "door7"}, + { "8", "Castle Door 8" , "door8" , "door8"}, +-- { "9", "Castle Door 9" , "door9" , "door9"}, +-- { "10", "Castle Door 10" , "door10" , "door10"}, +-- { "11", "Castle Door 11" , "door11" , "door11"}, +-- { "12", "Castle Door 12" , "door12" , "door12"}, +-- { "13", "Castle Door 13" , "door13" , "door13"}, +} + + +for i in ipairs(cdoor_list) do + local num = cdoor_list[i][1] + local desc = cdoor_list[i][2] + local inv = cdoor_list[i][3] + local img = cdoor_list[i][4] + local lock = cdoor_list[i][5] + + +mdoors.register_door("my_castle_doors:door"..num.."_locked", { + description = desc.." Locked", + inventory_image = "mydoors_"..inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mydoors_"..img.."_bottom.png", "mydoors_"..img.."_edge.png"}, + tiles_top = {"mydoors_"..img.."_top.png", "mydoors_"..img.."_edge.png"}, + only_placer_can_open = true, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "my_castle_doors:door1_locked 1", + recipe = { + {"default:steel_ingot", "default:glass", ""}, + {"my_door_wood:wood_dark_grey", "my_door_wood:wood_dark_grey", "default:steel_ingot"}, + {"my_door_wood:wood_dark_grey", "default:steel_ingot", ""} + } +}) + +minetest.register_craft({ + output = "my_castle_doors:door2_locked 1", + recipe = { + {"default:steel_ingot", "default:glass", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", "default:steel_ingot"}, + {"my_door_wood:wood_red", "default:steel_ingot", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door3_locked 1", + recipe = { + {"my_door_wood:wood_yellow", "default:steel_ingot", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", "default:steel_ingot"}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door4_locked 1", + recipe = { + {"my_door_wood:wood_brown", "default:steel_ingot", ""}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", "default:steel_ingot"}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door5_locked 1", + recipe = { + {"my_door_wood:wood_yellow", "default:steel_ingot", ""}, + {"my_door_wood:wood_white", "my_door_wood:wood_yellow", "default:steel_ingot"}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door6_locked 1", + recipe = { + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""}, + {"my_door_wood:wood_grey", "default:steel_ingot", "default:steel_ingot"}, + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door7_locked 1", + recipe = { + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "default:steel_ingot", "default:steel_ingot"}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door8_locked 1", + recipe = { + {"default:steel_ingot", "default:steel_ingot", ""}, + {"my_door_wood:wood_dark_grey", "my_door_wood:wood_dark_grey", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door9_locked 1", + recipe = { + {"default:steel_ingot", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", "default:steel_ingot"}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door10_locked 1", + recipe = { + {"my_door_wood:wood_red", "default:steel_ingot", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", "default:steel_ingot"}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door11_locked 1", + recipe = { + {"my_door_wood:wood_brown", "default:steel_ingot", ""}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", "default:steel_ingot"}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door12_locked 1", + recipe = { + {"my_door_wood:wood_brown", "default:steel_ingot", ""}, + {"my_door_wood:wood_grey", "my_door_wood:wood_brown", "default:steel_ingot"}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door13_locked 1", + recipe = { + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", "default:steel_ingot"}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", "default:steel_ingot"}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", "default:steel_ingot"} + } +}) + + + diff --git a/my_castle_doors/textures/mydoors_brown_wood.png b/my_castle_doors/textures/mydoors_brown_wood.png new file mode 100644 index 0000000..35f5f46 Binary files /dev/null and b/my_castle_doors/textures/mydoors_brown_wood.png differ diff --git a/my_castle_doors/textures/mydoors_clear_wood.png b/my_castle_doors/textures/mydoors_clear_wood.png new file mode 100644 index 0000000..1340f13 Binary files /dev/null and b/my_castle_doors/textures/mydoors_clear_wood.png differ diff --git a/my_castle_doors/textures/mydoors_dark_grey_wood.png b/my_castle_doors/textures/mydoors_dark_grey_wood.png new file mode 100644 index 0000000..918f0e5 Binary files /dev/null and b/my_castle_doors/textures/mydoors_dark_grey_wood.png differ diff --git a/my_castle_doors/textures/mydoors_door10_bottom.png b/my_castle_doors/textures/mydoors_door10_bottom.png new file mode 100644 index 0000000..08b37d8 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door10_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door10_edge.png b/my_castle_doors/textures/mydoors_door10_edge.png new file mode 100644 index 0000000..edc8985 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door10_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door10_inv.png b/my_castle_doors/textures/mydoors_door10_inv.png new file mode 100644 index 0000000..d3093e9 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door10_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door10_top.png b/my_castle_doors/textures/mydoors_door10_top.png new file mode 100644 index 0000000..f6cdeb5 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door10_top.png differ diff --git a/my_castle_doors/textures/mydoors_door11_bottom.png b/my_castle_doors/textures/mydoors_door11_bottom.png new file mode 100644 index 0000000..99c851e Binary files /dev/null and b/my_castle_doors/textures/mydoors_door11_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door11_edge.png b/my_castle_doors/textures/mydoors_door11_edge.png new file mode 100644 index 0000000..d2267e6 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door11_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door11_inv.png b/my_castle_doors/textures/mydoors_door11_inv.png new file mode 100644 index 0000000..cde7030 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door11_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door11_top.png b/my_castle_doors/textures/mydoors_door11_top.png new file mode 100644 index 0000000..7d3b7b3 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door11_top.png differ diff --git a/my_castle_doors/textures/mydoors_door12_bottom.png b/my_castle_doors/textures/mydoors_door12_bottom.png new file mode 100644 index 0000000..6eb09d0 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door12_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door12_edge.png b/my_castle_doors/textures/mydoors_door12_edge.png new file mode 100644 index 0000000..33dc391 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door12_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door12_inv.png b/my_castle_doors/textures/mydoors_door12_inv.png new file mode 100644 index 0000000..11f4957 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door12_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door12_top.png b/my_castle_doors/textures/mydoors_door12_top.png new file mode 100644 index 0000000..fcf9961 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door12_top.png differ diff --git a/my_castle_doors/textures/mydoors_door13_bottom.png b/my_castle_doors/textures/mydoors_door13_bottom.png new file mode 100644 index 0000000..4aabb00 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door13_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door13_edge.png b/my_castle_doors/textures/mydoors_door13_edge.png new file mode 100644 index 0000000..26cbe0b Binary files /dev/null and b/my_castle_doors/textures/mydoors_door13_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door13_inv.png b/my_castle_doors/textures/mydoors_door13_inv.png new file mode 100644 index 0000000..75e1313 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door13_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door13_top.png b/my_castle_doors/textures/mydoors_door13_top.png new file mode 100644 index 0000000..0ca2ff1 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door13_top.png differ diff --git a/my_castle_doors/textures/mydoors_door1_bottom.png b/my_castle_doors/textures/mydoors_door1_bottom.png new file mode 100644 index 0000000..7c4a85d Binary files /dev/null and b/my_castle_doors/textures/mydoors_door1_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door1_edge.png b/my_castle_doors/textures/mydoors_door1_edge.png new file mode 100644 index 0000000..44cabdb Binary files /dev/null and b/my_castle_doors/textures/mydoors_door1_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door1_inv.png b/my_castle_doors/textures/mydoors_door1_inv.png new file mode 100644 index 0000000..cc3efe7 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door1_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door1_top.png b/my_castle_doors/textures/mydoors_door1_top.png new file mode 100644 index 0000000..8e61010 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door1_top.png differ diff --git a/my_castle_doors/textures/mydoors_door2_bottom.png b/my_castle_doors/textures/mydoors_door2_bottom.png new file mode 100644 index 0000000..215fe9e Binary files /dev/null and b/my_castle_doors/textures/mydoors_door2_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door2_edge.png b/my_castle_doors/textures/mydoors_door2_edge.png new file mode 100644 index 0000000..19abe8c Binary files /dev/null and b/my_castle_doors/textures/mydoors_door2_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door2_inv.png b/my_castle_doors/textures/mydoors_door2_inv.png new file mode 100644 index 0000000..ed44bd0 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door2_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door2_top.png b/my_castle_doors/textures/mydoors_door2_top.png new file mode 100644 index 0000000..5699318 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door2_top.png differ diff --git a/my_castle_doors/textures/mydoors_door3_bottom.png b/my_castle_doors/textures/mydoors_door3_bottom.png new file mode 100644 index 0000000..2f3935e Binary files /dev/null and b/my_castle_doors/textures/mydoors_door3_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door3_edge.png b/my_castle_doors/textures/mydoors_door3_edge.png new file mode 100644 index 0000000..cc4bf4b Binary files /dev/null and b/my_castle_doors/textures/mydoors_door3_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door3_inv.png b/my_castle_doors/textures/mydoors_door3_inv.png new file mode 100644 index 0000000..46036dd Binary files /dev/null and b/my_castle_doors/textures/mydoors_door3_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door3_top.png b/my_castle_doors/textures/mydoors_door3_top.png new file mode 100644 index 0000000..37b9d42 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door3_top.png differ diff --git a/my_castle_doors/textures/mydoors_door4_bottom.png b/my_castle_doors/textures/mydoors_door4_bottom.png new file mode 100644 index 0000000..e741e2e Binary files /dev/null and b/my_castle_doors/textures/mydoors_door4_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door4_edge.png b/my_castle_doors/textures/mydoors_door4_edge.png new file mode 100644 index 0000000..96ec83d Binary files /dev/null and b/my_castle_doors/textures/mydoors_door4_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door4_inv.png b/my_castle_doors/textures/mydoors_door4_inv.png new file mode 100644 index 0000000..f10c433 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door4_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door4_top.png b/my_castle_doors/textures/mydoors_door4_top.png new file mode 100644 index 0000000..0084d2e Binary files /dev/null and b/my_castle_doors/textures/mydoors_door4_top.png differ diff --git a/my_castle_doors/textures/mydoors_door5_bottom.png b/my_castle_doors/textures/mydoors_door5_bottom.png new file mode 100644 index 0000000..31e784d Binary files /dev/null and b/my_castle_doors/textures/mydoors_door5_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door5_edge.png b/my_castle_doors/textures/mydoors_door5_edge.png new file mode 100644 index 0000000..6bff038 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door5_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door5_inv.png b/my_castle_doors/textures/mydoors_door5_inv.png new file mode 100644 index 0000000..652ed54 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door5_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door5_top.png b/my_castle_doors/textures/mydoors_door5_top.png new file mode 100644 index 0000000..2f9b02a Binary files /dev/null and b/my_castle_doors/textures/mydoors_door5_top.png differ diff --git a/my_castle_doors/textures/mydoors_door6_bottom.png b/my_castle_doors/textures/mydoors_door6_bottom.png new file mode 100644 index 0000000..1784892 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door6_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door6_edge.png b/my_castle_doors/textures/mydoors_door6_edge.png new file mode 100644 index 0000000..19abe8c Binary files /dev/null and b/my_castle_doors/textures/mydoors_door6_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door6_inv.png b/my_castle_doors/textures/mydoors_door6_inv.png new file mode 100644 index 0000000..bd7eec5 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door6_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door6_top.png b/my_castle_doors/textures/mydoors_door6_top.png new file mode 100644 index 0000000..40e067e Binary files /dev/null and b/my_castle_doors/textures/mydoors_door6_top.png differ diff --git a/my_castle_doors/textures/mydoors_door7_bottom.png b/my_castle_doors/textures/mydoors_door7_bottom.png new file mode 100644 index 0000000..6b1da8e Binary files /dev/null and b/my_castle_doors/textures/mydoors_door7_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door7_edge.png b/my_castle_doors/textures/mydoors_door7_edge.png new file mode 100644 index 0000000..d1a16d6 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door7_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door7_inv.png b/my_castle_doors/textures/mydoors_door7_inv.png new file mode 100644 index 0000000..cbe357c Binary files /dev/null and b/my_castle_doors/textures/mydoors_door7_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door7_top.png b/my_castle_doors/textures/mydoors_door7_top.png new file mode 100644 index 0000000..47ca0b5 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door7_top.png differ diff --git a/my_castle_doors/textures/mydoors_door8_bottom.png b/my_castle_doors/textures/mydoors_door8_bottom.png new file mode 100644 index 0000000..bc5a169 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door8_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door8_edge.png b/my_castle_doors/textures/mydoors_door8_edge.png new file mode 100644 index 0000000..19abe8c Binary files /dev/null and b/my_castle_doors/textures/mydoors_door8_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door8_inv.png b/my_castle_doors/textures/mydoors_door8_inv.png new file mode 100644 index 0000000..fc20618 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door8_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door8_top.png b/my_castle_doors/textures/mydoors_door8_top.png new file mode 100644 index 0000000..51cbee2 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door8_top.png differ diff --git a/my_castle_doors/textures/mydoors_door9_bottom.png b/my_castle_doors/textures/mydoors_door9_bottom.png new file mode 100644 index 0000000..6b4b6ee Binary files /dev/null and b/my_castle_doors/textures/mydoors_door9_bottom.png differ diff --git a/my_castle_doors/textures/mydoors_door9_edge.png b/my_castle_doors/textures/mydoors_door9_edge.png new file mode 100644 index 0000000..26cbe0b Binary files /dev/null and b/my_castle_doors/textures/mydoors_door9_edge.png differ diff --git a/my_castle_doors/textures/mydoors_door9_inv.png b/my_castle_doors/textures/mydoors_door9_inv.png new file mode 100644 index 0000000..3c8401b Binary files /dev/null and b/my_castle_doors/textures/mydoors_door9_inv.png differ diff --git a/my_castle_doors/textures/mydoors_door9_top.png b/my_castle_doors/textures/mydoors_door9_top.png new file mode 100644 index 0000000..be3fcf5 Binary files /dev/null and b/my_castle_doors/textures/mydoors_door9_top.png differ diff --git a/my_castle_doors/textures/mydoors_grey_wood.png b/my_castle_doors/textures/mydoors_grey_wood.png new file mode 100644 index 0000000..9a2572a Binary files /dev/null and b/my_castle_doors/textures/mydoors_grey_wood.png differ diff --git a/my_castle_doors/textures/mydoors_red_wood.png b/my_castle_doors/textures/mydoors_red_wood.png new file mode 100644 index 0000000..33075dd Binary files /dev/null and b/my_castle_doors/textures/mydoors_red_wood.png differ diff --git a/my_castle_doors/textures/mydoors_white_wood.png b/my_castle_doors/textures/mydoors_white_wood.png new file mode 100644 index 0000000..7b3d376 Binary files /dev/null and b/my_castle_doors/textures/mydoors_white_wood.png differ diff --git a/my_castle_doors/unlocked.lua b/my_castle_doors/unlocked.lua new file mode 100644 index 0000000..85ceb24 --- /dev/null +++ b/my_castle_doors/unlocked.lua @@ -0,0 +1,144 @@ +local cdoor_list = { --Number , Description , Inven Image , Image +-- { "1" , "Castle Door 1" , "door1", "door1"}, +-- { "2" , "Castle Door 2" , "door2" , "door2"}, + { "3", "Castle Door 3" , "door3" , "door3"}, + { "4", "Castle Door 4" , "door4" , "door4"}, + { "5", "Castle Door 5" , "door5" , "door5"}, +-- { "6", "Castle Door 6" , "door6" , "door6"}, +-- { "7", "Castle Door 7" , "door7" , "door7"}, +-- { "8", "Castle Door 8" , "door8" , "door8"}, + { "9", "Castle Door 9" , "door9" , "door9"}, + { "10", "Castle Door 10" , "door10" , "door10"}, + { "11", "Castle Door 11" , "door11" , "door11"}, + { "12", "Castle Door 12" , "door12" , "door12"}, + { "13", "Castle Door 13" , "door13" , "door13"}, +} + + +for i in ipairs(cdoor_list) do + local num = cdoor_list[i][1] + local desc = cdoor_list[i][2] + local inv = cdoor_list[i][3] + local img = cdoor_list[i][4] + local lock = cdoor_list[i][5] + + +mdoors.register_door("my_castle_doors:door"..num, { + description = desc, + inventory_image = "mydoors_"..inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mydoors_"..img.."_bottom.png", "mydoors_"..img.."_edge.png"}, + tiles_top = {"mydoors_"..img.."_top.png", "mydoors_"..img.."_edge.png"}, + only_placer_can_open = false, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "my_castle_doors:door1 1", + recipe = { + {"default:steel_ingot", "default:glass", ""}, + {"my_door_wood:wood_dark_grey", "my_door_wood:wood_dark_grey", ""}, + {"my_door_wood:wood_dark_grey", "default:steel_ingot", ""} + } +}) + +minetest.register_craft({ + output = "my_castle_doors:door2 1", + recipe = { + {"default:steel_ingot", "default:glass", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "default:steel_ingot", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door3 1", + recipe = { + {"my_door_wood:wood_yellow", "default:steel_ingot", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door4 1", + recipe = { + {"my_door_wood:wood_brown", "default:steel_ingot", ""}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", ""}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door5 1", + recipe = { + {"my_door_wood:wood_yellow", "default:steel_ingot", ""}, + {"my_door_wood:wood_white", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door6 1", + recipe = { + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""}, + {"my_door_wood:wood_grey", "default:steel_ingot", ""}, + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door7 1", + recipe = { + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "default:steel_ingot", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door8 1", + recipe = { + {"default:steel_ingot", "default:steel_ingot", ""}, + {"my_door_wood:wood_dark_grey", "my_door_wood:wood_dark_grey", ""}, + {"default:steel_ingot", "default:steel_ingot", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door9 1", + recipe = { + {"default:steel_ingot", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door10 1", + recipe = { + {"my_door_wood:wood_red", "default:steel_ingot", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door11 1", + recipe = { + {"my_door_wood:wood_brown", "default:steel_ingot", ""}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", ""}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door12 1", + recipe = { + {"my_door_wood:wood_brown", "default:steel_ingot", ""}, + {"my_door_wood:wood_grey", "my_door_wood:wood_brown", ""}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", ""} + } +}) +minetest.register_craft({ + output = "my_castle_doors:door13 1", + recipe = { + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", "default:steel_ingot"}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", ""}, + {"my_door_wood:wood_brown", "my_door_wood:wood_brown", "default:steel_ingot"} + } +}) + + diff --git a/my_cottage_doors/depends.txt b/my_cottage_doors/depends.txt new file mode 100644 index 0000000..bfb8e83 --- /dev/null +++ b/my_cottage_doors/depends.txt @@ -0,0 +1,3 @@ +default +mdoors +my_door_wood diff --git a/my_cottage_doors/init.lua b/my_cottage_doors/init.lua new file mode 100644 index 0000000..15a8803 --- /dev/null +++ b/my_cottage_doors/init.lua @@ -0,0 +1,4 @@ +dofile(minetest.get_modpath("my_cottage_doors").."/locked.lua") +dofile(minetest.get_modpath("my_cottage_doors").."/unlocked.lua") + + diff --git a/my_cottage_doors/locked.lua b/my_cottage_doors/locked.lua new file mode 100644 index 0000000..0ce0ad7 --- /dev/null +++ b/my_cottage_doors/locked.lua @@ -0,0 +1,47 @@ +local cdoor_list = { --Number , Description , Inven Image , Image + { "1", "Cottage Door 1" , "door1", "door1"}, +-- { "2", "Cottage Door 2" , "door2" , "door2"}, +} + + +for i in ipairs(cdoor_list) do + local num = cdoor_list[i][1] + local desc = cdoor_list[i][2] + local inv = cdoor_list[i][3] + local img = cdoor_list[i][4] + local lock = cdoor_list[i][5] + + +mdoors.register_door("my_cottage_doors:door"..num.."_locked", { + description = desc.." Locked", + inventory_image = "mycdoors_"..inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mycdoors_"..img.."_bottom.png", "mycdoors_"..img.."_edge.png"}, + tiles_top = {"mycdoors_"..img.."_top.png", "mycdoors_"..img.."_edge.png"}, + only_placer_can_open = true, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "my_cottage_doors:door1_locked 1", + recipe = { + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", "default:steel_ingot"}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", "default:steel_ingot"}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", "default:steel_ingot"} + } +}) + +minetest.register_craft({ + output = "my_cottage_doors:door2_locked 1", + recipe = { + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", "default:steel_ingot"}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) + + + + diff --git a/my_cottage_doors/textures/mycdoors_door1_bottom.png b/my_cottage_doors/textures/mycdoors_door1_bottom.png new file mode 100644 index 0000000..203b793 Binary files /dev/null and b/my_cottage_doors/textures/mycdoors_door1_bottom.png differ diff --git a/my_cottage_doors/textures/mycdoors_door1_edge.png b/my_cottage_doors/textures/mycdoors_door1_edge.png new file mode 100644 index 0000000..aa074c5 Binary files /dev/null and b/my_cottage_doors/textures/mycdoors_door1_edge.png differ diff --git a/my_cottage_doors/textures/mycdoors_door1_inv.png b/my_cottage_doors/textures/mycdoors_door1_inv.png new file mode 100644 index 0000000..1cef8dc Binary files /dev/null and b/my_cottage_doors/textures/mycdoors_door1_inv.png differ diff --git a/my_cottage_doors/textures/mycdoors_door1_top.png b/my_cottage_doors/textures/mycdoors_door1_top.png new file mode 100644 index 0000000..dff765b Binary files /dev/null and b/my_cottage_doors/textures/mycdoors_door1_top.png differ diff --git a/my_cottage_doors/textures/mycdoors_door2_bottom.png b/my_cottage_doors/textures/mycdoors_door2_bottom.png new file mode 100644 index 0000000..3e78aad Binary files /dev/null and b/my_cottage_doors/textures/mycdoors_door2_bottom.png differ diff --git a/my_cottage_doors/textures/mycdoors_door2_edge.png b/my_cottage_doors/textures/mycdoors_door2_edge.png new file mode 100644 index 0000000..dd6879c Binary files /dev/null and b/my_cottage_doors/textures/mycdoors_door2_edge.png differ diff --git a/my_cottage_doors/textures/mycdoors_door2_inv.png b/my_cottage_doors/textures/mycdoors_door2_inv.png new file mode 100644 index 0000000..188da2f Binary files /dev/null and b/my_cottage_doors/textures/mycdoors_door2_inv.png differ diff --git a/my_cottage_doors/textures/mycdoors_door2_top.png b/my_cottage_doors/textures/mycdoors_door2_top.png new file mode 100644 index 0000000..48d5cef Binary files /dev/null and b/my_cottage_doors/textures/mycdoors_door2_top.png differ diff --git a/my_cottage_doors/unlocked.lua b/my_cottage_doors/unlocked.lua new file mode 100644 index 0000000..f10c26d --- /dev/null +++ b/my_cottage_doors/unlocked.lua @@ -0,0 +1,47 @@ +local cdoor_list = { --Number , Description , Inven Image , Image +-- { "1", "Cottage Door 1" , "door1", "door1"}, + { "2", "Cottage Door 2" , "door2" , "door2"}, +} + + +for i in ipairs(cdoor_list) do + local num = cdoor_list[i][1] + local desc = cdoor_list[i][2] + local inv = cdoor_list[i][3] + local img = cdoor_list[i][4] + local lock = cdoor_list[i][5] + + +mdoors.register_door("my_cottage_doors:door"..num, { + description = desc.." Locked", + inventory_image = "mycdoors_"..inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mycdoors_"..img.."_bottom.png", "mycdoors_"..img.."_edge.png"}, + tiles_top = {"mycdoors_"..img.."_top.png", "mycdoors_"..img.."_edge.png"}, + only_placer_can_open = false, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "my_cottage_doors:door1 1", + recipe = { + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", "default:steel_ingot"}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", "default:steel_ingot"} + } +}) + +minetest.register_craft({ + output = "my_cottage_doors:door2 1", + recipe = { + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) + + + + diff --git a/my_default_doors/depends.txt b/my_default_doors/depends.txt new file mode 100644 index 0000000..bfb8e83 --- /dev/null +++ b/my_default_doors/depends.txt @@ -0,0 +1,3 @@ +default +mdoors +my_door_wood diff --git a/my_default_doors/init.lua b/my_default_doors/init.lua new file mode 100644 index 0000000..5106fad --- /dev/null +++ b/my_default_doors/init.lua @@ -0,0 +1,4 @@ +dofile(minetest.get_modpath("my_default_doors").."/locked.lua") +--dofile(minetest.get_modpath("my_default_doors").."/unlocked.lua") + + diff --git a/my_default_doors/locked.lua b/my_default_doors/locked.lua new file mode 100644 index 0000000..9f786ce --- /dev/null +++ b/my_default_doors/locked.lua @@ -0,0 +1,42 @@ +local cdoor_list = { --Number , Description , Inven Image , Image + { "1", "Bronze Door" , "bronze", "bronze_ingot"}, + { "2", "Copper Door" , "copper", "copper_ingot"}, + { "3", "Gold Door" , "gold", "gold_ingot"}, + { "4", "Diamond Door" , "diamond", "diamond"}, + { "5", "Mese Door" , "mese", "mese_crystal"}, +} + + +for i in ipairs(cdoor_list) do + local num = cdoor_list[i][1] + local desc = cdoor_list[i][2] + local img = cdoor_list[i][3] + local itm = cdoor_list[i][4] + + +mdoors.register_door("my_default_doors:door"..num.."_locked", { + description = desc.." Locked", + inventory_image = "mydoors_"..img.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mydoors_"..img.."_bottom.png", "mydoors_"..img.."_edge.png"}, + tiles_top = {"mydoors_"..img.."_top.png", "mydoors_"..img.."_edge.png"}, + only_placer_can_open = true, +}) + + +-- Crafts + +minetest.register_craft({ + output = "my_default_doors:door"..num.."_locked 1", + recipe = { + {"", "", ""}, + {"default:"..itm, "doors:door_steel", "default:"..itm}, + {"", "default:steel_ingot", ""} + } +}) +end + + + + + diff --git a/my_default_doors/textures/mydoors_bronze_bottom.png b/my_default_doors/textures/mydoors_bronze_bottom.png new file mode 100644 index 0000000..ca92ffc Binary files /dev/null and b/my_default_doors/textures/mydoors_bronze_bottom.png differ diff --git a/my_default_doors/textures/mydoors_bronze_edge.png b/my_default_doors/textures/mydoors_bronze_edge.png new file mode 100644 index 0000000..774c926 Binary files /dev/null and b/my_default_doors/textures/mydoors_bronze_edge.png differ diff --git a/my_default_doors/textures/mydoors_bronze_inv.png b/my_default_doors/textures/mydoors_bronze_inv.png new file mode 100644 index 0000000..b8aa025 Binary files /dev/null and b/my_default_doors/textures/mydoors_bronze_inv.png differ diff --git a/my_default_doors/textures/mydoors_bronze_top.png b/my_default_doors/textures/mydoors_bronze_top.png new file mode 100644 index 0000000..3f6392c Binary files /dev/null and b/my_default_doors/textures/mydoors_bronze_top.png differ diff --git a/my_default_doors/textures/mydoors_copper_bottom.png b/my_default_doors/textures/mydoors_copper_bottom.png new file mode 100644 index 0000000..09c2a34 Binary files /dev/null and b/my_default_doors/textures/mydoors_copper_bottom.png differ diff --git a/my_default_doors/textures/mydoors_copper_edge.png b/my_default_doors/textures/mydoors_copper_edge.png new file mode 100644 index 0000000..273ddb6 Binary files /dev/null and b/my_default_doors/textures/mydoors_copper_edge.png differ diff --git a/my_default_doors/textures/mydoors_copper_inv.png b/my_default_doors/textures/mydoors_copper_inv.png new file mode 100644 index 0000000..09263a5 Binary files /dev/null and b/my_default_doors/textures/mydoors_copper_inv.png differ diff --git a/my_default_doors/textures/mydoors_copper_top.png b/my_default_doors/textures/mydoors_copper_top.png new file mode 100644 index 0000000..36b815d Binary files /dev/null and b/my_default_doors/textures/mydoors_copper_top.png differ diff --git a/my_default_doors/textures/mydoors_default_doors.xcf b/my_default_doors/textures/mydoors_default_doors.xcf new file mode 100644 index 0000000..b6d0dfa Binary files /dev/null and b/my_default_doors/textures/mydoors_default_doors.xcf differ diff --git a/my_default_doors/textures/mydoors_diamond_bottom.png b/my_default_doors/textures/mydoors_diamond_bottom.png new file mode 100644 index 0000000..00b8156 Binary files /dev/null and b/my_default_doors/textures/mydoors_diamond_bottom.png differ diff --git a/my_default_doors/textures/mydoors_diamond_edge.png b/my_default_doors/textures/mydoors_diamond_edge.png new file mode 100644 index 0000000..07ac046 Binary files /dev/null and b/my_default_doors/textures/mydoors_diamond_edge.png differ diff --git a/my_default_doors/textures/mydoors_diamond_inv.png b/my_default_doors/textures/mydoors_diamond_inv.png new file mode 100644 index 0000000..0757352 Binary files /dev/null and b/my_default_doors/textures/mydoors_diamond_inv.png differ diff --git a/my_default_doors/textures/mydoors_diamond_top.png b/my_default_doors/textures/mydoors_diamond_top.png new file mode 100644 index 0000000..277519e Binary files /dev/null and b/my_default_doors/textures/mydoors_diamond_top.png differ diff --git a/my_default_doors/textures/mydoors_gold_bottom.png b/my_default_doors/textures/mydoors_gold_bottom.png new file mode 100644 index 0000000..8dfbf47 Binary files /dev/null and b/my_default_doors/textures/mydoors_gold_bottom.png differ diff --git a/my_default_doors/textures/mydoors_gold_edge.png b/my_default_doors/textures/mydoors_gold_edge.png new file mode 100644 index 0000000..f6d0a65 Binary files /dev/null and b/my_default_doors/textures/mydoors_gold_edge.png differ diff --git a/my_default_doors/textures/mydoors_gold_inv.png b/my_default_doors/textures/mydoors_gold_inv.png new file mode 100644 index 0000000..d90b264 Binary files /dev/null and b/my_default_doors/textures/mydoors_gold_inv.png differ diff --git a/my_default_doors/textures/mydoors_gold_top.png b/my_default_doors/textures/mydoors_gold_top.png new file mode 100644 index 0000000..15926e3 Binary files /dev/null and b/my_default_doors/textures/mydoors_gold_top.png differ diff --git a/my_default_doors/textures/mydoors_mese_bottom.png b/my_default_doors/textures/mydoors_mese_bottom.png new file mode 100644 index 0000000..7870e5d Binary files /dev/null and b/my_default_doors/textures/mydoors_mese_bottom.png differ diff --git a/my_default_doors/textures/mydoors_mese_edge.png b/my_default_doors/textures/mydoors_mese_edge.png new file mode 100644 index 0000000..7c97008 Binary files /dev/null and b/my_default_doors/textures/mydoors_mese_edge.png differ diff --git a/my_default_doors/textures/mydoors_mese_inv.png b/my_default_doors/textures/mydoors_mese_inv.png new file mode 100644 index 0000000..68a2e0d Binary files /dev/null and b/my_default_doors/textures/mydoors_mese_inv.png differ diff --git a/my_default_doors/textures/mydoors_mese_top.png b/my_default_doors/textures/mydoors_mese_top.png new file mode 100644 index 0000000..e48da31 Binary files /dev/null and b/my_default_doors/textures/mydoors_mese_top.png differ diff --git a/my_default_doors/unlocked.lua b/my_default_doors/unlocked.lua new file mode 100644 index 0000000..a585f2e --- /dev/null +++ b/my_default_doors/unlocked.lua @@ -0,0 +1,42 @@ +local cdoor_list = { --Number , Description , Inven Image , Image + { "1", "Bronze Door" , "bronze", "bronze_ingot"}, + { "2", "Copper Door" , "copper", "copper_ingot"}, + { "3", "Gold Door" , "gold", "gold_ingot"}, + { "4", "Diamond Door" , "diamond", "diamond"}, + { "5", "Mese Door" , "mese", "mese_crystal"}, +} + + +for i in ipairs(cdoor_list) do + local num = cdoor_list[i][1] + local desc = cdoor_list[i][2] + local img = cdoor_list[i][3] + local itm = cdoor_list[i][4] + + +mdoors.register_door("my_default_doors:door"..num, { + description = desc, + inventory_image = "mydoors_"..img.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mydoors_"..img.."_bottom.png", "mydoors_"..img.."_edge.png"}, + tiles_top = {"mydoors_"..img.."_top.png", "mydoors_"..img.."_edge.png"}, + only_placer_can_open = false, +}) + + +-- Crafts + +minetest.register_craft({ + output = "my_default_doors:door"..num.." 1", + recipe = { + {"", "", ""}, + {"default:"..itm, "doors:door_steel", "default:"..itm}, + {"", "", ""} + } +}) +end + + + + + diff --git a/my_door_wood/init.lua b/my_door_wood/init.lua new file mode 100644 index 0000000..da108b5 --- /dev/null +++ b/my_door_wood/init.lua @@ -0,0 +1,38 @@ +local door_wood = { -- color, desc, image + {"red", "Red Stained", "red"}, + {"grey", "Grey Stained", "grey"}, + {"dark_grey", "Dark Grey Stained", "dark_grey"}, + {"brown", "Brown Stained", "brown"}, + {"white", "White Stained", "white"}, + {"yellow", "Clear Stained", "yellow"}, + {"black", "Black", "black"}, +} +for i in ipairs(door_wood) do + local color = door_wood[i][1] + local desc = door_wood[i][2] + local img = door_wood[i][3] + +minetest.register_node("my_door_wood:wood_"..color, { + description = desc.." Wood", + drawtype = "normal", + paramtype = "light", + tiles = {"mydoors_"..img.."_wood.png"}, + paramtype = "light", + groups = {cracky = 2, choppy = 2}, + +}) + +-- Crafts + +minetest.register_craft({ + output = "my_door_wood:wood_"..color, + recipe = { + {"default:wood", "", ""}, + {"dye:"..color, "", ""}, + {"", "", ""} + } +}) +end + + + diff --git a/my_door_wood/textures/mydoors_black_wood.png b/my_door_wood/textures/mydoors_black_wood.png new file mode 100644 index 0000000..a7effb2 Binary files /dev/null and b/my_door_wood/textures/mydoors_black_wood.png differ diff --git a/my_door_wood/textures/mydoors_brown_wood.png b/my_door_wood/textures/mydoors_brown_wood.png new file mode 100644 index 0000000..35f5f46 Binary files /dev/null and b/my_door_wood/textures/mydoors_brown_wood.png differ diff --git a/my_door_wood/textures/mydoors_dark_grey_wood.png b/my_door_wood/textures/mydoors_dark_grey_wood.png new file mode 100644 index 0000000..918f0e5 Binary files /dev/null and b/my_door_wood/textures/mydoors_dark_grey_wood.png differ diff --git a/my_door_wood/textures/mydoors_grey_wood.png b/my_door_wood/textures/mydoors_grey_wood.png new file mode 100644 index 0000000..9a2572a Binary files /dev/null and b/my_door_wood/textures/mydoors_grey_wood.png differ diff --git a/my_door_wood/textures/mydoors_red_wood.png b/my_door_wood/textures/mydoors_red_wood.png new file mode 100644 index 0000000..33075dd Binary files /dev/null and b/my_door_wood/textures/mydoors_red_wood.png differ diff --git a/my_door_wood/textures/mydoors_swood.png b/my_door_wood/textures/mydoors_swood.png new file mode 100644 index 0000000..83eb38f Binary files /dev/null and b/my_door_wood/textures/mydoors_swood.png differ diff --git a/my_door_wood/textures/mydoors_white_wood.png b/my_door_wood/textures/mydoors_white_wood.png new file mode 100644 index 0000000..7b3d376 Binary files /dev/null and b/my_door_wood/textures/mydoors_white_wood.png differ diff --git a/my_door_wood/textures/mydoors_yellow_wood.png b/my_door_wood/textures/mydoors_yellow_wood.png new file mode 100644 index 0000000..1340f13 Binary files /dev/null and b/my_door_wood/textures/mydoors_yellow_wood.png differ diff --git a/my_fancy_doors/depends.txt b/my_fancy_doors/depends.txt new file mode 100644 index 0000000..bfb8e83 --- /dev/null +++ b/my_fancy_doors/depends.txt @@ -0,0 +1,3 @@ +default +mdoors +my_door_wood diff --git a/my_fancy_doors/init.lua b/my_fancy_doors/init.lua new file mode 100644 index 0000000..aa7ab97 --- /dev/null +++ b/my_fancy_doors/init.lua @@ -0,0 +1,4 @@ +dofile(minetest.get_modpath("my_fancy_doors").."/locked.lua") +dofile(minetest.get_modpath("my_fancy_doors").."/unlocked.lua") + + diff --git a/my_fancy_doors/locked.lua b/my_fancy_doors/locked.lua new file mode 100644 index 0000000..24c7b26 --- /dev/null +++ b/my_fancy_doors/locked.lua @@ -0,0 +1,98 @@ +local fdoor_list = { --Number , Description , Inven Image , Image + { "1" , "Fancy Door 1" , "door1" , "door1"}, +-- { "2" , "Fancy Door 2" , "door2" , "door2"}, +-- { "3" , "Fancy Door 3" , "door3" , "door3"}, + { "4" , "Fancy Door 4" , "door4" , "door4"}, + { "5" , "Fancy Door 5" , "door5" , "door5"}, + { "6" , "Fancy Door 6" , "door6" , "door6"}, + { "7" , "Fancy Door 7" , "door7" , "door7"}, + { "8" , "Fancy Door 8" , "door8" , "door8"}, +} + + +for i in ipairs(fdoor_list) do + local num = fdoor_list[i][1] + local desc = fdoor_list[i][2] + local inv = fdoor_list[i][3] + local img = fdoor_list[i][4] + + +mdoors.register_door("my_fancy_doors:door"..num.."_locked", { + description = desc.." Locked", + inventory_image = "myfdoors_"..inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"myfdoors_"..img.."_bottom.png", "myfdoors_"..img.."_edge.png"}, + tiles_top = {"myfdoors_"..img.."_top.png", "myfdoors_"..img.."_edge.png"}, + only_placer_can_open = true, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "my_fancy_doors:door1_locked 1", + recipe = { + {"my_door_wood:wood_yellow", "default:glass", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", "default:steel_ingot"}, + {"my_door_wood:wood_yellow", "default:glass", ""} + } +}) + +minetest.register_craft({ + output = "my_fancy_doors:door2_locked 1", + recipe = { + {"my_door_wood:wood_yellow", "default:glass", ""}, + {"my_door_wood:wood_yellow", "default:steel_ingot", "default:steel_ingot"}, + {"my_door_wood:wood_yellow", "default:glass", ""} + } +}) +minetest.register_craft({ + output = "my_fancy_doors:door3_locked 1", + recipe = { + {"my_door_wood:wood_white", "default:glass", ""}, + {"my_door_wood:wood_white", "my_door_wood:wood_white", "default:steel_ingot"}, + {"my_door_wood:wood_white", "default:glass", ""} + } +}) +minetest.register_craft({ + output = "my_fancy_doors:door4_locked 1", + recipe = { + {"my_door_wood:wood_red", "my_door_wood:wood_dark_grey", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", "default:steel_ingot"}, + {"my_door_wood:wood_red", "my_door_wood:wood_dark_grey", ""} + } +}) +minetest.register_craft({ + output = "my_fancy_doors:door5_locked 1", + recipe = { + {"default:glass", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "default:glass", "default:steel_ingot"}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""} + } +}) +minetest.register_craft({ + output = "my_fancy_doors:door6_locked 1", + recipe = { + {"default:glass", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "default:glass", "default:steel_ingot"}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) +minetest.register_craft({ + output = "my_fancy_doors:door7_locked 1", + recipe = { + {"my_door_wood:wood_red", "default:glass", ""}, + {"my_door_wood:wood_red", "default:glass", "default:steel_ingot"}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) +minetest.register_craft({ + output = "my_fancy_doors:door7_locked 1", + recipe = { + {"default:glass", "my_door_wood:wood_red", ""}, + {"default:glass", "my_door_wood:wood_red", "default:steel_ingot"}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) + + diff --git a/my_fancy_doors/screenshot.png b/my_fancy_doors/screenshot.png new file mode 100644 index 0000000..b4f5c9e Binary files /dev/null and b/my_fancy_doors/screenshot.png differ diff --git a/my_fancy_doors/textures/myfdoors_door1_bottom.png b/my_fancy_doors/textures/myfdoors_door1_bottom.png new file mode 100644 index 0000000..afe3d8e Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door1_bottom.png differ diff --git a/my_fancy_doors/textures/myfdoors_door1_edge.png b/my_fancy_doors/textures/myfdoors_door1_edge.png new file mode 100644 index 0000000..238c8dd Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door1_edge.png differ diff --git a/my_fancy_doors/textures/myfdoors_door1_inv.png b/my_fancy_doors/textures/myfdoors_door1_inv.png new file mode 100644 index 0000000..866a159 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door1_inv.png differ diff --git a/my_fancy_doors/textures/myfdoors_door1_top.png b/my_fancy_doors/textures/myfdoors_door1_top.png new file mode 100644 index 0000000..12c9eb0 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door1_top.png differ diff --git a/my_fancy_doors/textures/myfdoors_door2_bottom.png b/my_fancy_doors/textures/myfdoors_door2_bottom.png new file mode 100644 index 0000000..572a9fb Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door2_bottom.png differ diff --git a/my_fancy_doors/textures/myfdoors_door2_edge.png b/my_fancy_doors/textures/myfdoors_door2_edge.png new file mode 100644 index 0000000..238c8dd Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door2_edge.png differ diff --git a/my_fancy_doors/textures/myfdoors_door2_inv.png b/my_fancy_doors/textures/myfdoors_door2_inv.png new file mode 100644 index 0000000..bf274f4 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door2_inv.png differ diff --git a/my_fancy_doors/textures/myfdoors_door2_top.png b/my_fancy_doors/textures/myfdoors_door2_top.png new file mode 100644 index 0000000..181ba01 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door2_top.png differ diff --git a/my_fancy_doors/textures/myfdoors_door3_bottom.png b/my_fancy_doors/textures/myfdoors_door3_bottom.png new file mode 100644 index 0000000..8b98c43 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door3_bottom.png differ diff --git a/my_fancy_doors/textures/myfdoors_door3_edge.png b/my_fancy_doors/textures/myfdoors_door3_edge.png new file mode 100644 index 0000000..5a71adc Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door3_edge.png differ diff --git a/my_fancy_doors/textures/myfdoors_door3_inv.png b/my_fancy_doors/textures/myfdoors_door3_inv.png new file mode 100644 index 0000000..43831f6 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door3_inv.png differ diff --git a/my_fancy_doors/textures/myfdoors_door3_top.png b/my_fancy_doors/textures/myfdoors_door3_top.png new file mode 100644 index 0000000..65de7ad Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door3_top.png differ diff --git a/my_fancy_doors/textures/myfdoors_door4_bottom.png b/my_fancy_doors/textures/myfdoors_door4_bottom.png new file mode 100644 index 0000000..8793eed Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door4_bottom.png differ diff --git a/my_fancy_doors/textures/myfdoors_door4_edge.png b/my_fancy_doors/textures/myfdoors_door4_edge.png new file mode 100644 index 0000000..b59c11f Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door4_edge.png differ diff --git a/my_fancy_doors/textures/myfdoors_door4_inv.png b/my_fancy_doors/textures/myfdoors_door4_inv.png new file mode 100644 index 0000000..97470e3 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door4_inv.png differ diff --git a/my_fancy_doors/textures/myfdoors_door4_top.png b/my_fancy_doors/textures/myfdoors_door4_top.png new file mode 100644 index 0000000..b128591 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door4_top.png differ diff --git a/my_fancy_doors/textures/myfdoors_door5_bottom.png b/my_fancy_doors/textures/myfdoors_door5_bottom.png new file mode 100644 index 0000000..0a1eaa1 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door5_bottom.png differ diff --git a/my_fancy_doors/textures/myfdoors_door5_edge.png b/my_fancy_doors/textures/myfdoors_door5_edge.png new file mode 100644 index 0000000..68f3a7e Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door5_edge.png differ diff --git a/my_fancy_doors/textures/myfdoors_door5_inv.png b/my_fancy_doors/textures/myfdoors_door5_inv.png new file mode 100644 index 0000000..a6de67e Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door5_inv.png differ diff --git a/my_fancy_doors/textures/myfdoors_door5_top.png b/my_fancy_doors/textures/myfdoors_door5_top.png new file mode 100644 index 0000000..06c735b Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door5_top.png differ diff --git a/my_fancy_doors/textures/myfdoors_door6_bottom.png b/my_fancy_doors/textures/myfdoors_door6_bottom.png new file mode 100644 index 0000000..fd2ffba Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door6_bottom.png differ diff --git a/my_fancy_doors/textures/myfdoors_door6_edge.png b/my_fancy_doors/textures/myfdoors_door6_edge.png new file mode 100644 index 0000000..a2f0c84 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door6_edge.png differ diff --git a/my_fancy_doors/textures/myfdoors_door6_inv.png b/my_fancy_doors/textures/myfdoors_door6_inv.png new file mode 100644 index 0000000..2f9641d Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door6_inv.png differ diff --git a/my_fancy_doors/textures/myfdoors_door6_top.png b/my_fancy_doors/textures/myfdoors_door6_top.png new file mode 100644 index 0000000..23bf707 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door6_top.png differ diff --git a/my_fancy_doors/textures/myfdoors_door7_bottom.png b/my_fancy_doors/textures/myfdoors_door7_bottom.png new file mode 100644 index 0000000..533196b Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door7_bottom.png differ diff --git a/my_fancy_doors/textures/myfdoors_door7_edge.png b/my_fancy_doors/textures/myfdoors_door7_edge.png new file mode 100644 index 0000000..a2f0c84 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door7_edge.png differ diff --git a/my_fancy_doors/textures/myfdoors_door7_inv.png b/my_fancy_doors/textures/myfdoors_door7_inv.png new file mode 100644 index 0000000..c25468c Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door7_inv.png differ diff --git a/my_fancy_doors/textures/myfdoors_door7_top.png b/my_fancy_doors/textures/myfdoors_door7_top.png new file mode 100644 index 0000000..107e5b8 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door7_top.png differ diff --git a/my_fancy_doors/textures/myfdoors_door8_bottom.png b/my_fancy_doors/textures/myfdoors_door8_bottom.png new file mode 100644 index 0000000..70ae93c Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door8_bottom.png differ diff --git a/my_fancy_doors/textures/myfdoors_door8_edge.png b/my_fancy_doors/textures/myfdoors_door8_edge.png new file mode 100644 index 0000000..a2f0c84 Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door8_edge.png differ diff --git a/my_fancy_doors/textures/myfdoors_door8_inv.png b/my_fancy_doors/textures/myfdoors_door8_inv.png new file mode 100644 index 0000000..6c5fc7f Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door8_inv.png differ diff --git a/my_fancy_doors/textures/myfdoors_door8_top.png b/my_fancy_doors/textures/myfdoors_door8_top.png new file mode 100644 index 0000000..ce3184b Binary files /dev/null and b/my_fancy_doors/textures/myfdoors_door8_top.png differ diff --git a/my_fancy_doors/unlocked.lua b/my_fancy_doors/unlocked.lua new file mode 100644 index 0000000..3ab5817 --- /dev/null +++ b/my_fancy_doors/unlocked.lua @@ -0,0 +1,65 @@ +local fdoor_list = { --Number , Description , Inven Image , Image +-- { "1" , "Fancy Door 1" , "door1" , "door1"}, + { "2" , "Fancy Door 2" , "door2" , "door2"}, + { "3" , "Fancy Door 3" , "door3" , "door3"}, +-- { "4" , "Fancy Door 4" , "door4" , "door4"}, +-- { "5" , "Fancy Door 5" , "door5" , "door5"}, +-- { "6" , "Fancy Door 6" , "door6" , "door6"}, +-- { "7" , "Fancy Door 7" , "door7" , "door7"}, +-- { "8" , "Fancy Door 8" , "door8" , "door8"}, +} + + +for i in ipairs(fdoor_list) do + local num = fdoor_list[i][1] + local desc = fdoor_list[i][2] + local inv = fdoor_list[i][3] + local img = fdoor_list[i][4] + + +mdoors.register_door("my_fancy_doors:door"..num, { + description = desc, + inventory_image = "myfdoors_"..inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"myfdoors_"..img.."_bottom.png", "myfdoors_"..img.."_edge.png"}, + tiles_top = {"myfdoors_"..img.."_top.png", "myfdoors_"..img.."_edge.png"}, + only_placer_can_open = false, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "my_fancy_doors:door1 1", + recipe = { + {"my_door_wood:wood_yellow", "default:glass", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "default:glass", ""} + } +}) + +minetest.register_craft({ + output = "my_fancy_doors:door2 1", + recipe = { + {"my_door_wood:wood_yellow", "default:glass", ""}, + {"my_door_wood:wood_yellow", "default:steel_ingot", ""}, + {"my_door_wood:wood_yellow", "default:glass", ""} + } +}) +minetest.register_craft({ + output = "my_fancy_doors:door3 1", + recipe = { + {"my_door_wood:wood_white", "default:glass", ""}, + {"my_door_wood:wood_white", "my_door_wood:wood_white", ""}, + {"my_door_wood:wood_white", "default:glass", ""} + } +}) +minetest.register_craft({ + output = "my_fancy_doors:door4 1", + recipe = { + {"my_door_wood:wood_red", "my_door_wood:wood_dark_grey", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_dark_grey", ""} + } +}) + diff --git a/my_future_doors/depends.txt b/my_future_doors/depends.txt new file mode 100644 index 0000000..a0295b7 --- /dev/null +++ b/my_future_doors/depends.txt @@ -0,0 +1 @@ +my_door_wood diff --git a/my_future_doors/framed.lua b/my_future_doors/framed.lua new file mode 100644 index 0000000..a26e23c --- /dev/null +++ b/my_future_doors/framed.lua @@ -0,0 +1,190 @@ +local doorcolors = {"white","red","black"} +for i = 1,#doorcolors do +local col = doorcolors[i] + +minetest.register_node("my_future_doors:door1a_"..col, { + description = "Door 1a", + tiles = { + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col.."b.png", + "myndoors_door1_"..col.."b.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {-0.4375, -0.5, -0.1875, 0.4375, 0.5, -0.0625}, + {-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5}, + {0.4375, -0.5, -0.5, 0.5, 0.5, 0.5}, + {0.4375, -0.5, 0.5, 0.625, 0.5, 0.5625}, + {0.4375, -0.5, -0.5625, 0.625, 0.5, -0.5}, + {-0.625, -0.5, -0.5625, -0.4375, 0.5, -0.5}, + {-0.625, -0.5, 0.5, -0.4375, 0.5, 0.5625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.4375, -0.5, -0.1875, 0.4375, 1.5, -0.0625}, --door + {0.4375, -0.5, -0.5625, 0.625, 1.4375, 0.5625}, --right + {-0.625, -0.5, -0.5625, -0.4375, 1.4375, 0.5625}, --left + {-0.625, 1.4375, -0.5625, 0.625, 1.625, 0.5625}, --top + } + }, + +on_place = function(itemstack, placer, pointed_thing) + local pos1 = pointed_thing.above + local pos2 = {x=pos1.x, y=pos1.y, z=pos1.z} + pos2.y = pos2.y+1 + if + not minetest.registered_nodes[minetest.get_node(pos1).name].buildable_to or + not minetest.registered_nodes[minetest.get_node(pos2).name].buildable_to or + not placer or + not placer:is_player() then + return + end + return minetest.item_place(itemstack, placer, pointed_thing) +end, +after_place_node = function(pos, placer, itemstack, pointed_thing) + local node = minetest.get_node(pos) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="my_future_doors:door1b_"..col,param2=node.param2}) +end, +after_destruct = function(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) +end, +on_rightclick = function(pos, node, player, itemstack, pointed_thing) + local timer = minetest.get_node_timer(pos) + if node.name == "my_future_doors:door1a_"..col then + minetest.set_node(pos,{name="my_future_doors:door1c_"..col,param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="my_future_doors:door1d_"..col,param2=node.param2}) + timer:start(3) + end +end, +}) +minetest.register_node("my_future_doors:door1b_"..col, { + tiles = { + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col.."b.png", + "myndoors_door1_"..col.."b.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.4375, -0.5, -0.1875, 0.4375, 0.5, -0.0625}, + {-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5}, + {0.4375, -0.5, -0.5, 0.5, 0.5, 0.5}, + {0.4375, -0.5, 0.5, 0.625, 0.5, 0.5625}, + {0.4375, -0.5, -0.5625, 0.625, 0.5, -0.5}, + {-0.625, -0.5, -0.5625, -0.4375, 0.5, -0.5}, + {-0.625, -0.5, 0.5, -0.4375, 0.5, 0.5625}, + {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, + {-0.625, 0.4375, -0.5625, 0.625, 0.625, -0.5}, + {-0.625, 0.4375, 0.5, 0.625, 0.625, 0.5625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, -0.5, -0.5, -0.5}, + } + }, +})minetest.register_node("my_future_doors:door1c_"..col, { + tiles = { + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col.."b.png", + "myndoors_door1_"..col.."b.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5}, + {0.4375, -0.5, -0.5, 0.5, 0.5, 0.5}, + {0.4375, -0.5, 0.5, 0.625, 0.5, 0.5625}, + {0.4375, -0.5, -0.5625, 0.625, 0.5, -0.5}, + {-0.625, -0.5, -0.5625, -0.4375, 0.5, -0.5}, + {-0.625, -0.5, 0.5, -0.4375, 0.5, 0.5625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0.4375, -0.5, -0.5625, 0.625, 1.4375, 0.5625}, --right + {-0.625, -0.5, -0.5625, -0.4375, 1.4375, 0.5625}, --left + {-0.625, 1.4375, -0.5625, 0.625, 1.625, 0.5625}, --top + } + }, +after_place_node = function(pos, placer, itemstack, pointed_thing) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="my_future_doors:door1d_"..col,param2=nodeu.param2}) +end, +after_destruct = function(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) +end, +on_timer = function(pos, elapsed) + local node = minetest.get_node(pos) + minetest.set_node(pos,{name="my_future_doors:door1a_"..col,param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="my_future_doors:door1b_"..col,param2=node.param2}) +end, +}) +minetest.register_node("my_future_doors:door1d_"..col, { + tiles = { + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col..".png", + "myndoors_door1_"..col.."b.png", + "myndoors_door1_"..col.."b.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5}, + {0.4375, -0.5, -0.5, 0.5, 0.5, 0.5}, + {0.4375, -0.5, 0.5, 0.625, 0.5, 0.5625}, + {0.4375, -0.5, -0.5625, 0.625, 0.5, -0.5}, + {-0.625, -0.5, -0.5625, -0.4375, 0.5, -0.5}, + {-0.625, -0.5, 0.5, -0.4375, 0.4375, 0.5625}, + {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, + {-0.625, 0.4375, -0.5625, 0.625, 0.625, -0.5}, + {-0.625, 0.4375, 0.5, 0.625, 0.625, 0.5625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, -0.5, -0.5, -0.5}, + } + }, +}) +minetest.register_craft({ + output = "my_future_doors:door1a_"..col.." 1", + recipe = { + {"my_door_wood:wood_"..col, "wool:"..col, "my_door_wood:wood_"..col}, + {"wool:"..col, "my_door_wood:wood_"..col, "wool:"..col}, + {"my_door_wood:wood_"..col, "wool:"..col, "my_door_wood:wood_"..col} + } +}) +end diff --git a/my_future_doors/init.lua b/my_future_doors/init.lua new file mode 100644 index 0000000..dc058b8 --- /dev/null +++ b/my_future_doors/init.lua @@ -0,0 +1,2 @@ +dofile(minetest.get_modpath("my_future_doors").."/framed.lua") +dofile(minetest.get_modpath("my_future_doors").."/sliding.lua") diff --git a/my_future_doors/screenshot.png b/my_future_doors/screenshot.png new file mode 100644 index 0000000..e8054e4 Binary files /dev/null and b/my_future_doors/screenshot.png differ diff --git a/my_future_doors/sliding.lua b/my_future_doors/sliding.lua new file mode 100644 index 0000000..43cd1b8 --- /dev/null +++ b/my_future_doors/sliding.lua @@ -0,0 +1,245 @@ +local doors = { + {"my_future_doors:door2a","my_future_doors:door2b","my_future_doors:door2c","my_future_doors:door2d","2","Steel"}, + {"my_future_doors:door3a","my_future_doors:door3b","my_future_doors:door3c","my_future_doors:door3d","3","Squared"}, + {"my_future_doors:door4a","my_future_doors:door4b","my_future_doors:door4c","my_future_doors:door4d","4","Dark"}, + {"my_future_doors:door6a","my_future_doors:door6b","my_future_doors:door6c","my_future_doors:door6d","6","Points"}, + {"my_future_doors:door7a","my_future_doors:door7b","my_future_doors:door7c","my_future_doors:door7d","7","Snow Flake"}, + } +for i in ipairs (doors) do +local doora = doors[i][1] +local doorb = doors[i][2] +local doorc = doors[i][3] +local doord = doors[i][4] +local num = doors[i][5] +local des = doors[i][6] + +function onplace(itemstack, placer, pointed_thing) + local pos1 = pointed_thing.above + local pos2 = {x=pos1.x, y=pos1.y, z=pos1.z} + pos2.y = pos2.y+1 + if + not minetest.registered_nodes[minetest.get_node(pos1).name].buildable_to or + not minetest.registered_nodes[minetest.get_node(pos2).name].buildable_to or + not placer or + not placer:is_player() then + return + end + local pt = pointed_thing.above + local pt2 = {x=pt.x, y=pt.y, z=pt.z} + pt2.y = pt2.y+1 + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pt3 = {x=pt.x, y=pt.y, z=pt.z} + local p4 = 0 + if p2 == 0 then + pt3.x = pt3.x-1 + p4 = 2 + elseif p2 == 1 then + pt3.z = pt3.z+1 + p4 = 3 + elseif p2 == 2 then + pt3.x = pt3.x+1 + p4 = 0 + elseif p2 == 3 then + pt3.z = pt3.z-1 + p4 = 1 + end + if minetest.get_node(pt3).name == doora then + minetest.set_node(pt, {name=doora, param2=p4}) + minetest.set_node(pt2, {name=doorb, param2=p4}) + else + minetest.set_node(pt, {name=doora, param2=p2}) + minetest.set_node(pt2, {name=doorb, param2=p2}) + end +end + +function afterdestruct(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) +end + +function rightclick(pos, node, player, itemstack, pointed_thing) + local timer = minetest.get_node_timer(pos) + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + minetest.set_node(pos, {name=doorc, param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doord, param2=node.param2}) + + if a.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doorc, param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doord, param2=a.param2}) + end + if b.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doorc, param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doord, param2=b.param2}) + end + if c.name == doora then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doorc, param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doord, param2=c.param2}) + end + if d.name == doora then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doorc, param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doord, param2=d.param2}) + end + + timer:start(3) + +end + +function afterplace(pos, placer, itemstack, pointed_thing) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name=doord,param2=nodeu.param2}) +end + +function ontimer(pos, elapsed) + local node = minetest.get_node(pos) + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + minetest.set_node(pos, {name=doora, param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doorb, param2=node.param2}) + + if a.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doora, param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doorb, param2=a.param2}) + end + if b.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doora, param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doorb, param2=b.param2}) + end + if c.name == doorc then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doora, param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doorb, param2=c.param2}) + end + if d.name == doorc then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doora, param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doorb, param2=d.param2}) + end + +end + +minetest.register_node(doora, { + description = des.." Sliding Door", + inventory_image = "myndoors_door"..num.."a_inv.png", + wield_image = "myndoors_door"..num.."a_inv.png", + tiles = { + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_bottom.png", + "myndoors_door"..num.."a_bottom.png^[transformFX" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.0625} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, 0.5, 1.5, 0.0625} + } + }, + +on_place = onplace, + +after_destruct = afterdestruct, + +on_rightclick = rightclick, +}) +minetest.register_node(doorb, { + tiles = { + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_bottom.png^[transformFY", + "myndoors_door"..num.."a_bottom.png^[transformFX^[transformFY" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.0625} + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +})minetest.register_node(doorc, { + tiles = { + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_bottomo.png", + "myndoors_door"..num.."a_bottomo.png^[transformFX" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + drop = doora, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, -0.25, 0.5, 0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, -0.25, 1.5, 0.0625}, + } + }, +after_place_node = afterplace, +after_destruct = afterdestruct, +on_timer = ontimer, +}) +minetest.register_node(doord, { + tiles = { + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_edge.png", + "myndoors_door"..num.."a_bottomo.png^[transformFY", + "myndoors_door"..num.."a_bottomo.png^[transformFX^[transformFY" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, -0.25, 0.5, 0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +}) +minetest.register_craft({ + output = "my_future_doors:door"..num.."a 1", + recipe = { + {"default:steel_ingot", "default:steelblock", ""}, + {"default:steel_ingot", "default:steel_ingot", ""}, + {"default:steelblock", "default:steel_ingot", ""} + } +}) +end diff --git a/my_future_doors/textures/myndoors_door1_black.png b/my_future_doors/textures/myndoors_door1_black.png new file mode 100644 index 0000000..72c4789 Binary files /dev/null and b/my_future_doors/textures/myndoors_door1_black.png differ diff --git a/my_future_doors/textures/myndoors_door1_blackb.png b/my_future_doors/textures/myndoors_door1_blackb.png new file mode 100644 index 0000000..3406484 Binary files /dev/null and b/my_future_doors/textures/myndoors_door1_blackb.png differ diff --git a/my_future_doors/textures/myndoors_door1_bottomf.png b/my_future_doors/textures/myndoors_door1_bottomf.png new file mode 100644 index 0000000..e9fff31 Binary files /dev/null and b/my_future_doors/textures/myndoors_door1_bottomf.png differ diff --git a/my_future_doors/textures/myndoors_door1_red.png b/my_future_doors/textures/myndoors_door1_red.png new file mode 100644 index 0000000..bad99d2 Binary files /dev/null and b/my_future_doors/textures/myndoors_door1_red.png differ diff --git a/my_future_doors/textures/myndoors_door1_redb.png b/my_future_doors/textures/myndoors_door1_redb.png new file mode 100644 index 0000000..f6339dd Binary files /dev/null and b/my_future_doors/textures/myndoors_door1_redb.png differ diff --git a/my_future_doors/textures/myndoors_door1_white.png b/my_future_doors/textures/myndoors_door1_white.png new file mode 100644 index 0000000..1a95505 Binary files /dev/null and b/my_future_doors/textures/myndoors_door1_white.png differ diff --git a/my_future_doors/textures/myndoors_door1_whiteb.png b/my_future_doors/textures/myndoors_door1_whiteb.png new file mode 100644 index 0000000..3b84950 Binary files /dev/null and b/my_future_doors/textures/myndoors_door1_whiteb.png differ diff --git a/my_future_doors/textures/myndoors_door2a_bottom.png b/my_future_doors/textures/myndoors_door2a_bottom.png new file mode 100644 index 0000000..bf4121b Binary files /dev/null and b/my_future_doors/textures/myndoors_door2a_bottom.png differ diff --git a/my_future_doors/textures/myndoors_door2a_bottomo.png b/my_future_doors/textures/myndoors_door2a_bottomo.png new file mode 100644 index 0000000..ca8b979 Binary files /dev/null and b/my_future_doors/textures/myndoors_door2a_bottomo.png differ diff --git a/my_future_doors/textures/myndoors_door2a_edge.png b/my_future_doors/textures/myndoors_door2a_edge.png new file mode 100644 index 0000000..26d356f Binary files /dev/null and b/my_future_doors/textures/myndoors_door2a_edge.png differ diff --git a/my_future_doors/textures/myndoors_door2a_inv.png b/my_future_doors/textures/myndoors_door2a_inv.png new file mode 100644 index 0000000..1b17546 Binary files /dev/null and b/my_future_doors/textures/myndoors_door2a_inv.png differ diff --git a/my_future_doors/textures/myndoors_door3a_bottom.png b/my_future_doors/textures/myndoors_door3a_bottom.png new file mode 100644 index 0000000..f73fab7 Binary files /dev/null and b/my_future_doors/textures/myndoors_door3a_bottom.png differ diff --git a/my_future_doors/textures/myndoors_door3a_bottomo.png b/my_future_doors/textures/myndoors_door3a_bottomo.png new file mode 100644 index 0000000..bbd1fd8 Binary files /dev/null and b/my_future_doors/textures/myndoors_door3a_bottomo.png differ diff --git a/my_future_doors/textures/myndoors_door3a_edge.png b/my_future_doors/textures/myndoors_door3a_edge.png new file mode 100644 index 0000000..26d356f Binary files /dev/null and b/my_future_doors/textures/myndoors_door3a_edge.png differ diff --git a/my_future_doors/textures/myndoors_door3a_inv.png b/my_future_doors/textures/myndoors_door3a_inv.png new file mode 100644 index 0000000..533ffab Binary files /dev/null and b/my_future_doors/textures/myndoors_door3a_inv.png differ diff --git a/my_future_doors/textures/myndoors_door4a_bottom.png b/my_future_doors/textures/myndoors_door4a_bottom.png new file mode 100644 index 0000000..3eb8d7a Binary files /dev/null and b/my_future_doors/textures/myndoors_door4a_bottom.png differ diff --git a/my_future_doors/textures/myndoors_door4a_bottomo.png b/my_future_doors/textures/myndoors_door4a_bottomo.png new file mode 100644 index 0000000..f7650e1 Binary files /dev/null and b/my_future_doors/textures/myndoors_door4a_bottomo.png differ diff --git a/my_future_doors/textures/myndoors_door4a_edge.png b/my_future_doors/textures/myndoors_door4a_edge.png new file mode 100644 index 0000000..db005ac Binary files /dev/null and b/my_future_doors/textures/myndoors_door4a_edge.png differ diff --git a/my_future_doors/textures/myndoors_door4a_inv.png b/my_future_doors/textures/myndoors_door4a_inv.png new file mode 100644 index 0000000..9b91085 Binary files /dev/null and b/my_future_doors/textures/myndoors_door4a_inv.png differ diff --git a/my_future_doors/textures/myndoors_door6a_bottom.png b/my_future_doors/textures/myndoors_door6a_bottom.png new file mode 100644 index 0000000..771ac07 Binary files /dev/null and b/my_future_doors/textures/myndoors_door6a_bottom.png differ diff --git a/my_future_doors/textures/myndoors_door6a_bottomo.png b/my_future_doors/textures/myndoors_door6a_bottomo.png new file mode 100644 index 0000000..7529230 Binary files /dev/null and b/my_future_doors/textures/myndoors_door6a_bottomo.png differ diff --git a/my_future_doors/textures/myndoors_door6a_edge.png b/my_future_doors/textures/myndoors_door6a_edge.png new file mode 100644 index 0000000..3c6064f Binary files /dev/null and b/my_future_doors/textures/myndoors_door6a_edge.png differ diff --git a/my_future_doors/textures/myndoors_door6a_inv.png b/my_future_doors/textures/myndoors_door6a_inv.png new file mode 100644 index 0000000..ba1a9ef Binary files /dev/null and b/my_future_doors/textures/myndoors_door6a_inv.png differ diff --git a/my_future_doors/textures/myndoors_door7a_bottom.png b/my_future_doors/textures/myndoors_door7a_bottom.png new file mode 100644 index 0000000..e29018f Binary files /dev/null and b/my_future_doors/textures/myndoors_door7a_bottom.png differ diff --git a/my_future_doors/textures/myndoors_door7a_bottomo.png b/my_future_doors/textures/myndoors_door7a_bottomo.png new file mode 100644 index 0000000..c08fc2e Binary files /dev/null and b/my_future_doors/textures/myndoors_door7a_bottomo.png differ diff --git a/my_future_doors/textures/myndoors_door7a_edge.png b/my_future_doors/textures/myndoors_door7a_edge.png new file mode 100644 index 0000000..bfd86dc Binary files /dev/null and b/my_future_doors/textures/myndoors_door7a_edge.png differ diff --git a/my_future_doors/textures/myndoors_door7a_inv.png b/my_future_doors/textures/myndoors_door7a_inv.png new file mode 100644 index 0000000..3c906fe Binary files /dev/null and b/my_future_doors/textures/myndoors_door7a_inv.png differ diff --git a/my_garage_door/init.lua b/my_garage_door/init.lua new file mode 100644 index 0000000..da9ae93 --- /dev/null +++ b/my_garage_door/init.lua @@ -0,0 +1,157 @@ + +minetest.register_node("my_garage_door:garage_door", { + description = "Garage Door", + tiles = { + "default_snow.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=3}, + node_box = { + type = "fixed", + fixed = { + {-1.5, -0.5, -0.125, 1.5, 0.5, -0.0625}, + {-1.5, -0.5, -0.1875, 1.5, -0.3125, -0.0625}, + {-1.5, -0.25, -0.1875, 1.5, -0.0624999, -0.0625}, + {-1.5, 0, -0.1875, 1.5, 0.1875, -0.0625}, + {-1.5, 0.25, -0.1875, 1.5, 0.4375, -0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1.5, -0.5, -0.1875, 1.5, 1.5, -0.0625}, + } + }, + on_place = function(itemstack, placer, pointed_thing) + local p = pointed_thing.above + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) +print(p2) + minetest.set_node(p, {name = "my_garage_door:garage_door",param2 = p2}) + minetest.set_node({x=p.x,y=p.y+1,z=p.z}, {name = "my_garage_door:garage_door_top",param2 = p2}) + end, + after_destruct = function(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name = "air"}) + end, + + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + local p2 = node.param2 --minetest.dir_to_facedir(player:get_look_dir()) + local t1 = {x=pos.x,y=pos.y+1,z=pos.z} + local t2 = {x=pos.x,y=pos.y+1,z=pos.z} + if p2 == 0 then + t1 = {x=pos.x,y=pos.y+1,z=pos.z+1} + t2 = {x=pos.x,y=pos.y+1,z=pos.z+2} + elseif p2 == 1 then + t1 = {x=pos.x+1,y=pos.y+1,z=pos.z} + t2 = {x=pos.x+2,y=pos.y+1,z=pos.z} + elseif p2 == 2 then + t1 = {x=pos.x,y=pos.y+1,z=pos.z-1} + t2 = {x=pos.x,y=pos.y+1,z=pos.z-2} + elseif p2 == 3 then + t1 = {x=pos.x-1,y=pos.y+1,z=pos.z} + t2 = {x=pos.x-2,y=pos.y+1,z=pos.z} + end + minetest.set_node(t1,{name="my_garage_door:garage_door_open",param2=p2}) + minetest.set_node(t2,{name="my_garage_door:garage_door_open2",param2=p2}) + minetest.set_node(pos,{name="air"}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) + --end + end, +}) +minetest.register_node("my_garage_door:garage_door_top", { + tiles = { + "default_snow.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2= "facedir", + drop = "", + diggable = false, + pointable = false, + groups = {cracky=3}, + node_box = { + type = "fixed", + fixed = { + {-1.5, -0.5, -0.125, 1.5, 0.5, -0.0625}, + {-1.5, -0.5, -0.1875, 1.5, -0.3125, -0.0625}, + {-1.5, -0.25, -0.1875, 1.5, -0.0624999, -0.0625}, + {-1.5, 0, -0.1875, 1.5, 0.1875, -0.0625}, + {-1.5, 0.25, -0.1875, 1.5, 0.4375, -0.0625}, + } + }, + selection_box = {type = "fixed",fixed = {{0, 0, 0, 0, 0, 0},}}, +}) +minetest.register_node("my_garage_door:garage_door_open", { + tiles = { + "default_snow.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2= "facedir", + drop = "my_garage_door:garage_door", + diggable = false, + groups = {cracky=3}, + node_box = { + type = "fixed", + fixed = { + {-1.5, 0.4375, -0.5, 1.5, 0.375, 0.5}, + {-1.5, 0.375, 0.3125, 1.5, 0.5, 0.5}, + {-1.5, 0.375, 0.0625, 1.5, 0.5, 0.25}, + {-1.5, 0.375, -0.1875, 1.5, 0.5, 0}, + {-1.5, 0.375, -0.4375, 1.5, 0.5, -0.25}, + } + }, + selection_box = {type = "fixed",fixed = {{-1.5, 0.375, -0.5, 1.5, 0.5, 1.5},}}, + + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + local p2 = node.param2 --minetest.dir_to_facedir(player:get_look_dir()) + local t1 = {x=pos.x,y=pos.y+1,z=pos.z} + local t2 = {x=pos.x,y=pos.y+1,z=pos.z} + if p2 == 0 then + t1 = {x=pos.x,y=pos.y,z=pos.z-1} + t2 = {x=pos.x,y=pos.y-1,z=pos.z-1} + t3 = {x=pos.x,y=pos.y,z=pos.z+1} + elseif p2 == 1 then + t1 = {x=pos.x-1,y=pos.y,z=pos.z} + t2 = {x=pos.x-1,y=pos.y-1,z=pos.z} + t3 = {x=pos.x+1,y=pos.y,z=pos.z} + elseif p2 == 2 then + t1 = {x=pos.x,y=pos.y,z=pos.z+1} + t2 = {x=pos.x,y=pos.y-1,z=pos.z+1} + t3 = {x=pos.x,y=pos.y,z=pos.z-1} + elseif p2 == 3 then + t1 = {x=pos.x+1,y=pos.y,z=pos.z} + t2 = {x=pos.x+1,y=pos.y-1,z=pos.z} + t3 = {x=pos.x-1,y=pos.y,z=pos.z} + end + minetest.set_node(t1,{name="my_garage_door:garage_door_top",param2=p2}) + minetest.set_node(t2,{name="my_garage_door:garage_door",param2=p2}) + minetest.set_node(pos,{name="air"}) + minetest.set_node(t3,{name="air"}) + end, +}) +minetest.register_node("my_garage_door:garage_door_open2", { + tiles = { + "default_snow.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2= "facedir", + drop = "", + diggable = false, + pointable = false, + groups = {cracky=3}, + node_box = { + type = "fixed", + fixed = { + {-1.5, 0.4375, -0.5, 1.5, 0.375, 0.5}, + {-1.5, 0.375, 0.3125, 1.5, 0.5, 0.5}, + {-1.5, 0.375, 0.0625, 1.5, 0.5, 0.25}, + {-1.5, 0.375, -0.1875, 1.5, 0.5, 0}, + {-1.5, 0.375, -0.4375, 1.5, 0.5, -0.25}, + } + }, + selection_box = {type = "fixed",fixed = {{0, 0, 0, 0, 0, 0},}}, + +}) diff --git a/my_hidden_doors/depends.txt b/my_hidden_doors/depends.txt new file mode 100644 index 0000000..bfb8e83 --- /dev/null +++ b/my_hidden_doors/depends.txt @@ -0,0 +1,3 @@ +default +mdoors +my_door_wood diff --git a/my_hidden_doors/init.lua b/my_hidden_doors/init.lua new file mode 100644 index 0000000..3a8e648 --- /dev/null +++ b/my_hidden_doors/init.lua @@ -0,0 +1,121 @@ +local hdoor_list = { --Number , Description , default image + { "cobble" , "Hidden Cobble Door", "default_cobble"}, + { "stone" , "Hidden Stone Door", "default_stone"}, + { "wood", "Hidden Wood Door", "default_wood"}, + { "stone_brick", "Hidden Stone Brick Door", "default_stone_brick"}, + { "brick", "Hidden Brick Door", "default_brick"}, + { "desert_cobble", "Hidden Desert Cobble Door", "default_desert_cobble"}, + { "furnace", "Hidden Furnace Door" , "mydoors_furnace" , "door7"}, + { "chest", "Hidden Chest Door" , "mydoors_chest" , "door8"}, + { "bookshelf", "Hidden Bookshelf Door" , "mydoors_bookshelf" , "door9"}, +} + + +for i in ipairs(hdoor_list) do + local img = hdoor_list[i][1] + local desc = hdoor_list[i][2] + local dimg = hdoor_list[i][3] + + +mdoors.register_door("my_hidden_doors:hidden_door"..img, { + description = desc.." Locked", + inventory_image = "mydoors_"..img.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {dimg..".png^[transformFX", "mydoors_"..img.."_edge.png"}, + tiles_top = {dimg..".png^[transformFX", "mydoors_"..img.."_edge.png"}, + only_placer_can_open = false, +}) + +end +mdoors.register_door("my_hidden_doors:hidden_door_grey", { + description = "Grey Door Locked", + inventory_image = "mydoors_grey_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mydoors_grey_bottom.png^[transformFX", "mydoors_grey_edge.png"}, + tiles_top = {"mydoors_grey_top.png^[transformFX", "mydoors_grey_edge.png"}, + only_placer_can_open = false, +}) +-- Crafts + +minetest.register_craft({ + output = "my_hidden_doors:hidden_doorcobble 1", + recipe = { + {"my_hidden_doors:hidden_door_grey", "default:cobble", ""}, + {"", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "my_hidden_doors:hidden_doorstone 1", + recipe = { + {"my_hidden_doors:hidden_door_grey", "default:stone", ""}, + {"", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "my_hidden_doors:hidden_doorwood 1", + recipe = { + {"my_hidden_doors:hidden_door_grey", "default:wood", ""}, + {"", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "my_hidden_doors:hidden_doorstone_brick 1", + recipe = { + {"my_hidden_doors:hidden_door_grey", "default:stonebrick", ""}, + {"", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "my_hidden_doors:hidden_doordesert_cobble 1", + recipe = { + {"my_hidden_doors:hidden_door_grey", "default:desert_cobble", ""}, + {"", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "my_hidden_doors:hidden_doorfurnace 1", + recipe = { + {"my_hidden_doors:hidden_door_grey", "default:furnace", ""}, + {"", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "my_hidden_doors:hidden_doorchest 1", + recipe = { + {"my_hidden_doors:hidden_door_grey", "default:chest", ""}, + {"", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "my_hidden_doors:hidden_doorbookshelf 1", + recipe = { + {"my_hidden_doors:hidden_door_grey", "default:bookshelf", ""}, + {"", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "my_hidden_doors:hidden_doorbrick 1", + recipe = { + {"my_hidden_doors:hidden_door_grey", "default:brick", ""}, + {"", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "my_hidden_doors:hidden_door_grey 1", + recipe = { + {"my_door_wood:wood_dark_grey", "my_door_wood:wood_dark_grey", ""}, + {"my_door_wood:wood_dark_grey", "my_door_wood:wood_dark_grey", ""}, + {"my_door_wood:wood_dark_grey", "my_door_wood:wood_dark_grey", ""} + } +}) + + diff --git a/my_hidden_doors/textures/mydoors_bookshelf.png b/my_hidden_doors/textures/mydoors_bookshelf.png new file mode 100644 index 0000000..2771a3b Binary files /dev/null and b/my_hidden_doors/textures/mydoors_bookshelf.png differ diff --git a/my_hidden_doors/textures/mydoors_bookshelf_edge.png b/my_hidden_doors/textures/mydoors_bookshelf_edge.png new file mode 100644 index 0000000..238c8dd Binary files /dev/null and b/my_hidden_doors/textures/mydoors_bookshelf_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_bookshelf_inv.png b/my_hidden_doors/textures/mydoors_bookshelf_inv.png new file mode 100644 index 0000000..a1f411e Binary files /dev/null and b/my_hidden_doors/textures/mydoors_bookshelf_inv.png differ diff --git a/my_hidden_doors/textures/mydoors_brick_edge.png b/my_hidden_doors/textures/mydoors_brick_edge.png new file mode 100644 index 0000000..96d34fd Binary files /dev/null and b/my_hidden_doors/textures/mydoors_brick_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_brick_inv.png b/my_hidden_doors/textures/mydoors_brick_inv.png new file mode 100644 index 0000000..896f771 Binary files /dev/null and b/my_hidden_doors/textures/mydoors_brick_inv.png differ diff --git a/my_hidden_doors/textures/mydoors_chest.png b/my_hidden_doors/textures/mydoors_chest.png new file mode 100644 index 0000000..c61e92a Binary files /dev/null and b/my_hidden_doors/textures/mydoors_chest.png differ diff --git a/my_hidden_doors/textures/mydoors_chest_edge.png b/my_hidden_doors/textures/mydoors_chest_edge.png new file mode 100644 index 0000000..238c8dd Binary files /dev/null and b/my_hidden_doors/textures/mydoors_chest_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_chest_inv.png b/my_hidden_doors/textures/mydoors_chest_inv.png new file mode 100644 index 0000000..221c1b8 Binary files /dev/null and b/my_hidden_doors/textures/mydoors_chest_inv.png differ diff --git a/my_hidden_doors/textures/mydoors_cobble_edge.png b/my_hidden_doors/textures/mydoors_cobble_edge.png new file mode 100644 index 0000000..44cabdb Binary files /dev/null and b/my_hidden_doors/textures/mydoors_cobble_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_cobble_inv.png b/my_hidden_doors/textures/mydoors_cobble_inv.png new file mode 100644 index 0000000..19a1fdc Binary files /dev/null and b/my_hidden_doors/textures/mydoors_cobble_inv.png differ diff --git a/my_hidden_doors/textures/mydoors_desert_cobble_edge.png b/my_hidden_doors/textures/mydoors_desert_cobble_edge.png new file mode 100644 index 0000000..1670c1b Binary files /dev/null and b/my_hidden_doors/textures/mydoors_desert_cobble_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_desert_cobble_inv.png b/my_hidden_doors/textures/mydoors_desert_cobble_inv.png new file mode 100644 index 0000000..4958a65 Binary files /dev/null and b/my_hidden_doors/textures/mydoors_desert_cobble_inv.png differ diff --git a/my_hidden_doors/textures/mydoors_door2_edge.png b/my_hidden_doors/textures/mydoors_door2_edge.png new file mode 100644 index 0000000..5d9d054 Binary files /dev/null and b/my_hidden_doors/textures/mydoors_door2_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_furnace.png b/my_hidden_doors/textures/mydoors_furnace.png new file mode 100644 index 0000000..21b442e Binary files /dev/null and b/my_hidden_doors/textures/mydoors_furnace.png differ diff --git a/my_hidden_doors/textures/mydoors_furnace_edge.png b/my_hidden_doors/textures/mydoors_furnace_edge.png new file mode 100644 index 0000000..44cabdb Binary files /dev/null and b/my_hidden_doors/textures/mydoors_furnace_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_furnace_inv.png b/my_hidden_doors/textures/mydoors_furnace_inv.png new file mode 100644 index 0000000..7f46717 Binary files /dev/null and b/my_hidden_doors/textures/mydoors_furnace_inv.png differ diff --git a/my_hidden_doors/textures/mydoors_grey_bottom.png b/my_hidden_doors/textures/mydoors_grey_bottom.png new file mode 100644 index 0000000..7f0966b Binary files /dev/null and b/my_hidden_doors/textures/mydoors_grey_bottom.png differ diff --git a/my_hidden_doors/textures/mydoors_grey_edge.png b/my_hidden_doors/textures/mydoors_grey_edge.png new file mode 100644 index 0000000..699d870 Binary files /dev/null and b/my_hidden_doors/textures/mydoors_grey_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_grey_inv.png b/my_hidden_doors/textures/mydoors_grey_inv.png new file mode 100644 index 0000000..4112927 Binary files /dev/null and b/my_hidden_doors/textures/mydoors_grey_inv.png differ diff --git a/my_hidden_doors/textures/mydoors_grey_top.png b/my_hidden_doors/textures/mydoors_grey_top.png new file mode 100644 index 0000000..641c2c3 Binary files /dev/null and b/my_hidden_doors/textures/mydoors_grey_top.png differ diff --git a/my_hidden_doors/textures/mydoors_stone_brick_edge.png b/my_hidden_doors/textures/mydoors_stone_brick_edge.png new file mode 100644 index 0000000..44cabdb Binary files /dev/null and b/my_hidden_doors/textures/mydoors_stone_brick_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_stone_brick_inv.png b/my_hidden_doors/textures/mydoors_stone_brick_inv.png new file mode 100644 index 0000000..cc7cf24 Binary files /dev/null and b/my_hidden_doors/textures/mydoors_stone_brick_inv.png differ diff --git a/my_hidden_doors/textures/mydoors_stone_edge.png b/my_hidden_doors/textures/mydoors_stone_edge.png new file mode 100644 index 0000000..44cabdb Binary files /dev/null and b/my_hidden_doors/textures/mydoors_stone_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_stone_inv.png b/my_hidden_doors/textures/mydoors_stone_inv.png new file mode 100644 index 0000000..bf80436 Binary files /dev/null and b/my_hidden_doors/textures/mydoors_stone_inv.png differ diff --git a/my_hidden_doors/textures/mydoors_wood_edge.png b/my_hidden_doors/textures/mydoors_wood_edge.png new file mode 100644 index 0000000..238c8dd Binary files /dev/null and b/my_hidden_doors/textures/mydoors_wood_edge.png differ diff --git a/my_hidden_doors/textures/mydoors_wood_inv.png b/my_hidden_doors/textures/mydoors_wood_inv.png new file mode 100644 index 0000000..2175e6b Binary files /dev/null and b/my_hidden_doors/textures/mydoors_wood_inv.png differ diff --git a/my_misc_doors/bars.lua b/my_misc_doors/bars.lua new file mode 100644 index 0000000..033baab --- /dev/null +++ b/my_misc_doors/bars.lua @@ -0,0 +1,229 @@ +minetest.register_node("my_misc_doors:door2a", { + description = "Sliding Door", + inventory_image = "mydoors_bars.png", + tiles = { + "mydoors_bars.png", + "mydoors_bars.png", + "mydoors_bars.png", + "mydoors_bars.png", + "mydoors_bars.png", + "mydoors_bars.png", + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {-0.4375, -0.5, -0.0625, -0.3125, 0.5, 0.0625}, + {-0.0625, -0.5, -0.0625, 0.0625, 0.5, 0.0625}, + {0.3125, -0.5, -0.0625, 0.4375, 0.5, 0.0625}, + {0.125, -0.5, -0.0625, 0.25, 0.5, 0.0625}, + {-0.25, -0.5, -0.0625, -0.125, 0.5, 0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.4375, -0.5, -0.0625, 0.4375, 1.5, 0.0625}, + } + }, + +on_place = function(itemstack, placer, pointed_thing) + local pos1 = pointed_thing.above + local pos2 = {x=pos1.x, y=pos1.y, z=pos1.z} + pos2.y = pos2.y+1 + if + not minetest.registered_nodes[minetest.get_node(pos1).name].buildable_to or + not minetest.registered_nodes[minetest.get_node(pos2).name].buildable_to or + not placer or + not placer:is_player() then + return + end + local pt = pointed_thing.above + local pt2 = {x=pt.x, y=pt.y, z=pt.z} + pt2.y = pt2.y+1 + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pt3 = {x=pt.x, y=pt.y, z=pt.z} + local p4 = 0 + if p2 == 0 then + pt3.x = pt3.x-1 + p4 = 2 + elseif p2 == 1 then + pt3.z = pt3.z+1 + p4 = 3 + elseif p2 == 2 then + pt3.x = pt3.x+1 + p4 = 0 + elseif p2 == 3 then + pt3.z = pt3.z-1 + p4 = 1 + end + if minetest.get_node(pt3).name == "my_misc_doors:door2a" then + minetest.set_node(pt, {name="my_misc_doors:door2a", param2=p4}) + minetest.set_node(pt2, {name="my_misc_doors:door2b", param2=p4}) + else + minetest.set_node(pt, {name="my_misc_doors:door2a", param2=p2}) + minetest.set_node(pt2, {name="my_misc_doors:door2b", param2=p2}) + end +end, +after_destruct = function(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) +end, +on_rightclick = function(pos, node, player, itemstack, pointed_thing) + local timer = minetest.get_node_timer(pos) + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + minetest.set_node(pos, {name="my_misc_doors:door2c", param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name="my_misc_doors:door2d", param2=node.param2}) + + if a.name == "my_misc_doors:door2a" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name="my_misc_doors:door2c", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name="my_misc_doors:door2d", param2=a.param2}) + end + if b.name == "my_misc_doors:door2a" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name="my_misc_doors:door2c", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name="my_misc_doors:door2d", param2=b.param2}) + end + if c.name == "my_misc_doors:door2a" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name="my_misc_doors:door2c", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name="my_misc_doors:door2d", param2=c.param2}) + end + if d.name == "my_misc_doors:door2a" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name="my_misc_doors:door2c", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name="my_misc_doors:door2d", param2=d.param2}) + end + + timer:start(3) + +end, +}) +minetest.register_node("my_misc_doors:door2b", { + tiles = { + "mydoors_bars.png", + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.4375, -0.5, -0.0625, -0.3125, 0.5, 0.0625}, + {-0.0625, -0.5, -0.0625, 0.0625, 0.5, 0.0625}, + {0.3125, -0.5, -0.0625, 0.4375, 0.5, 0.0625}, + {0.125, -0.5, -0.0625, 0.25, 0.5, 0.0625}, + {-0.25, -0.5, -0.0625, -0.125, 0.5, 0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +}) +minetest.register_node("my_misc_doors:door2c", { + tiles = { + "mydoors_bars.png", + "mydoors_bars.png", + "mydoors_bars.png", + "mydoors_bars.png", + "mydoors_bars.png^[transformFX", + "mydoors_bars.png", + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.4375, -0.375, -0.0625, -0.3125, -0.5, 0.0625}, + {-0.0625, -0.375, -0.0625, 0.0625, -0.5, 0.0625}, + {0.3125, -0.375, -0.0625, 0.4375, -0.5, 0.0625}, + {0.125, -0.375, -0.0625, 0.25, -0.5, 0.0625}, + {-0.25, -0.375, -0.0625, -0.125, -0.5, 0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +after_place_node = function(pos, placer, itemstack, pointed_thing) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="my_misc_doors:door2d",param2=nodeu.param2}) +end, +after_destruct = function(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) +end, +on_timer = function(pos, elapsed) + local node = minetest.get_node(pos) + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + minetest.set_node(pos, {name="my_misc_doors:door2a", param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name="my_misc_doors:door2b", param2=node.param2}) + + if a.name == "my_misc_doors:door2c" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name="my_misc_doors:door2a", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name="my_misc_doors:door2b", param2=a.param2}) + end + if b.name == "my_misc_doors:door2c" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name="my_misc_doors:door2a", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name="my_misc_doors:door2b", param2=b.param2}) + end + if c.name == "my_misc_doors:door2c" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name="my_misc_doors:door2a", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name="my_misc_doors:door2b", param2=c.param2}) + end + if d.name == "my_misc_doors:door2c" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name="my_misc_doors:door2a", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name="my_misc_doors:door2b", param2=d.param2}) + end + +end, +}) +minetest.register_node("my_misc_doors:door2d", { + tiles = { + "mydoors_bars.png", + "mydoors_bars.png", + "mydoors_bars.png", + "mydoors_bars.png", + "mydoors_bars.png^[transformFX", + "mydoors_bars.png", + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.4375, 0.375, -0.0625, -0.3125, 0.5, 0.0625}, + {-0.0625, 0.375, -0.0625, 0.0625, 0.5, 0.0625}, + {0.3125, 0.375, -0.0625, 0.4375, 0.5, 0.0625}, + {0.125, 0.375, -0.0625, 0.25, 0.5, 0.0625}, + {-0.25, 0.375, -0.0625, -0.125, 0.5, 0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +}) +minetest.register_craft({ + output = "my_misc_doors:door2a 1", + recipe = { + {"default:steel_ingot", "default:steelblock", ""}, + {"default:steel_ingot", "default:steel_ingot", ""}, + {"default:steelblock", "default:steel_ingot", ""} + } +}) diff --git a/my_misc_doors/depends.txt b/my_misc_doors/depends.txt new file mode 100644 index 0000000..d0c0845 --- /dev/null +++ b/my_misc_doors/depends.txt @@ -0,0 +1,4 @@ +default +mdoors +my_door_wood +wool diff --git a/my_misc_doors/init.lua b/my_misc_doors/init.lua new file mode 100644 index 0000000..1622020 --- /dev/null +++ b/my_misc_doors/init.lua @@ -0,0 +1,5 @@ +dofile(minetest.get_modpath("my_misc_doors").."/locked.lua") +dofile(minetest.get_modpath("my_misc_doors").."/unlocked.lua") +dofile(minetest.get_modpath("my_misc_doors").."/bars.lua") + + diff --git a/my_misc_doors/locked.lua b/my_misc_doors/locked.lua new file mode 100644 index 0000000..a245111 --- /dev/null +++ b/my_misc_doors/locked.lua @@ -0,0 +1,81 @@ +local mdoor_list = { --Number , Description , Inven Image , Image +-- { "1" , "Misc Door 1" , "door1" , "door1"}, +-- { "2" , "Misc Door 2" , "door2" , "door2"}, + { "3" , "Misc Door 3" , "door3" , "door3"}, + { "4" , "Misc Door 4" , "door4" , "door4"}, +-- { "5" , "Misc Door 5" , "door5" , "door5"}, + { "6" , "Misc Door 6" , "door6" , "door6"}, +} + + +for i in ipairs(mdoor_list) do + local num = mdoor_list[i][1] + local desc = mdoor_list[i][2] + local inv = mdoor_list[i][3] + local img = mdoor_list[i][4] + + +mdoors.register_door("my_misc_doors:door"..num.."_locked", { + description = desc.." Locked", + inventory_image = "mymdoors_"..inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mymdoors_"..img.."_bottom.png", "mymdoors_"..img.."_edge.png"}, + tiles_top = {"mymdoors_"..img.."_top.png", "mymdoors_"..img.."_edge.png"}, + only_placer_can_open = true, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "my_misc_doors:door1_locked 1", + recipe = { + {"my_door_wood:wood_white", "my_door_wood:wood_white", ""}, + {"my_door_wood:wood_white", "my_door_wood:wood_white", "default:steel_ingot"}, + {"my_door_wood:wood_white", "my_door_wood:wood_white", ""} + } +}) + +minetest.register_craft({ + output = "my_misc_doors:door2_locked 1", + recipe = { + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""}, + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", "default:steel_ingot"}, + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""} + } +}) +minetest.register_craft({ + output = "my_misc_doors:door3_locked 1", + recipe = { + {"default:stone", "default:stone", ""}, + {"default:stone", "default:stone", "default:steel_ingot"}, + {"default:stone", "default:stone", ""} + } +}) +minetest.register_craft({ + output = "my_misc_doors:door4_locked 1", + recipe = { + {"default:cobble", "default:cobble", ""}, + {"default:cobble", "default:cobble", "default:steel_ingot"}, + {"default:cobble", "default:cobble", ""} + } +}) +minetest.register_craft({ + output = "my_misc_doors:door5_locked 1", + recipe = { + {"my_door_wood:wood_white", "wool:red", ""}, + {"my_door_wood:wood_white", "my_door_wood:wood_white", "default:steel_ingot"}, + {"my_door_wood:wood_white", "wool:red", ""} + } +}) +minetest.register_craft({ + output = "my_misc_doors:door6_locked 1", + recipe = { + {"default:steel_ingot", "default:iron_lump", ""}, + {"default:steel_ingot", "default:iron_lump", "default:steel_ingot"}, + {"default:steel_ingot", "default:iron_lump", ""} + } +}) + + + diff --git a/my_misc_doors/textures/mydoors_bars.png b/my_misc_doors/textures/mydoors_bars.png new file mode 100644 index 0000000..74c4d42 Binary files /dev/null and b/my_misc_doors/textures/mydoors_bars.png differ diff --git a/my_misc_doors/textures/mymdoors_door1_bottom.png b/my_misc_doors/textures/mymdoors_door1_bottom.png new file mode 100644 index 0000000..69d45bc Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door1_bottom.png differ diff --git a/my_misc_doors/textures/mymdoors_door1_edge.png b/my_misc_doors/textures/mymdoors_door1_edge.png new file mode 100644 index 0000000..3f6d8bb Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door1_edge.png differ diff --git a/my_misc_doors/textures/mymdoors_door1_inv.png b/my_misc_doors/textures/mymdoors_door1_inv.png new file mode 100644 index 0000000..a7089ff Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door1_inv.png differ diff --git a/my_misc_doors/textures/mymdoors_door1_top.png b/my_misc_doors/textures/mymdoors_door1_top.png new file mode 100644 index 0000000..107809b Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door1_top.png differ diff --git a/my_misc_doors/textures/mymdoors_door2_bottom.png b/my_misc_doors/textures/mymdoors_door2_bottom.png new file mode 100644 index 0000000..0787e79 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door2_bottom.png differ diff --git a/my_misc_doors/textures/mymdoors_door2_edge.png b/my_misc_doors/textures/mymdoors_door2_edge.png new file mode 100644 index 0000000..5d9d054 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door2_edge.png differ diff --git a/my_misc_doors/textures/mymdoors_door2_inv.png b/my_misc_doors/textures/mymdoors_door2_inv.png new file mode 100644 index 0000000..a22d587 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door2_inv.png differ diff --git a/my_misc_doors/textures/mymdoors_door2_top.png b/my_misc_doors/textures/mymdoors_door2_top.png new file mode 100644 index 0000000..d681d90 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door2_top.png differ diff --git a/my_misc_doors/textures/mymdoors_door3_bottom.png b/my_misc_doors/textures/mymdoors_door3_bottom.png new file mode 100644 index 0000000..bf5fb58 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door3_bottom.png differ diff --git a/my_misc_doors/textures/mymdoors_door3_edge.png b/my_misc_doors/textures/mymdoors_door3_edge.png new file mode 100644 index 0000000..44cabdb Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door3_edge.png differ diff --git a/my_misc_doors/textures/mymdoors_door3_inv.png b/my_misc_doors/textures/mymdoors_door3_inv.png new file mode 100644 index 0000000..1b3ee35 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door3_inv.png differ diff --git a/my_misc_doors/textures/mymdoors_door3_top.png b/my_misc_doors/textures/mymdoors_door3_top.png new file mode 100644 index 0000000..5847494 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door3_top.png differ diff --git a/my_misc_doors/textures/mymdoors_door4_bottom.png b/my_misc_doors/textures/mymdoors_door4_bottom.png new file mode 100644 index 0000000..de34b70 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door4_bottom.png differ diff --git a/my_misc_doors/textures/mymdoors_door4_edge.png b/my_misc_doors/textures/mymdoors_door4_edge.png new file mode 100644 index 0000000..44cabdb Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door4_edge.png differ diff --git a/my_misc_doors/textures/mymdoors_door4_inv.png b/my_misc_doors/textures/mymdoors_door4_inv.png new file mode 100644 index 0000000..1167b04 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door4_inv.png differ diff --git a/my_misc_doors/textures/mymdoors_door4_top.png b/my_misc_doors/textures/mymdoors_door4_top.png new file mode 100644 index 0000000..7a70c6c Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door4_top.png differ diff --git a/my_misc_doors/textures/mymdoors_door5_bottom.png b/my_misc_doors/textures/mymdoors_door5_bottom.png new file mode 100644 index 0000000..3531318 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door5_bottom.png differ diff --git a/my_misc_doors/textures/mymdoors_door5_edge.png b/my_misc_doors/textures/mymdoors_door5_edge.png new file mode 100644 index 0000000..3f6d8bb Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door5_edge.png differ diff --git a/my_misc_doors/textures/mymdoors_door5_inv.png b/my_misc_doors/textures/mymdoors_door5_inv.png new file mode 100644 index 0000000..bffa770 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door5_inv.png differ diff --git a/my_misc_doors/textures/mymdoors_door5_top.png b/my_misc_doors/textures/mymdoors_door5_top.png new file mode 100644 index 0000000..24392d7 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door5_top.png differ diff --git a/my_misc_doors/textures/mymdoors_door6_bottom.png b/my_misc_doors/textures/mymdoors_door6_bottom.png new file mode 100644 index 0000000..575b89f Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door6_bottom.png differ diff --git a/my_misc_doors/textures/mymdoors_door6_edge.png b/my_misc_doors/textures/mymdoors_door6_edge.png new file mode 100644 index 0000000..5d9d054 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door6_edge.png differ diff --git a/my_misc_doors/textures/mymdoors_door6_inv.png b/my_misc_doors/textures/mymdoors_door6_inv.png new file mode 100644 index 0000000..8018227 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door6_inv.png differ diff --git a/my_misc_doors/textures/mymdoors_door6_top.png b/my_misc_doors/textures/mymdoors_door6_top.png new file mode 100644 index 0000000..f66e0b5 Binary files /dev/null and b/my_misc_doors/textures/mymdoors_door6_top.png differ diff --git a/my_misc_doors/unlocked.lua b/my_misc_doors/unlocked.lua new file mode 100644 index 0000000..8160615 --- /dev/null +++ b/my_misc_doors/unlocked.lua @@ -0,0 +1,77 @@ +local mdoor_list = { --Number , Description , Inven Image , Image + { "1" , "Misc Door 1" , "door1" , "door1"}, + { "2" , "Misc Door 2" , "door2" , "door2"}, +-- { "3" , "Misc Door 3" , "door3" , "door3"}, +-- { "4" , "Misc Door 4" , "door4" , "door4"}, + { "5" , "Misc Door 5" , "door5" , "door5"}, +} + + +for i in ipairs(mdoor_list) do + local num = mdoor_list[i][1] + local desc = mdoor_list[i][2] + local inv = mdoor_list[i][3] + local img = mdoor_list[i][4] + + +mdoors.register_door("my_misc_doors:door"..num, { + description = desc, + inventory_image = "mymdoors_"..inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mymdoors_"..img.."_bottom.png", "mymdoors_"..img.."_edge.png"}, + tiles_top = {"mymdoors_"..img.."_top.png", "mymdoors_"..img.."_edge.png"}, + only_placer_can_open = false, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "my_misc_doors:door1 1", + recipe = { + {"my_door_wood:wood_white", "my_door_wood:wood_white", ""}, + {"my_door_wood:wood_white", "my_door_wood:wood_white", ""}, + {"my_door_wood:wood_white", "my_door_wood:wood_white", ""} + } +}) + +minetest.register_craft({ + output = "my_misc_doors:door2 1", + recipe = { + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""}, + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""}, + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""} + } +}) +minetest.register_craft({ + output = "my_misc_doors:door3 1", + recipe = { + {"default:stone", "default:stone", ""}, + {"default:stone", "default:stone", ""}, + {"default:stone", "default:stone", ""} + } +}) +minetest.register_craft({ + output = "my_misc_doors:door4 1", + recipe = { + {"default:cobble", "default:cobble", ""}, + {"default:cobble", "default:cobble", ""}, + {"default:cobble", "default:cobble", ""} + } +}) +minetest.register_craft({ + output = "my_misc_doors:door5 1", + recipe = { + {"my_door_wood:wood_white", "wool:red", ""}, + {"my_door_wood:wood_white", "my_door_wood:wood_white", ""}, + {"my_door_wood:wood_white", "wool:red", ""} + } +}) +minetest.register_craft({ + output = "my_misc_doors:door6 1", + recipe = { + {"default:steel_ingot", "default:iron_lump", ""}, + {"default:steel_ingot", "default:iron_lump", ""}, + {"default:steel_ingot", "default:iron_lump", ""} + } +}) diff --git a/my_old_doors/depends.txt b/my_old_doors/depends.txt new file mode 100644 index 0000000..bfb8e83 --- /dev/null +++ b/my_old_doors/depends.txt @@ -0,0 +1,3 @@ +default +mdoors +my_door_wood diff --git a/my_old_doors/init.lua b/my_old_doors/init.lua new file mode 100644 index 0000000..56ba45d --- /dev/null +++ b/my_old_doors/init.lua @@ -0,0 +1,4 @@ +dofile(minetest.get_modpath("my_old_doors").."/locked.lua") +dofile(minetest.get_modpath("my_old_doors").."/unlocked.lua") + + diff --git a/my_old_doors/locked.lua b/my_old_doors/locked.lua new file mode 100644 index 0000000..8f02183 --- /dev/null +++ b/my_old_doors/locked.lua @@ -0,0 +1,57 @@ +local cdoor_list = { --Number , Description , Inven Image , Image + { "1", "Old Door 1" , "old1", "old1"}, + { "2", "Old Door 2" , "old2" , "old2"}, + { "3", "Old Door 3" , "old3" , "old3"}, + { "4", "Old Door 4" , "old4" , "old4"}, +} +for i in ipairs(cdoor_list) do + local num = cdoor_list[i][1] + local desc = cdoor_list[i][2] + local inv = cdoor_list[i][3] + local img = cdoor_list[i][4] + + +mdoors.register_door("my_old_doors:door"..num.."_locked", { + description = desc.." Locked", + inventory_image = "mydoors_"..inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mydoors_"..img.."_bottom.png", "mydoors_"..img.."_edge.png"}, + tiles_top = {"mydoors_"..img.."_top.png", "mydoors_"..img.."_edge.png"}, + only_placer_can_open = true, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "my_old_doors:door1_locked 1", + recipe = { + {"default:glass", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", "default:steel_ingot"}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""} + } +}) +minetest.register_craft({ + output = "my_old_doors:door2_locked 1", + recipe = { + {"default:glass", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", "default:steel_ingot"}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) +minetest.register_craft({ + output = "my_old_doors:door3_locked 1", + recipe = { + {"default:glass", "my_door_wood:wood_grey", ""}, + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", "default:steel_ingot"}, + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""} + } +}) +minetest.register_craft({ + output = "my_old_doors:door4_locked 1", + recipe = { + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "dye:black", "default:steel_ingot"}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) diff --git a/my_old_doors/textures/mydoors_old1_bottom.png b/my_old_doors/textures/mydoors_old1_bottom.png new file mode 100644 index 0000000..2d71948 Binary files /dev/null and b/my_old_doors/textures/mydoors_old1_bottom.png differ diff --git a/my_old_doors/textures/mydoors_old1_edge.png b/my_old_doors/textures/mydoors_old1_edge.png new file mode 100644 index 0000000..7098a0d Binary files /dev/null and b/my_old_doors/textures/mydoors_old1_edge.png differ diff --git a/my_old_doors/textures/mydoors_old1_inv.png b/my_old_doors/textures/mydoors_old1_inv.png new file mode 100644 index 0000000..a742ffb Binary files /dev/null and b/my_old_doors/textures/mydoors_old1_inv.png differ diff --git a/my_old_doors/textures/mydoors_old1_top.png b/my_old_doors/textures/mydoors_old1_top.png new file mode 100644 index 0000000..da44da3 Binary files /dev/null and b/my_old_doors/textures/mydoors_old1_top.png differ diff --git a/my_old_doors/textures/mydoors_old2_bottom.png b/my_old_doors/textures/mydoors_old2_bottom.png new file mode 100644 index 0000000..932ff72 Binary files /dev/null and b/my_old_doors/textures/mydoors_old2_bottom.png differ diff --git a/my_old_doors/textures/mydoors_old2_edge.png b/my_old_doors/textures/mydoors_old2_edge.png new file mode 100644 index 0000000..113bd62 Binary files /dev/null and b/my_old_doors/textures/mydoors_old2_edge.png differ diff --git a/my_old_doors/textures/mydoors_old2_inv.png b/my_old_doors/textures/mydoors_old2_inv.png new file mode 100644 index 0000000..9784fa4 Binary files /dev/null and b/my_old_doors/textures/mydoors_old2_inv.png differ diff --git a/my_old_doors/textures/mydoors_old2_top.png b/my_old_doors/textures/mydoors_old2_top.png new file mode 100644 index 0000000..8dba6ce Binary files /dev/null and b/my_old_doors/textures/mydoors_old2_top.png differ diff --git a/my_old_doors/textures/mydoors_old3_bottom.png b/my_old_doors/textures/mydoors_old3_bottom.png new file mode 100644 index 0000000..b38894a Binary files /dev/null and b/my_old_doors/textures/mydoors_old3_bottom.png differ diff --git a/my_old_doors/textures/mydoors_old3_edge.png b/my_old_doors/textures/mydoors_old3_edge.png new file mode 100644 index 0000000..a6775f8 Binary files /dev/null and b/my_old_doors/textures/mydoors_old3_edge.png differ diff --git a/my_old_doors/textures/mydoors_old3_inv.png b/my_old_doors/textures/mydoors_old3_inv.png new file mode 100644 index 0000000..25ac985 Binary files /dev/null and b/my_old_doors/textures/mydoors_old3_inv.png differ diff --git a/my_old_doors/textures/mydoors_old3_top.png b/my_old_doors/textures/mydoors_old3_top.png new file mode 100644 index 0000000..f3f4025 Binary files /dev/null and b/my_old_doors/textures/mydoors_old3_top.png differ diff --git a/my_old_doors/textures/mydoors_old4_bottom.png b/my_old_doors/textures/mydoors_old4_bottom.png new file mode 100644 index 0000000..8f47d30 Binary files /dev/null and b/my_old_doors/textures/mydoors_old4_bottom.png differ diff --git a/my_old_doors/textures/mydoors_old4_edge.png b/my_old_doors/textures/mydoors_old4_edge.png new file mode 100644 index 0000000..8f265fa Binary files /dev/null and b/my_old_doors/textures/mydoors_old4_edge.png differ diff --git a/my_old_doors/textures/mydoors_old4_inv.png b/my_old_doors/textures/mydoors_old4_inv.png new file mode 100644 index 0000000..6963021 Binary files /dev/null and b/my_old_doors/textures/mydoors_old4_inv.png differ diff --git a/my_old_doors/textures/mydoors_old4_top.png b/my_old_doors/textures/mydoors_old4_top.png new file mode 100644 index 0000000..ad88f9b Binary files /dev/null and b/my_old_doors/textures/mydoors_old4_top.png differ diff --git a/my_old_doors/unlocked.lua b/my_old_doors/unlocked.lua new file mode 100644 index 0000000..5eaecd8 --- /dev/null +++ b/my_old_doors/unlocked.lua @@ -0,0 +1,59 @@ +local cdoor_list = { --Number , Description , Inven Image , Image +-- { "1", "Old Door 1" , "old1", "old1"}, +-- { "2", "Old Door 2" , "old2" , "old2"}, +-- { "3", "Old Door 3" , "old3" , "old3"}, +-- { "4", "Old Door 4" , "old4" , "old4"}, +} +for i in ipairs(cdoor_list) do + local num = cdoor_list[i][1] + local desc = cdoor_list[i][2] + local inv = cdoor_list[i][3] + local img = cdoor_list[i][4] + +mdoors.register_door("my_old_doors:door"..num, { + description = desc, + inventory_image = "mydoors_"..inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {"mydoors_"..img.."_bottom.png", "mydoors_"..img.."_edge.png"}, + tiles_top = {"mydoors_"..img.."_top.png", "mydoors_"..img.."_edge.png"}, + only_placer_can_open = false, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "my_old_doors:door1 1", + recipe = { + {"default:glass", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""}, + {"my_door_wood:wood_yellow", "my_door_wood:wood_yellow", ""} + } +}) +minetest.register_craft({ + output = "my_old_doors:door2 1", + recipe = { + {"default:glass", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) +minetest.register_craft({ + output = "my_old_doors:door3 1", + recipe = { + {"default:glass", "my_door_wood:wood_grey", ""}, + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""}, + {"my_door_wood:wood_grey", "my_door_wood:wood_grey", ""} + } +}) +minetest.register_craft({ + output = "my_old_doors:door4 1", + recipe = { + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""}, + {"my_door_wood:wood_red", "dye:black", ""}, + {"my_door_wood:wood_red", "my_door_wood:wood_red", ""} + } +}) + + + diff --git a/my_saloon_doors/depends.txt b/my_saloon_doors/depends.txt new file mode 100644 index 0000000..bfb8e83 --- /dev/null +++ b/my_saloon_doors/depends.txt @@ -0,0 +1,3 @@ +default +mdoors +my_door_wood diff --git a/my_saloon_doors/init.lua b/my_saloon_doors/init.lua new file mode 100644 index 0000000..00253b1 --- /dev/null +++ b/my_saloon_doors/init.lua @@ -0,0 +1,109 @@ + +local doorcol = { + {"white", "White", "^[colorize:white:120"}, + {"red", "Red", "^[colorize:red:120"}, + {"black", "Black", "^[colorize:black:220"}, + {"brown", "Brown", "^[colorize:black:180"}, + {"grey", "Grey", "^[colorize:white:120^[colorize:black:120"}, + {"dark_grey", "Dark grey", "^[colorize:white:120^[colorize:black:200"}, + {"yellow", "Yellow", "^[colorize:yellow:100"}, + } +for i in ipairs (doorcol) do +local col = doorcol[i][1] +local des = doorcol[i][2] +local tint = doorcol[i][3] + +minetest.register_node("my_saloon_doors:door1a_"..col, { + description = des.." Saloon Door ", + tiles = {"mydoors_saloon_bottom.png"..tint}, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.1875, -0.0625, 0, 0.75, 0.0625}, + {-0.5, 0.75, -0.0625, -0.0625, 0.8125, 0.0625}, + {-0.5, 0.8125, -0.0625, -0.125, 0.875, 0.0625}, + {-0.5, 0.875, -0.0625, -0.1875, 0.9375, 0.0625}, + {-0.5, 0.9375, -0.0625, -0.3125, 1, 0.0625}, + {-0, -0.1875, -0.0625, 0.5, 0.75, 0.0625}, + {0.0625, 0.75, -0.0625, 0.5, 0.8125, 0.0625}, + {0.125, 0.8125, -0.0625, 0.5, 0.875, 0.0625}, + {0.1875, 0.875, -0.0625, 0.5, 0.9375, 0.0625}, + {0.3125, 0.9375, -0.0625, 0.5, 1, 0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.1875, -0.0625, 0.5, 1, 0.0625}, + } + }, + +on_place = function(itemstack, placer, pointed_thing) + local pos1 = pointed_thing.above + local pos2 = {x=pos1.x, y=pos1.y, z=pos1.z} + pos2.y = pos2.y+1 + if + not minetest.registered_nodes[minetest.get_node(pos1).name].buildable_to or + not minetest.registered_nodes[minetest.get_node(pos2).name].buildable_to or + not placer or + not placer:is_player() then + return + end + return minetest.item_place(itemstack, placer, pointed_thing) +end, +on_rightclick = function(pos, node, player, itemstack, pointed_thing) + + local timer = minetest.get_node_timer(pos) + local par1 = node.param2 + local par2 = minetest.dir_to_facedir(player:get_look_dir()) + if par1 + par2 == 1 or + par1 + par2 == 3 or + par1 + par2 == 5 then + par2 = par1 + end + if node.name == "my_saloon_doors:door1a_"..col then + minetest.set_node(pos,{name="my_saloon_doors:door1b_"..col,param2=par2}) + timer:start(3) + end +end, +}) +minetest.register_node("my_saloon_doors:door1b_"..col, { + tiles = {"mydoors_saloon_bottom.png^[transformFY"..tint}, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.1875, -0.0625, -0.375, 0.75, 0.5}, + {-0.5, 0.75, -0.0625, -0.375, 0.8125, 0.4375}, + {-0.5, 0.8125, -0.0625, -0.375, 0.875, 0.375}, + {-0.5, 0.875, -0.0625, -0.375, 0.9375, 0.3125}, + {-0.5, 0.9375, -0.0625, -0.375, 1, 0.1875}, + {0.375, -0.1875, -0.0625, 0.5, 0.75, 0.5}, + {0.375, 0.75, -0.0625, 0.5, 0.8125, 0.4375}, + {0.375, 0.8125, -0.0625, 0.5, 0.875, 0.375}, + {0.375, 0.875, -0.0625, 0.5, 0.9375, 0.3125}, + {0.375, 0.9375, -0.0625, 0.5, 1, 0.1875}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, + +on_timer = function(pos, elapsed) + local node = minetest.get_node(pos) + minetest.set_node(pos,{name="my_saloon_doors:door1a_"..col,param2=node.param2}) +-- minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="my_saloon_doors:door1b_"..col,param2=node.param2}) +end, +}) + +end diff --git a/my_saloon_doors/textures/mydoors_saloon_bottom.png b/my_saloon_doors/textures/mydoors_saloon_bottom.png new file mode 100644 index 0000000..82ea242 Binary files /dev/null and b/my_saloon_doors/textures/mydoors_saloon_bottom.png differ diff --git a/my_sliding_doors/init.lua b/my_sliding_doors/init.lua new file mode 100644 index 0000000..68d6140 --- /dev/null +++ b/my_sliding_doors/init.lua @@ -0,0 +1,3 @@ + +dofile(minetest.get_modpath("my_sliding_doors").."/jdoors1.lua") +dofile(minetest.get_modpath("my_sliding_doors").."/jdoors2.lua") diff --git a/my_sliding_doors/jdoors1 (copy).lua b/my_sliding_doors/jdoors1 (copy).lua new file mode 100644 index 0000000..ba1519f --- /dev/null +++ b/my_sliding_doors/jdoors1 (copy).lua @@ -0,0 +1,483 @@ +local doors = { + {"my_sliding_doors:door1a","my_sliding_doors:door1b","my_sliding_doors:door1c","my_sliding_doors:door1d","1","White"}, + {"my_sliding_doors:door2a","my_sliding_doors:door2b","my_sliding_doors:door2c","my_sliding_doors:door2d","2","Flower"}, + {"my_sliding_doors:door3a","my_sliding_doors:door3b","my_sliding_doors:door3c","my_sliding_doors:door3d","3","Framed"}, + } +for i in ipairs (doors) do +local doora = doors[i][1] +local doorb = doors[i][2] +local doorc = doors[i][3] +local doord = doors[i][4] +local num = doors[i][5] +local des = doors[i][6] + +function onplace(itemstack, placer, pointed_thing) + local pos1 = pointed_thing.above + local pos2 = {x=pos1.x, y=pos1.y, z=pos1.z} + pos2.y = pos2.y+1 + if + not minetest.registered_nodes[minetest.get_node(pos1).name].buildable_to or + not minetest.registered_nodes[minetest.get_node(pos2).name].buildable_to or + not placer or + not placer:is_player() then + return + end + local pt = pointed_thing.above + local pt2 = {x=pt.x, y=pt.y, z=pt.z} + pt2.y = pt2.y+1 + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pt3 = {x=pt.x, y=pt.y, z=pt.z} + local p4 = 0 + local pa = {x=pt.x, y=pt.y, z=pt.z} + if p2 == 0 then + pt3.x = pt3.x-1 + pa.x = pa.x+1 + p4 = 2 + elseif p2 == 1 then + pt3.z = pt3.z+1 + pa.z = pa.z-1 + p4 = 3 + elseif p2 == 2 then + pt3.x = pt3.x+1 + pa.x = pa.x-1 + p4 = 0 + elseif p2 == 3 then + pt3.z = pt3.z-1 + pa.z = pa.z+1 + p4 = 1 + end + local pa = pt3 + if minetest.get_node(pt3).name ~= "air" then + minetest.chat_send_player(placer:get_player_name(),"Not enough room") + return + end + if minetest.get_node(pt3).name == doora then + minetest.set_node(pt, {name=doora, param2=p2}) + minetest.set_node(pt2, {name=doorb, param2=p2}) + else + minetest.set_node(pt, {name=doora, param2=p2}) + minetest.set_node(pt2, {name=doorb, param2=p2}) + end +end + +function afterdestruct(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) +end + +function rightclick(pos, node, player, itemstack, pointed_thing) + local timer = minetest.get_node_timer(pos) + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + minetest.set_node(pos, {name=doorc, param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doord, param2=node.param2}) +---[[ + if a.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doorc, param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doord, param2=a.param2}) + end + if b.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doorc, param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doord, param2=b.param2}) + end + if c.name == doora then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doorc, param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doord, param2=c.param2}) + end + if d.name == doora then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doorc, param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doord, param2=d.param2}) + end + --]] + if a.name == doora.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doorc.."2", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doord.."2", param2=a.param2}) + end + if b.name == doora.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doorc.."2", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doord.."2", param2=b.param2}) + end + if c.name == doora.."2" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doorc.."2", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doord.."2", param2=c.param2}) + end + if d.name == doora.."2" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doorc.."2", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doord.."2", param2=d.param2}) + end + + timer:start(3) + +end + +function afterplace(pos, placer, itemstack, pointed_thing) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name=doord,param2=nodeu.param2}) +end + +function ontimer(pos, elapsed) + local node = minetest.get_node(pos) + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + minetest.set_node(pos, {name=doora, param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doorb, param2=node.param2}) + + if a.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doora, param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doorb, param2=a.param2}) + end + if b.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doora, param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doorb, param2=b.param2}) + end + if c.name == doorc then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doora, param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doorb, param2=c.param2}) + end + if d.name == doorc then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doora, param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doorb, param2=d.param2}) + end + + if a.name == doorc.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doora.."2", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doorb.."2", param2=a.param2}) + end + if b.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doora.."2", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doorb.."2", param2=b.param2}) + end + if c.name == doorc.."2" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doora.."2", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doorb.."2", param2=c.param2}) + end + if d.name == doorc.."2" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doora.."2", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doorb.."2", param2=d.param2}) + end + +end + +minetest.register_node(doora, { + description = des.." Sliding Door", + inventory_image = "myjdoors_door"..num.."a_inv.png", + wield_image = "myjdoors_door"..num.."a_inv.png", + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png^[transformFX", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, 0.1875, 0.5, 0.5, 0.0625}, + {-0.5, -0.5, 0.1875, -0.375, 0.5, 0.0625}, + + {-0.5, -0.5, 0.1875, 0.5, -0.375, 0.0625}, + {-0.5, -0.5, 0.125, 0.5, 0.5, 0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, -0.5, -0.0625, -0.5, -0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = {type = "fixed",fixed = {{-1.5, -0.5, -0.0625, -0.5, 1.5, 0.0625},{-0.5, -0.5, 0.0625, 0.5, 1.5, 0.1875}}}, + +on_place = onplace, + +after_destruct = afterdestruct, + +on_rightclick = rightclick, +}) +minetest.register_node(doorb, { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png^[transformFX", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, 0.1875, 0.5, 0.5, 0.0625}, + {-0.5, -0.5, 0.1875, -0.375, 0.5, 0.0625}, + + {-0.5, 0.5, 0.1875, 0.5, 0.375, 0.0625}, + {-0.5, -0.5, 0.125, 0.5, 0.5, 0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, 0.5, -0.0625, -0.5, 0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +})minetest.register_node(doorc, { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png^[transformFX", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + drop = doora, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.625, -0.5, 0.1875, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, 0.1875, -1.375, 0.5, 0.0625}, + + {-1.5, -0.5, 0.1875, -0.5, -0.375, 0.0625}, + {-1.5, -0.5, 0.125, -0.5, 0.5, 0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, -0.5, -0.0625, -0.5, -0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1.5, -0.5, -0.0625, -0.5, 1.5, 0.1875} + } + }, +after_place_node = afterplace, +after_destruct = afterdestruct, +on_timer = ontimer, +}) +minetest.register_node(doord, { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png^[transformFX", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.625, -0.5, 0.1875, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, 0.1875, -1.375, 0.5, 0.0625}, + + {-1.5, 0.5, 0.1875, -0.5, 0.375, 0.0625}, + {-1.5, -0.5, 0.125, -0.5, 0.5, 0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, 0.5, -0.0625, -0.5, 0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +}) +minetest.register_node("my_sliding_doors:jpanel"..num, { + description = des.." Panel", + inventory_image = "myjdoors_panel"..num.."_inv.png", + wield_image = "myjdoors_panel"..num.."_inv.png", + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, -0.0625, 0.5, 0.5, 0.0625}, + {-0.5, -0.5, -0.0625, -0.375, 0.5, 0.0625}, + {-0.5, -0.5, -0.0625, 0.5, -0.375, 0.0625}, + {-0.4375, -0.5, 0, 0.4375, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, 0.5, 1.5, 0.0625} + } + }, + on_place = function(itemstack, placer, pointed_thing) + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pos = pointed_thing.above + local na = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if na.name == "air" then + minetest.set_node(pos,{name = "my_sliding_doors:jpanel"..num, param2 = p2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name = "my_sliding_doors:jpanel_top"..num, param2 = p2}) + else + return + end + end, + on_destruct = function(pos) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) + end, +}) +minetest.register_node("my_sliding_doors:jpanel_top"..num, { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + drop = "", + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, -0.0625, 0.5, 0.5, 0.0625}, + {-0.5, -0.5, -0.0625, -0.375, 0.5, 0.0625}, + {-0.5, 0.5, -0.0625, 0.5, 0.375, 0.0625}, + {-0.4375, -0.5, 0, 0.4375, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0} + } + }, +}) +minetest.register_node("my_sliding_doors:jpanel_corner_"..num, { + description = des.." Panel Corner", + inventory_image = "myjdoors_panel"..num.."_corner_inv.png", + wield_image = "myjdoors_panel"..num.."_corner_inv.png", + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png", + "myjdoors_door"..num.."a_bottom.png", + "myjdoors_door"..num.."a_bottom.png", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {-0.0625, -0.5, -0.5, 0.0625001, 0.5, -0.375}, + {-0.5, -0.5, -0.0625, -0.375, 0.5, 0.0625}, + {-0.5, -0.5, -0.0625, 0.0624999, -0.375, 0.0625}, + {-0.5, -0.5, 0, 0, 0.5, 0.02}, + {-0.0625, -0.5, -0.5, 0.0625, -0.375, 0.0625}, + {0.02, -0.5, -0.5, 0, 0.5, 0}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.0625, -0.5, -0.5, 0.0625001, 0.5, -0.375}, + {-0.5, -0.5, -0.0625, -0.375, 0.5, 0.0625}, + {-0.5, 0.375, -0.0625, 0.0625, 0.5, 0.0625}, + {-0.5, -0.5, 0, 0, 0.5, 0.02}, + {-0.0625, 0.375, -0.5, 0.0625, 0.5, 0.0625}, + {0.02, -0.5, -0.5, 0, 0.5, 0}, + } + }, + on_place = function(itemstack, placer, pointed_thing) + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pos = pointed_thing.above + local na = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if na.name == "air" then + minetest.set_node(pos,{name = "my_sliding_doors:jpanel_corner_"..num, param2 = p2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name = "my_sliding_doors:jpanel_corner_top"..num, param2 = p2}) + else + return + end + end, + on_destruct = function(pos) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) + end, +}) +minetest.register_node("my_sliding_doors:jpanel_corner_top"..num, { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png", + "myjdoors_door"..num.."a_top.png", + "myjdoors_door"..num.."a_top.png", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + drop = "", + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {-0.0625, -0.5, -0.5, 0.0625001, 0.5, -0.375}, + {-0.5, -0.5, -0.0625, -0.375, 0.5, 0.0625}, + {-0.5, 0.375, -0.0625, 0.0625, 0.5, 0.0625}, + {-0.5, -0.5, 0, 0, 0.5, 0.02}, + {-0.0625, 0.375, -0.5, 0.0625, 0.5, 0.0625}, + {0.02, -0.5, -0.5, 0, 0.5, 0}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0} + } + }, +}) +end diff --git a/my_sliding_doors/jdoors1.lua b/my_sliding_doors/jdoors1.lua new file mode 100644 index 0000000..3f30cc8 --- /dev/null +++ b/my_sliding_doors/jdoors1.lua @@ -0,0 +1,444 @@ +local doors = { + {"my_sliding_doors:door1a","my_sliding_doors:door1b","my_sliding_doors:door1c","my_sliding_doors:door1d","1","White"}, + {"my_sliding_doors:door2a","my_sliding_doors:door2b","my_sliding_doors:door2c","my_sliding_doors:door2d","2","Flower"}, + {"my_sliding_doors:door3a","my_sliding_doors:door3b","my_sliding_doors:door3c","my_sliding_doors:door3d","3","Framed"}, + } +for i in ipairs (doors) do +local doora = doors[i][1] +local doorb = doors[i][2] +local doorc = doors[i][3] +local doord = doors[i][4] +local num = doors[i][5] +local des = doors[i][6] + +function onplace(itemstack, placer, pointed_thing) + + local pos1 = pointed_thing.above + local pos = pos1 + local pos2 = minetest.find_node_near(pos1, 1, {doora}) + local par = minetest.dir_to_facedir(placer:get_look_dir()) + local par2 = par + 2 + + if par2 == 4 then par2 = 0 end + if par2 == 5 then par2 = 1 end + if pos2 == nil then + minetest.set_node(pos, {name=doora,param2=par}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doorb,param2=par}) + else + minetest.set_node(pos, {name=doora.."2",param2=par2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doorb.."2",param2=par2}) + end + +end + +function afterdestruct(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) +end + +function rightclick(pos, node, player, itemstack, pointed_thing) + + local pos2 = minetest.find_node_near(pos, 1, {doora,doora.."2"}) + local par = minetest.get_node(pos).param2 + local par2 = par + 2 + if par2 == 4 then par2 = 0 end + if par2 == 5 then par2 = 1 end + + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + if node.name == doora then + minetest.set_node(pos, {name=doorc, param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doord, param2=node.param2}) + elseif node.name == doorc then + minetest.set_node(pos, {name=doora, param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doorb, param2=node.param2}) + end + + if a.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doorc, param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doord, param2=a.param2}) + end + if b.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doorc, param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doord, param2=b.param2}) + end + if c.name == doora then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doorc, param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doord, param2=c.param2}) + end + if d.name == doora then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doorc, param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doord, param2=d.param2}) + end + + if a.name == doora.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doorc.."2", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doord.."2", param2=a.param2}) + end + if b.name == doora.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doorc.."2", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doord.."2", param2=b.param2}) + end + if c.name == doora.."2" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doorc.."2", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doord.."2", param2=c.param2}) + end + if d.name == doora.."2" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doorc.."2", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doord.."2", param2=d.param2}) + end + if a.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doora, param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doorb, param2=a.param2}) + end + if b.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doora, param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doorb, param2=b.param2}) + end + if c.name == doorc then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doora, param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doorb, param2=c.param2}) + end + if d.name == doorc then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doora, param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doorb, param2=d.param2}) + end + + if a.name == doorc.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doora.."2", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doorb.."2", param2=a.param2}) + end + if b.name == doorc.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doora.."2", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doorb.."2", param2=b.param2}) + end + if c.name == doorc.."2" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doora.."2", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doorb.."2", param2=c.param2}) + end + if d.name == doorc.."2" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doora.."2", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doorb.."2", param2=d.param2}) + end + +end + +function afterplace(pos, placer, itemstack, pointed_thing) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name=doord,param2=nodeu.param2}) +end + +minetest.register_node(doora, { + description = des.." Sliding Door", + inventory_image = "myjdoors_door"..num.."a_inv.png", + wield_image = "myjdoors_door"..num.."a_inv.png", + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png^[transformFX", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, 0.1875, 0.5, 0.5, 0.0625}, + {-0.5, -0.5, 0.1875, -0.375, 0.5, 0.0625}, + + {-0.5, -0.5, 0.1875, 0.5, -0.375, 0.0625}, + {-0.5, -0.5, 0.125, 0.5, 0.5, 0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, -0.5, -0.0625, -0.5, -0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = {type = "fixed",fixed = {{-1.5, -0.5, -0.0625, -0.5, 1.5, 0.0625},{-0.5, -0.5, 0.0625, 0.5, 1.5, 0.1875}}}, + +on_place = onplace, + +after_destruct = afterdestruct, + +on_rightclick = rightclick, +}) +minetest.register_node(doorb, { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png^[transformFX", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, 0.1875, 0.5, 0.5, 0.0625}, + {-0.5, -0.5, 0.1875, -0.375, 0.5, 0.0625}, + + {-0.5, 0.5, 0.1875, 0.5, 0.375, 0.0625}, + {-0.5, -0.5, 0.125, 0.5, 0.5, 0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, 0.5, -0.0625, -0.5, 0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +})minetest.register_node(doorc, { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png^[transformFX", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + drop = doora, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.625, -0.5, 0.1875, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, 0.1875, -1.375, 0.5, 0.0625}, + + {-1.5, -0.5, 0.1875, -0.5, -0.375, 0.0625}, + {-1.5, -0.5, 0.125, -0.5, 0.5, 0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, -0.5, -0.0625, -0.5, -0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1.5, -0.5, -0.0625, -0.5, 1.5, 0.1875} + } + }, +after_place_node = afterplace, +after_destruct = afterdestruct, +on_rightclick = rightclick, +}) +minetest.register_node(doord, { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png^[transformFX", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.625, -0.5, 0.1875, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, 0.1875, -1.375, 0.5, 0.0625}, + + {-1.5, 0.5, 0.1875, -0.5, 0.375, 0.0625}, + {-1.5, -0.5, 0.125, -0.5, 0.5, 0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, 0.5, -0.0625, -0.5, 0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +}) +minetest.register_node("my_sliding_doors:jpanel"..num, { + description = des.." Panel", + inventory_image = "myjdoors_panel"..num.."_inv.png", + wield_image = "myjdoors_panel"..num.."_inv.png", + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, -0.0625, 0.5, 0.5, 0.0625}, + {-0.5, -0.5, -0.0625, -0.375, 0.5, 0.0625}, + {-0.5, -0.5, -0.0625, 0.5, -0.375, 0.0625}, + {-0.4375, -0.5, 0, 0.4375, 0.5, 0.02}, + } + }, + selection_box = {type = "fixed",fixed = {{-0.5, -0.5, -0.0625, 0.5, 1.5, 0.0625}}}, + collision_box = {type = "fixed",fixed = {{-0.5, -0.5, -0.0625, 0.5, 1.5, 0.0625}}}, + + on_place = function(itemstack, placer, pointed_thing) + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pos = pointed_thing.above + local na = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if na.name == "air" then + minetest.set_node(pos,{name = "my_sliding_doors:jpanel"..num, param2 = p2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name = "my_sliding_doors:jpanel_top"..num, param2 = p2}) + else + return + end + end, + on_destruct = function(pos) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) + end, +}) +minetest.register_node("my_sliding_doors:jpanel_top"..num, { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + drop = "", + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, -0.0625, 0.5, 0.5, 0.0625}, + {-0.5, -0.5, -0.0625, -0.375, 0.5, 0.0625}, + {-0.5, 0.5, -0.0625, 0.5, 0.375, 0.0625}, + {-0.4375, -0.5, 0, 0.4375, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0} + } + }, +}) +minetest.register_node("my_sliding_doors:jpanel_corner_"..num, { + description = des.." Panel Corner", + inventory_image = "myjdoors_panel"..num.."_corner_inv.png", + wield_image = "myjdoors_panel"..num.."_corner_inv.png", + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png", + "myjdoors_door"..num.."a_bottom.png", + "myjdoors_door"..num.."a_bottom.png", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {-0.0625, -0.5, -0.5, 0.0625001, 0.5, -0.375}, + {-0.5, -0.5, -0.0625, -0.375, 0.5, 0.0625}, + {-0.5, -0.5, -0.0625, 0.0624999, -0.375, 0.0625}, + {-0.5, -0.5, 0, 0, 0.5, 0.02}, + {-0.0625, -0.5, -0.5, 0.0625, -0.375, 0.0625}, + {0.02, -0.5, -0.5, 0, 0.5, 0}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.0625, -0.5, -0.5, 0.0625, 1.5, 0}, + {-0.5, -0.5, -0.0625, 0, 1.5, 0.0625}, + } + }, + on_place = function(itemstack, placer, pointed_thing) + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pos = pointed_thing.above + local na = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if na.name == "air" then + minetest.set_node(pos,{name = "my_sliding_doors:jpanel_corner_"..num, param2 = p2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name = "my_sliding_doors:jpanel_corner_top"..num, param2 = p2}) + else + return + end + end, + on_destruct = function(pos) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) + end, +}) +minetest.register_node("my_sliding_doors:jpanel_corner_top"..num, { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png", + "myjdoors_door"..num.."a_top.png", + "myjdoors_door"..num.."a_top.png", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + drop = "", + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {-0.0625, -0.5, -0.5, 0.0625001, 0.5, -0.375}, + {-0.5, -0.5, -0.0625, -0.375, 0.5, 0.0625}, + {-0.5, 0.375, -0.0625, 0.0625, 0.5, 0.0625}, + {-0.5, -0.5, 0, 0, 0.5, 0.02}, + {-0.0625, 0.375, -0.5, 0.0625, 0.5, 0.0625}, + {0.02, -0.5, -0.5, 0, 0.5, 0}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0} + } + }, +}) +end diff --git a/my_sliding_doors/jdoors2 (copy).lua b/my_sliding_doors/jdoors2 (copy).lua new file mode 100644 index 0000000..b345388 --- /dev/null +++ b/my_sliding_doors/jdoors2 (copy).lua @@ -0,0 +1,318 @@ +local doors = { + {"my_sliding_doors:door1a","my_sliding_doors:door1b","my_sliding_doors:door1c","my_sliding_doors:door1d","1","White Right"}, + {"my_sliding_doors:door2a","my_sliding_doors:door2b","my_sliding_doors:door2c","my_sliding_doors:door2d","2","Flower Right"}, + {"my_sliding_doors:door3a","my_sliding_doors:door3b","my_sliding_doors:door3c","my_sliding_doors:door3d","3","Framed Right"}, + } +for i in ipairs (doors) do +local doora = doors[i][1] +local doorb = doors[i][2] +local doorc = doors[i][3] +local doord = doors[i][4] +local num = doors[i][5] +local des = doors[i][6] + +function onplace(itemstack, placer, pointed_thing) + local pos1 = pointed_thing.above + local pos2 = {x=pos1.x, y=pos1.y, z=pos1.z} + pos2.y = pos2.y+1 + if + not minetest.registered_nodes[minetest.get_node(pos1).name].buildable_to or + not minetest.registered_nodes[minetest.get_node(pos2).name].buildable_to or + not placer or + not placer:is_player() then + return + end + local pt = pointed_thing.above + local pt2 = {x=pt.x, y=pt.y, z=pt.z} + pt2.y = pt2.y+1 + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pt3 = {x=pt.x, y=pt.y, z=pt.z} + local p4 = 0 + local pa = {x=pt.x, y=pt.y, z=pt.z} + if p2 == 0 then + pt3.x = pt3.x-1 + pa.x = pa.x+1 + p4 = 2 + elseif p2 == 1 then + pt3.z = pt3.z+1 + pa.z = pa.z-1 + p4 = 3 + elseif p2 == 2 then + pt3.x = pt3.x+1 + pa.x = pa.x-1 + p4 = 0 + elseif p2 == 3 then + pt3.z = pt3.z-1 + pa.z = pa.z+1 + p4 = 1 + end + local pa = pt3 + if minetest.get_node(pt3).name ~= "air" then + minetest.chat_send_player(placer:get_player_name(),"Not enough room") + return + end + if minetest.get_node(pt3).name == doora then + minetest.set_node(pt, {name=doora.."2", param2=p2}) + minetest.set_node(pt2, {name=doorb.."2", param2=p2}) + else + minetest.set_node(pt, {name=doora.."2", param2=p2}) + minetest.set_node(pt2, {name=doorb.."2", param2=p2}) + end +end + +function afterdestruct(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) +end + +function rightclick(pos, node, player, itemstack, pointed_thing) + local timer = minetest.get_node_timer(pos) + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + minetest.set_node(pos, {name=doorc.."2", param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doord.."2", param2=node.param2}) + + if a.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doorc, param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doord, param2=a.param2}) + end + if b.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doorc, param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doord, param2=b.param2}) + end + if c.name == doora then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doorc, param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doord, param2=c.param2}) + end + if d.name == doora then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doorc, param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doord, param2=d.param2}) + end + + if a.name == doora.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doorc.."2", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doord.."2", param2=a.param2}) + end + if b.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doorc.."2", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doord.."2", param2=b.param2}) + end + if c.name == doora then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doorc.."2", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doord.."2", param2=c.param2}) + end + if d.name == doora then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doorc.."2", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doord.."2", param2=d.param2}) + end + + timer:start(3) + +end + +function afterplace(pos, placer, itemstack, pointed_thing) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name=doord,param2=nodeu.param2}) +end + +function ontimer(pos, elapsed) + local node = minetest.get_node(pos) + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + minetest.set_node(pos, {name=doora.."2", param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doorb.."2", param2=node.param2}) + + if a.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doora, param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doorb, param2=a.param2}) + end + if b.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doora, param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doorb, param2=b.param2}) + end + if c.name == doorc then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doora, param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doorb, param2=c.param2}) + end + if d.name == doorc then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doora, param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doorb, param2=d.param2}) + end + + if a.name == doorc.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doora.."2", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doorb.."2", param2=a.param2}) + end + if b.name == doorc.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doora.."2", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doorb.."2", param2=b.param2}) + end + if c.name == doorc.."2" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doora.."2", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doorb.."2", param2=c.param2}) + end + if d.name == doorc.."2" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doora.."2", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doorb.."2", param2=d.param2}) + end + +end + +minetest.register_node(doora.."2", { + description = des.." Sliding Door", + inventory_image = "myjdoors_door"..num.."a_inv.png", + wield_image = "myjdoors_door"..num.."a_inv.png", + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png^[transformFX", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, -0.1875, 0.5, 0.5, -0.0625}, + {-0.5, -0.5, -0.1875, -0.375, 0.5, -0.0625}, + + {-0.5, -0.5, -0.1875, 0.5, -0.375, -0.0625}, + {-0.5, -0.5, -0.125, 0.5, 0.5, -0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, -0.5, -0.0625, -0.5, -0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = {type = "fixed",fixed = {{-1.5, -0.5, -0.0625, -0.5, 1.5, 0.0625},{-0.5, -0.5, -0.0625, 0.5, 1.5, -0.1875}}}, + +on_place = onplace, + +after_destruct = afterdestruct, + +on_rightclick = rightclick, +}) +minetest.register_node(doorb.."2", { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png^[transformFX", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, -0.1875, 0.5, 0.5, -0.0625}, + {-0.5, -0.5, -0.1875, -0.375, 0.5, -0.0625}, + + {-0.5, 0.5, -0.1875, 0.5, 0.375, -0.0625}, + {-0.5, -0.5, -0.125, 0.5, 0.5, -0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, 0.5, -0.0625, -0.5, 0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +})minetest.register_node(doorc.."2", { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png^[transformFX", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + drop = doora, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.625, -0.5, -0.1875, -0.5, 0.5, -0.0625}, + {-1.5, -0.5, -0.1875, -1.375, 0.5, -0.0625}, + + {-1.5, -0.5, -0.1875, -0.5, -0.375, -0.0625}, + {-1.5, -0.5, -0.125, -0.5, 0.5, -0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, -0.5, -0.0625, -0.5, -0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1.5, -0.5, -0.0625, -0.5, 1.5, 0.1875} + } + }, +after_place_node = afterplace, +after_destruct = afterdestruct, +on_timer = ontimer, +}) +minetest.register_node(doord.."2", { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png^[transformFX", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.625, -0.5, -0.1875, -0.5, 0.5, -0.0625}, + {-1.5, -0.5, -0.1875, -1.375, 0.5, -0.0625}, + + {-1.5, 0.5, -0.1875, -0.5, 0.375, -0.0625}, + {-1.5, -0.5, -0.125, -0.5, 0.5, -0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, 0.5, -0.0625, -0.5, 0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +}) +end diff --git a/my_sliding_doors/jdoors2.lua b/my_sliding_doors/jdoors2.lua new file mode 100644 index 0000000..b929ed0 --- /dev/null +++ b/my_sliding_doors/jdoors2.lua @@ -0,0 +1,314 @@ +local doors = { + {"my_sliding_doors:door1a","my_sliding_doors:door1b","my_sliding_doors:door1c","my_sliding_doors:door1d","1","White Right"}, + {"my_sliding_doors:door2a","my_sliding_doors:door2b","my_sliding_doors:door2c","my_sliding_doors:door2d","2","Flower Right"}, + {"my_sliding_doors:door3a","my_sliding_doors:door3b","my_sliding_doors:door3c","my_sliding_doors:door3d","3","Framed Right"}, + } +for i in ipairs (doors) do +local doora = doors[i][1] +local doorb = doors[i][2] +local doorc = doors[i][3] +local doord = doors[i][4] +local num = doors[i][5] +local des = doors[i][6] + +function onplace(itemstack, placer, pointed_thing) + local pos1 = pointed_thing.above + local pos2 = {x=pos1.x, y=pos1.y, z=pos1.z} + pos2.y = pos2.y+1 + if + not minetest.registered_nodes[minetest.get_node(pos1).name].buildable_to or + not minetest.registered_nodes[minetest.get_node(pos2).name].buildable_to or + not placer or + not placer:is_player() then + return + end + local pt = pointed_thing.above + local pt2 = {x=pt.x, y=pt.y, z=pt.z} + pt2.y = pt2.y+1 + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pt3 = {x=pt.x, y=pt.y, z=pt.z} + local p4 = 0 + local pa = {x=pt.x, y=pt.y, z=pt.z} + if p2 == 0 then + pt3.x = pt3.x-1 + pa.x = pa.x+1 + p4 = 2 + elseif p2 == 1 then + pt3.z = pt3.z+1 + pa.z = pa.z-1 + p4 = 3 + elseif p2 == 2 then + pt3.x = pt3.x+1 + pa.x = pa.x-1 + p4 = 0 + elseif p2 == 3 then + pt3.z = pt3.z-1 + pa.z = pa.z+1 + p4 = 1 + end + local pa = pt3 + if minetest.get_node(pt3).name ~= "air" then + minetest.chat_send_player(placer:get_player_name(),"Not enough room") + return + end + if minetest.get_node(pt3).name == doora then + minetest.set_node(pt, {name=doora.."2", param2=p2}) + minetest.set_node(pt2, {name=doorb.."2", param2=p2}) + else + minetest.set_node(pt, {name=doora.."2", param2=p2}) + minetest.set_node(pt2, {name=doorb.."2", param2=p2}) + end +end + +function afterdestruct(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) +end + +function rightclick(pos, node, player, itemstack, pointed_thing) + + local pos2 = minetest.find_node_near(pos, 1, {doora,doora.."2"}) + local par = minetest.get_node(pos).param2 + local par2 = par + 2 + if par2 == 4 then par2 = 0 end + if par2 == 5 then par2 = 1 end + + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + if node.name == doora.."2" then + minetest.set_node(pos, {name=doorc.."2", param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doord.."2", param2=node.param2}) + elseif node.name == doorc.."2" then + minetest.set_node(pos, {name=doora.."2", param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name=doorb.."2", param2=node.param2}) + end + + if a.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doorc, param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doord, param2=a.param2}) + end + if b.name == doora then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doorc, param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doord, param2=b.param2}) + end + if c.name == doora then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doorc, param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doord, param2=c.param2}) + end + if d.name == doora then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doorc, param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doord, param2=d.param2}) + end + + if a.name == doora.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doorc.."2", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doord.."2", param2=a.param2}) + end + if b.name == doora.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doorc.."2", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doord.."2", param2=b.param2}) + end + if c.name == doora.."2" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doorc.."2", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doord.."2", param2=c.param2}) + end + if d.name == doora.."2" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doorc.."2", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doord.."2", param2=d.param2}) + end + if a.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doora, param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doorb, param2=a.param2}) + end + if b.name == doorc then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doora, param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doorb, param2=b.param2}) + end + if c.name == doorc then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doora, param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doorb, param2=c.param2}) + end + if d.name == doorc then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doora, param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doorb, param2=d.param2}) + end + + if a.name == doorc.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name=doora.."2", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name=doorb.."2", param2=a.param2}) + end + if b.name == doorc.."2" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name=doora.."2", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name=doorb.."2", param2=b.param2}) + end + if c.name == doorc.."2" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name=doora.."2", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name=doorb.."2", param2=c.param2}) + end + if d.name == doorc.."2" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name=doora.."2", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name=doorb.."2", param2=d.param2}) + end + +end + +function afterplace(pos, placer, itemstack, pointed_thing) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name=doord,param2=nodeu.param2}) +end + + +minetest.register_node(doora.."2", { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png^[transformFX", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + drop = doora, + sunlight_propagates = true, + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, -0.1875, 0.5, 0.5, -0.0625}, + {-0.5, -0.5, -0.1875, -0.375, 0.5, -0.0625}, + + {-0.5, -0.5, -0.1875, 0.5, -0.375, -0.0625}, + {-0.5, -0.5, -0.125, 0.5, 0.5, -0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, -0.5, -0.0625, -0.5, -0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = {type = "fixed",fixed = {{-1.5, -0.5, -0.0625, -0.5, 1.5, 0.0625},{-0.5, -0.5, -0.0625, 0.5, 1.5, -0.1875}}}, + +on_place = onplace, + +after_destruct = afterdestruct, + +on_rightclick = rightclick, +}) +minetest.register_node(doorb.."2", { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png^[transformFX", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {0.375, -0.5, -0.1875, 0.5, 0.5, -0.0625}, + {-0.5, -0.5, -0.1875, -0.375, 0.5, -0.0625}, + + {-0.5, 0.5, -0.1875, 0.5, 0.375, -0.0625}, + {-0.5, -0.5, -0.125, 0.5, 0.5, -0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, 0.5, -0.0625, -0.5, 0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +})minetest.register_node(doorc.."2", { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_bottom.png^[transformFX", + "myjdoors_door"..num.."a_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + drop = doora, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.625, -0.5, -0.1875, -0.5, 0.5, -0.0625}, + {-1.5, -0.5, -0.1875, -1.375, 0.5, -0.0625}, + + {-1.5, -0.5, -0.1875, -0.5, -0.375, -0.0625}, + {-1.5, -0.5, -0.125, -0.5, 0.5, -0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, -0.5, -0.0625, -0.5, -0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1.5, -0.5, 0.0625, -0.5, 1.5, -0.1875} + } + }, +after_place_node = afterplace, +after_destruct = afterdestruct, +on_rightclick = rightclick, +}) +minetest.register_node(doord.."2", { + tiles = { + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_edge.png", + "myjdoors_door"..num.."a_top.png^[transformFX", + "myjdoors_door"..num.."a_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.625, -0.5, -0.1875, -0.5, 0.5, -0.0625}, + {-1.5, -0.5, -0.1875, -1.375, 0.5, -0.0625}, + + {-1.5, 0.5, -0.1875, -0.5, 0.375, -0.0625}, + {-1.5, -0.5, -0.125, -0.5, 0.5, -0.145}, + + {-0.625, -0.5, -0.0625, -0.5, 0.5, 0.0625}, + {-1.5, -0.5, -0.0625, -1.375, 0.5, 0.0625}, + + {-1.5, 0.5, -0.0625, -0.5, 0.375, 0.0625}, + {-1.5, -0.5, 0, -0.5, 0.5, 0.02}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, +}) +end diff --git a/my_sliding_doors/textures/myjdoors_door1a_bottom.png b/my_sliding_doors/textures/myjdoors_door1a_bottom.png new file mode 100644 index 0000000..37c393d Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door1a_bottom.png differ diff --git a/my_sliding_doors/textures/myjdoors_door1a_edge.png b/my_sliding_doors/textures/myjdoors_door1a_edge.png new file mode 100644 index 0000000..d472534 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door1a_edge.png differ diff --git a/my_sliding_doors/textures/myjdoors_door1a_inv.png b/my_sliding_doors/textures/myjdoors_door1a_inv.png new file mode 100644 index 0000000..fb2e4d8 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door1a_inv.png differ diff --git a/my_sliding_doors/textures/myjdoors_door1a_top.png b/my_sliding_doors/textures/myjdoors_door1a_top.png new file mode 100644 index 0000000..0455927 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door1a_top.png differ diff --git a/my_sliding_doors/textures/myjdoors_door2a_bottom.png b/my_sliding_doors/textures/myjdoors_door2a_bottom.png new file mode 100644 index 0000000..eb8959b Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door2a_bottom.png differ diff --git a/my_sliding_doors/textures/myjdoors_door2a_edge.png b/my_sliding_doors/textures/myjdoors_door2a_edge.png new file mode 100644 index 0000000..d472534 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door2a_edge.png differ diff --git a/my_sliding_doors/textures/myjdoors_door2a_inv.png b/my_sliding_doors/textures/myjdoors_door2a_inv.png new file mode 100644 index 0000000..50de996 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door2a_inv.png differ diff --git a/my_sliding_doors/textures/myjdoors_door2a_top.png b/my_sliding_doors/textures/myjdoors_door2a_top.png new file mode 100644 index 0000000..5862718 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door2a_top.png differ diff --git a/my_sliding_doors/textures/myjdoors_door3a_bottom.png b/my_sliding_doors/textures/myjdoors_door3a_bottom.png new file mode 100644 index 0000000..937a7ac Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door3a_bottom.png differ diff --git a/my_sliding_doors/textures/myjdoors_door3a_edge.png b/my_sliding_doors/textures/myjdoors_door3a_edge.png new file mode 100644 index 0000000..d472534 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door3a_edge.png differ diff --git a/my_sliding_doors/textures/myjdoors_door3a_inv.png b/my_sliding_doors/textures/myjdoors_door3a_inv.png new file mode 100644 index 0000000..d9eb9a8 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door3a_inv.png differ diff --git a/my_sliding_doors/textures/myjdoors_door3a_top.png b/my_sliding_doors/textures/myjdoors_door3a_top.png new file mode 100644 index 0000000..89d9fe8 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_door3a_top.png differ diff --git a/my_sliding_doors/textures/myjdoors_panel1_corner_inv.png b/my_sliding_doors/textures/myjdoors_panel1_corner_inv.png new file mode 100644 index 0000000..37f5f51 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_panel1_corner_inv.png differ diff --git a/my_sliding_doors/textures/myjdoors_panel1_inv.png b/my_sliding_doors/textures/myjdoors_panel1_inv.png new file mode 100644 index 0000000..080cb69 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_panel1_inv.png differ diff --git a/my_sliding_doors/textures/myjdoors_panel2_corner_inv.png b/my_sliding_doors/textures/myjdoors_panel2_corner_inv.png new file mode 100644 index 0000000..a9846cf Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_panel2_corner_inv.png differ diff --git a/my_sliding_doors/textures/myjdoors_panel2_inv.png b/my_sliding_doors/textures/myjdoors_panel2_inv.png new file mode 100644 index 0000000..a59c83b Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_panel2_inv.png differ diff --git a/my_sliding_doors/textures/myjdoors_panel3_corner_inv.png b/my_sliding_doors/textures/myjdoors_panel3_corner_inv.png new file mode 100644 index 0000000..a8fe7f0 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_panel3_corner_inv.png differ diff --git a/my_sliding_doors/textures/myjdoors_panel3_inv.png b/my_sliding_doors/textures/myjdoors_panel3_inv.png new file mode 100644 index 0000000..7d15f04 Binary files /dev/null and b/my_sliding_doors/textures/myjdoors_panel3_inv.png differ diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..2dff9a5 Binary files /dev/null and b/screenshot.png differ diff --git a/screenshot2.png b/screenshot2.png new file mode 100644 index 0000000..21ffc81 Binary files /dev/null and b/screenshot2.png differ