From d64758c11350dfb55412f54f4591cf4f0ec01fda Mon Sep 17 00:00:00 2001 From: D00Med Date: Tue, 7 Mar 2017 07:04:32 +1000 Subject: [PATCH] stuff --- init.lua | 74 ++++++++++++++++++++++++++++-- models.lua | 2 +- nodeboxes.lua | 6 +++ textures/scifi_nodes_bluegrid.png | Bin 0 -> 310 bytes 4 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 textures/scifi_nodes_bluegrid.png diff --git a/init.lua b/init.lua index 945ab34..c9d0bd7 100644 --- a/init.lua +++ b/init.lua @@ -2,9 +2,26 @@ --the builder node +local builder_formspec = + "size[8,9]" .. + default.gui_bg .. + default.gui_bg_img .. + default.gui_slots .. + "list[current_name;input;1,1;1,1;]" .. + "list[current_name;output;3,0;4,3;]" .. + "list[current_player;main;0,4.85;8,1;]" .. + "list[current_player;main;0,6.08;8,3;8]" .. + "listring[current_name;input]" .. + "listring[current_name;output]" .. + "listring[current_player;main]" .. + default.get_hotbar_bg(0,4.85) + +local input_items = { + {"default:steel_ingot 1", "scifi_nodes:black", "scifi_nodes:black", "scifi_nodes:black", "scifi_nodes:black", "scifi_nodes:black", "scifi_nodes:black", "scifi_nodes:black", "scifi_nodes:black", "scifi_nodes:black", "scifi_nodes:black", "scifi_nodes:black", "scifi_nodes:black"} +} + minetest.register_node("scifi_nodes:builder", { description = "Sci-fi Node Builder", - sunlight_propagates = false, tiles = { "scifi_nodes_builder.png", "scifi_nodes_builder.png", @@ -14,16 +31,64 @@ minetest.register_node("scifi_nodes:builder", { "scifi_nodes_builder_front.png" }, on_construct = function(pos) + --local meta = minetest.get_meta(pos) + --meta:set_string("infotext", "Node Builder (currently does nothing)") + local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Node Builder (currently does nothing)") + meta:set_string("formspec", builder_formspec) + meta:set_string("infotext", "Node Builder") + local inv = meta:get_inventory() + inv:set_size("output", 4 * 3) + inv:set_size("input", 1 * 1) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if listname == "input" then + for _, row in ipairs(input_items) do + local item = row[1] + if inv:contains_item("input", item) then + inv:set_stack("output", 1, row[2]) + inv:set_stack("output", 2, row[3]) + inv:set_stack("output", 3, row[4]) + inv:set_stack("output", 4, row[5]) + inv:set_stack("output", 5, row[6]) + inv:set_stack("output", 6, row[7]) + inv:set_stack("output", 7, row[8]) + inv:set_stack("output", 8, row[9]) + inv:set_stack("output", 9, row[10]) + inv:set_stack("output", 10, row[11]) + inv:set_stack("output", 11, row[12]) + inv:set_stack("output", 12, row[13]) + end + end + end + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack = inv:get_stack("input", 1) + local stack_name = stack:get_name() + inv:remove_item("input", stack_name.." 1") + + inv:set_stack("output", 1, "") + inv:set_stack("output", 2, "") + inv:set_stack("output", 3, "") + inv:set_stack("output", 4, "") + inv:set_stack("output", 5, "") + inv:set_stack("output", 6, "") + inv:set_stack("output", 7, "") + inv:set_stack("output", 8, "") + inv:set_stack("output", 9, "") + inv:set_stack("output", 10, "") + inv:set_stack("output", 11, "") + inv:set_stack("output", 12, "") end, paramtype = "light", paramtype2 = "facedir", groups = {cracky=1, oddly_breakable_by_hand=1} }) - - --nodes minetest.register_node("scifi_nodes:grassblk", { @@ -494,6 +559,7 @@ node.types = { {"screen3", "Wall monitor", "screen3"}, {"doomlight", "Doom light", "doomlight", 12}, {"bluwllight", "Blue wall light", "capsule3", 20}, + {"bluegrid", "Blue Grid", "bluegrid", 5}, {"fan", "Fan", "fan"}, {"ppllght", "Purple wall light", "", 50}, {"pplwll", "Purple wall", "", 0}, diff --git a/models.lua b/models.lua index 03a6d14..403d450 100644 --- a/models.lua +++ b/models.lua @@ -54,5 +54,5 @@ scifi_nodes.register_slope("lightstripe", "Lightstripe", {"scifi_nodes_lightstri scifi_nodes.register_slope("blight2", "Blue Light 2", {"scifi_nodes_capsule3.png",}, 20) scifi_nodes.register_slope("wallpipe", "Alien Pipe", {"scifi_nodes_wallpipe.png",}, 0) scifi_nodes.register_slope("alien", "Alien Wall", {"scifi_nodes_alnslp.png",}, 0) -scifi_nodes.register_slope("purple", "Purple", {"scifi_nodes_stripes.png",}, 0) +scifi_nodes.register_slope("purple", "Purple", {"scifi_nodes_purple.png",}, 0) scifi_nodes.register_slope("gblock", "Gblock", {"scifi_nodes_gblock2_front1.png",}, 0) \ No newline at end of file diff --git a/nodeboxes.lua b/nodeboxes.lua index 6e93ab5..18321c1 100644 --- a/nodeboxes.lua +++ b/nodeboxes.lua @@ -451,6 +451,12 @@ minetest.register_node("scifi_nodes:lightbar", { {-0.125, -0.5, -0.5, 0.125, -0.375, 0.5}, -- NodeBox1 } }, + selection_box = { + type = "wallmounted", + wallmounted = { + {-0.125, -0.5, -0.5, 0.125, -0.375, 0.5}, -- NodeBox1 + } + }, groups = {cracky=1}, sounds = default.node_sound_glass_defaults() }) diff --git a/textures/scifi_nodes_bluegrid.png b/textures/scifi_nodes_bluegrid.png new file mode 100644 index 0000000000000000000000000000000000000000..c1dd9dcc1a5c2cbf39681bf8711fc7f72192bf7a GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkQ1FGP zi(`nz>9>;|^Oy{IT<6cdkm7YUdc$)U9ZR>PkyVS{Rd;xCSn(Kd+|7}cb}(c`PPS%H z*!jNy-8tp?=a@wq@7dd34DK$|4dVL26U@TT=*>G#+U#{GYsPh zI?npElGA9W!*1b+6$&!nJnGrzGj=@cRxdbSY|Ny=9K^Q7{(AEE`46IQdr2h!wshvZy zkHLH9rW(eHyF<54S>C`FcQAP0f8(W{r)GbBb>90AqtL{xy6V>w?m#~?c)I$ztaD0e F0sw*0c5VOw literal 0 HcmV?d00001