From 7a198e0ad9b8dff17079708d997883a9d39ef997 Mon Sep 17 00:00:00 2001 From: DonBatman Date: Wed, 3 Dec 2014 07:01:07 -0800 Subject: [PATCH] Added wood nodes and crafts --- init.lua | 149 +--------------------------- locked.lua | 99 ++++++++++++++++++ textures/mydoors_brown_wood.png | Bin 0 -> 243 bytes textures/mydoors_clear_wood.png | Bin 0 -> 286 bytes textures/mydoors_dark_grey_wood.png | Bin 0 -> 230 bytes textures/mydoors_grey_wood.png | Bin 0 -> 257 bytes textures/mydoors_red_wood.png | Bin 0 -> 263 bytes textures/mydoors_white_wood.png | Bin 0 -> 222 bytes unlocked.lua | 97 ++++++++++++++++++ wood.lua | 105 ++++++++++++++++++++ 10 files changed, 305 insertions(+), 145 deletions(-) create mode 100644 locked.lua create mode 100644 textures/mydoors_brown_wood.png create mode 100644 textures/mydoors_clear_wood.png create mode 100644 textures/mydoors_dark_grey_wood.png create mode 100644 textures/mydoors_grey_wood.png create mode 100644 textures/mydoors_red_wood.png create mode 100644 textures/mydoors_white_wood.png create mode 100644 unlocked.lua create mode 100644 wood.lua diff --git a/init.lua b/init.lua index ab9f6c8..5b197a6 100644 --- a/init.lua +++ b/init.lua @@ -1,147 +1,6 @@ -local door_list = { --Number , Description , Inven Image , Image , Is Locked - { "1" , "Locked Circle" , "door1", "door1" , "true"}, - { "2" , "Wood Circle" , "door2" , "door2" , "false"}, - { "3" , "Wood Glass" , "door3" , "door3" , "false"}, - { "4" , "Wood" , "door4" , "door4" , "false"}, - { "5", "White" , "door5" , "door5" , "false"}, - { "6", "Medevil 1" , "door6" , "door6" , "true"}, - { "7", "Medevil 2" , "door7" , "door7" , "true"}, - { "8", "Medevil 3" , "door8" , "door8" , "true"}, -} + +dofile(minetest.get_modpath("mydoors").."/wood.lua") +dofile(minetest.get_modpath("mydoors").."/locked.lua") +dofile(minetest.get_modpath("mydoors").."/unlocked.lua") -for i in ipairs(door_list) do - local num = door_list[i][1] - local desc = door_list[i][2] - local inv = door_list[i][3] - local img = door_list[i][4] - local lock = door_list[i][5] - - -doors.register_door("mydoors:door"..num.."_locked", { - description = desc.." Door", - inventory_image = inv.."_inv.png", - groups = {choppy=2,cracky=2,door=1}, - tiles_bottom = {img.."_bottom.png", img.."_edge.png"}, - tiles_top = {img.."_top.png", img.."_edge.png"}, - only_placer_can_open = lock, -}) - ---[[ - ---Unlocked Door - -doors.register_door("mydoors:door"..num.."_unlocked", { - description = desc.." Door Unlocked", - inventory_image = inv.."_inv.png", - groups = {choppy=2,cracky=2,door=1}, - tiles_bottom = {img.."_bottom.png", img.."_edge.png"}, - tiles_top = {img.."_top.png", img.."_edge.png"}, - only_placer_can_open = false, -}) - - ---Crafts - ---Locked -minetest.register_craft({ - output = "bat_blocks:bat_door", - recipe = { - {"bat_blocks:bat_color_black", "default:tree"}, - {"default:tree", "bat_blocks:bat_rod_black"}, - {"bat_blocks:bat_color_black", "default:tree"} - } -}) - ---Unlocked -minetest.register_craft({ - output = "bat_blocks:bat_door_unlocked", - recipe = { - {"bat_blocks:bat_color_black", "default:tree"}, - {"default:tree", "bat_blocks:bat_color_black"}, - {"bat_blocks:bat_color_black", "default:tree"} - } -}) - - -----trapdoor---- - -local function update_node(pos, node) - minetest.set_node(pos, node) -end - -local function punch(pos) - local meta = minetest.get_meta(pos) - local state = meta:get_int("state") - local me = minetest.get_node(pos) - local tmp_node - local tmp_node2 - oben = {x=pos.x, y=pos.y, z=pos.z} - if state == 1 then - state = 0 - tmp_node = {name="bat_blocks:bat_trapdoor", param1=me.param1, param2=me.param2} - else - state = 1 - tmp_node = {name="bat_blocks:bat_trapdoor_open", param1=me.param1, param2=me.param2} - end - update_node(pos, tmp_node) - meta:set_int("state", state) -end -minetest.register_node("bat_blocks:bat_trapdoor", { - description = "Trapdoor", - inventory_image = "bat_trapdoor.png", - drawtype = "nodebox", - tiles = {"bat_trapdoor.png", "bat_trapdoor.png", "bat_trap_side.png", "bat_trap_side.png", "bat_trap_side.png", "bat_trap_side.png"}, - paramtype = "light", - paramtype2 = "facedir", - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, - sounds = default.node_sound_wood_defaults(), - drop = "bat_blocks:bat_trapdoor", - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} - }, - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} - }, - - on_punch = function(pos, node, clicker) - punch(pos) - end, -}) - -minetest.register_node("bat_blocks:bat_trapdoor_open", { - drawtype = "nodebox", - tiles = {"bat_trap_side.png", "bat_trap_side.png", "bat_trap_side.png", "bat_trap_side.png", "bat_trapdoor.png", "bat_trapdoor.png"}, - paramtype = "light", - paramtype2 = "facedir", - pointable = true, - stack_max = 0, - groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, - climbable = true, - sounds = default.node_sound_wood_defaults(), - drop = "bat_blocks:bat_trapdoor", - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5} - }, - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5} - }, - on_punch = function(pos, node, clicker) - punch(pos) - end, -}) - -minetest.register_craft({ - output = 'bat_blocks:bat_trapdoor 2', - recipe = { - {'bat_blocks:bat_color_black', 'bat_blocks:bat_rod_black', ''}, - {'bat_blocks:bat_color_black', 'bat_blocks:bat_rod_black', ''}, - {'', '', ''}, - } -}) ---]] -end diff --git a/locked.lua b/locked.lua new file mode 100644 index 0000000..17514a4 --- /dev/null +++ b/locked.lua @@ -0,0 +1,99 @@ +local door_list = { --Number , Description , Inven Image , Image , Is Locked + { "1" , "Circle" , "door1", "door1" , "true"}, + { "2" , "Wood Circle" , "door2" , "door2" , "false"}, + { "3" , "Wood Glass" , "door3" , "door3" , "false"}, +-- { "4" , "Wood Glass 2" , "door4" , "door4" , "false"}, +-- { "5", "White" , "door5" , "door5" , "false"}, + { "6", "Medevil 1" , "door6" , "door6" , "true"}, + { "7", "Medevil 2" , "door7" , "door7" , "true"}, + { "8", "Medevil 3" , "door8" , "door8" , "true"}, +} + + +for i in ipairs(door_list) do + local num = door_list[i][1] + local desc = door_list[i][2] + local inv = door_list[i][3] + local img = door_list[i][4] + local lock = door_list[i][5] + + +doors.register_door("mydoors:door"..num.."_locked", { + description = desc.." Door Locked", + inventory_image = inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {img.."_bottom.png", img.."_edge.png"}, + tiles_top = {img.."_top.png", img.."_edge.png"}, + only_placer_can_open = true, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "mydoors:door1_locked 1", + recipe = { + {"default:steel_ingot", "default:glass", ""}, + {"mydoors:wood_dark_grey", "mydoors:wood_dark_grey", "default:steel_ingot"}, + {"mydoors:wood_dark_grey", "default:steel_ingot", ""} + } +}) + +minetest.register_craft({ + output = "mydoors:door2_locked 1", + recipe = { + {"default:steel_ingot", "default:glass", ""}, + {"mydoors:wood_red", "mydoors:wood_red", "default:steel_ingot"}, + {"mydoors:wood_red", "default:steel_ingot", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door3_locked 1", + recipe = { + {"mydoors:wood_clear", "default:glass", ""}, + {"mydoors:wood_clear", "mydoors:wood_clear", "default:steel_ingot"}, + {"mydoors:wood_clear", "default:glass", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door4_locked 1", + recipe = { + {"default:glass", "mydoors:wood_clear", ""}, + {"mydoors:wood_clear", "mydoors:wood_clear", "default:steel_ingot"}, + {"default:glass", "mydoors:wood_clear", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door5_locked 1", + recipe = { + {"mydoors:wood_white", "default:glass", ""}, + {"mydoors:wood_white", "mydoors:wood_white", "default:steel_ingot"}, + {"mydoors:wood_white", "default:glass", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door6_locked 1", + recipe = { + {"mydoors:wood_grey", "mydoors:wood_grey", ""}, + {"mydoors:wood_grey", "default:steel_ingot", "default:steel_ingot"}, + {"mydoors:wood_grey", "mydoors:wood_grey", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door7_locked 1", + recipe = { + {"mydoors:wood_red", "mydoors:wood_red", ""}, + {"mydoors:wood_red", "default:steel_ingot", "default:steel_ingot"}, + {"mydoors:wood_red", "mydoors:wood_red", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door8_locked 1", + recipe = { + {"default:steel_ingot", "default:steel_ingot", ""}, + {"mydoors:wood_dark_grey", "mydoors:wood_dark_grey", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot", ""} + } +}) + + diff --git a/textures/mydoors_brown_wood.png b/textures/mydoors_brown_wood.png new file mode 100644 index 0000000000000000000000000000000000000000..d0962f21b637e859172393e89722169c4ba7d786 GIT binary patch literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#9uG4gr^SKayUzlJCV9FzhFF|F8|28>pulrm%*3s>`+xm(_GFQEb~DF=-30~H zCv7UxMh@@Ap3M^fM4utnrnPsR6o{XE z)7O>#9uG4gizQRgS23W_UQZXt5R21igU|9EGT>OY<#%V{tDesDk9Pm~5!b`M*zljv zF&l@}!g*=@ML!>8E6QKk^_I<=fkCM)W@P>W=@D1~WW+uJ9) zE^I%i>Gh_n^GD<2x8KF~TuXSc&_+M*#BIk%OOCj3&6##UUwBbiNZ{haJT2R0K>~9# zGq)~U^?>zttAOn6rq{MtoxAp$@6|QneD|&C_0ojv-b=pa%L%Ps_xa?B$ff%O+h?RU h`ERoRtaVW;zW$H?KSLR*Y@kONJYD@<);T3K0RW@Vb2R_} literal 0 HcmV?d00001 diff --git a/textures/mydoors_dark_grey_wood.png b/textures/mydoors_dark_grey_wood.png new file mode 100644 index 0000000000000000000000000000000000000000..c43c62e2073c029fb717fd124500a6581eb152b3 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#9uG4gC+{?m`gcH~R!BVvk$vkD2&ly&1WttE)YwI;B2D!zH;@<5&@BRMoTalBU=X?_6AGT~yo>%p3 zMp{$7tEBeg>!JJ89;t9B+EfW7*DR^d=gyw6B{XE z)7O>#9uG4ghkleXzc)~5fv1aOh{fr%lf3y_6a-x4jk+3x3;#c!G2?`LTC%Xros&sb z&X?|b?p@_p`JVegSH~DJiwbGE~ zy)MT*mh!{9)BMGrRm!=1SbZz(+{|xB-mcWXYtWP$`Kv{LYH955IY~Xu97lHl$ep?^ zm-&F@bwLlg`VSLXUR(6tGC6j~sm7}CZl(7JR`CdH>C=nnNdeu;;OXk;vd$@?2>?SG BUn>9r literal 0 HcmV?d00001 diff --git a/textures/mydoors_red_wood.png b/textures/mydoors_red_wood.png new file mode 100644 index 0000000000000000000000000000000000000000..d069f7a50456fa89b90a9e3189356a3f4c5ffd37 GIT binary patch literal 263 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#9uG4g2bZAvZ62V|GEW!B5R21iCmBi|GT?BNUs89=k^jlx_m3YWnQHP~Sa#KF zX|s;XgbByxpR78`&?Py4nhV2@*}pemF?QCO>h`*;m*I))T0ZWkC%rYVbyx=oe`4{B&T#w<=s`rw0-dl|JLflNk?VQ&e|%haqrCO zPfBk#M)!P3eVo*1TyNl!Tyt~rtCO8VT-iTlZe0Bpuw~{0-c#xZ1ssa@e}FD#@O1Ta JS?83{1OU2#Wi9{! literal 0 HcmV?d00001 diff --git a/textures/mydoors_white_wood.png b/textures/mydoors_white_wood.png new file mode 100644 index 0000000000000000000000000000000000000000..91c430ed9431bb3e6b102e54c253dcd1a17ce5bd GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#9uG4gx5xp}t!scnwVp1HAr`04PTt6MK!Jz#yi~!5|MpiE7iMgtEWZdbs zN9KHhmt|pSHmidRLqI4)kk{e4%}0gqe=K~#k+#)mLw?J(TYED%<+MmVeqHgKBW?YR zh{c=3_ZJ$xemD2bi)oxqtLE8xY}>~0bWZz*nbYN2PCov2>5u#i*L?0vtdEylz0mu# R;~3B(44$rjF6*2UngB(tQ|bT! literal 0 HcmV?d00001 diff --git a/unlocked.lua b/unlocked.lua new file mode 100644 index 0000000..f29c4fc --- /dev/null +++ b/unlocked.lua @@ -0,0 +1,97 @@ +local door_list = { --Number , Description , Inven Image , Image , Is Locked + { "1" , "Locked Circle" , "door1", "door1" , "true"}, +-- { "2" , "Wood Circle" , "door2" , "door2" , "false"}, +-- { "3" , "Wood Glass" , "door3" , "door3" , "false"}, + { "4" , "Wood Glass 2" , "door4" , "door4" , "false"}, + { "5", "White" , "door5" , "door5" , "false"}, +-- { "6", "Medevil 1" , "door6" , "door6" , "true"}, +-- { "7", "Medevil 2" , "door7" , "door7" , "true"}, +-- { "8", "Medevil 3" , "door8" , "door8" , "true"}, +} + +for i in ipairs(door_list) do + local num = door_list[i][1] + local desc = door_list[i][2] + local inv = door_list[i][3] + local img = door_list[i][4] + local lock = door_list[i][5] + + + +doors.register_door("mydoors:door"..num.."_unlocked", { + description = desc.." Door Unlocked", + inventory_image = inv.."_inv.png", + groups = {choppy=2,cracky=2,door=1}, + tiles_bottom = {img.."_bottom.png", img.."_edge.png"}, + tiles_top = {img.."_top.png", img.."_edge.png"}, + only_placer_can_open = false, +}) +end + +-- Crafts + +minetest.register_craft({ + output = "mydoors:door1_unlocked 1", + recipe = { + {"default:steel_ingot", "default:glass", ""}, + {"mydoors:wood_dark_grey", "mydoors:wood_dark_grey", ""}, + {"mydoors:wood_dark_grey", "default:steel_ingot", ""} + } +}) + +minetest.register_craft({ + output = "mydoors:door2_unlocked 1", + recipe = { + {"default:steel_ingot", "default:glass", ""}, + {"mydoors:wood_red", "mydoors:wood_red", ""}, + {"mydoors:wood_red", "default:steel_ingot", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door3_unlocked 1", + recipe = { + {"mydoors:wood_clear", "default:glass", ""}, + {"mydoors:wood_clear", "mydoors:wood_clear", ""}, + {"mydoors:wood_clear", "default:glass", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door4_unlocked 1", + recipe = { + {"default:glass", "mydoors:wood_clear", ""}, + {"mydoors:wood_clear", "mydoors:wood_clear", ""}, + {"default:glass", "mydoors:wood_clear", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door5_unlocked 1", + recipe = { + {"mydoors:wood_white", "default:glass", ""}, + {"mydoors:wood_white", "mydoors:wood_white", ""}, + {"mydoors:wood_white", "default:glass", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door6_unlocked 1", + recipe = { + {"mydoors:wood_grey", "mydoors:wood_grey", ""}, + {"mydoors:wood_grey", "default:steel_ingot", ""}, + {"mydoors:wood_grey", "mydoors:wood_grey", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door7_unlocked 1", + recipe = { + {"mydoors:wood_red", "mydoors:wood_red", ""}, + {"mydoors:wood_red", "default:steel_ingot", ""}, + {"mydoors:wood_red", "mydoors:wood_red", ""} + } +}) +minetest.register_craft({ + output = "mydoors:door8_unlocked 1", + recipe = { + {"default:steel_ingot", "default:steel_ingot", ""}, + {"mydoors:wood_dark_grey", "mydoors:wood_dark_grey", ""}, + {"default:steel_ingot", "default:steel_ingot", ""} + } +}) diff --git a/wood.lua b/wood.lua new file mode 100644 index 0000000..603890c --- /dev/null +++ b/wood.lua @@ -0,0 +1,105 @@ +minetest.register_node("mydoors:wood_red", { + description = "Red Stained Wood", + drawtype = "normal", + paramtype = "light", + tiles = {"mydoors_red_wood.png"}, + paramtype = "light", + groups = {cracky = 2, choppy = 2}, + +}) +minetest.register_node("mydoors:wood_grey", { + description = "Grey Stained Wood", + drawtype = "normal", + paramtype = "light", + tiles = {"mydoors_grey_wood.png"}, + paramtype = "light", + groups = {cracky = 2, choppy = 2}, + +}) +minetest.register_node("mydoors:wood_dark_grey", { + description = "Dark Grey Stained Wood", + drawtype = "normal", + paramtype = "light", + tiles = {"mydoors_dark_grey_wood.png"}, + paramtype = "light", + groups = {cracky = 2, choppy = 2}, + +}) +minetest.register_node("mydoors:wood_brown", { + description = "Brown Stained Wood", + drawtype = "normal", + paramtype = "light", + tiles = {"mydoors_brown_wood.png"}, + paramtype = "light", + groups = {cracky = 2, choppy = 2}, + +}) +minetest.register_node("mydoors:wood_white", { + description = "White Stained Wood", + drawtype = "normal", + paramtype = "light", + tiles = {"mydoors_white_wood.png"}, + paramtype = "light", + groups = {cracky = 2, choppy = 2}, + +}) +minetest.register_node("mydoors:wood_clear", { + description = "Clear Stained Wood", + drawtype = "normal", + paramtype = "light", + tiles = {"mydoors_clear_wood.png"}, + paramtype = "light", + groups = {cracky = 2, choppy = 2}, + +}) + +-- Crafts + +minetest.register_craft({ + output = "mydoors:wood_red 1", + recipe = { + {"default:wood", "", ""}, + {"dye:red", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "mydoors:wood_grey 1", + recipe = { + {"default:wood", "", ""}, + {"dye:grey", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "mydoors:wood_dark_grey 1", + recipe = { + {"default:wood", "", ""}, + {"dye:dark_grey", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "mydoors:wood_brown 1", + recipe = { + {"default:wood", "", ""}, + {"dye:brown", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "mydoors:wood_white 1", + recipe = { + {"default:wood", "", ""}, + {"dye:white", "", ""}, + {"", "", ""} + } +}) +minetest.register_craft({ + output = "mydoors:wood_clear 1", + recipe = { + {"default:wood", "", ""}, + {"default:glass", "", ""}, + {"", "", ""} + } +})