mirror of
https://github.com/minetest-mods/technic.git
synced 2025-07-03 16:50:37 +02:00
Merge branch 'protected-mithril-chest' into pandorabox
This commit is contained in:
@ -6,7 +6,7 @@ minetest.register_craft({
|
||||
{'technic:mv_cable', 'technic:mv_cable', 'technic:mv_cable'},
|
||||
{'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting'},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
technic.register_cable("HV", 3/16)
|
||||
|
||||
|
@ -8,7 +8,7 @@ minetest.register_craft({
|
||||
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
|
||||
{'default:paper', 'default:paper', 'default:paper'},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
technic.register_cable("LV", 2/16)
|
||||
|
||||
|
@ -22,7 +22,7 @@ minetest.register_craft({
|
||||
|
||||
minetest.register_craftitem("technic:geothermal", {
|
||||
description = S("Geothermal %s Generator"):format("LV"),
|
||||
})
|
||||
})
|
||||
|
||||
local check_node_around = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
|
@ -1,5 +1,5 @@
|
||||
-- A water mill produces LV EUs by exploiting flowing water across it
|
||||
-- It is a LV EU supplyer and fairly low yield (max 180EUs)
|
||||
-- It is a LV EU supplier and fairly low yield (max 180EUs)
|
||||
-- It is a little over half as good as the thermal generator.
|
||||
|
||||
local S = technic.getter
|
||||
|
@ -8,7 +8,7 @@ minetest.register_craft({
|
||||
{'technic:lv_cable', 'technic:lv_cable', 'technic:lv_cable'},
|
||||
{'technic:rubber', 'technic:rubber', 'technic:rubber'},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
technic.register_cable("MV", 2.5/16)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
-- A Hydro Turbine produces MV EUs by exploiting flowing water across it
|
||||
-- It is a MV EU supplyer and fairly high yield (max 1800EUs)
|
||||
-- It is a MV EU supplier and fairly high yield (max 1800EUs)
|
||||
|
||||
local S = technic.getter
|
||||
|
||||
@ -18,14 +18,14 @@ minetest.register_craft({
|
||||
|
||||
local function get_water_flow(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if minetest.get_item_group(node.name, "water") == 3 then
|
||||
if minetest.get_item_group(node.name, "water") == 3 and string.find(node.name, "flowing") then
|
||||
return node.param2 -- returns approx. water flow, if any
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
---
|
||||
-- 10 times better than LV hydro because of 2 extra water mills and 4 stainless steel, a transformer and whatnot ;P.
|
||||
-- 10 times better than LV hydro because of 2 extra water mills and 4 stainless steel, a transformer and whatnot ;P.
|
||||
-- Man hydro turbines are tough and long lasting. So, give it some value :)
|
||||
local run = function(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
@ -49,7 +49,7 @@ local dirs1 = {20, 23, 22, 21}
|
||||
local dirs2 = {9, 18, 7, 12}
|
||||
|
||||
local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_thing)
|
||||
if not technic_homedecor_node_is_owned(pointed_thing.under, placer)
|
||||
if not technic_homedecor_node_is_owned(pointed_thing.under, placer)
|
||||
and not technic_homedecor_node_is_owned(pointed_thing.above, placer) then
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
||||
@ -76,7 +76,7 @@ local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_t
|
||||
|
||||
if not minetest.registered_nodes[minetest.get_node(pos1).name]["buildable_to"] then return end
|
||||
|
||||
if iswall then
|
||||
if iswall then
|
||||
minetest.add_node(pos1, {name = wield_name, param2 = dirs2[fdir+1] }) -- place wall variant
|
||||
elseif isceiling then
|
||||
minetest.add_node(pos1, {name = wield_name, param2 = 20 }) -- place upside down variant
|
||||
|
@ -6,7 +6,7 @@ local fs_helpers = pipeworks.fs_helpers
|
||||
local tube_entry = "^pipeworks_tube_connection_metallic.png"
|
||||
|
||||
local function inject_items (pos)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local mode=meta:get_string("mode")
|
||||
if mode=="single items" then
|
||||
@ -15,7 +15,7 @@ local function inject_items (pos)
|
||||
i=i+1
|
||||
if stack then
|
||||
local item0=stack:to_table()
|
||||
if item0 then
|
||||
if item0 then
|
||||
item0["count"] = "1"
|
||||
technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0)
|
||||
stack:take_item(1)
|
||||
@ -31,7 +31,7 @@ local function inject_items (pos)
|
||||
i=i+1
|
||||
if stack then
|
||||
local item0=stack:to_table()
|
||||
if item0 then
|
||||
if item0 then
|
||||
technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0)
|
||||
stack:clear()
|
||||
inv:set_stack("main", i, stack)
|
||||
@ -142,7 +142,7 @@ minetest.register_abm({
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local pos1 = vector.add(pos, vector.new(0, -1, 0))
|
||||
local node1 = minetest.get_node(pos1)
|
||||
local node1 = minetest.get_node(pos1)
|
||||
if minetest.get_item_group(node1.name, "tubedevice") > 0 then
|
||||
inject_items(pos)
|
||||
end
|
||||
|
@ -26,7 +26,7 @@ local recipes = {
|
||||
{"technic:silicon_wafer", "technic:gold_dust", "technic:doped_silicon_wafer"},
|
||||
-- from https://en.wikipedia.org/wiki/Carbon_black
|
||||
-- The highest volume use of carbon black is as a reinforcing filler in rubber products, especially tires.
|
||||
-- "[Compounding a] pure gum vulcanizate … with 50% of its weight of carbon black improves its tensile strength and wear resistance …"
|
||||
-- "[Compounding a] pure gum vulcanizate … with 50% of its weight of carbon black improves its tensile strength and wear resistance …"
|
||||
{"technic:raw_latex 4", "technic:coal_dust 2", "technic:rubber 6", 2},
|
||||
}
|
||||
|
||||
|
@ -129,11 +129,11 @@ local tube = {
|
||||
}
|
||||
|
||||
local function add_on_off_buttons(meta, ltier, charge_percent)
|
||||
local formspec = ""
|
||||
if ltier == "mv" or ltier == "hv" then
|
||||
formspec = "image[1,1;1,2;technic_power_meter_bg.png"
|
||||
local formspec = "image[1,1;1,2;technic_power_meter_bg.png"
|
||||
.."^[lowpart:"..charge_percent
|
||||
..":technic_power_meter_fg.png]"..
|
||||
..":technic_power_meter_fg.png]"
|
||||
if ltier == "mv" or ltier == "hv" then
|
||||
formspec = formspec..
|
||||
fs_helpers.cycling_button(
|
||||
meta,
|
||||
"image_button[3,2.0;1,0.6",
|
||||
|
@ -122,7 +122,7 @@ local function item_place_override_node(itemstack, placer, pointed, node)
|
||||
local temp_itemstack = ItemStack(itemstack)
|
||||
temp_itemstack:set_name(node.name)
|
||||
local original_count = temp_itemstack:get_count()
|
||||
temp_itemstack =
|
||||
temp_itemstack =
|
||||
minetest.item_place(temp_itemstack, placer, pointed, node.param2) or
|
||||
temp_itemstack
|
||||
-- Remove the same number of items from the real itemstack
|
||||
|
@ -66,14 +66,14 @@ function technic.send_items(pos, x_velocity, z_velocity, output_name)
|
||||
output_name = "dst"
|
||||
end
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local i = 0
|
||||
for _, stack in ipairs(inv:get_list(output_name)) do
|
||||
i = i + 1
|
||||
if stack then
|
||||
local item0 = stack:to_table()
|
||||
if item0 then
|
||||
if item0 then
|
||||
item0["count"] = "1"
|
||||
technic.tube_inject_item(pos, pos, vector.new(x_velocity, 0, z_velocity), item0)
|
||||
stack:take_item(1)
|
||||
@ -124,7 +124,7 @@ function technic.handle_machine_pipeworks(pos, tube_upgrade, send_function)
|
||||
if node.param2 == 0 then pos1.x = pos1.x + 1 x_velocity = 1 end
|
||||
|
||||
local output_tube_connected = false
|
||||
local node1 = minetest.get_node(pos1)
|
||||
local node1 = minetest.get_node(pos1)
|
||||
if minetest.get_item_group(node1.name, "tubedevice") > 0 then
|
||||
output_tube_connected = true
|
||||
end
|
||||
|
@ -57,7 +57,7 @@ function technic.register_generator(data)
|
||||
-- Burn another piece of fuel
|
||||
if burn_time == 0 then
|
||||
local inv = meta:get_inventory()
|
||||
if not inv:is_empty("src") then
|
||||
if not inv:is_empty("src") then
|
||||
local fuellist = inv:get_list("src")
|
||||
local fuel
|
||||
local afterfuel
|
||||
@ -96,7 +96,7 @@ function technic.register_generator(data)
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
end
|
||||
meta:set_string("formspec",
|
||||
meta:set_string("formspec",
|
||||
"size[8, 9]"..
|
||||
"label[0, 0;"..minetest.formspec_escape(desc).."]"..
|
||||
"list[current_name;src;3, 1;1, 1;]"..
|
||||
@ -120,7 +120,7 @@ function technic.register_generator(data)
|
||||
"technic_"..ltier.."_generator_side.png"..tentry,
|
||||
"technic_"..ltier.."_generator_side.png"..tentry,
|
||||
"technic_"..ltier.."_generator_front.png"
|
||||
},
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = groups,
|
||||
connect_sides = {"bottom", "back", "left", "right"},
|
||||
@ -240,7 +240,7 @@ function technic.register_generator(data)
|
||||
}
|
||||
)..pipeworks.button_label
|
||||
end
|
||||
meta:set_string("formspec",
|
||||
meta:set_string("formspec",
|
||||
"size[8, 9]"..
|
||||
"label[0, 0;"..minetest.formspec_escape(desc).."]"..
|
||||
"list[current_name;src;3, 1;1, 1;]"..
|
||||
@ -274,7 +274,7 @@ function technic.register_generator(data)
|
||||
local burn_time = meta:get_int("burn_time")
|
||||
local percent = math.floor(burn_time / burn_totaltime * 100)
|
||||
|
||||
meta:set_string("formspec",
|
||||
meta:set_string("formspec",
|
||||
"size[8, 9]"..
|
||||
"label[0, 0;"..minetest.formspec_escape(desc).."]"..
|
||||
"list[current_name;src;3, 1;1, 1;]"..
|
||||
|
@ -147,7 +147,7 @@ function technic.register_base_machine(data)
|
||||
minetest.register_node("technic:"..ltier.."_"..machine_name, {
|
||||
description = machine_desc:format(tier),
|
||||
tiles = {
|
||||
"technic_"..ltier.."_"..machine_name.."_top.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_top.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_bottom.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry,
|
||||
"technic_"..ltier.."_"..machine_name.."_side.png"..tentry,
|
||||
|
Reference in New Issue
Block a user