summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--technic/alloy_furnace.lua3
-rw-r--r--technic/alloy_furnaces_commons.lua15
-rw-r--r--technic/alloy_furnaces_commons.lua~39
-rw-r--r--technic/battery_box.lua149
-rw-r--r--technic/battery_box_hv.lua1
-rw-r--r--technic/battery_box_mv.lua1
-rw-r--r--technic/chainsaw.lua5
-rw-r--r--technic/cnc.lua20
-rw-r--r--technic/cnc_nodes.lua2
-rw-r--r--technic/constructor.lua78
-rw-r--r--technic/down_converter_hv.lua225
-rw-r--r--technic/down_converter_mv.lua226
-rw-r--r--technic/electric.lua10
-rw-r--r--technic/electric_furnace.lua1
-rw-r--r--technic/frames.lua18
-rw-r--r--technic/generator.lua2
-rw-r--r--technic/grinder.lua5
-rw-r--r--technic/grinder.lua~353
-rw-r--r--technic/init.lua17
-rw-r--r--technic/items.lua41
-rw-r--r--technic/mining_drill.lua18
-rw-r--r--technic/mining_laser_mk1.lua2
-rw-r--r--technic/music_player.lua2
-rw-r--r--technic/solar_array_hv.lua2
-rw-r--r--technic/solar_array_lv.lua2
-rw-r--r--technic/solar_array_mv.lua3
-rw-r--r--technic/solar_panel.lua1
-rw-r--r--technic/textures/technic_hv_down_converter_bottom.pngbin0 -> 653 bytes
-rw-r--r--technic/textures/technic_hv_down_converter_side.pngbin0 -> 609 bytes
-rw-r--r--technic/textures/technic_hv_down_converter_top.pngbin0 -> 653 bytes
-rw-r--r--technic/textures/technic_mv_down_converter_bottom.pngbin0 -> 738 bytes
-rw-r--r--technic/textures/technic_mv_down_converter_side.pngbin0 -> 670 bytes
-rw-r--r--technic/textures/technic_mv_down_converter_top.pngbin0 -> 738 bytes
-rw-r--r--technic/textures/technic_stainless_steel_ingot.pngbin230 -> 281 bytes
-rw-r--r--technic/textures/technic_tin_dust.pngbin1261 -> 241 bytes
-rw-r--r--technic/textures/technic_zinc_dust.pngbin1150 -> 246 bytes
-rw-r--r--technic/tool_workshop.lua2
-rw-r--r--technic/water.lua26
-rw-r--r--technic/water_mill.lua2
-rw-r--r--technic/wires.lua2
-rw-r--r--technic_chests/copper_chest.lua32
-rw-r--r--technic_chests/gold_chest.lua473
-rw-r--r--technic_chests/iron_chest.lua22
-rw-r--r--technic_chests/mithril_chest.lua20
-rw-r--r--technic_chests/silver_chest.lua92
-rw-r--r--technic_worldgen/crafts.lua74
-rw-r--r--technic_worldgen/nodes.lua40
-rw-r--r--technic_worldgen/textures/technic_brass_block.pngbin0 -> 649 bytes
-rw-r--r--technic_worldgen/textures/technic_brass_ingot.pngbin456 -> 330 bytes
-rw-r--r--technic_worldgen/textures/technic_chromium_block.pngbin0 -> 611 bytes
-rw-r--r--technic_worldgen/textures/technic_chromium_ingot.pngbin242 -> 295 bytes
-rw-r--r--technic_worldgen/textures/technic_chromium_lump.pngbin213 -> 313 bytes
-rw-r--r--technic_worldgen/textures/technic_stainless_steel_block.pngbin0 -> 589 bytes
-rw-r--r--technic_worldgen/textures/technic_uranium.pngbin213 -> 352 bytes
-rw-r--r--technic_worldgen/textures/technic_uranium_block.pngbin0 -> 649 bytes
-rw-r--r--technic_worldgen/textures/technic_zinc_block.pngbin0 -> 681 bytes
-rw-r--r--technic_worldgen/textures/technic_zinc_ingot.pngbin242 -> 317 bytes
-rw-r--r--technic_worldgen/textures/technic_zinc_lump.pngbin214 -> 308 bytes
-rw-r--r--unified_inventory/api.lua24
-rw-r--r--unified_inventory/depends.txt1
-rw-r--r--unified_inventory/textures/ui_colorbutton0.pngbin0 -> 147 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton1.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton10.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton11.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton12.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton13.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton14.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton15.pngbin0 -> 3562 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton2.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton3.pngbin0 -> 140 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton4.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton5.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton6.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton7.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton8.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_colorbutton9.pngbin0 -> 148 bytes
-rw-r--r--unified_inventory/textures/ui_copper_chest_inventory.pngbin0 -> 11117 bytes
-rw-r--r--unified_inventory/textures/ui_furnace_inventory.pngbin0 -> 7383 bytes
-rw-r--r--unified_inventory/textures/ui_gold_chest_inventory.pngbin0 -> 5813 bytes
-rw-r--r--unified_inventory/textures/ui_iron_chest_inventory.pngbin0 -> 6685 bytes
-rw-r--r--unified_inventory/textures/ui_lv_alloy_furnace.pngbin0 -> 8640 bytes
-rw-r--r--unified_inventory/textures/ui_lv_battery_box.pngbin0 -> 15941 bytes
-rw-r--r--unified_inventory/textures/ui_lv_electric_furnace.pngbin0 -> 4334 bytes
-rw-r--r--unified_inventory/textures/ui_lv_grinder.pngbin0 -> 4334 bytes
-rw-r--r--unified_inventory/textures/ui_main_inventory.pngbin0 -> 7646 bytes
-rw-r--r--unified_inventory/textures/ui_mithril_chest_inventory.pngbin0 -> 7804 bytes
-rw-r--r--unified_inventory/textures/ui_silver_chest_inventory.pngbin0 -> 7743 bytes
-rw-r--r--unified_inventory/textures/ui_wooden_chest_inventory.pngbin0 -> 7490 bytes
88 files changed, 1475 insertions, 576 deletions
diff --git a/technic/alloy_furnace.lua b/technic/alloy_furnace.lua
index d36b93c..fcdb9c0 100644
--- a/technic/alloy_furnace.lua
+++ b/technic/alloy_furnace.lua
@@ -14,7 +14,7 @@ minetest.register_craft({
recipe = {
{'default:brick', 'default:brick', 'default:brick'},
{'default:brick', '', 'default:brick'},
- {'default:steel_ingot', 'moreores:copper_ingot', 'default:steel_ingot'},
+ {'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
}
})
@@ -364,3 +364,4 @@ minetest.register_abm({
inv:set_stack("fuel", 1, stack)
end,
})
+
diff --git a/technic/alloy_furnaces_commons.lua b/technic/alloy_furnaces_commons.lua
index 5a6e65b..15996d0 100644
--- a/technic/alloy_furnaces_commons.lua
+++ b/technic/alloy_furnaces_commons.lua
@@ -66,19 +66,20 @@ function register_alloy_recipe (string1,count1, string2,count2, string3,count3)
registered_recipes_count=registered_recipes_count+1
if unified_inventory then
unified_inventory.register_craft({
- type = "alloy",
- output = string3.." "..count3,
- items = {string1.." "..count1,string2.." "..count2},
- width = 2,
- })
+ type = "alloy",
+ output = string3.." "..count3,
+ items = {string1.." "..count1,string2.." "..count2},
+ width = 2,
+ })
end
end
register_alloy_recipe ("technic:copper_dust",3, "technic:tin_dust",1, "technic:bronze_dust",4)
-register_alloy_recipe ("moreores:copper_ingot",3, "moreores:tin_ingot",1, "moreores:bronze_ingot",4)
+register_alloy_recipe ("default:copper_ingot",3, "moreores:tin_ingot",1, "default:bronze_ingot",4)
register_alloy_recipe ("technic:iron_dust",3, "technic:chromium_dust",1, "technic:stainless_steel_dust",4)
register_alloy_recipe ("default:steel_ingot",3, "technic:chromium_ingot",1, "technic:stainless_steel_ingot",4)
register_alloy_recipe ("technic:copper_dust",2, "technic:zinc_dust",1, "technic:brass_dust",3)
-register_alloy_recipe ("moreores:copper_ingot",2, "technic:zinc_ingot",1, "technic:brass_ingot",3)
+register_alloy_recipe ("default:copper_ingot",2, "technic:zinc_ingot",1, "technic:brass_ingot",3)
register_alloy_recipe ("default:sand",2, "technic:coal_dust",2, "technic:silicon_wafer",1)
register_alloy_recipe ("technic:silicon_wafer",1, "technic:gold_dust",1, "technic:doped_silicon_wafer",1)
+
diff --git a/technic/alloy_furnaces_commons.lua~ b/technic/alloy_furnaces_commons.lua~
new file mode 100644
index 0000000..9c9c42a
--- /dev/null
+++ b/technic/alloy_furnaces_commons.lua~
@@ -0,0 +1,39 @@
+alloy_recipes ={}
+
+registered_recipes_count=1
+
+function register_alloy_recipe (string1,count1, string2,count2, string3,count3)
+alloy_recipes[registered_recipes_count]={}
+alloy_recipes[registered_recipes_count].src1_name=string1
+alloy_recipes[registered_recipes_count].src1_count=count1
+alloy_recipes[registered_recipes_count].src2_name=string2
+alloy_recipes[registered_recipes_count].src2_count=count2
+alloy_recipes[registered_recipes_count].dst_name=string3
+alloy_recipes[registered_recipes_count].dst_count=count3
+registered_recipes_count=registered_recipes_count+1
+alloy_recipes[registered_recipes_count]={}
+alloy_recipes[registered_recipes_count].src1_name=string2
+alloy_recipes[registered_recipes_count].src1_count=count2
+alloy_recipes[registered_recipes_count].src2_name=string1
+alloy_recipes[registered_recipes_count].src2_count=count1
+alloy_recipes[registered_recipes_count].dst_name=string3
+alloy_recipes[registered_recipes_count].dst_count=count3
+registered_recipes_count=registered_recipes_count+1
+if unified_inventory then
+ unified_inventory.register_craft({
+ type = "alloy",
+ output = string3.." "..count3,
+ items = {string1.." "..count1,string2.." "..count2},
+ width = 2,
+ })
+ end
+end
+
+register_alloy_recipe ("technic:copper_dust",3, "technic:tin_dust",1, "technic:bronze_dust",4)
+register_alloy_recipe ("moreores:copper_ingot",3, "moreores:tin_ingot",1, "moreores:bronze_ingot",4)
+register_alloy_recipe ("technic:iron_dust",3, "technic:chromium_dust",1, "technic:stainless_steel_dust",4)
+register_alloy_recipe ("default:steel_ingot",3, "technic:chromium_ingot",1, "technic:stainless_steel_ingot",4)
+register_alloy_recipe ("technic:copper_dust",2, "technic:zinc_dust",1, "technic:brass_dust",3)
+register_alloy_recipe ("moreores:copper_ingot",2, "technic:zinc_ingot",1, "technic:brass_ingot",3)
+register_alloy_recipe ("default:sand",2, "technic:coal_dust",2, "technic:silicon_wafer",1)
+register_alloy_recipe ("technic:silicon_wafer",1, "technic:gold_dust",1, "technic:doped_silicon_wafer",1)
diff --git a/technic/battery_box.lua b/technic/battery_box.lua
index 1f0740d..3a2272a 100644
--- a/technic/battery_box.lua
+++ b/technic/battery_box.lua
@@ -5,91 +5,99 @@ technic.register_HV_power_tool("technic:green_energy_crystal",250000)
technic.register_HV_power_tool("technic:blue_energy_crystal",500000)
minetest.register_craft({
- output = 'technic:battery 1',
- recipe = {
- {'default:wood', 'moreores:copper_ingot', 'default:wood'},
- {'default:wood', 'moreores:tin_ingot', 'default:wood'},
- {'default:wood', 'moreores:copper_ingot', 'default:wood'},
- }
- })
+ output = 'technic:battery 1',
+ recipe = {
+ {'default:wood', 'default:copper_ingot', 'default:wood'},
+ {'default:wood', 'moreores:tin_ingot', 'default:wood'},
+ {'default:wood', 'default:copper_ingot', 'default:wood'},
+ }
+})
-minetest.register_tool("technic:battery",
- {description = "RE Battery",
- inventory_image = "technic_battery.png",
- tool_capabilities = {load=0,max_drop_level=0, groupcaps={fleshy={times={}, uses=10000, maxlevel=0}}}})
+minetest.register_tool("technic:battery", {
+ description = "RE Battery",
+ inventory_image = "technic_battery.png",
+ tool_capabilities = {
+ load=0,
+ max_drop_level=0,
+ groupcaps={
+ fleshy={times={}, uses=10000, maxlevel=0}
+ }
+ }
+})
--------------------------------------------
-- The Battery box
--------------------------------------------
-minetest.register_craftitem(
- "technic:battery_box",
- {
- description = "Battery box",
- stack_max = 99,
- })
+minetest.register_craftitem("technic:battery_box", {
+ description = "Battery box",
+ stack_max = 99,
+})
-minetest.register_craft(
- {
- output = 'technic:battery_box 1',
- recipe = {
- {'technic:battery', 'default:wood', 'technic:battery'},
- {'technic:battery', 'moreores:copper_ingot', 'technic:battery'},
- {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
- }
- })
+minetest.register_craft({
+ output = 'technic:battery_box 1',
+ recipe = {
+ {'technic:battery', 'default:wood', 'technic:battery'},
+ {'technic:battery', 'default:copper_ingot', 'technic:battery'},
+ {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
+ }
+})
local battery_box_formspec =
- "invsize[8,9;]"..
- "image[1,1;1,2;technic_power_meter_bg.png]"..
- "list[current_name;src;3,1;1,1;]"..
- "image[4,1;1,1;technic_battery_reload.png]"..
- "list[current_name;dst;5,1;1,1;]"..
- "label[0,0;Battery box]"..
- "label[3,0;Charge]"..
- "label[5,0;Discharge]"..
- "label[1,3;Power level]"..
- "list[current_player;main;0,5;8,4;]"
+ "invsize[8,9;]"..
+ "image[1,1;1,2;technic_power_meter_bg.png]"..
+ "list[current_name;src;3,1;1,1;]"..
+ "image[4,1;1,1;technic_battery_reload.png]"..
+ "list[current_name;dst;5,1;1,1;]"..
+ "label[0,0;Battery box]"..
+ "label[3,0;Charge]"..
+ "label[5,0;Discharge]"..
+ "label[1,3;Power level]"..
+ "list[current_player;main;0,5;8,4;]"
-minetest.register_node(
- "technic:battery_box", {
- description = "LV Battery Box",
- tiles = {"technic_battery_box_top.png", "technic_battery_box_bottom.png", "technic_battery_box_side0.png",
- "technic_battery_box_side0.png", "technic_battery_box_side0.png", "technic_battery_box_side0.png"},
- groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
- sounds = default.node_sound_wood_defaults(),
- drop="technic:battery_box",
- on_construct = function(pos)
- local meta = minetest.env:get_meta(pos)
- local inv = meta:get_inventory()
- meta:set_string("infotext", "Battery box")
- meta:set_float("technic_power_machine", 1)
- meta:set_string("formspec", battery_box_formspec)
- meta:set_int("LV_EU_demand", 0) -- How much can this node charge
- meta:set_int("LV_EU_supply", 0) -- How much can this node discharge
- meta:set_int("LV_EU_input", 0) -- How much power is this machine getting.
- meta:set_float("internal_EU_charge", 0)
- inv:set_size("src", 1)
- inv:set_size("dst", 1)
- end,
- can_dig = function(pos,player)
- local meta = minetest.env:get_meta(pos);
- local inv = meta:get_inventory()
- if not inv:is_empty("src") or not inv:is_empty("dst") then
- minetest.chat_send_player(player:get_player_name(), "Machine cannot be removed because it is not empty");
- return false
- else
- return true
- end
- end,
- })
+minetest.register_node("technic:battery_box", {
+ description = "LV Battery Box",
+ tiles = {"technic_battery_box_top.png", "technic_battery_box_bottom.png",
+ "technic_battery_box_side0.png", "technic_battery_box_side0.png",
+ "technic_battery_box_side0.png", "technic_battery_box_side0.png"},
+ groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+ sounds = default.node_sound_wood_defaults(),
+ drop="technic:battery_box",
+ on_construct = function(pos)
+ local meta = minetest.env:get_meta(pos)
+ local inv = meta:get_inventory()
+ meta:set_string("infotext", "Battery box")
+ meta:set_float("technic_power_machine", 1)
+ meta:set_string("formspec", battery_box_formspec)
+ meta:set_int("LV_EU_demand", 0) -- How much can this node charge
+ meta:set_int("LV_EU_supply", 0) -- How much can this node discharge
+ meta:set_int("LV_EU_input", 0) -- How much power is this machine getting.
+ meta:set_float("internal_EU_charge", 0)
+ inv:set_size("src", 1)
+ inv:set_size("dst", 1)
+ end,
+ can_dig = function(pos,player)
+ local meta = minetest.env:get_meta(pos);
+ local inv = meta:get_inventory()
+ if not inv:is_empty("src") or not inv:is_empty("dst") then
+ minetest.chat_send_player(player:get_player_name(),
+ "Machine cannot be removed because it is not empty");
+ return false
+ else
+ return true
+ end
+ end,
+})
for i=1,8,1 do
minetest.register_node(
"technic:battery_box"..i, {
description = "LV Battery Box",
- tiles = {"technic_battery_box_top.png", "technic_battery_box_bottom.png", "technic_battery_box_side0.png^technic_power_meter"..i..".png",
- "technic_battery_box_side0.png^technic_power_meter"..i..".png", "technic_battery_box_side0.png^technic_power_meter"..i..".png", "technic_battery_box_side0.png^technic_power_meter"..i..".png"},
+ tiles = {"technic_battery_box_top.png", "technic_battery_box_bottom.png",
+ "technic_battery_box_side0.png^technic_power_meter"..i..".png",
+ "technic_battery_box_side0.png^technic_power_meter"..i..".png",
+ "technic_battery_box_side0.png^technic_power_meter"..i..".png",
+ "technic_battery_box_side0.png^technic_power_meter"..i..".png"},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
drop="technic:battery_box",
@@ -258,3 +266,4 @@ technic.register_LV_machine("technic:battery_box","BA")
for i=1,8,1 do
technic.register_LV_machine("technic:battery_box"..i,"BA")
end
+
diff --git a/technic/battery_box_hv.lua b/technic/battery_box_hv.lua
index 8cd0e2f..5f9f772 100644
--- a/technic/battery_box_hv.lua
+++ b/technic/battery_box_hv.lua
@@ -228,3 +228,4 @@ technic.register_HV_machine("technic:hv_battery_box","BA")
for i=1,8,1 do
technic.register_HV_machine("technic:hv_battery_box"..i,"BA")
end
+
diff --git a/technic/battery_box_mv.lua b/technic/battery_box_mv.lua
index dfedc05..a413639 100644
--- a/technic/battery_box_mv.lua
+++ b/technic/battery_box_mv.lua
@@ -231,3 +231,4 @@ technic.register_MV_machine("technic:mv_battery_box","BA")
for i=1,8,1 do
technic.register_MV_machine("technic:mv_battery_box"..i,"BA")
end
+
diff --git a/technic/chainsaw.lua b/technic/chainsaw.lua
index 5c5de4c..ae0c30c 100644
--- a/technic/chainsaw.lua
+++ b/technic/chainsaw.lua
@@ -33,8 +33,8 @@ minetest.register_craft({
output = 'technic:chainsaw',
recipe = {
{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:battery'},
- {'technic:stainless_steel_ingot', 'technic:motor', 'technic:battery'},
- {'','','moreores:copper_ingot'},
+ {'technic:stainless_steel_ingot', 'technic:motor', 'technic:battery'},
+ {'', '', 'default:copper_ingot'},
}
})
@@ -266,3 +266,4 @@ recursive_dig = function(pos, remaining_charge, player)
-- Nothing sawed down
return remaining_charge
end
+
diff --git a/technic/cnc.lua b/technic/cnc.lua
index ad3dc67..8e215ae 100644
--- a/technic/cnc.lua
+++ b/technic/cnc.lua
@@ -6,6 +6,8 @@
-- beyond what is available in the panel today.
-- I could imagine some form of API allowing modders to come with their own node
-- box definitions and easily stuff it in the this machine for production.
+
+
local shape = {}
local onesize_products = {
slope = 2,
@@ -276,16 +278,16 @@ minetest.register_abm(
technic.register_LV_machine ("technic:cnc","RE")
technic.register_LV_machine ("technic:cnc_active","RE")
--------------------------
+-------------------------
-- CNC Machine Recipe
-------------------------
minetest.register_craft({
- output = 'technic:cnc',
- recipe = {
- {'default:glass', 'technic:diamond_drill_head', 'default:glass'},
- {'technic:control_logic_unit', 'technic:motor', 'default:steel_ingot'},
- {'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
- },
- })
-------------------------- \ No newline at end of file
+ output = 'technic:cnc',
+ recipe = {
+ {'default:glass', 'technic:diamond_drill_head', 'default:glass'},
+ {'technic:control_logic_unit', 'technic:motor', 'default:steel_ingot'},
+ {'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
+ },
+})
+
diff --git a/technic/cnc_nodes.lua b/technic/cnc_nodes.lua
index df82385..3d263b9 100644
--- a/technic/cnc_nodes.lua
+++ b/technic/cnc_nodes.lua
@@ -54,7 +54,7 @@ technic_cnc_api.register_all("default:sandstone",
---------
technic_cnc_api.register_all("default:leaves",
{snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
- {"bucharest_tree.png"},
+ {"default_leaves.png"},
"Leaves")
-- TREE
-------
diff --git a/technic/constructor.lua b/technic/constructor.lua
index b5a61cb..2b031e5 100644
--- a/technic/constructor.lua
+++ b/technic/constructor.lua
@@ -273,26 +273,72 @@ minetest.register_node("technic:constructor_mk3_on", {
deploy_node =function (inv, slot_name, pos1, node1, node)
-if node1.name == "air" then
- if not inv:is_empty(slot_name) then
+ if node1.name == "air" then
+ if not inv:is_empty(slot_name) then
stack1=inv:get_list(slot_name)
- node_to_be_placed={name=stack1[1]:get_name(), param1=0, param2=node.param2}
- minetest.env:set_node(pos1,node_to_be_placed)
- stack1[1]:take_item()
- inv:set_stack(slot_name, 1, stack1[1])
- return
+ local def = stack1[1]:get_definition()
+ if def.type == "node" then
+ node_to_be_placed={name=stack1[1]:get_name(), param1=0, param2=node.param2}
+ minetest.env:set_node(pos1,node_to_be_placed)
+ stack1[1]:take_item()
+ inv:set_stack(slot_name, 1, stack1[1])
+ elseif def.type == "craft" then
+ if def.on_place then
+ -- print("deploy_node: item has on_place. trying...")
+ local ok, stk = pcall(def.on_place, stack1[1], nil, {
+ -- Fake pointed_thing
+ type = "node",
+ above = pos1,
+ under = { x=pos1.x, y=pos1.y-1, z=pos1.z },
+ })
+ if ok then
+ -- print("deploy_node: on_place succeeded!")
+ inv:set_stack(slot_name, 1, stk or stack1[1])
+ return
+ -- else
+ -- print("deploy_node: WARNING: error while running on_place: "..tostring(stk))
+ end
+ end
+ minetest.item_place_object(stack1[1], nil, {
+ -- Fake pointed_thing
+ type = "node",
+ above = pos1,
+ under = pos1,
+ })
+ inv:set_stack(slot_name, 1, nil)
end
- return
end
- if node1.name == "ignore" or
- node1.name == "default:lava_source" or
- node1.name == "default:lava_flowing" or
- node1.name == "default:water_source" or
- node1.name == "default:water_flowing"
- then return end
- if inv:room_for_item(slot_name,node1) then
- inv:add_item(slot_name,node1)
+ return
+ end
+ if node1.name == "ignore" or
+ node1.name == "default:lava_source" or
+ node1.name == "default:lava_flowing" or
+ node1.name == "default:water_source" or
+ node1.name == "default:water_flowing"
+ then return end
+ if inv:room_for_item(slot_name,node1) then
+ local def = minetest.registered_nodes[node1.name]
+ if not def then return end
+ local drop = def.drop or node1.name
+ if type(drop) == "table" then
+ local pr = PseudoRandom(math.random())
+ local c = 0
+ local loop = 0 -- Prevent infinite loop
+ while (c < (drop.max_items or 1)) and (loop < 1000) do
+ local i = math.floor(pr:next(1, #drop.items))
+ if pr:next(1, drop.items[i].rarity or 1) == 1 then
+ for _,item in ipairs(drop.items[i].items) do
+ inv:add_item(slot_name,item)
+ end
+ c = c + 1
+ end
+ loop = loop + 1
+ end
+ minetest.env:remove_node(pos1)
+ elseif type(drop) == "string" then
+ inv:add_item(slot_name,drop)
minetest.env:remove_node(pos1)
end
+ end
end
diff --git a/technic/down_converter_hv.lua b/technic/down_converter_hv.lua
new file mode 100644
index 0000000..0e2e16d
--- /dev/null
+++ b/technic/down_converter_hv.lua
@@ -0,0 +1,225 @@
+-- The HV down converter will step down HV EUs to MV EUs
+-- If we take the solar panel as calibration then the
+-- 1 HVEU = 5 MVEU as we stack 5 MV arrays to get a HV array.
+-- The downconverter does of course have a conversion loss.
+-- This loses 30% of the power.
+-- The converter does not store any energy by itself.
+minetest.register_node("technic:down_converter_hv", {
+ description = "HV Down Converter",
+ tiles = {"technic_hv_down_converter_top.png", "technic_hv_down_converter_bottom.png", "technic_hv_down_converter_side.png",
+ "technic_hv_down_converter_side.png", "technic_hv_down_converter_side.png", "technic_hv_down_converter_side.png"},
+ groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+ sounds = default.node_sound_wood_defaults(),
+ drawtype = "nodebox",
+ paramtype = "light",
+ is_ground_content = true,
+ node_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
+ },
+ on_construct = function(pos)
+ local meta = minetest.env:get_meta(pos)
+ meta:set_float("technic_hv_power_machine", 1)
+ meta:set_float("technic_mv_power_machine", 1)
+ meta:set_float("internal_EU_buffer",0)
+ meta:set_float("internal_EU_buffer_size",0)
+ meta:set_string("infotext", "HV Down Converter")
+ meta:set_float("active", false)
+ end,
+ })
+
+minetest.register_craft({
+ output = 'technic:down_converter_hv 1',
+ recipe = {
+ {'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot','technic:stainless_steel_ingot'},
+ {'technic:hv_transformer', 'technic:hv_cable', 'technic:mv_transformer'},
+ {'technic:hv_cable', 'technic:rubber', 'technic:mv_cable'},
+ }
+})
+
+minetest.register_abm(
+ {nodenames = {"technic:down_converter_hv"},
+ interval = 1,
+ chance = 1,
+ action = function(pos, node, active_object_count, active_object_count_wider)
+ -- HV->MV conversion factor
+ local hv_mv_factor = 5
+ -- The maximun charge a single converter can handle. Let's set this to
+ -- what 5 HV solar arrays can produce - 30% loss (2880*5*0.7)
+ local max_charge = 10080*hv_mv_factor
+
+ local meta = minetest.env:get_meta(pos)
+ local meta1 = nil
+ local pos1 = {}
+ local available_charge = 0 -- counted in MV units
+ local used_charge = 0 -- counted in MV units
+
+ -- Index all HV nodes connected to the network
+ -- HV cable comes in through the bottom
+ pos1.y = pos.y-1
+ pos1.x = pos.x
+ pos1.z = pos.z
+ meta1 = minetest.env:get_meta(pos1)
+ if meta1:get_float("hv_cablelike")~=1 then return end
+
+ local HV_nodes = {} -- HV type
+ local HV_PR_nodes = {} -- HV type
+ local HV_BA_nodes = {} -- HV type
+
+ HV_nodes[1] = {}
+ HV_nodes[1].x = pos1.x
+ HV_nodes[1].y = pos1.y
+ HV_nodes[1].z = pos1.z
+
+ local table_index = 1
+ repeat
+ check_HV_node(HV_PR_nodes,nil,HV_BA_nodes,HV_nodes,table_index)
+ table_index = table_index + 1
+ if HV_nodes[table_index] == nil then break end
+ until false
+
+ --print("HV_nodes: PR="..table.getn(HV_PR_nodes).." BA="..table.getn(HV_BA_nodes))
+
+ -- Index all MV nodes connected to the network
+ -- MV cable comes out of the top
+ pos1.y = pos.y+1
+ pos1.x = pos.x
+ pos1.z = pos.z
+ meta1 = minetest.env:get_meta(pos1)
+ if meta1:get_float("mv_cablelike")~=1 then return end
+
+ local MV_nodes = {} -- MV type
+ local MV_RE_nodes = {} -- MV type
+ local MV_BA_nodes = {} -- MV type
+
+ MV_nodes[1] = {}
+ MV_nodes[1].x = pos1.x
+ MV_nodes[1].y = pos1.y
+ MV_nodes[1].z = pos1.z
+
+ table_index = 1
+ repeat
+ check_MV_node(nil,MV_RE_nodes,MV_BA_nodes,MV_nodes,table_index)
+ table_index = table_index + 1
+ if MV_nodes[table_index] == nil then break end
+ until false
+
+ --print("MV_nodes: RE="..table.getn(MV_RE_nodes).." BA="..table.getn(MV_BA_nodes))
+
+ -- First get available power from all the attached HV suppliers
+ -- Get the supplier internal EU buffer and read the EUs from it
+ -- No update yet!
+ local pos1
+-- FIXME: Until further leave the producers out of it and just let the batteries be the hub
+-- for _,pos1 in ipairs(HV_PR_nodes) do
+-- meta1 = minetest.env:get_meta(pos1)
+-- local internal_EU_buffer = meta1:get_float("internal_EU_buffer")
+-- available_charge = available_charge + meta1:get_float("internal_EU_buffer") * hv_mv_factor
+-- -- Limit conversion capacity
+-- if available_charge > max_charge then
+-- available_charge = max_charge
+-- break
+-- end
+-- end
+-- --print("Available_charge PR:"..available_charge)
+
+ for _,pos1 in ipairs(HV_BA_nodes) do
+ meta1 = minetest.env:get_meta(pos1)
+ local internal_EU_buffer = meta1:get_float("internal_EU_buffer")
+ available_charge = available_charge + meta1:get_float("internal_EU_buffer") * hv_mv_factor
+ -- Limit conversion capacity
+ if available_charge > max_charge then
+ available_charge = max_charge
+ break
+ end
+ end
+ --print("Available_charge PR+BA:"..available_charge)
+
+ -- Calculate total number of receivers:
+ local MV_receivers = table.getn(MV_RE_nodes)+table.getn(MV_BA_nodes)
+
+ -- Next supply power to all connected MV machines
+ -- Get the power receiver internal EU buffer and give EUs to it
+ -- Note: for now leave out RE type machines until producers distribute power themselves even without a battery
+-- for _,pos1 in ipairs(MV_RE_nodes) do
+-- local meta1 = minetest.env:get_meta(pos1)
+-- local internal_EU_buffer = meta1:get_float("internal_EU_buffer")
+-- local internal_EU_buffer_size = meta1:get_float("internal_EU_buffer_size")
+-- local charge_to_give = math.min(4000, available_charge/MV_receivers) -- power rating limit on the MV wire
+-- -- How much can this unit take?
+-- if internal_EU_buffer+charge_to_give > internal_EU_buffer_size then
+-- charge_to_give=internal_EU_buffer_size-internal_EU_buffer
+-- end
+-- -- If we are emptying the supply take the remainder
+-- if available_charge<used_charge+charge_to_give then charge_to_give=available_charge-used_charge end
+-- -- Update the unit supplied to
+-- internal_EU_buffer = internal_EU_buffer + charge_to_give
+-- meta1:set_float("internal_EU_buffer",internal_EU_buffer)
+-- -- Do the accounting
+-- used_charge = used_charge + charge_to_give
+-- if available_charge == used_charge then break end -- bail out if supply depleted
+-- end
+ --print("used_charge RE:"..used_charge)
+
+ for _,pos1 in ipairs(MV_BA_nodes) do
+ local meta1 = minetest.env:get_meta(pos1)
+ local internal_EU_buffer = meta1:get_float("internal_EU_buffer")
+ local internal_EU_buffer_size = meta1:get_float("internal_EU_buffer_size")
+ --print("internal_EU_buffer:"..internal_EU_buffer)
+ --print("internal_EU_buffer_size:"..internal_EU_buffer_size)
+ local charge_to_give = math.min(math.floor(available_charge/MV_receivers), 4000) -- power rating limit on the MV wire
+ --print("charge_to_give:"..charge_to_give)
+ -- How much can this unit take?
+ if internal_EU_buffer+charge_to_give > internal_EU_buffer_size then
+ charge_to_give=internal_EU_buffer_size-internal_EU_buffer
+ end
+ --print("charge_to_give2:"..charge_to_give)
+ -- If we are emptying the supply take the remainder
+ if available_charge<used_charge+charge_to_give then charge_to_give=available_charge-used_charge end
+ -- Update the unit supplied to
+ --print("charge_to_give3:"..charge_to_give)
+ internal_EU_buffer = internal_EU_buffer + charge_to_give
+ --print("internal_EU_buffer:"..internal_EU_buffer)
+ meta1:set_float("internal_EU_buffer",internal_EU_buffer)
+ -- Do the accounting
+ used_charge = used_charge + charge_to_give
+ --print("used_charge:"..used_charge)
+ if available_charge == used_charge then break end -- bail out if supply depleted
+ end
+ --print("used_charge RE+BA:"..used_charge)
+
+ -- Last update the HV suppliers with the actual demand.
+ -- Get the supplier internal EU buffer and update the EUs from it
+ -- Note: So far PR nodes left out and only BA nodes are updated
+ local HV_BA_size = table.getn(HV_BA_nodes)
+ for _,pos1 in ipairs(HV_BA_nodes) do
+ meta1 = minetest.env:get_meta(pos1)
+ local internal_EU_buffer = meta1:get_float("internal_EU_buffer")
+ local charge_to_take = math.floor(used_charge/HV_BA_size/hv_mv_factor) -- HV units
+ if internal_EU_buffer-charge_to_take <= 0 then
+ charge_to_take = internal_EU_buffer
+ end
+ if charge_to_take > 0 then
+ internal_EU_buffer = internal_EU_buffer-charge_to_take
+ meta1:set_float("internal_EU_buffer",internal_EU_buffer)
+ end
+ end
+
+ if used_charge>0 then
+ meta:set_string("infotext", "HV Down Converter is active (HV:"..available_charge.."/MV:"..used_charge..")");
+ meta:set_float("active",1) -- used for setting textures someday maybe
+ else
+ meta:set_string("infotext", "HV Down Converter is inactive (HV:"..available_charge.."/MV:"..used_charge..")");
+ meta:set_float("active",0) -- used for setting textures someday maybe
+ return
+ end
+ end,
+})
+
+-- This machine does not store energy it receives energy from the HV side and outputs it on the MV side
+register_HV_machine ("technic:down_converter_hv","RE")
+register_MV_machine ("technic:down_converter_hv","PR")
diff --git a/technic/down_converter_mv.lua b/technic/down_converter_mv.lua
new file mode 100644
index 0000000..1d26630
--- /dev/null
+++ b/technic/down_converter_mv.lua
@@ -0,0 +1,226 @@
+-- The MV down converter will step down MV EUs to LV EUs
+-- If we take the solar panel as calibration then the
+-- 1 MVEU = 5 LVEU as we stack 5 LV arrays to get an MV array.
+-- The downconverter does of course have a conversion loss.
+-- This loses 30% of the power.
+-- The converter does not store any energy by itself.
+minetest.register_node(
+ "technic:down_converter_mv", {
+ description = "MV Down Converter",
+ tiles = {"technic_mv_down_converter_top.png", "technic_mv_down_converter_bottom.png", "technic_mv_down_converter_side.png",
+ "technic_mv_down_converter_side.png", "technic_mv_down_converter_side.png", "technic_mv_down_converter_side.png"},
+ groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+ sounds = default.node_sound_wood_defaults(),
+ drawtype = "nodebox",
+ paramtype = "light",
+ is_ground_content = true,
+ node_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
+ },
+ on_construct = function(pos)
+ local meta = minetest.env:get_meta(pos)
+ meta:set_float("technic_mv_power_machine", 1)
+ meta:set_float("technic_power_machine", 1)
+ meta:set_float("internal_EU_buffer",0)
+ meta:set_float("internal_EU_buffer_size",0)
+ meta:set_string("infotext", "MV Down Converter")
+ meta:set_float("active", false)
+ end,
+ })
+
+minetest.register_craft({
+ output = 'technic:down_converter_mv 1',
+ recipe = {
+ {'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot','technic:stainless_steel_ingot'},
+ {'technic:mv_transformer', 'technic:mv_cable', 'technic:lv_transformer'},
+ {'technic:mv_cable', 'technic:rubber', 'technic:lv_cable'},
+ }
+})
+
+minetest.register_abm(
+ {nodenames = {"technic:down_converter_mv"},
+ interval = 1,
+ chance = 1,
+ action = function(pos, node, active_object_count, active_object_count_wider)
+ -- MV->LV conversion factor
+ local mv_lv_factor = 5
+ -- The maximun charge a single converter can handle. Let's set this to
+ -- what 5 MV solar arrays can produce - 30% loss (720*5*0.7)
+ local max_charge = 2520*mv_lv_factor
+
+ local meta = minetest.env:get_meta(pos)
+ local meta1 = nil
+ local pos1 = {}
+ local available_charge = 0 -- counted in LV units
+ local used_charge = 0 -- counted in LV units
+
+ -- Index all MV nodes connected to the network
+ -- MV cable comes in through the bottom
+ pos1.y = pos.y-1
+ pos1.x = pos.x
+ pos1.z = pos.z
+ meta1 = minetest.env:get_meta(pos1)
+ if meta1:get_float("mv_cablelike")~=1 then return end
+
+ local MV_nodes = {} -- MV type
+ local MV_PR_nodes = {} -- MV type
+ local MV_BA_nodes = {} -- MV type
+
+ MV_nodes[1] = {}
+ MV_nodes[1].x = pos1.x
+ MV_nodes[1].y = pos1.y
+ MV_nodes[1].z = pos1.z
+
+ local table_index = 1
+ repeat
+ check_MV_node(MV_PR_nodes,nil,MV_BA_nodes,MV_nodes,table_index)
+ table_index = table_index + 1
+ if MV_nodes[table_index] == nil then break end
+ until false
+
+ --print("MV_nodes: PR="..table.getn(MV_PR_nodes).." BA="..table.getn(MV_BA_nodes))
+
+ -- Index all LV nodes connected to the network
+ -- LV cable comes out of the top
+ pos1.y = pos.y+1
+ pos1.x = pos.x
+ pos1.z = pos.z
+ meta1 = minetest.env:get_meta(pos1)
+ if meta1:get_float("cablelike")~=1 then return end
+
+ local LV_nodes = {} -- LV type
+ local LV_RE_nodes = {} -- LV type
+ local LV_BA_nodes = {} -- LV type
+
+ LV_nodes[1] = {}
+ LV_nodes[1].x = pos1.x
+ LV_nodes[1].y = pos1.y
+ LV_nodes[1].z = pos1.z
+
+ table_index = 1
+ repeat
+ check_LV_node(nil,LV_RE_nodes,LV_BA_nodes,LV_nodes,table_index)
+ table_index = table_index + 1
+ if LV_nodes[table_index] == nil then break end
+ until false
+
+ --print("LV_nodes: RE="..table.getn(LV_RE_nodes).." BA="..table.getn(LV_BA_nodes))
+
+ -- First get available power from all the attached MV suppliers
+ -- Get the supplier internal EU buffer and read the EUs from it
+ -- No update yet!
+ local pos1
+-- FIXME: Until further leave the producers out of it and just let the batteries be the hub
+-- for _,pos1 in ipairs(MV_PR_nodes) do
+-- meta1 = minetest.env:get_meta(pos1)
+-- local internal_EU_buffer = meta1:get_float("internal_EU_buffer")
+-- available_charge = available_charge + meta1:get_float("internal_EU_buffer") * mv_lv_factor
+-- -- Limit conversion capacity
+-- if available_charge > max_charge then
+-- available_charge = max_charge
+-- break
+-- end
+-- end
+-- print("Available_charge PR:"..available_charge)
+
+ for _,pos1 in ipairs(MV_BA_nodes) do
+ meta1 = minetest.env:get_meta(pos1)
+ local internal_EU_buffer = meta1:get_float("internal_EU_buffer")
+ available_charge = available_charge + meta1:get_float("internal_EU_buffer") * mv_lv_factor
+ -- Limit conversion capacity
+ if available_charge > max_charge then
+ available_charge = max_charge
+ break
+ end
+ end
+ --print("Available_charge PR+BA:"..available_charge)
+
+ -- Calculate total number of receivers:
+ local LV_receivers = table.getn(LV_RE_nodes)+table.getn(LV_BA_nodes)
+
+ -- Next supply power to all connected LV machines
+ -- Get the power receiver internal EU buffer and give EUs to it
+ -- Note: for now leave out RE type machines until producers distribute power themselves even without a battery
+-- for _,pos1 in ipairs(LV_RE_nodes) do
+-- local meta1 = minetest.env:get_meta(pos1)
+-- local internal_EU_buffer = meta1:get_float("internal_EU_buffer")
+-- local internal_EU_buffer_size = meta1:get_float("internal_EU_buffer_size")
+-- local charge_to_give = math.min(1000, available_charge/LV_receivers) -- power rating limit on the LV wire
+-- -- How much can this unit take?
+-- if internal_EU_buffer+charge_to_give > internal_EU_buffer_size then
+-- charge_to_give=internal_EU_buffer_size-internal_EU_buffer
+-- end
+-- -- If we are emptying the supply take the remainder
+-- if available_charge<used_charge+charge_to_give then charge_to_give=available_charge-used_charge end
+-- -- Update the unit supplied to
+-- internal_EU_buffer = internal_EU_buffer + charge_to_give
+-- meta1:set_float("internal_EU_buffer",internal_EU_buffer)
+-- -- Do the accounting
+-- used_charge = used_charge + charge_to_give
+-- if available_charge == used_charge then break end -- bail out if supply depleted
+-- end
+ --print("used_charge RE:"..used_charge)
+
+ for _,pos1 in ipairs(LV_BA_nodes) do
+ local meta1 = minetest.env:get_meta(pos1)
+ local internal_EU_buffer = meta1:get_float("internal_EU_buffer")
+ local internal_EU_buffer_size = meta1:get_float("internal_EU_buffer_size")
+ --print("internal_EU_buffer:"..internal_EU_buffer)
+ --print("internal_EU_buffer_size:"..internal_EU_buffer_size)
+ local charge_to_give = math.min(math.floor(available_charge/LV_receivers), 1000) -- power rating limit on the LV wire
+ --print("charge_to_give:"..charge_to_give)
+ -- How much can this unit take?
+ if internal_EU_buffer+charge_to_give > internal_EU_buffer_size then
+ charge_to_give=internal_EU_buffer_size-internal_EU_buffer
+ end
+ --print("charge_to_give2:"..charge_to_give)
+ -- If we are emptying the supply take the remainder
+ if available_charge<used_charge+charge_to_give then charge_to_give=available_charge-used_charge end
+ -- Update the unit supplied to
+ --print("charge_to_give3:"..charge_to_give)
+ internal_EU_buffer = internal_EU_buffer + charge_to_give
+ --print("internal_EU_buffer:"..internal_EU_buffer)
+ meta1:set_float("internal_EU_buffer",internal_EU_buffer)
+ -- Do the accounting
+ used_charge = used_charge + charge_to_give
+ --print("used_charge:"..used_charge)
+ if available_charge == used_charge then break end -- bail out if supply depleted
+ end
+ --print("used_charge RE+BA:"..used_charge)
+
+ -- Last update the MV suppliers with the actual demand.
+ -- Get the supplier internal EU buffer and update the EUs from it
+ -- Note: So far PR nodes left out and only BA nodes are updated
+ local MV_BA_size = table.getn(MV_BA_nodes)
+ for _,pos1 in ipairs(MV_BA_nodes) do
+ meta1 = minetest.env:get_meta(pos1)
+ local internal_EU_buffer = meta1:get_float("internal_EU_buffer")
+ local charge_to_take = math.floor(used_charge/MV_BA_size/mv_lv_factor) -- MV units
+ if internal_EU_buffer-charge_to_take <= 0 then
+ charge_to_take = internal_EU_buffer
+ end
+ if charge_to_take > 0 then
+ internal_EU_buffer = internal_EU_buffer-charge_to_take
+ meta1:set_float("internal_EU_buffer",internal_EU_buffer)
+ end
+ end
+
+ if used_charge>0 then
+ meta:set_string("infotext", "MV Down Converter is active (MV:"..available_charge.."/LV:"..used_charge..")");
+ meta:set_float("active",1) -- used for setting textures someday maybe
+ else
+ meta:set_string("infotext", "MV Down Converter is inactive (MV:"..available_charge.."/LV:"..used_charge..")");
+ meta:set_float("active",0) -- used for setting textures someday maybe
+ return
+ end
+ end,
+})
+
+-- This machine does not store energy it receives energy from the MV side and outputs it on the LV side
+register_MV_machine ("technic:down_converter_mv","RE")
+register_LV_machine ("technic:down_converter_mv","PR")
diff --git a/technic/electric.lua b/technic/electric.lua
index 2eb2bf3..fc519de 100644
--- a/technic/electric.lua
+++ b/technic/electric.lua
@@ -21,9 +21,9 @@ minetest.register_alias("electric_furnace", "technic:electric_furnace")
minetest.register_craft({
output = 'technic:battery 1',
recipe = {
- {'default:wood', 'moreores:copper_ingot', 'default:wood'},
+ {'default:wood', 'default:copper_ingot', 'default:wood'},
{'default:wood', 'moreores:tin_ingot', 'default:wood'},
- {'default:wood', 'moreores:copper_ingot', 'default:wood'},
+ {'default:wood', 'default:copper_ingot', 'default:wood'},
}
})
@@ -31,7 +31,7 @@ minetest.register_craft({
output = 'technic:battery_box 1',
recipe = {
{'technic:battery', 'default:wood', 'technic:battery'},
- {'technic:battery', 'moreores:copper_ingot', 'technic:battery'},
+ {'technic:battery', 'default:copper_ingot', 'technic:battery'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
@@ -41,7 +41,7 @@ minetest.register_craft({
recipe = {
{'default:brick', 'default:brick', 'default:brick'},
{'default:brick', '', 'default:brick'},
- {'default:steel_ingot', 'moreores:copper_ingot', 'default:steel_ingot'},
+ {'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
}
})
@@ -265,4 +265,4 @@ minetest.register_abm({
end,
-}) \ No newline at end of file
+})
diff --git a/technic/electric_furnace.lua b/technic/electric_furnace.lua
index 4f2f11c..0c1f43e 100644
--- a/technic/electric_furnace.lua
+++ b/technic/electric_furnace.lua
@@ -157,3 +157,4 @@ minetest.register_abm(
technic.register_LV_machine ("technic:electric_furnace","RE")
technic.register_LV_machine ("technic:electric_furnace_active","RE")
+
diff --git a/technic/frames.lua b/technic/frames.lua
index 565a2ef..7d141dc 100644
--- a/technic/frames.lua
+++ b/technic/frames.lua
@@ -1,3 +1,5 @@
+frames={}
+
function get_face(pos,ppos,pvect)
ppos={x=ppos.x-pos.x,y=ppos.y-pos.y+1.5,z=ppos.z-pos.z}
if pvect.x>0 then
@@ -360,8 +362,10 @@ end
function move_nodes_vect(poslist,vect)
for _,pos in ipairs(poslist) do
- local npos=addVect(pos,vect)
- if minetest.env:get_node(npos).name~="air" and not(pos_in_list(poslist,npos)) then return end
+ local npos=frames.addVect(pos,vect)
+ local name = minetest.env:get_node(npos).name
+ if (name~="air" and minetest.registered_nodes[name].liquidtype=="none") and not(pos_in_list(poslist,npos)) then
+ return end
end
nodelist={}
for _,pos in ipairs(poslist) do
@@ -376,14 +380,14 @@ function move_nodes_vect(poslist,vect)
end
end
for _,obj in ipairs(objects) do
- obj:setpos(addVect(obj:getpos(),vect))
+ obj:setpos(frames.addVect(obj:getpos(),vect))
le=obj:get_luaentity()
if le and le.name == "pipeworks:tubed_item" then
- le.start_pos=addVect(le.start_pos,vect)
+ le.start_pos=frames.addVect(le.start_pos,vect)
end
end
for _,n in ipairs(nodelist) do
- local npos=addVect(n.pos,vect)
+ local npos=frames.addVect(n.pos,vect)
minetest.env:set_node(npos,n.node)
local meta=minetest.env:get_meta(npos)
meta:from_table(n.meta)
@@ -406,7 +410,7 @@ function get_connected_nodes(pos)
return c
end
-function addVect(pos,vect)
+function frames.addVect(pos,vect)
return {x=pos.x+vect.x,y=pos.y+vect.y,z=pos.z+vect.z}
end
@@ -419,7 +423,7 @@ end
function connected(pos,c,adj)
for _,vect in ipairs(adj) do
- local pos1=addVect(pos,vect)
+ local pos1=frames.addVect(pos,vect)
local nodename=minetest.env:get_node(pos1).name
if not(pos_in_list(c,pos1)) and nodename~="air" and
(minetest.registered_nodes[nodename].frames_can_connect==nil or
diff --git a/technic/generator.lua b/technic/generator.lua
index 48f3b03..5d3554d 100644
--- a/technic/generator.lua
+++ b/technic/generator.lua
@@ -10,7 +10,7 @@ minetest.register_craft({
recipe = {
{'default:stone', 'default:stone', 'default:stone'},
{'default:stone', '', 'default:stone'},
- {'default:stone', 'moreores:copper_ingot', 'default:stone'},
+ {'default:stone', 'default:copper_ingot', 'default:stone'},
}
})
diff --git a/technic/grinder.lua b/technic/grinder.lua
index ba78710..baef12d 100644
--- a/technic/grinder.lua
+++ b/technic/grinder.lua
@@ -112,7 +112,7 @@ minetest.register_craftitem( "technic:gold_dust", {
})
minetest.register_craft({
type = "cooking",
- output = "moreores:gold_ingot",
+ output = "default:gold_ingot",
recipe = "technic:gold_dust",
})
@@ -145,7 +145,7 @@ minetest.register_craftitem( "technic:bronze_dust", {
})
minetest.register_craft({
type = "cooking",
- output = "moreores:bronze_ingot",
+ output = "default:bronze_ingot",
recipe = "technic:bronze_dust",
})
@@ -349,3 +349,4 @@ minetest.register_abm(
technic.register_LV_machine ("technic:grinder","RE")
technic.register_LV_machine ("technic:grinder_active","RE")
+
diff --git a/technic/grinder.lua~ b/technic/grinder.lua~
new file mode 100644
index 0000000..8343a94
--- /dev/null
+++ b/technic/grinder.lua~
@@ -0,0 +1,353 @@
+grinder_recipes ={}
+
+registered_grinder_recipes_count=1
+
+function register_grinder_recipe (string1,string2)
+grinder_recipes[registered_grinder_recipes_count]={}
+grinder_recipes[registered_grinder_recipes_count].src_name=string1
+grinder_recipes[registered_grinder_recipes_count].dst_name=string2
+registered_grinder_recipes_count=registered_grinder_recipes_count+1
+if unified_inventory then
+ unified_inventory.register_craft({
+ type = "grinding",
+ output = string2,
+ items = {string1},
+ width = 0,
+ })
+ end
+end
+
+register_grinder_recipe("default:stone","default:sand")
+register_grinder_recipe("default:cobble","default:gravel")
+register_grinder_recipe("default:gravel","default:dirt")
+register_grinder_recipe("default:desert_stone","default:desert_sand")
+register_grinder_recipe("default:iron_lump","technic:iron_dust 2")
+register_grinder_recipe("default:steel_ingot","technic:iron_dust 1")
+register_grinder_recipe("default:coal_lump","technic:coal_dust 2")
+register_grinder_recipe("default:copper_lump","technic:copper_dust 2")
+register_grinder_recipe("default:copper_ingot","technic:copper_dust 1")
+register_grinder_recipe("default:gold_lump","technic:gold_dust 2")
+register_grinder_recipe("default:gold_ingot","technic:gold_dust 1")
+--register_grinder_recipe("default:bronze_ingot","technic:bronze_dust 1") -- Dust does not exist yet
+--register_grinder_recipe("home_decor:brass_ingot","technic:brass_dust 1") -- needs check for the mod
+register_grinder_recipe("moreores:tin_lump","technic:tin_dust 2")
+register_grinder_recipe("moreores:tin_ingot","technic:tin_dust 1")
+register_grinder_recipe("moreores:silver_lump","technic:silver_dust 2")
+register_grinder_recipe("moreores:silver_ingot","technic:silver_dust 1")
+register_grinder_recipe("moreores:mithril_lump","technic:mithril_dust 2")
+register_grinder_recipe("moreores:mithril_ingot","technic:mithril_dust 1")
+register_grinder_recipe("technic:chromium_lump","technic:chromium_dust 2")
+register_grinder_recipe("technic:chromium_ingot","technic:chromium_dust 1")
+register_grinder_recipe("technic:stainless_steel_ingot","stainless_steel_dust 1")
+register_grinder_recipe("group:brass_ingot","technic:brass_dust 1")
+register_grinder_recipe("technic:zinc_lump","technic:zinc_dust 2")
+register_grinder_recipe("technic:zinc_ingot","technic:zinc_dust 1")
+register_grinder_recipe("technic:coal_dust","dye:black 2")
+register_grinder_recipe("default:cactus","dye:green 2")
+register_grinder_recipe("default:dry_shrub","dye:brown 2")
+register_grinder_recipe("flowers:flower_geranium","dye:blue 2")
+register_grinder_recipe("flowers:flower_dandelion_white","dye:white 2")
+register_grinder_recipe("flowers:flower_dandelion_yellow","dye:yellow 2")
+register_grinder_recipe("flowers:flower_tulip","dye:orange 2")
+register_grinder_recipe("flowers:flower_rose","dye:red 2")
+register_grinder_recipe("flowers:flower_viola","dye:violet 2")
+
+minetest.register_craftitem( "technic:coal_dust", {
+ description = "Coal Dust",
+ inventory_image = "technic_coal_dust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+
+minetest.register_craftitem( "technic:iron_dust", {
+ description = "Iron Dust",
+ inventory_image = "technic_iron_dust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+
+minetest.register_craft({
+ type = "cooking",
+ output = "default:steel_ingot",
+ recipe = "technic:iron_dust",
+})
+
+minetest.register_craftitem( "technic:copper_dust", {
+ description = "Copper Dust",
+ inventory_image = "technic_copper_dust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+minetest.register_craft({
+ type = "cooking",
+ output = "moreores:copper_ingot",
+ recipe = "technic:copper_dust",
+})
+
+minetest.register_craftitem( "technic:tin_dust", {
+ description = "Tin Dust",
+ inventory_image = "technic_tin_dust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+minetest.register_craft({
+ type = "cooking",
+ output = "moreores:tin_ingot",
+ recipe = "technic:tin_dust",
+})
+
+minetest.register_craftitem( "technic:silver_dust", {
+ description = "Silver Dust",
+ inventory_image = "technic_silver_dust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+minetest.register_craft({
+ type = "cooking",
+ output = "moreores:silver_ingot",
+ recipe = "technic:silver_dust",
+})
+
+minetest.register_craftitem( "technic:gold_dust", {
+ description = "Gold Dust",
+ inventory_image = "technic_gold_dust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+minetest.register_craft({
+ type = "cooking",
+ output = "moreores:gold_ingot",
+ recipe = "technic:gold_dust",
+})
+
+minetest.register_craftitem( "technic:mithril_dust", {
+ description = "Mithril Dust",
+ inventory_image = "technic_mithril_dust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+minetest.register_craft({
+ type = "cooking",
+ output = "moreores:mithril_ingot",
+ recipe = "technic:mithril_dust",
+})
+
+minetest.register_craftitem( "technic:chromium_dust", {
+ description = "Chromium Dust",
+ inventory_image = "technic_chromium_dust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+minetest.register_craft({
+ type = "cooking",
+ output = "technic:chromium_ingot",
+ recipe = "technic:chromium_dust",
+})
+
+minetest.register_craftitem( "technic:bronze_dust", {
+ description = "Bronze Dust",
+ inventory_image = "technic_bronze_dust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+minetest.register_craft({
+ type = "cooking",
+ output = "moreores:bronze_ingot",
+ recipe = "technic:bronze_dust",
+})
+
+minetest.register_craftitem( "technic:brass_dust", {
+ description = "Brass Dust",
+ inventory_image = "technic_brass_dust.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+ })
+
+minetest.register_craft({
+ type = "cooking",
+ output = "technic:brass_ingot",
+ recipe = "technic:brass_dust",
+})
+
+minetest.register_craftitem( "technic:stainless_steel_dust", {
+ description = "Stainless Steel Dust",
+ inventory_image = "technic_stainless_steel_dust.png",
+ })
+
+minetest.register_craft({
+ type = "cooking",
+ output = "technic:stainless_steel_ingot",
+ recipe = "technic:stainless_steel_dust",
+})
+
+minetest.register_craftitem( "technic:zinc_dust", {
+ description = "Zinc Dust",
+ inventory_image = "technic_zinc_dust.png",
+ })
+
+minetest.register_craft({
+ type = "cooking",
+ output = "technic:zinc_ingot",
+ recipe = "technic:zinc_dust",
+})
+
+minetest.register_alias("grinder", "technic:grinder")
+minetest.register_craft({
+ output = 'technic:grinder',
+ recipe = {
+ {'default:desert_stone', 'default:desert_stone', 'default:desert_stone'},
+ {'default:desert_stone', 'default:diamond', 'default:desert_stone'},
+ {'default:stone', 'moreores:copper_ingot', 'default:stone'},
+ }
+})
+
+minetest.register_craftitem("technic:grinder", {
+ description = "Grinder",
+ stack_max = 99,
+})
+
+grinder_formspec =
+ "invsize[8,9;]"..
+ "image[1,1;1,2;technic_power_meter_bg.png]"..
+ "label[0,0;Grinder]"..
+ "label[1,3;Power level]"..
+ "list[current_name;src;3,1;1,1;]"..
+ "list[current_name;dst;5,1;2,2;]"..
+ "list[current_player;main;0,5;8,4;]"
+
+
+minetest.register_node("technic:grinder", {
+ description = "Grinder",
+ tiles = {"technic_lv_grinder_top.png", "technic_lv_grinder_bottom.png", "technic_lv_grinder_side.png",
+ "technic_lv_grinder_side.png", "technic_lv_grinder_side.png", "technic_lv_grinder_front.png"},
+ paramtype2 = "facedir",
+ groups = {cracky=2},
+ legacy_facedir_simple = true,
+ sounds = default.node_sound_wood_defaults(),
+ technic_power_machine=1,
+ internal_EU_buffer=0;
+ internal_EU_buffer_size=5000;
+ grind_time=0;
+ grinded = nil;
+ src_time = 0;
+ on_construct = function(pos)
+ local meta = minetest.env:get_meta(pos)
+ meta:set_string("infotext", "Grinder")
+ meta:set_float("technic_power_machine", 1)
+ meta:set_float("internal_EU_buffer", 0)
+ meta:set_float("internal_EU_buffer_size", 5000)
+ meta:set_string("formspec", grinder_formspec)
+ meta:set_float("grind_time", 0)
+ local inv = meta:get_inventory()
+ inv:set_size("src", 1)
+ inv:set_size("dst", 4)
+ end,
+ can_dig = function(pos,player)
+ local meta = minetest.env:get_meta(pos);
+ local inv = meta:get_inventory()
+ if not inv:is_empty("src") then
+ return false
+ end
+ if not inv:is_empty("dst") then
+ return false
+ end
+ return true
+ end,
+})
+
+minetest.register_node("technic:grinder_active", {
+ description = "Grinder",
+ tiles = {"technic_lv_grinder_top.png", "technic_lv_grinder_bottom.png", "technic_lv_grinder_side.png",
+ "technic_lv_grinder_side.png", "technic_lv_grinder_side.png", "technic_lv_grinder_front_active.png"},
+ paramtype2 = "facedir",
+ groups = {cracky=2,not_in_creative_inventory=1},
+ legacy_facedir_simple = true,
+ sounds = default.node_sound_wood_defaults(),
+ can_dig = function(pos,player)
+ local meta = minetest.env:get_meta(pos);
+ local inv = meta:get_inventory()
+ if not inv:is_empty("src") then
+ return false
+ end
+ if not inv:is_empty("dst") then
+ return false
+ end
+ return true
+ end,
+})
+
+minetest.register_abm({
+ nodenames = {"technic:grinder","technic:grinder_active"},
+ interval = 1,
+ chance = 1,
+ action = function(pos, node, active_object_count, active_object_count_wider)
+
+ local meta = minetest.env:get_meta(pos)
+ local charge= meta:get_float("internal_EU_buffer")
+ local max_charge= meta:get_float("internal_EU_buffer_size")
+ local grind_cost=200
+
+ local load = math.floor((charge/max_charge)*100)
+ meta:set_string("formspec",
+ "invsize[8,9;]"..
+ "image[1,1;1,2;technic_power_meter_bg.png^[lowpart:"..
+ (load)..":technic_power_meter_fg.png]"..
+ "label[0,0;Grinder]"..
+ "label[1,3;Power level]"..
+ "list[current_name;src;3,1;1,1;]"..
+ "list[current_name;dst;5,1;2,2;]"..
+ "list[current_player;main;0,5;8,4;]"
+ )
+
+ local inv = meta:get_inventory()
+ local srclist = inv:get_list("src")
+ if inv:is_empty("src") then meta:set_float("grinder_on",0) end
+
+ if (meta:get_float("grinder_on") == 1) then
+ if charge>=grind_cost then
+ charge=charge-grind_cost;
+ meta:set_float("internal_EU_buffer",charge)
+ meta:set_float("src_time", meta:get_float("src_time") + 1)
+ if meta:get_float("src_time") >= meta:get_float("grind_time") then
+ -- check if there's room for output in "dst" list
+ grinded = get_grinded_item (inv:get_stack("src", 1))
+ if inv:room_for_item("dst",grinded) then
+ -- Put result in "dst" list
+ inv:add_item("dst", grinded)
+ -- take stuff from "src" list
+ srcstack = inv:get_stack("src", 1)
+ srcstack:take_item()
+ inv:set_stack("src", 1, srcstack)
+ if inv:is_empty("src") then meta:set_float("grinder_on",0) end
+ else
+ print("Grinder inventory full!")
+ end
+ meta:set_float("src_time", 0)
+ end
+ end
+ end
+ if (meta:get_float("grinder_on")==0) then
+ local grinded=nil
+ if not inv:is_empty("src") then
+ grinded = get_grinded_item (inv:get_stack("src", 1))
+ if grinded then
+ meta:set_float("grinder_on",1)
+ hacky_swap_node(pos,"technic:grinder_active")
+ meta:set_string("infotext", "Grinder Active")
+ grind_time=4
+ meta:set_float("grind_time",grind_time)
+ meta:set_float("src_time", 0)
+ return
+ end
+ else
+ hacky_swap_node(pos,"technic:grinder")
+ meta:set_string("infotext", "Grinder Inactive")
+ end
+ end
+ end
+})
+
+function get_grinded_item (items)
+new_item =nil
+src_item=items:to_table()
+item_name=src_item["name"]
+
+local counter=registered_grinder_recipes_count-1
+for i=1, counter,1 do
+ if grinder_recipes[i].src_name==item_name then return ItemStack(grinder_recipes[i].dst_name) end
+end
+return nil
+end
+
+register_LV_machine ("technic:grinder","RE")
+register_LV_machine ("technic:grinder_active","RE")
diff --git a/technic/init.lua b/technic/init.lua
index 2d748bc..edb1c34 100644
--- a/technic/init.lua
+++ b/technic/init.lua
@@ -5,12 +5,12 @@
technic = {}
technic.dprint = function(string)
- if technic.DBG == 1 then
- print(string)
- end
- end
+ if technic.DBG == 1 then
+ print(string)
+ end
+end
-local modpath=minetest.get_modpath("technic")
+local modpath = minetest.get_modpath("technic")
--Read technic config file
dofile(modpath.."/config.lua")
@@ -50,6 +50,7 @@ dofile(modpath.."/extractor.lua")
dofile(modpath.."/wires_mv.lua")
dofile(modpath.."/battery_box_mv.lua")
dofile(modpath.."/solar_array_mv.lua")
+--dofile(modpath.."/down_converter_mv.lua")
dofile(modpath.."/electric_furnace_mv.lua")
dofile(modpath.."/alloy_furnace_mv.lua")
dofile(modpath.."/forcefield.lua")
@@ -63,6 +64,12 @@ dofile(modpath.."/wires_hv.lua")
dofile(modpath.."/battery_box_hv.lua")
dofile(modpath.."/solar_array_hv.lua")
+--HV machines
+dofile(modpath.."/wires_hv.lua")
+dofile(modpath.."/battery_box_hv.lua")
+dofile(modpath.."/solar_array_hv.lua")
+--dofile(modpath.."/down_converter_hv.lua")
+
--Tools
if technic.config:getBool("enable_mining_drill") then dofile(modpath.."/mining_drill.lua") end
if technic.config:getBool("enable_mining_laser") then dofile(modpath.."/mining_laser_mk1.lua") end
diff --git a/technic/items.lua b/technic/items.lua
index 0f23648..8d952c6 100644
--- a/technic/items.lua
+++ b/technic/items.lua
@@ -81,27 +81,27 @@ minetest.register_craft({
minetest.register_craft({
output = 'technic:green_energy_crystal',
recipe = {
- {'moreores:gold_ingot', 'technic:battery', 'dye:green'},
+ {'default:gold_ingot', 'technic:battery', 'dye:green'},
{'technic:battery', 'technic:red_energy_crystal', 'technic:battery'},
- {'dye:green', 'technic:battery', 'moreores:gold_ingot'},
+ {'dye:green', 'technic:battery', 'default:gold_ingot'},
}
})
minetest.register_craft({
output = 'technic:blue_energy_crystal',
recipe = {
- {'moreores:gold_ingot', 'technic:battery', 'dye:blue'},
+ {'default:gold_ingot', 'technic:battery', 'dye:blue'},
{'technic:battery', 'technic:green_energy_crystal', 'technic:battery'},
- {'dye:blue', 'technic:battery', 'moreores:gold_ingot'},
+ {'dye:blue', 'technic:battery', 'default:gold_ingot'},
}
})
minetest.register_craft({
output = 'technic:red_energy_crystal',
recipe = {
- {'moreores:gold_ingot', 'technic:battery', 'dye:red'},
+ {'default:gold_ingot', 'technic:battery', 'dye:red'},
{'technic:battery', 'default:diamondblock', 'technic:battery'},
- {'dye:red', 'technic:battery', 'moreores:gold_ingot'},
+ {'dye:red', 'technic:battery', 'default:gold_ingot'},
}
})
@@ -130,9 +130,9 @@ minetest.register_craftitem( "technic:fine_copper_wire", {
minetest.register_craft({
output = 'technic:fine_copper_wire 2',
recipe = {
- {'', 'moreores:copper_ingot', ''},
- {'', 'moreores:copper_ingot', ''},
- {'', 'moreores:copper_ingot', ''},
+ {'', 'default:copper_ingot', ''},
+ {'', 'default:copper_ingot', ''},
+ {'', 'default:copper_ingot', ''},
}
})
@@ -162,7 +162,22 @@ minetest.register_craft({
recipe = {
{'default:steel_ingot', 'technic:copper_coil', 'default:steel_ingot'},
{'default:steel_ingot', 'technic:copper_coil', 'default:steel_ingot'},
- {'default:steel_ingot', 'moreores:copper_ingot', 'default:steel_ingot'},
+ {'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
+ }
+})
+
+minetest.register_craftitem( "technic:lv_transformer", {
+ description = "Low Voltage Transformer",
+ inventory_image = "technic_lv_transformer.png",
+ on_place_on_ground = minetest.craftitem_place_item,
+})
+
+minetest.register_craft({
+ output = 'technic:lv_transformer',
+ recipe = {
+ {'default:iron_lump', 'default:iron_lump', 'default:iron_lump'},
+ {'technic:copper_coil', 'default:iron_lump', 'technic:copper_coil'},
+ {'default:iron_lump', 'default:iron_lump', 'default:iron_lump'},
}
})
@@ -220,8 +235,8 @@ minetest.register_craftitem( "technic:control_logic_unit", {
minetest.register_craft({
output = 'technic:control_logic_unit',
recipe = {
- {'', 'moreores:gold_ingot', ''},
- {'moreores:copper_ingot', 'technic:silicon_wafer', 'moreores:copper_ingot'},
- {'', 'moreores:copper_ingot', ''},
+ {'', 'default:gold_ingot', ''},
+ {'default:copper_ingot', 'technic:silicon_wafer', 'default:copper_ingot'},
+ {'', 'default:copper_ingot', ''},
}
})
diff --git a/technic/mining_drill.lua b/technic/mining_drill.lua
index 4a50f2f..6df9e97 100644
--- a/technic/mining_drill.lua
+++ b/technic/mining_drill.lua
@@ -8,25 +8,25 @@ local mining_drill_mk3_power_usage=1800
minetest.register_craft({
output = 'technic:mining_drill',
recipe = {
- {'technic:stainless_steel_ingot', 'technic:diamond_drill_head', 'technic:stainless_steel_ingot'},
- {'technic:stainless_steel_ingot', 'technic:motor', 'technic:stainless_steel_ingot'},
- {'', 'technic:red_energy_crystal', 'moreores:copper_ingot'},
+ {'technic:stainless_steel_ingot', 'technic:diamond_drill_head', 'technic:stainless_steel_ingot'},
+ {'technic:stainless_steel_ingot', 'technic:motor', 'technic:stainless_steel_ingot'},
+ {'', 'technic:red_energy_crystal', 'moreores:copper_ingot'},
}
})
minetest.register_craft({
output = 'technic:mining_drill_mk2',
recipe = {
- {'technic:diamond_drill_head', 'technic:diamond_drill_head', 'technic:diamond_drill_head'},
- {'technic:stainless_steel_ingot', 'technic:mining_drill', 'technic:stainless_steel_ingot'},
- {'', 'technic:green_energy_crystal', ''},
+ {'technic:diamond_drill_head', 'technic:diamond_drill_head', 'technic:diamond_drill_head'},
+ {'technic:stainless_steel_ingot', 'technic:mining_drill', 'technic:stainless_steel_ingot'},
+ {'', 'technic:green_energy_crystal', ''},
}
})
minetest.register_craft({
output = 'technic:mining_drill_mk3',
recipe = {
- {'technic:diamond_drill_head', 'technic:diamond_drill_head', 'technic:diamond_drill_head'},
- {'technic:stainless_steel_ingot', 'technic:mining_drill_mk2', 'technic:stainless_steel_ingot'},
- {'', 'technic:blue_energy_crystal', ''},
+ {'technic:diamond_drill_head', 'technic:diamond_drill_head', 'technic:diamond_drill_head'},
+ {'technic:stainless_steel_ingot', 'technic:mining_drill_mk2', 'technic:stainless_steel_ingot'},
+ {'', 'technic:blue_energy_crystal', ''},
}
})
diff --git a/technic/mining_laser_mk1.lua b/technic/mining_laser_mk1.lua
index 4dc76f8..8b89131 100644
--- a/technic/mining_laser_mk1.lua
+++ b/technic/mining_laser_mk1.lua
@@ -77,7 +77,7 @@ minetest.register_craft({
recipe = {
{'default:diamond', 'default:steel_ingot', 'technic:battery'},
{'', 'default:steel_ingot', 'technic:battery'},
- {'', '', 'moreores:copper_ingot'},
+ {'', '', 'default:copper_ingot'},
}
})
diff --git a/technic/music_player.lua b/technic/music_player.lua
index e0520ff..a3f52aa 100644
--- a/technic/music_player.lua
+++ b/technic/music_player.lua
@@ -6,7 +6,7 @@ minetest.register_craft({
recipe = {
{'default:wood', 'default:wood', 'default:wood'},
{'default:diamond', 'default:diamond', 'default:diamond'},
- {'default:stone', 'moreores:copper_ingot', 'default:stone'},
+ {'default:stone', 'default:copper_ingot', 'default:stone'},
}
})
diff --git a/technic/solar_array_hv.lua b/technic/solar_array_hv.lua
index a2fb516..73f6ee2 100644
--- a/technic/solar_array_hv.lua
+++ b/technic/solar_array_hv.lua
@@ -55,7 +55,6 @@ minetest.register_abm(
pos1.y=pos.y+1
pos1.x=pos.x
pos1.z=pos.z
-
local light = minetest.env:get_node_light(pos1, nil)
local time_of_day = minetest.env:get_timeofday()
local meta = minetest.env:get_meta(pos)
@@ -76,3 +75,4 @@ minetest.register_abm(
})
technic.register_HV_machine ("technic:solar_array_hv","PR")
+
diff --git a/technic/solar_array_lv.lua b/technic/solar_array_lv.lua
index ecc55d9..e758eb8 100644
--- a/technic/solar_array_lv.lua
+++ b/technic/solar_array_lv.lua
@@ -55,7 +55,6 @@ minetest.register_abm(
pos1.y=pos.y+1
pos1.x=pos.x
pos1.z=pos.z
-
local light = minetest.env:get_node_light(pos1, nil)
local time_of_day = minetest.env:get_timeofday()
local meta = minetest.env:get_meta(pos)
@@ -76,3 +75,4 @@ minetest.register_abm(
})
technic.register_LV_machine ("technic:solar_array_lv","PR")
+
diff --git a/technic/solar_array_mv.lua b/technic/solar_array_mv.lua
index 3eba790..f389a9f 100644
--- a/technic/solar_array_mv.lua
+++ b/technic/solar_array_mv.lua
@@ -57,7 +57,7 @@ minetest.register_abm(
pos1.y=pos.y+1
pos1.x=pos.x
pos1.z=pos.z
-
+
local light = minetest.env:get_node_light(pos1, nil)
local time_of_day = minetest.env:get_timeofday()
local meta = minetest.env:get_meta(pos)
@@ -79,3 +79,4 @@ minetest.register_abm(
})
technic.register_MV_machine ("technic:solar_array_mv","PR")
+
diff --git a/technic/solar_panel.lua b/technic/solar_panel.lua
index 96ee744..ff3e34a 100644
--- a/technic/solar_panel.lua
+++ b/technic/solar_panel.lua
@@ -75,3 +75,4 @@ minetest.register_abm(
})
technic.register_LV_machine ("technic:solar_panel","PR")
+
diff --git a/technic/textures/technic_hv_down_converter_bottom.png b/technic/textures/technic_hv_down_converter_bottom.png
new file mode 100644
index 0000000..996b2d4
--- /dev/null
+++ b/technic/textures/technic_hv_down_converter_bottom.png
Binary files differ
diff --git a/technic/textures/technic_hv_down_converter_side.png b/technic/textures/technic_hv_down_converter_side.png
new file mode 100644
index 0000000..ab904f1
--- /dev/null
+++ b/technic/textures/technic_hv_down_converter_side.png
Binary files differ
diff --git a/technic/textures/technic_hv_down_converter_top.png b/technic/textures/technic_hv_down_converter_top.png
new file mode 100644
index 0000000..996b2d4
--- /dev/null
+++ b/technic/textures/technic_hv_down_converter_top.png
Binary files differ
diff --git a/technic/textures/technic_mv_down_converter_bottom.png b/technic/textures/technic_mv_down_converter_bottom.png
new file mode 100644
index 0000000..a610660
--- /dev/null
+++ b/technic/textures/technic_mv_down_converter_bottom.png
Binary files differ
diff --git a/technic/textures/technic_mv_down_converter_side.png b/technic/textures/technic_mv_down_converter_side.png
new file mode 100644
index 0000000..6492d5c
--- /dev/null
+++ b/technic/textures/technic_mv_down_converter_side.png
Binary files differ
diff --git a/technic/textures/technic_mv_down_converter_top.png b/technic/textures/technic_mv_down_converter_top.png
new file mode 100644
index 0000000..a610660
--- /dev/null
+++ b/technic/textures/technic_mv_down_converter_top.png
Binary files differ
diff --git a/technic/textures/technic_stainless_steel_ingot.png b/technic/textures/technic_stainless_steel_ingot.png
index 46fa296..14bd703 100644
--- a/technic/textures/technic_stainless_steel_ingot.png
+++ b/technic/textures/technic_stainless_steel_ingot.png
Binary files differ
diff --git a/technic/textures/technic_tin_dust.png b/technic/textures/technic_tin_dust.png
index 4e94e00..98e6f3f 100644
--- a/technic/textures/technic_tin_dust.png
+++ b/technic/textures/technic_tin_dust.png
Binary files differ
diff --git a/technic/textures/technic_zinc_dust.png b/technic/textures/technic_zinc_dust.png
index 0d2f75a..bbd826c 100644
--- a/technic/textures/technic_zinc_dust.png
+++ b/technic/textures/technic_zinc_dust.png
Binary files differ
diff --git a/technic/tool_workshop.lua b/technic/tool_workshop.lua
index 9351c0e..52cd044 100644
--- a/technic/tool_workshop.lua
+++ b/technic/tool_workshop.lua
@@ -6,7 +6,7 @@ minetest.register_craft({
recipe = {
{'default:wood', 'default:wood', 'default:wood'},
{'default:wood', 'default:diamond', 'default:wood'},
- {'default:stone', 'moreores:copper_ingot', 'default:stone'},
+ {'default:stone', 'default:copper_ingot', 'default:stone'},
}
})
diff --git a/technic/water.lua b/technic/water.lua
index 6ddaa46..044ee59 100644
--- a/technic/water.lua
+++ b/technic/water.lua
@@ -6,27 +6,27 @@ minetest.register_alias("electric_furnace", "technic:electric_furnace")
minetest.register_craft({
output = 'technic:battery 1',
recipe = {
- {'default:wood', 'moreores:copper_ingot', 'default:wood'},
- {'default:wood', 'moreores:tin_ingot', 'default:wood'},
- {'default:wood', 'moreores:copper_ingot', 'default:wood'},
+ {'default:wood', 'default:copper_ingot', 'default:wood'},
+ {'default:wood', 'moreores:tin_ingot', 'default:wood'},
+ {'default:wood', 'default:copper_ingot', 'default:wood'},
}
})
minetest.register_craft({
output = 'technic:battery_box 1',
recipe = {
- {'technic:battery', 'default:wood', 'technic:battery'},
- {'technic:battery', 'moreores:copper_ingot', 'technic:battery'},
- {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
+ {'technic:battery', 'default:wood', 'technic:battery'},
+ {'technic:battery', 'default:copper_ingot', 'technic:battery'},
+ {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'technic:electric_furnace',
recipe = {
- {'default:brick', 'default:brick', 'default:brick'},
- {'default:brick', '', 'default:brick'},
- {'default:steel_ingot', 'moreores:copper_ingot', 'default:steel_ingot'},
+ {'default:brick', 'default:brick', 'default:brick'},
+ {'default:brick', '', 'default:brick'},
+ {'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
}
})
@@ -556,9 +556,9 @@ minetest.register_node("technic:solar_panel", {
minetest.register_craft({
output = 'technic:solar_panel 1',
recipe = {
- {'default:sand', 'default:sand','default:sand'},
- {'default:sand', 'moreores:copper_ingot','default:sand'},
- {'default:sand', 'default:sand','default:sand'},
+ {'default:sand', 'default:sand', 'default:sand'},
+ {'default:sand', 'default:copper_ingot', 'default:sand'},
+ {'default:sand', 'default:sand', 'default:sand'},
}
})
@@ -585,4 +585,4 @@ minetest.register_abm(
meta:set_float("active",0)
end
end,
-}) \ No newline at end of file
+})
diff --git a/technic/water_mill.lua b/technic/water_mill.lua
index e6314f0..a7e8ce4 100644
--- a/technic/water_mill.lua
+++ b/technic/water_mill.lua
@@ -8,7 +8,7 @@ minetest.register_craft({
recipe = {
{'default:stone', 'default:stone', 'default:stone'},
{'default:wood', 'default:diamond', 'default:wood'},
- {'default:stone', 'moreores:copper_ingot', 'default:stone'},
+ {'default:stone', 'default:copper_ingot', 'default:stone'},
}
})
diff --git a/technic/wires.lua b/technic/wires.lua
index e09fc2a..db8c823 100644
--- a/technic/wires.lua
+++ b/technic/wires.lua
@@ -6,7 +6,7 @@ minetest.register_alias("lv_cable", "technic:lv_cable")
minetest.register_craft({
output = 'technic:lv_cable 6',
recipe = {
- {'moreores:copper_ingot', 'moreores:copper_ingot', 'moreores:copper_ingot'},
+ {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
}
})
diff --git a/technic_chests/copper_chest.lua b/technic_chests/copper_chest.lua
index c121e78..91efa96 100644
--- a/technic_chests/copper_chest.lua
+++ b/technic_chests/copper_chest.lua
@@ -1,18 +1,18 @@
minetest.register_craft({
output = 'technic:copper_chest 1',
recipe = {
- {'moreores:copper_ingot','moreores:copper_ingot','moreores:copper_ingot'},
- {'moreores:copper_ingot','technic:iron_chest','moreores:copper_ingot'},
- {'moreores:copper_ingot','moreores:copper_ingot','moreores:copper_ingot'},
+ {'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
+ {'default:copper_ingot','technic:iron_chest','default:copper_ingot'},
+ {'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
}
})
minetest.register_craft({
output = 'technic:copper_locked_chest 1',
recipe = {
- {'moreores:copper_ingot','moreores:copper_ingot','moreores:copper_ingot'},
- {'moreores:copper_ingot','technic:iron_locked_chest','moreores:copper_ingot'},
- {'moreores:copper_ingot','moreores:copper_ingot','moreores:copper_ingot'},
+ {'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
+ {'default:copper_ingot','technic:iron_locked_chest','default:copper_ingot'},
+ {'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
}
})
@@ -44,9 +44,13 @@ minetest.register_node(":technic:copper_chest", {
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
- "invsize[10,9;]"..
- "list[current_name;main;0,0;10,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ "invsize[10,10;]"..
+ "label[0,0;Copper Chest]"..
+ "list[current_name;main;0,1;10,4;]"..
+ "list[current_player;main;0,6;8,4;]"..
+ "background[-0.19,-0.25;10.4,10.75;ui_form_bg.png]"..
+ "background[0,1;10,4;ui_copper_chest_inventory.png]"..
+ "background[0,6;8,4;ui_main_inventory.png]")
meta:set_string("infotext", "Copper Chest")
local inv = meta:get_inventory()
inv:set_size("main", 10*4)
@@ -76,9 +80,13 @@ minetest.register_node(":technic:copper_locked_chest", {
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
- "invsize[10,9;]"..
- "list[current_name;main;0,0;10,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ "invsize[10,10;]"..
+ "label[0,0;Copper Locked Chest]"..
+ "list[current_name;main;0,1;10,4;]"..
+ "list[current_player;main;0,6;8,4;]"..
+ "background[-0.19,-0.25;10.4,10.75;ui_form_bg.png]"..
+ "background[0,1;10,4;ui_copper_chest_inventory.png]"..
+ "background[0,6;8,4;ui_main_inventory.png]")
meta:set_string("infotext", "Copper Locked Chest")
meta:set_string("owner", "")
local inv = meta:get_inventory()
diff --git a/technic_chests/gold_chest.lua b/technic_chests/gold_chest.lua
index fa275fa..5c137d9 100644
--- a/technic_chests/gold_chest.lua
+++ b/technic_chests/gold_chest.lua
@@ -1,41 +1,42 @@
local chest_mark_colors = {
- '_black',
- '_blue',
- '_brown',
- '_cyan',
- '_dark_green',
- '_dark_grey',
- '_green',
- '_grey',
- '_magenta',
- '_orange',
- '_pink',
- '_red',
- '_violet',
- '_white',
- '_yellow',
+ {'_black','Black'},
+ {'_blue','Blue'},
+ {'_brown','Brown'},
+ {'_cyan','Cyan'},
+ {'_dark_green','Dark Green'},
+ {'_dark_grey','Dark Grey'},
+ {'_green','Green'},
+ {'_grey','Grey'},
+ {'_magenta','Magenta'},
+ {'_orange','Orange'},
+ {'_pink','Pink'},
+ {'_red','Red'},
+ {'_violet','Violet'},
+ {'_white','White'},
+ {'_yellow','Yellow'},
+ {'','None'}
}
minetest.register_craft({
- output = 'technic:gold_chest 1',
+ output = 'technic:gold_chest',
recipe = {
- {'moreores:gold_ingot','moreores:gold_ingot','moreores:gold_ingot'},
- {'moreores:gold_ingot','technic:silver_chest','moreores:gold_ingot'},
- {'moreores:gold_ingot','moreores:gold_ingot','moreores:gold_ingot'},
+ {'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
+ {'default:gold_ingot','technic:silver_chest','default:gold_ingot'},
+ {'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
}
})
minetest.register_craft({
- output = 'technic:gold_locked_chest 1',
+ output = 'technic:gold_locked_chest',
recipe = {
- {'moreores:gold_ingot','moreores:gold_ingot','moreores:gold_ingot'},
- {'moreores:gold_ingot','technic:silver_locked_chest','moreores:gold_ingot'},
- {'moreores:gold_ingot','moreores:gold_ingot','moreores:gold_ingot'},
+ {'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
+ {'default:gold_ingot','technic:silver_locked_chest','default:gold_ingot'},
+ {'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
}
})
minetest.register_craft({
- output = 'technic:gold_locked_chest 1',
+ output = 'technic:gold_locked_chest',
recipe = {
{'default:steel_ingot'},
{'technic:gold_chest'},
@@ -51,9 +52,24 @@ minetest.register_craftitem(":technic:gold_locked_chest", {
stack_max = 99,
})
-gold_chest_formspec = "invsize[12,9;]"..
- "list[current_name;main;0,0;12,4;]"..
- "list[current_player;main;0,5;8,4;]"
+function get_pallette_buttons ()
+local buttons_string=""
+ for y=0,3,1 do
+ for x=0,3,1 do
+ local file_name="ui_colorbutton"..(y*4+x)..".png"
+ buttons_string=buttons_string.."image_button["..(9.2+x*.7)..","..(6+y*.7)..";.81,.81;"..file_name..";color_button"..(y*4+x)..";]"
+ end
+ end
+return buttons_string
+end
+
+gold_chest_formspec = "invsize[12,10;]"..
+ "list[current_name;main;0,1;12,4;]"..
+ "list[current_player;main;0,6;8,4;]"..
+ "background[-0.19,-0.25;12.4,10.75;ui_form_bg.png]"..
+ "background[0,1;12,4;ui_gold_chest_inventory.png]"..
+ "background[0,6;8,4;ui_main_inventory.png]"..
+ get_pallette_buttons ()
gold_chest_inv_size = 12*4
@@ -69,7 +85,10 @@ minetest.register_node(":technic:gold_chest", {
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
- meta:set_string("formspec",gold_chest_formspec)
+ meta:set_string("formspec",gold_chest_formspec..
+ "label[0,0;Gold Chest]"..
+ "image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"..
+ "label[9.2,9;Color Filter: None")
meta:set_string("infotext", "Gold Chest")
local inv = meta:get_inventory()
inv:set_size("main", gold_chest_inv_size)
@@ -77,16 +96,26 @@ minetest.register_node(":technic:gold_chest", {
can_dig = chest_can_dig,
- on_punch = function (pos, node, puncher)
- chest_punched (pos,node,puncher);
- end,
-
on_receive_fields = function(pos, formname, fields, sender)
- local meta = minetest.env:get_meta(pos);
- fields.text = fields.text or ""
- meta:set_string("text", fields.text)
- meta:set_string("infotext", '"'..fields.text..'"')
- meta:set_string("formspec",gold_chest_formspec)
+ local meta = minetest.env:get_meta(pos)
+ local page="main"
+ if fields.edit_infotext then
+ page="edit_infotext"
+ end
+ if fields.save_infotext then
+ meta:set_string("infotext",fields.infotext_box)
+ end
+ local formspec = gold_chest_formspec.."label[0,0;Gold Chest]"
+ if page=="main" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
+ formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
+ end
+ if page=="edit_infotext" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
+ formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
+ end
+ formspec = formspec .. "label[9.2,9;Color Filter: "..chest_mark_colors[check_color_buttons (pos,"technic:gold_chest",fields)][2].."]"
+ meta:set_string("formspec",formspec)
end,
on_metadata_inventory_move = def_on_metadata_inventory_move,
@@ -94,37 +123,39 @@ minetest.register_node(":technic:gold_chest", {
on_metadata_inventory_take = def_on_metadata_inventory_take
})
-for i, state in ipairs(chest_mark_colors) do
-minetest.register_node(":technic:gold_chest".. state, {
+for i=1,15,1 do
+minetest.register_node(":technic:gold_chest".. chest_mark_colors[i][1], {
description = "Gold Chest",
tiles = {"technic_gold_chest_top.png", "technic_gold_chest_top.png", "technic_gold_chest_side.png",
- "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_front"..state..".png"},
+ "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_front"..chest_mark_colors[i][1]..".png"},
paramtype2 = "facedir",
groups = chest_groups2,
tube = tubes_properties,
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
drop = "technic:gold_chest",
- on_construct = function(pos)
- local meta = minetest.env:get_meta(pos)
- meta:set_string("formspec",gold_chest_formspec)
- meta:set_string("infotext", "Gold Chest")
- local inv = meta:get_inventory()
- inv:set_size("main", gold_chest_inv_size)
- end,
-
can_dig =chest_can_dig,
-
- on_punch = function (pos, node, puncher)
- chest_punched (pos,node,puncher);
- end,
on_receive_fields = function(pos, formname, fields, sender)
- local meta = minetest.env:get_meta(pos);
- fields.text = fields.text or ""
- meta:set_string("text", fields.text)
- meta:set_string("infotext", '"'..fields.text..'"')
- meta:set_string("formspec",gold_chest_formspec)
+ local meta = minetest.env:get_meta(pos)
+ local page="main"
+ if fields.edit_infotext then
+ page="edit_infotext"
+ end
+ if fields.save_infotext then
+ meta:set_string("infotext",fields.infotext_box)
+ end
+ local formspec = gold_chest_formspec.."label[0,0;Gold Chest]"
+ if page=="main" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
+ formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
+ end
+ if page=="edit_infotext" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
+ formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
+ end
+ formspec = formspec .. "label[9.2,9;Color Filter: "..chest_mark_colors[check_color_buttons (pos,"technic:gold_chest",fields)][2].."]"
+ meta:set_string("formspec",formspec)
end,
on_metadata_inventory_move = def_on_metadata_inventory_move,
@@ -151,8 +182,11 @@ minetest.register_node(":technic:gold_locked_chest", {
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
- meta:set_string("formspec",gold_chest_formspec)
- meta:set_string("infotext", "Gold Locked Chest")
+ meta:set_string("formspec",
+ gold_chest_formspec..
+ "label[0,0;Gold Locked Chest]"..
+ "image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"..
+ "label[9.2,9;Color Filter: None")
meta:set_string("owner", "")
local inv = meta:get_inventory()
inv:set_size("main", gold_chest_inv_size)
@@ -160,19 +194,27 @@ minetest.register_node(":technic:gold_locked_chest", {
can_dig =chest_can_dig,
- on_punch = function (pos, node, puncher)
- local meta = minetest.env:get_meta(pos);
- if (has_locked_chest_privilege(meta, puncher)) then
- locked_chest_punched (pos,node,puncher);
- end
- end,
-
on_receive_fields = function(pos, formname, fields, sender)
- local meta = minetest.env:get_meta(pos);
- fields.text = fields.text or ""
- meta:set_string("text", fields.text)
- meta:set_string("infotext", '"'..fields.text..'"')
- meta:set_string("formspec",gold_chest_formspec)
+ local meta = minetest.env:get_meta(pos)
+ local formspec = gold_chest_formspec..
+ "label[0,0;Gold Locked Chest]"
+ local page="main"
+ if fields.edit_infotext then
+ page="edit_infotext"
+ end
+ if fields.save_infotext then
+ meta:set_string("infotext",fields.infotext_box)
+ end
+ if page=="main" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
+ formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
+ end
+ if page=="edit_infotext" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
+ formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
+ end
+ formspec = formspec .. "label[9.2,9;Color Filter: "..chest_mark_colors[check_color_buttons (pos,"technic:gold_locked_chest",fields)][2].."]"
+ meta:set_string("formspec",formspec)
end,
allow_metadata_inventory_move = def_allow_metadata_inventory_move,
@@ -183,47 +225,40 @@ minetest.register_node(":technic:gold_locked_chest", {
on_metadata_inventory_take = def_on_metadata_inventory_take
})
-for i, state in ipairs(chest_mark_colors) do
-minetest.register_node(":technic:gold_locked_chest".. state, {
+for i=1,15,1 do
+minetest.register_node(":technic:gold_locked_chest".. chest_mark_colors[i][1], {
description = "Gold Locked Chest",
tiles = {"technic_gold_chest_top.png", "technic_gold_chest_top.png", "technic_gold_chest_side.png",
- "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_locked"..state..".png"},
+ "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_locked"..chest_mark_colors[i][1]..".png"},
paramtype2 = "facedir",
drop = "technic:gold_locked_chest",
groups = chest_groups2,
tube = tubes_properties,
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
- after_place_node = function(pos, placer)
- local meta = minetest.env:get_meta(pos)
- meta:set_string("owner", placer:get_player_name() or "")
- meta:set_string("infotext", "Gold Locked Chest (owned by "..
- meta:get_string("owner")..")")
- end,
- on_construct = function(pos)
- local meta = minetest.env:get_meta(pos)
- meta:set_string("formspec",gold_chest_formspec)
- meta:set_string("infotext", "Gold Locked Chest")
- meta:set_string("owner", "")
- local inv = meta:get_inventory()
- inv:set_size("main", gold_chest_inv_size)
- end,
-
can_dig = chest_can_dig,
- on_punch = function (pos, node, puncher)
- local meta = minetest.env:get_meta(pos);
- if (has_locked_chest_privilege(meta, puncher)) then
- locked_chest_punched (pos,node,puncher);
- end
- end,
-
on_receive_fields = function(pos, formname, fields, sender)
- local meta = minetest.env:get_meta(pos);
- fields.text = fields.text or ""
- meta:set_string("text", fields.text)
- meta:set_string("infotext", '"'..fields.text..'"')
- meta:set_string("formspec",gold_chest_formspec)
+ local meta = minetest.env:get_meta(pos)
+ local formspec = gold_chest_formspec..
+ "label[0,0;Gold Locked Chest]"
+ local page="main"
+ if fields.edit_infotext then
+ page="edit_infotext"
+ end
+ if fields.save_infotext then
+ meta:set_string("infotext",fields.infotext_box)
+ end
+ if page=="main" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
+ formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
+ end
+ if page=="edit_infotext" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
+ formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
+ end
+ formspec = formspec .. "label[9.2,9;Color Filter: "..chest_mark_colors[check_color_buttons (pos,"technic:gold_locked_chest",fields)][2].."]"
+ meta:set_string("formspec",formspec)
end,
allow_metadata_inventory_move = def_allow_metadata_inventory_move,
@@ -235,232 +270,18 @@ minetest.register_node(":technic:gold_locked_chest".. state, {
})
end
-function chest_punched (pos,node,puncher)
-
- local player_tool = puncher:get_wielded_item();
- local item=player_tool:get_name();
- if item == "dye:black" then
- if (hacky_swap_node(pos,"technic:gold_chest_black")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:blue" then
- if (hacky_swap_node(pos,"technic:gold_chest_blue")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:brown" then
- if (hacky_swap_node(pos,"technic:gold_chest_brown")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:cyan" then
- if (hacky_swap_node(pos,"technic:gold_chest_cyan")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:dark_green" then
- if (hacky_swap_node(pos,"technic:gold_chest_dark_green")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:dark_grey" then
- if (hacky_swap_node(pos,"technic:gold_chest_dark_grey")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:green" then
- if (hacky_swap_node(pos,"technic:gold_chest_green")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:grey" then
- if (hacky_swap_node(pos,"technic:gold_chest_grey")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:magenta" then
- if (hacky_swap_node(pos,"technic:gold_chest_magenta")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:orange" then
- if (hacky_swap_node(pos,"technic:gold_chest_orange")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:pink" then
- if (hacky_swap_node(pos,"technic:gold_chest_pink")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:red" then
- if (hacky_swap_node(pos,"technic:gold_chest_red")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:violet" then
- if (hacky_swap_node(pos,"technic:gold_chest_violet")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:white" then
- if (hacky_swap_node(pos,"technic:gold_chest_white")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:yellow" then
- if (hacky_swap_node(pos,"technic:gold_chest_yellow")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
-
- local meta = minetest.env:get_meta(pos);
- meta:set_string("formspec", "hack:sign_text_input")
+function check_color_buttons (pos,chest_name,fields)
+ if fields.color_button15 then
+ hacky_swap_node(pos,chest_name)
+ return 16
end
-
-
-function locked_chest_punched (pos,node,puncher)
-
- local player_tool = puncher:get_wielded_item();
- local item=player_tool:get_name();
- if item == "dye:black" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_black")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:blue" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_blue")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:brown" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_brown")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:cyan" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_cyan")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:dark_green" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_dark_green")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:dark_grey" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_dark_grey")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:green" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_green")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:grey" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_grey")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
+ for i=0,14,1 do
+ local button="color_button"..i
+ if fields[button] then
+ hacky_swap_node(pos,chest_name..chest_mark_colors[i+1][1])
+ return i+1
end
- if item == "dye:magenta" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_magenta")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:orange" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_orange")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:pink" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_pink")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:red" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_red")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:violet" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_violet")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:white" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_white")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
- if item == "dye:yellow" then
- if (hacky_swap_node(pos,"technic:gold_locked_chest_yellow")) then
- player_tool:take_item(1);
- puncher:set_wielded_item(player_tool);
- return
- end
- end
-
- local meta = minetest.env:get_meta(pos);
- meta:set_string("formspec", "hack:sign_text_input")
end
+ return 16
+end
diff --git a/technic_chests/iron_chest.lua b/technic_chests/iron_chest.lua
index 3b71dfd..62a8ae3 100644
--- a/technic_chests/iron_chest.lua
+++ b/technic_chests/iron_chest.lua
@@ -46,9 +46,13 @@ minetest.register_node(":technic:iron_chest", {
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
- "invsize[9,9;]"..
- "list[current_name;main;0,0;9,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ "invsize[9,10;]"..
+ "label[0,0;Iron Chest]"..
+ "list[current_name;main;0,1;9,4;]"..
+ "list[current_player;main;0,6;8,4;]"..
+ "background[-0.19,-0.25;9.4,10.75;ui_form_bg.png]"..
+ "background[0,1;9,4;ui_iron_chest_inventory.png]"..
+ "background[0,6;8,4;ui_main_inventory.png]")
meta:set_string("infotext", "Iron Chest")
local inv = meta:get_inventory()
inv:set_size("main", 9*4)
@@ -72,14 +76,18 @@ minetest.register_node(":technic:iron_locked_chest", {
local meta = minetest.env:get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", "Locked Iron Chest (owned by "..
- meta:get_string("owner")..")")
+ meta:get_string("owner")..")")
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
- "invsize[9,9;]"..
- "list[current_name;main;0,0;9,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ "invsize[9,10;]"..
+ "label[0,0;Iron Locked Chest]"..
+ "list[current_name;main;0,1;9,4;]"..
+ "list[current_player;main;0,6;8,4;]"..
+ "background[-0.19,-0.25;9.4,10.75;ui_form_bg.png]"..
+ "background[0,1;9,4;ui_iron_chest_inventory.png]"..
+ "background[0,6;8,4;ui_main_inventory.png]")
meta:set_string("infotext", "Iron Locked Chest")
meta:set_string("owner", "")
local inv = meta:get_inventory()
diff --git a/technic_chests/mithril_chest.lua b/technic_chests/mithril_chest.lua
index d173ab9..892e48c 100644
--- a/technic_chests/mithril_chest.lua
+++ b/technic_chests/mithril_chest.lua
@@ -35,9 +35,13 @@ minetest.register_node(":technic:mithril_chest", {
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
- "invsize[13,9;]"..
- "list[current_name;main;0,0;13,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ "invsize[13,10;]"..
+ "label[0,0;Mithril Chest]"..
+ "list[current_name;main;0,1;13,4;]"..
+ "list[current_player;main;0,6;8,4;]"..
+ "background[-0.19,-0.25;13.4,10.75;ui_form_bg.png]"..
+ "background[0,1;13,4;ui_mithril_chest_inventory.png]"..
+ "background[0,6;8,4;ui_main_inventory.png]")
meta:set_string("infotext", "Mithril Chest")
local inv = meta:get_inventory()
inv:set_size("main", 13*4)
@@ -84,9 +88,13 @@ minetest.register_node(":technic:mithril_locked_chest", {
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
- "invsize[13,9;]"..
- "list[current_name;main;0,0;13,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ "invsize[13,10;]"..
+ "label[0,0;Mithril Locked Chest]"..
+ "list[current_name;main;0,1;13,4;]"..
+ "list[current_player;main;0,6;8,4;]"..
+ "background[-0.19,-0.25;13.4,10.75;ui_form_bg.png]"..
+ "background[0,1;13,4;ui_mithril_chest_inventory.png]"..
+ "background[0,6;8,4;ui_main_inventory.png]")
meta:set_string("infotext", "Mithril Locked Chest")
meta:set_string("owner", "")
local inv = meta:get_inventory()
diff --git a/technic_chests/silver_chest.lua b/technic_chests/silver_chest.lua
index 3df092a..176e36f 100644
--- a/technic_chests/silver_chest.lua
+++ b/technic_chests/silver_chest.lua
@@ -1,5 +1,5 @@
minetest.register_craft({
- output = 'technic:silver_chest 1',
+ output = 'technic:silver_chest',
recipe = {
{'moreores:silver_ingot','moreores:silver_ingot','moreores:silver_ingot'},
{'moreores:silver_ingot','technic:copper_chest','moreores:silver_ingot'},
@@ -8,7 +8,7 @@ minetest.register_craft({
})
minetest.register_craft({
- output = 'technic:silver_locked_chest 1',
+ output = 'technic:silver_locked_chest',
recipe = {
{'moreores:silver_ingot','moreores:silver_ingot','moreores:silver_ingot'},
{'moreores:silver_ingot','technic:copper_locked_chest','moreores:silver_ingot'},
@@ -17,7 +17,7 @@ minetest.register_craft({
})
minetest.register_craft({
- output = 'technic:silver_locked_chest 1',
+ output = 'technic:silver_locked_chest',
recipe = {
{'default:steel_ingot'},
{'technic:silver_chest'},
@@ -33,6 +33,14 @@ minetest.register_craftitem(":technic:silver_locked_chest", {
stack_max = 99,
})
+silver_chest_formspec =
+ "invsize[11,10;]"..
+ "list[current_name;main;0,1;11,4;]"..
+ "list[current_player;main;0,6;8,4;]"..
+ "background[-0.19,-0.25;11.4,10.75;ui_form_bg.png]"..
+ "background[0,1;11,4;ui_silver_chest_inventory.png]"..
+ "background[0,6;8,4;ui_main_inventory.png]"
+
minetest.register_node(":technic:silver_chest", {
description = "Silver Chest",
tiles = {"technic_silver_chest_top.png", "technic_silver_chest_top.png", "technic_silver_chest_side.png",
@@ -45,30 +53,34 @@ minetest.register_node(":technic:silver_chest", {
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
- "invsize[11,9;]"..
- "list[current_name;main;0,0;11,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ silver_chest_formspec..
+ "label[0,0;Silver Chest]"..
+ "image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]")
meta:set_string("infotext", "Silver Chest")
local inv = meta:get_inventory()
inv:set_size("main", 11*4)
end,
can_dig = chest_can_dig,
- on_punch = function (pos, node, puncher)
- local meta = minetest.env:get_meta(pos);
- meta:set_string("formspec", "hack:sign_text_input")
- end,
-
on_receive_fields = function(pos, formname, fields, sender)
- local meta = minetest.env:get_meta(pos);
- fields.text = fields.text or ""
- meta:set_string("text", fields.text)
- meta:set_string("infotext", '"'..fields.text..'"')
-
- meta:set_string("formspec",
- "invsize[11,9;]"..
- "list[current_name;main;0,0;11,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ local meta = minetest.env:get_meta(pos)
+ local page="main"
+ if fields.edit_infotext then
+ page="edit_infotext"
+ end
+ if fields.save_infotext then
+ meta:set_string("infotext",fields.infotext_box)
+ end
+ local formspec = silver_chest_formspec.."label[0,0;Silver Chest]"
+ if page=="main" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
+ formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
+ end
+ if page=="edit_infotext" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
+ formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
+ end
+ meta:set_string("formspec",formspec)
end,
on_metadata_inventory_move = def_on_metadata_inventory_move,
@@ -94,34 +106,36 @@ minetest.register_node(":technic:silver_locked_chest", {
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
- "invsize[11,9;]"..
- "list[current_name;main;0,0;11,4;]"..
- "list[current_player;main;0,5;8,4;]")
- meta:set_string("infotext", "Silver Locked Chest")
+ silver_chest_formspec..
+ "label[0,0;Silver Locked Chest]"..
+ "image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]")
meta:set_string("owner", "")
local inv = meta:get_inventory()
inv:set_size("main", 11*4)
end,
can_dig = chest_can_dig,
- on_punch = function (pos, node, puncher)
- local meta = minetest.env:get_meta(pos);
- meta:set_string("formspec", "hack:sign_text_input")
- end,
-
on_receive_fields = function(pos, formname, fields, sender)
- local meta = minetest.env:get_meta(pos);
- fields.text = fields.text or ""
- meta:set_string("text", fields.text)
- meta:set_string("infotext", '"'..fields.text..'"')
-
- meta:set_string("formspec",
- "invsize[11,9;]"..
- "list[current_name;main;0,0;11,4;]"..
- "list[current_player;main;0,5;8,4;]")
+ local meta = minetest.env:get_meta(pos)
+ local page="main"
+ if fields.edit_infotext then
+ page="edit_infotext"
+ end
+ if fields.save_infotext then
+ meta:set_string("infotext",fields.infotext_box)
+ end
+ local formspec = silver_chest_formspec.."label[0,0;Silver Locked Chest]"
+ if page=="main" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
+ formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
+ end
+ if page=="edit_infotext" then
+ formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
+ formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
+ end
+ meta:set_string("formspec",formspec)
end,
-
allow_metadata_inventory_move = def_allow_metadata_inventory_move,
allow_metadata_inventory_put = def_allow_metadata_inventory_put,
allow_metadata_inventory_take = def_allow_metadata_inventory_take,
diff --git a/technic_worldgen/crafts.lua b/technic_worldgen/crafts.lua
index 7647c06..a601b7f 100644
--- a/technic_worldgen/crafts.lua
+++ b/technic_worldgen/crafts.lua
@@ -16,12 +16,6 @@ minetest.register_craftitem( ":technic:chromium_ingot", {
on_place_on_ground = minetest.craftitem_place_item,
})
-minetest.register_craft({
- type = 'cooking',
- output = "technic:chromium_ingot",
- recipe = "technic:chromium_lump"
-})
-
minetest.register_craftitem( ":technic:zinc_lump", {
description = "Zinc Lump",
inventory_image = "technic_zinc_lump.png",
@@ -37,13 +31,79 @@ minetest.register_craftitem( ":technic:stainless_steel_ingot", {
inventory_image = "technic_stainless_steel_ingot.png",
})
-minetest.register_craftitem( ":technic:brass_ingot", {
+minetest.register_craftitem( ":group:brass_ingot", {
description = "Brass Ingot",
inventory_image = "technic_brass_ingot.png",
})
minetest.register_craft({
+ output = "node technic:uranium_block",
+ recipe = {{"technic:uranium", "technic:uranium", "technic:uranium"},
+ {"technic:uranium", "technic:uranium", "technic:uranium"},
+ {"technic:uranium", "technic:uranium", "technic:uranium"}}
+})
+
+minetest.register_craft({
+ output = "craft technic:uranium 9",
+ recipe = {{"technic:uranium_block"}}
+})
+
+minetest.register_craft({
+ output = "node technic:chromium_block",
+ recipe = {{"technic:chromium_ingot", "technic:chromium_ingot", "technic:chromium_ingot"},
+ {"technic:chromium_ingot", "technic:chromium_ingot", "technic:chromium_ingot"},
+ {"technic:chromium_ingot", "technic:chromium_ingot", "technic:chromium_ingot"}}
+})
+
+minetest.register_craft({
+ output = "craft technic:chromium_ingot 9",
+ recipe = {{"technic:chromium_block"}}
+})
+
+minetest.register_craft({
+ output = "node technic:zinc_block",
+ recipe = {{"technic:zinc_ingot", "technic:zinc_ingot", "technic:zinc_ingot"},
+ {"technic:zinc_ingot", "technic:zinc_ingot", "technic:zinc_ingot"},
+ {"technic:zinc_ingot", "technic:zinc_ingot", "technic:zinc_ingot"}}
+})
+
+minetest.register_craft({
+ output = "craft technic:zinc_ingot 9",
+ recipe = {{"technic:zinc_block"}}
+})
+
+minetest.register_craft({
+ output = "node technic:stainless_steel_block",
+ recipe = {{"technic:stainless_steel_ingot", "technic:stainless_steel_ingot", "technic:stainless_steel_ingot"},
+ {"technic:stainless_steel_ingot", "technic:stainless_steel_ingot", "technic:stainless_steel_ingot"},
+ {"technic:stainless_steel_ingot", "technic:stainless_steel_ingot", "technic:stainless_steel_ingot"}}
+})
+
+minetest.register_craft({
+ output = "craft technic:stainless_steel_ingot 9",
+ recipe = {{"technic:stainless_steel_block"}}
+})
+
+minetest.register_craft({
+ output = "node group:brass_block",
+ recipe = {{"group:brass_ingot", "group:brass_ingot", "group:brass_ingot"},
+ {"group:brass_ingot", "group:brass_ingot", "group:brass_ingot"},
+ {"group:brass_ingot", "group:brass_ingot", "group:brass_ingot"}}
+})
+
+minetest.register_craft({
+ output = "craft group:brass_ingot 9",
+ recipe = {{"group:brass_block"}}
+})
+
+minetest.register_craft({
type = 'cooking',
output = "technic:zinc_ingot",
recipe = "technic:zinc_lump"
})
+
+minetest.register_craft({
+ type = 'cooking',
+ output = "technic:chromium_ingot",
+ recipe = "technic:chromium_lump"
+})
diff --git a/technic_worldgen/nodes.lua b/technic_worldgen/nodes.lua
index 28514f4..7b9d385 100644
--- a/technic_worldgen/nodes.lua
+++ b/technic_worldgen/nodes.lua
@@ -49,6 +49,46 @@ minetest.register_node( ":technic:marble_bricks", {
sounds = default.node_sound_stone_defaults(),
})
+minetest.register_node(":technic:uranium_block", {
+ description = "Uranium Block",
+ tiles = { "technic_uranium_block.png" },
+ is_ground_content = true,
+ groups = {cracky=1, level=2},
+ sounds = default.node_sound_stone_defaults()
+})
+
+minetest.register_node(":technic:chromium_block", {
+ description = "Chromium Block",
+ tiles = { "technic_chromium_block.png" },
+ is_ground_content = true,
+ groups = {cracky=1, level=2},
+ sounds = default.node_sound_stone_defaults()
+})
+
+minetest.register_node(":technic:zinc_block", {
+ description = "Zinc Block",
+ tiles = { "technic_zinc_block.png" },
+ is_ground_content = true,
+ groups = {cracky=1, level=2},
+ sounds = default.node_sound_stone_defaults()
+})
+
+minetest.register_node(":technic:stainless_steel_block", {
+ description = "Stainless Steel Block",
+ tiles = { "technic_stainless_steel_block.png" },
+ is_ground_content = true,
+ groups = {cracky=1, level=2},
+ sounds = default.node_sound_stone_defaults()
+})
+
+minetest.register_node(":technic:brass_block", {
+ description = "Brass Block",
+ tiles = { "technic_brass_block.png" },
+ is_ground_content = true,
+ groups = {cracky=1, level=2},
+ sounds = default.node_sound_stone_defaults()
+})
+
minetest.register_craft({
output = 'technic:marble_bricks 4',
recipe = {
diff --git a/technic_worldgen/textures/technic_brass_block.png b/technic_worldgen/textures/technic_brass_block.png
new file mode 100644
index 0000000..bc6fe78
--- /dev/null
+++ b/technic_worldgen/textures/technic_brass_block.png
Binary files differ
diff --git a/technic_worldgen/textures/technic_brass_ingot.png b/technic_worldgen/textures/technic_brass_ingot.png
index 2d8b153..063150f 100644
--- a/technic_worldgen/textures/technic_brass_ingot.png
+++ b/technic_worldgen/textures/technic_brass_ingot.png
Binary files differ
diff --git a/technic_worldgen/textures/technic_chromium_block.png b/technic_worldgen/textures/technic_chromium_block.png
new file mode 100644
index 0000000..ad173ca
--- /dev/null
+++ b/technic_worldgen/textures/technic_chromium_block.png
Binary files differ
diff --git a/technic_worldgen/textures/technic_chromium_ingot.png b/technic_worldgen/textures/technic_chromium_ingot.png
index 91d5b20..e9615dd 100644
--- a/technic_worldgen/textures/technic_chromium_ingot.png
+++ b/technic_worldgen/textures/technic_chromium_ingot.png
Binary files differ
diff --git a/technic_worldgen/textures/technic_chromium_lump.png b/technic_worldgen/textures/technic_chromium_lump.png
index 1588f92..0fe03a1 100644
--- a/technic_worldgen/textures/technic_chromium_lump.png
+++ b/technic_worldgen/textures/technic_chromium_lump.png
Binary files differ
diff --git a/technic_worldgen/textures/technic_stainless_steel_block.png b/technic_worldgen/textures/technic_stainless_steel_block.png
new file mode 100644
index 0000000..e451768
--- /dev/null
+++ b/technic_worldgen/textures/technic_stainless_steel_block.png
Binary files differ
diff --git a/technic_worldgen/textures/technic_uranium.png b/technic_worldgen/textures/technic_uranium.png
index 54225f8..2f5a66c 100644
--- a/technic_worldgen/textures/technic_uranium.png
+++ b/technic_worldgen/textures/technic_uranium.png
Binary files differ
diff --git a/technic_worldgen/textures/technic_uranium_block.png b/technic_worldgen/textures/technic_uranium_block.png
new file mode 100644
index 0000000..99dd51c
--- /dev/null
+++ b/technic_worldgen/textures/technic_uranium_block.png
Binary files differ
diff --git a/technic_worldgen/textures/technic_zinc_block.png b/technic_worldgen/textures/technic_zinc_block.png
new file mode 100644
index 0000000..5ae7947
--- /dev/null
+++ b/technic_worldgen/textures/technic_zinc_block.png
Binary files differ
diff --git a/technic_worldgen/textures/technic_zinc_ingot.png b/technic_worldgen/textures/technic_zinc_ingot.png
index 096ff9c..9f9eb2c 100644
--- a/technic_worldgen/textures/technic_zinc_ingot.png
+++ b/technic_worldgen/textures/technic_zinc_ingot.png
Binary files differ
diff --git a/technic_worldgen/textures/technic_zinc_lump.png b/technic_worldgen/textures/technic_zinc_lump.png
index d28a6dc..1a620ab 100644
--- a/technic_worldgen/textures/technic_zinc_lump.png
+++ b/technic_worldgen/textures/technic_zinc_lump.png
Binary files differ
diff --git a/unified_inventory/api.lua b/unified_inventory/api.lua
index 91681b1..e386a76 100644
--- a/unified_inventory/api.lua
+++ b/unified_inventory/api.lua
@@ -131,29 +131,29 @@ unified_inventory.get_formspec = function(player,page)
formspec = formspec .. "list[current_player;main;0,4.5;8,4;]"
-- backgrounds
- formspec = formspec .. "background[-0.19,-0.2,;14.38,10.55;ui_form_bg.png]"
+ formspec = formspec .. "background[-0.19,-0.2;14.38,10.55;ui_form_bg.png]"
if page=="craft" then
- formspec = formspec .. "background[0.06,0.99,;7.92,7.52;ui_crafting_form.png]"
+ formspec = formspec .. "background[0.06,0.99;7.92,7.52;ui_crafting_form.png]"
end
if page=="craftguide" then
- formspec = formspec .. "background[0.06,0.99,;7.92,7.52;ui_craftguide_form.png]"
+ formspec = formspec .. "background[0.06,0.99;7.92,7.52;ui_craftguide_form.png]"
end
if page=="misc" then
- formspec = formspec .. "background[0.06,0.99,;7.92,7.52;ui_misc_form.png]"
+ formspec = formspec .. "background[0.06,0.99;7.92,7.52;ui_misc_form.png]"
end
if page=="bags" then
- formspec = formspec .. "background[0.06,0.99,;7.92,7.52;ui_bags_main_form.png]"
+ formspec = formspec .. "background[0.06,0.99;7.92,7.52;ui_bags_main_form.png]"
end
for i=1,4 do
if page=="bag"..i then
local slots = player:get_inventory():get_stack(page, 1):get_definition().groups.bagslots
if slots == 8 then
- formspec = formspec .. "background[0.06,0.99,;7.92,7.52;ui_bags_sm_form.png]"
+ formspec = formspec .. "background[0.06,0.99;7.92,7.52;ui_bags_sm_form.png]"
elseif slots == 16 then
- formspec = formspec .. "background[0.06,0.99,;7.92,7.52;ui_bags_med_form.png]"
+ formspec = formspec .. "background[0.06,0.99;7.92,7.52;ui_bags_med_form.png]"
elseif slots == 24 then
- formspec = formspec .. "background[0.06,0.99,;7.92,7.52;ui_bags_lg_form.png]"
+ formspec = formspec .. "background[0.06,0.99;7.92,7.52;ui_bags_lg_form.png]"
end
end
end
@@ -560,8 +560,12 @@ unified_inventory.update_recipe = function(player, stack_name, alternate)
local craft = crafts[alternate]
inv:set_stack("output", 1, craft.output)
local items=craft.items
- -- cook, fuel, grinding recipes
- if craft.type == "cooking" or craft.type == "fuel" or craft.type == "grinding" or craft.type == "extracting" then
+
+ -- cooking, fuel, grinding, and extracting recipes
+ if craft.type == "cooking" or
+ craft.type == "fuel" or
+ craft.type == "grinding" or
+ craft.type == "extracting" then
def=unified_inventory.find_item_def(craft["items"][1])
if def then
inv:set_stack("build", 1, def)
diff --git a/unified_inventory/depends.txt b/unified_inventory/depends.txt
index c327490..45b4a33 100644
--- a/unified_inventory/depends.txt
+++ b/unified_inventory/depends.txt
@@ -1 +1,2 @@
creative
+
diff --git a/unified_inventory/textures/ui_colorbutton0.png b/unified_inventory/textures/ui_colorbutton0.png
new file mode 100644
index 0000000..35b7db2
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton0.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton1.png b/unified_inventory/textures/ui_colorbutton1.png
new file mode 100644
index 0000000..cbf095d
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton1.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton10.png b/unified_inventory/textures/ui_colorbutton10.png
new file mode 100644
index 0000000..8dfc5f0
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton10.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton11.png b/unified_inventory/textures/ui_colorbutton11.png
new file mode 100644
index 0000000..3b279e0
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton11.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton12.png b/unified_inventory/textures/ui_colorbutton12.png
new file mode 100644
index 0000000..a387b5f
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton12.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton13.png b/unified_inventory/textures/ui_colorbutton13.png
new file mode 100644
index 0000000..b1e7790
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton13.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton14.png b/unified_inventory/textures/ui_colorbutton14.png
new file mode 100644
index 0000000..c4ad486
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton14.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton15.png b/unified_inventory/textures/ui_colorbutton15.png
new file mode 100644
index 0000000..b7060d6
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton15.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton2.png b/unified_inventory/textures/ui_colorbutton2.png
new file mode 100644
index 0000000..caf1fc6
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton2.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton3.png b/unified_inventory/textures/ui_colorbutton3.png
new file mode 100644
index 0000000..6ac79a3
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton3.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton4.png b/unified_inventory/textures/ui_colorbutton4.png
new file mode 100644
index 0000000..dc43592
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton4.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton5.png b/unified_inventory/textures/ui_colorbutton5.png
new file mode 100644
index 0000000..98b8c67
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton5.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton6.png b/unified_inventory/textures/ui_colorbutton6.png
new file mode 100644
index 0000000..66478bc
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton6.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton7.png b/unified_inventory/textures/ui_colorbutton7.png
new file mode 100644
index 0000000..85f6b93
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton7.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton8.png b/unified_inventory/textures/ui_colorbutton8.png
new file mode 100644
index 0000000..868c35d
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton8.png
Binary files differ
diff --git a/unified_inventory/textures/ui_colorbutton9.png b/unified_inventory/textures/ui_colorbutton9.png
new file mode 100644
index 0000000..50eac0b
--- /dev/null
+++ b/unified_inventory/textures/ui_colorbutton9.png
Binary files differ
diff --git a/unified_inventory/textures/ui_copper_chest_inventory.png b/unified_inventory/textures/ui_copper_chest_inventory.png
new file mode 100644
index 0000000..debc9fc
--- /dev/null
+++ b/unified_inventory/textures/ui_copper_chest_inventory.png
Binary files differ
diff --git a/unified_inventory/textures/ui_furnace_inventory.png b/unified_inventory/textures/ui_furnace_inventory.png
new file mode 100644
index 0000000..ce84efb
--- /dev/null
+++ b/unified_inventory/textures/ui_furnace_inventory.png
Binary files differ
diff --git a/unified_inventory/textures/ui_gold_chest_inventory.png b/unified_inventory/textures/ui_gold_chest_inventory.png
new file mode 100644
index 0000000..b19524b
--- /dev/null
+++ b/unified_inventory/textures/ui_gold_chest_inventory.png
Binary files differ
diff --git a/unified_inventory/textures/ui_iron_chest_inventory.png b/unified_inventory/textures/ui_iron_chest_inventory.png
new file mode 100644
index 0000000..1785f88
--- /dev/null
+++ b/unified_inventory/textures/ui_iron_chest_inventory.png
Binary files differ
diff --git a/unified_inventory/textures/ui_lv_alloy_furnace.png b/unified_inventory/textures/ui_lv_alloy_furnace.png
new file mode 100644
index 0000000..3b98650
--- /dev/null
+++ b/unified_inventory/textures/ui_lv_alloy_furnace.png
Binary files differ
diff --git a/unified_inventory/textures/ui_lv_battery_box.png b/unified_inventory/textures/ui_lv_battery_box.png
new file mode 100644
index 0000000..61c55de
--- /dev/null
+++ b/unified_inventory/textures/ui_lv_battery_box.png
Binary files differ
diff --git a/unified_inventory/textures/ui_lv_electric_furnace.png b/unified_inventory/textures/ui_lv_electric_furnace.png
new file mode 100644
index 0000000..a91b241
--- /dev/null
+++ b/unified_inventory/textures/ui_lv_electric_furnace.png
Binary files differ
diff --git a/unified_inventory/textures/ui_lv_grinder.png b/unified_inventory/textures/ui_lv_grinder.png
new file mode 100644
index 0000000..7af5155
--- /dev/null
+++ b/unified_inventory/textures/ui_lv_grinder.png
Binary files differ
diff --git a/unified_inventory/textures/ui_main_inventory.png b/unified_inventory/textures/ui_main_inventory.png
new file mode 100644
index 0000000..b65dabb
--- /dev/null
+++ b/unified_inventory/textures/ui_main_inventory.png
Binary files differ
diff --git a/unified_inventory/textures/ui_mithril_chest_inventory.png b/unified_inventory/textures/ui_mithril_chest_inventory.png
new file mode 100644
index 0000000..9054775
--- /dev/null
+++ b/unified_inventory/textures/ui_mithril_chest_inventory.png
Binary files differ
diff --git a/unified_inventory/textures/ui_silver_chest_inventory.png b/unified_inventory/textures/ui_silver_chest_inventory.png
new file mode 100644
index 0000000..a61c4b9
--- /dev/null
+++ b/unified_inventory/textures/ui_silver_chest_inventory.png
Binary files differ
diff --git a/unified_inventory/textures/ui_wooden_chest_inventory.png b/unified_inventory/textures/ui_wooden_chest_inventory.png
new file mode 100644
index 0000000..145d9d2
--- /dev/null
+++ b/unified_inventory/textures/ui_wooden_chest_inventory.png
Binary files differ