Merge branch 'pandorabox' of https://github.com/pandorabox-io/technic into pandorabox

This commit is contained in:
Thomas Rudin 2018-12-11 17:09:42 +01:00
commit 8bcc8f6a44
43 changed files with 732 additions and 10 deletions

View File

@ -4,7 +4,7 @@ local conf_table = technic.config:to_table()
local defaults = {
enable_mining_drill = "true",
enable_mining_laser = "true",
enable_mining_laser = "false",
enable_flashlight = "false",
enable_wind_mill = "false",
enable_frames = "false",

View File

@ -0,0 +1,12 @@
-- HV compressor
minetest.register_craft({
output = 'technic:hv_compressor',
recipe = {
{'technic:carbon_plate', 'technic:mv_compressor', 'technic:composite_plate'},
{'pipeworks:tube_1', 'technic:hv_transformer', 'pipeworks:tube_1'},
{'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'},
}
})
technic.register_compressor({tier = "HV", demand = {1500, 1000, 750}, speed = 5, upgrade = 1, tube = 1})

View File

@ -0,0 +1,18 @@
-- MV Electric Furnace
-- This is a faster version of the stone furnace which runs on EUs
-- In addition to this it can be upgraded with microcontrollers and batteries
-- This new version uses the batteries to lower the power consumption of the machine
-- Also in addition this furnace can be attached to the pipe system from the pipeworks mod.
-- FIXME: kpoppel I'd like to introduce an induction heating element here also
minetest.register_craft({
output = 'technic:hv_electric_furnace',
recipe = {
{'technic:stainless_steel_ingot', 'technic:mv_electric_furnace', 'technic:stainless_steel_ingot'},
{'pipeworks:tube_1', 'technic:hv_transformer', 'pipeworks:tube_1'},
{'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'},
}
})
technic.register_electric_furnace({tier="HV", upgrade=1, tube=1, demand={4000, 2500, 1500}, speed=12})

View File

@ -121,6 +121,12 @@ local function set_forcefield_formspec(meta)
end
local forcefield_receive_fields = function(pos, formname, fields, sender)
local player_name = sender:get_player_name()
if minetest.is_protected(pos, player_name) then
minetest.chat_send_player(player_name, "You are not allowed to edit this!")
minetest.record_protection_violation(pos, player_name)
return
end
local meta = minetest.get_meta(pos)
local range = nil
if fields.range then

View File

@ -0,0 +1,13 @@
-- HV grinder
minetest.register_craft({
output = 'technic:hv_grinder',
recipe = {
{'technic:carbon_plate', 'technic:mv_grinder', 'technic:composite_plate'},
{'pipeworks:tube_1', 'technic:hv_transformer', 'pipeworks:tube_1'},
{'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'},
}
})
technic.register_grinder({tier="HV", demand={1200, 900, 600}, speed=5, upgrade=1, tube=1})

View File

@ -15,4 +15,8 @@ dofile(path.."/generator.lua")
-- Machines
dofile(path.."/quarry.lua")
dofile(path.."/forcefield.lua")
dofile(path.."/electric_furnace.lua")
dofile(path.."/grinder.lua")
dofile(path.."/compressor.lua")

View File

@ -60,6 +60,12 @@ local function set_quarry_demand(meta)
end
local function quarry_receive_fields(pos, formname, fields, sender)
local player_name = sender:get_player_name()
if minetest.is_protected(pos, player_name) then
minetest.chat_send_player(player_name, "You are not allowed to edit this!")
minetest.record_protection_violation(pos, player_name)
return
end
local meta = minetest.get_meta(pos)
if fields.size and string.find(fields.size, "^[0-9]+$") then
local size = tonumber(fields.size)
@ -81,8 +87,12 @@ end
local function quarry_handle_purge(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local cache = inv:get_list("cache")
if not cache then
return
end
local i = 0
for _,stack in ipairs(inv:get_list("cache")) do
for _,stack in ipairs(cache) do
i = i + 1
if stack then
local item = stack:to_table()
@ -160,10 +170,11 @@ local function quarry_run(pos, node)
end
if can_dig then
-- test above blocks if diggable
for ay = startpos.y, digpos.y+1, -1 do
local checkpos = {x=digpos.x, y=ay, z=digpos.z}
local checknode = technic.get_or_load_node(checkpos) or minetest.get_node(checkpos)
if checknode.name ~= "air" then
if checknode.name ~= "air" and checknode.name ~= "vacuum:vacuum" then
can_dig = false
break
end

View File

@ -22,3 +22,5 @@ dofile(path.."/extractor.lua")
dofile(path.."/compressor.lua")
dofile(path.."/music_player.lua")
dofile(path.."/lamp.lua")

View File

@ -0,0 +1,250 @@
-- LV LED and LV LED Lamp
-- LED - a weak light source, intended primarily as a core component for LED lamps
-- LED Lamp - a powerful light source, illuminating a 7x7x3(H) volume below itself
-- with light bright as the sun.
local S = technic.getter
local illuminate = function(pos, mode)
local loc = {}
-- loc.x, loc.y, loc.z = pos.x, pos.y, pos.z
for y=1,3,1 do
for x=-3,3,1 do
for z = -3,3,1 do
loc = {x = pos.x - x, y = pos.y - y, z = pos.z - z}
if mode then
if minetest.get_node(loc).name == "air" then
minetest.swap_node(loc, {name = "technic:dummy_light_source"})
end
else
if minetest.get_node(loc).name == "technic:dummy_light_source" then
minetest.swap_node(loc, {name = "air"})
end
end
end
end
end
end
local led_on = function(pos, node)
local meta = minetest.get_meta(pos)
local eu_input = meta:get_int("LV_EU_input")
local machine_name = S("%s LED"):format("LV")
local machine_node = "technic:lv_led"
local demand = 5
if eu_input < demand then
technic.swap_node(pos, machine_node)
meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
elseif eu_input >= demand then
technic.swap_node(pos, machine_node.."_active")
meta:set_string("infotext", S("%s Active"):format(machine_name))
end
meta:set_int("LV_EU_demand", demand)
end
local led_off = function(pos, node)
local meta = minetest.get_meta(pos)
local eu_input = meta:get_int("LV_EU_input")
local machine_name = S("%s LED"):format("LV")
local machine_node = "technic:lv_led"
technic.swap_node(pos, machine_node)
meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
meta:set_int("LV_EU_demand", 0)
end
local lamp_on = function(pos, node)
local meta = minetest.get_meta(pos)
local eu_input = meta:get_int("LV_EU_input")
local machine_name = S("%s Lamp"):format("LV")
local machine_node = "technic:lv_lamp"
local demand = 50
if eu_input < demand then
technic.swap_node(pos, machine_node)
meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
illuminate(pos, false)
elseif eu_input >= demand then
technic.swap_node(pos, machine_node.."_active")
meta:set_string("infotext", S("%s Active"):format(machine_name))
illuminate(pos, true)
end
meta:set_int("LV_EU_demand", demand)
end
local lamp_off = function(pos, node)
local meta = minetest.get_meta(pos)
local eu_input = meta:get_int("LV_EU_input")
local machine_name = S("%s Lamp"):format("LV")
local machine_node = "technic:lv_lamp"
illuminate(pos, false)
technic.swap_node(pos, machine_node)
meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
meta:set_int("LV_EU_demand", 0)
end
minetest.register_node("technic:dummy_light_source", {
description = S("Dummy light source node"),
node_box = {
type = "fixed",
fixed = {}
},
collision_box = {
type = "fixed",
fixed = {}
},
selection_box = {
type = "fixed",
fixed = {}
},
drawtype = "airlike",
buildable_to = true,
light_source = 14,
sunlight_propagates = true,
diggable = false,
walkable = false,
groups = { not_in_creative_inventory = 1 }
})
minetest.register_node("technic:lv_led", {
description = S("LV LED"),
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2}
},
collision_box = {
type = "fixed",
fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2}
},
selection_box = {
type = "fixed",
fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2}
},
tiles = {"technic_lv_led.png"},
inventory_image = "technic_lv_led_inv.png",
sunlight_propagates = true,
groups = {cracky=2, technic_machine=1, technic_lv=1},
connect_sides = {"front", "back", "left", "right", "top", "bottom"},
can_dig = technic.machine_can_dig,
technic_run = led_on,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("%s LED"):format("LV"))
end,
drop = "technic:lv_led"
})
minetest.register_node("technic:lv_led_active", {
description = S("LV LED Active"),
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2}
},
collision_box = {
type = "fixed",
fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2}
},
selection_box = {
type = "fixed",
fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2}
},
tiles = {"technic_lv_led.png"},
light_source = 9,
sunlight_propagates = true,
groups = {cracky=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
connect_sides = {"front", "back", "left", "right", "top", "bottom"},
can_dig = technic.machine_can_dig,
technic_run = led_on,
technic_on_disable = led_off,
drop = "technic:lv_led"
})
minetest.register_node("technic:lv_lamp", {
description = S("%s Lamp"):format("LV"),
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5}
},
collision_box = {
type = "fixed",
fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5}
},
selection_box = {
type = "fixed",
fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5}
},
tiles = {"technic_lv_lamp_top.png", "technic_lv_lamp_bottom.png", "technic_lv_lamp_side.png",
"technic_lv_lamp_side.png", "technic_lv_lamp_side.png", "technic_lv_lamp_side.png"},
groups = {cracky=2, technic_machine=1, technic_lv=1},
connect_sides = {"front", "back", "left", "right", "top",},
can_dig = technic.machine_can_dig,
technic_run = lamp_on,
on_destruct = lamp_off,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("%s Lamp"):format("LV"))
end,
})
minetest.register_node("technic:lv_lamp_active", {
description = S("%s Lamp Active"):format("LV"),
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5}
},
collision_box = {
type = "fixed",
fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5}
},
selection_box = {
type = "fixed",
fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5}
},
tiles = {"technic_lv_lamp_top.png", "technic_lv_lamp_bottom.png", "technic_lv_lamp_side.png",
"technic_lv_lamp_side.png", "technic_lv_lamp_side.png", "technic_lv_lamp_side.png"},
groups = {cracky=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
connect_sides = {"front", "back", "left", "right", "top"},
light_source = 1,
can_dig = technic.machine_can_dig,
technic_run = lamp_on,
on_destruct = lamp_off,
technic_on_disable = lamp_off,
})
minetest.register_craft({
output = 'technic:lv_led 2',
recipe = {
{'', 'homedecor:plastic_sheeting', ''},
{'homedecor:plastic_sheeting', 'technic:doped_silicon_wafer', 'homedecor:plastic_sheeting'},
{'', 'technic:fine_silver_wire', ''},
},
})
minetest.register_craft({
output = 'technic:lv_lamp',
recipe = {
{'default:glass', 'default:glass', 'default:glass'},
{'technic:lv_led', 'technic:lv_led', 'technic:lv_led'},
{'mesecons_materials:glue', 'technic:lv_cable', 'mesecons_materials:glue'},
},
})
technic.register_machine("LV", "technic:lv_lamp", technic.receiver)
technic.register_machine("LV", "technic:lv_lamp_active", technic.receiver)
technic.register_machine("LV", "technic:lv_led", technic.receiver)
technic.register_machine("LV", "technic:lv_led_active", technic.receiver)

View File

@ -7,6 +7,8 @@ dofile(path.."/LV/init.lua")
dofile(path.."/MV/init.lua")
dofile(path.."/HV/init.lua")
dofile(path.."/switching_station.lua")
dofile(path.."/power_monitor.lua")
dofile(path.."/supply_converter.lua")

View File

@ -30,6 +30,12 @@ local recipes = {
{"technic:raw_latex 4", "technic:coal_dust 2", "technic:rubber 6", 2},
}
if minetest.get_modpath("ethereal") then
table.insert(recipes, {"default:clay", "dye:red", "bakedclay:red"})
table.insert(recipes, {"default:clay", "dye:orange", "bakedclay:orange"})
table.insert(recipes, {"default:clay", "dye:grey", "bakedclay:grey"})
end
for _, data in pairs(recipes) do
technic.register_alloy_recipe({input = {data[1], data[2]}, output = data[3], time = data[4]})
end

View File

@ -15,7 +15,7 @@ local recipes = {
{ "technic:stainless_steel_dust 4", "technic:wrought_iron_dust 3", "technic:chromium_dust" },
{ "technic:brass_dust 3", "technic:copper_dust 2", "technic:zinc_dust" },
{ "technic:chernobylite_dust", "default:sand", "technic:uranium3_dust" },
{ "default:dirt 4", "default:sand", "default:gravel", "default:clay_lump 2" },
{ "default:dirt 4", "default:sand", "default:gravel", "default:clay_lump 4" },
}
local function uranium_dust(p)
@ -32,7 +32,15 @@ if minetest.get_modpath("bushes_classic") then
end
if minetest.get_modpath("farming") then
table.insert(recipes, { "farming:wheat 4", "farming:seed_wheat 3", "default:dry_shrub 1" })
if minetest.get_modpath("cottages") then
-- work as a mechanized threshing floor
table.insert(recipes, { "farming:wheat", "farming:seed_wheat", "cottages:straw_mat" })
table.insert(recipes, { "farming:barley", "farming:seed_barley", "cottages:straw_mat" })
else
-- work in a less fancy and less efficient manner
table.insert(recipes, { "farming:wheat 4", "farming:seed_wheat 3", "default:dry_shrub 1" })
table.insert(recipes, { "farming:barley 4", "farming:seed_barley 3", "default:dry_shrub 1" })
end
end
for _, data in pairs(recipes) do

View File

@ -19,8 +19,15 @@ local recipes = {
{"technic:coal_dust 4", "technic:graphite"},
{"technic:carbon_cloth", "technic:carbon_plate"},
{"technic:uranium35_ingot 5", "technic:uranium_fuel"},
{"technic:graphite 25", "default:diamond"}
}
if minetest.get_modpath("ethereal") then
-- the density of charcoal is ~1/10 of coal, otherwise it's pure carbon
table.insert(recipes, {"ethereal:charcoal_lump 10", "default:coal_lump 1"})
end
-- defuse the default sandstone recipe, since we have the compressor to take over in a more realistic manner
minetest.clear_craft({
recipe = {

View File

@ -29,6 +29,53 @@ if minetest.get_modpath("dye") then
{"bushes:blueberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:magenta 4"},
}
if minetest.get_modpath("hunger") and minetest.get_modpath("ethereal") then
table.insert(dye_recipes, {"ethereal:willow_twig 12", "technic:aspirin_pill"})
end
if minetest.get_modpath("farming") then
-- Cottonseed oil: a fuel and a potent fertilizer (irl: pesticide) ---
-- hemp oil calls for 8 seeds, but extractor recipes are normally twice as potent
table.insert(dye_recipes, {"farming:seed_cotton 4", "technic:cottonseed_oil"})
-- Dyes ---
-- better recipes for farming's crafting methods (twice the output)
table.insert(dye_recipes, {"farming:chili_pepper", "dye:red 4"})
table.insert(dye_recipes, {"farming:beans", "dye:green 4"})
table.insert(dye_recipes, {"farming:grapes", "dye:violet 4"})
table.insert(dye_recipes, {"farming:cocoa_beans", "dye:brown 4"})
-- Some extra recipes:
-- Himalayan rhubarb root can give yellow dye IRL
table.insert(dye_recipes, {"farming:rhubarb", "dye:yellow 4"})
table.insert(dye_recipes, {"farming:onion", "dye:yellow 4"})
table.insert(dye_recipes, {"farming:blueberries", "dye:blue 4"})
table.insert(dye_recipes, {"farming:raspberries", "dye:red 4"})
end
if minetest.get_modpath("ethereal") then
table.insert(dye_recipes, {"ethereal:seaweed", "dye:dark_green 6"})
table.insert(dye_recipes, {"ethereal:coral2", "dye:cyan 6"})
table.insert(dye_recipes, {"ethereal:coral3", "dye:orange 6"})
table.insert(dye_recipes, {"ethereal:coral4", "dye:pink 6"})
table.insert(dye_recipes, {"ethereal:coral5", "dye:green 6"})
table.insert(dye_recipes, {"ethereal:fern", "dye:dark_green 4"})
table.insert(dye_recipes, {"ethereal:snowygrass", "dye:grey 4"})
table.insert(dye_recipes, {"ethereal:crystalgrass", "dye:blue 4"})
end
if minetest.get_modpath("bakedclay") then
table.insert(dye_recipes, {"bakedclay:delphinium", "dye:cyan 8"})
table.insert(dye_recipes, {"bakedclay:thistle", "dye:magenta 8"})
table.insert(dye_recipes, {"bakedclay:lazarus", "dye:pink 8"})
table.insert(dye_recipes, {"bakedclay:mannagrass", "dye:dark_green 8"})
end
if minetest.get_modpath("bonemeal") then
table.insert(dye_recipes, {"bonemeal:bone", "dye:white 8"})
table.insert(dye_recipes, {"bonemeal:bonemeal", "dye:white 4"})
end
for _, data in ipairs(dye_recipes) do
technic.register_extractor_recipe({input = {data[1]}, output = data[2]})
end

View File

@ -34,6 +34,11 @@ local recipes = {
{"default:ice", "default:snowblock"},
}
if minetest.get_modpath("ethereal") then
-- the density of charcoal is ~1/10 of coal, otherwise it's the same graphitic carbon
table.insert(recipes, {"ethereal:charcoal_lump 5", "technic:coal_dust 1"})
end
-- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe)
minetest.clear_craft({
recipe = {

View File

@ -227,6 +227,15 @@ minetest.register_chatcommand("powerctrl", {
end
})
local check_timer = function(pos, meta, diff)
if diff > 500000 then
minetest.log("warning", "[technic] disabling switching station @ " .. minetest.pos_to_string(pos))
meta:set_int("overload", 30)
meta:set_int("active", 0)
meta:set_string("infotext", "Overload detected!")
end
end
minetest.register_abm({
nodenames = {"technic:switching_station"},
label = "Switching Station", -- allows the mtt profiler to profile this abm individually
@ -234,6 +243,7 @@ minetest.register_abm({
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if not technic.powerctrl_state then return end
local t0 = minetest.get_us_time()
local meta = minetest.get_meta(pos)
local meta1 = nil
local pos1 = {}
@ -248,6 +258,18 @@ minetest.register_abm({
local RE_nodes
local machine_name = S("Switching Station")
local overload = meta:get_int("overload")
if overload > 0 then
meta:set_int("overload", overload - 1)
meta:set_string("infotext", "Overload detected, resetting in " .. overload .. " seconds")
if overload == 1 then
-- re-enable in next step
meta:set_int("active", 1)
end
return
end
-- Which kind of network are we on:
pos1 = {x=pos.x, y=pos.y-1, z=pos.z}
@ -403,6 +425,13 @@ minetest.register_abm({
meta1:set_int(eu_input_str, math.floor(eu_demand * charge_factor))
--dprint("Charging battery:"..math.floor(eu_demand*charge_factor))
end
local t1 = minetest.get_us_time()
local diff = t1 - t0
if diff > 50000 then
check_timer(pos, meta, diff)
minetest.log("warning", "[technic] [+supply] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos))
end
return
end
@ -426,6 +455,12 @@ minetest.register_abm({
meta1:set_int(eu_input_str, math.floor(eu_supply * charge_factor))
--dprint("Discharging battery:"..math.floor(eu_supply*charge_factor))
end
local t1 = minetest.get_us_time()
local diff = t1 - t0
if diff > 50000 then
check_timer(pos, meta, diff)
minetest.log("warning", "[technic] [-supply] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos))
end
return
end
@ -444,6 +479,13 @@ minetest.register_abm({
meta1:set_int(eu_input_str, 0)
end
local t1 = minetest.get_us_time()
local diff = t1 - t0
if diff > 50000 then
check_timer(pos, meta, diff)
minetest.log("warning", "[technic] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos))
end
end,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 716 B

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 791 B

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 B

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

View File

@ -51,6 +51,10 @@ if minetest.get_modpath("moretrees") then
timber_nodenames["moretrees:spruce_trunk"] = true
timber_nodenames["moretrees:willow_trunk"] = true
timber_nodenames["moretrees:jungletree_trunk"] = true
timber_nodenames["moretrees:date_palm_trunk"] = true
timber_nodenames["moretrees:date_palm_mfruit_trunk"] = true
timber_nodenames["moretrees:date_palm_ffruit_trunk"] = true
if chainsaw_leaves then
timber_nodenames["moretrees:acacia_leaves"] = true
@ -75,6 +79,7 @@ if minetest.get_modpath("moretrees") then
timber_nodenames["moretrees:pine_cone"] = true
timber_nodenames["moretrees:fir_cone"] = true
timber_nodenames["moretrees:apple_blossoms"] = true
timber_nodenames["moretrees:date_palm_leaves"] = true
end
end

View File

@ -314,7 +314,7 @@ function technic.chests:definition(name, data)
def.can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main") and default.can_interact_with_node(player, pos)
return inv:is_empty("main") and player and player:is_player() and default.can_interact_with_node(player, pos)
end
def.on_skeleton_key_use = function(pos, player, newsecret)
local meta = minetest.get_meta(pos)

View File

@ -21,18 +21,77 @@ technic_cnc.register_all("default:wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"default_wood.png"},
S("Wooden"))
technic_cnc.register_all("default:junglewood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"default_junglewood.png"},
S("Junglewood"))
technic_cnc.register_all("default:pine_wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"default_pine_wood.png"},
S("Pine"))
technic_cnc.register_all("default:acacia_wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"default_acacia_wood.png"},
S("Acacia"))
technic_cnc.register_all("default:aspen_wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"default_aspen_wood.png"},
S("Aspen"))
-- STONE
--------
technic_cnc.register_all("default:stone",
{cracky=3, not_in_creative_inventory=1},
{cracky=3, stone=1, not_in_creative_inventory=1},
{"default_stone.png"},
S("Stone"))
technic_cnc.register_all("default:stonebrick",
{crumbly=2, cracky=3, stone=1, not_in_creative_inventory=1},
{"default_stone_brick.png"},
S("Stone Brick"))
technic_cnc.register_all("default:stone_block",
{crumbly=2, cracky=3, stone=1, not_in_creative_inventory=1},
{"default_stone_block.png"},
S("Stone Block"))
technic_cnc.register_all("default:desert_stone",
{cracky=3, stone=1, not_in_creative_inventory=1},
{"default_desert_stone.png"},
S("Desert Stone"))
technic_cnc.register_all("default:desert_stonebrick",
{crumbly=2, cracky=3, stone=1, not_in_creative_inventory=1},
{"default_desert_stone_brick.png"},
S("Desert Stone Brick"))
technic_cnc.register_all("default:desert_stone_block",
{crumbly=2, cracky=3, stone=1, not_in_creative_inventory=1},
{"default_desert_stone_block.png"},
S("Desert Stone Block"))
-- COBBLE
---------
technic_cnc.register_all("default:cobble",
{cracky=3, not_in_creative_inventory=1},
{cracky=3, stone=1, not_in_creative_inventory=1},
{"default_cobble.png"},
S("Cobble"))
technic_cnc.register_all("default:mossycobble",
{cracky=3, stone=1, not_in_creative_inventory=1},
{"default_mossycobble.png"},
S("Mossy Cobblestone"))
technic_cnc.register_all("default:desert_cobble",
{cracky=3, stone=1, not_in_creative_inventory=1},
{"default_desert_cobble.png"},
S("Desert Cobble"))
-- BRICK
--------
technic_cnc.register_all("default:brick",
@ -47,12 +106,58 @@ technic_cnc.register_all("default:sandstone",
{"default_sandstone.png"},
S("Sandstone"))
technic_cnc.register_all("default:sandstonebrick",
{crumbly=2, cracky=3, not_in_creative_inventory=1},
{"default_sandstone_brick.png"},
S("Sandstone Brick"))
technic_cnc.register_all("default:sandstone_block",
{crumbly=2, cracky=3, not_in_creative_inventory=1},
{"default_sandstone_block.png"},
S("Sandstone Block"))
technic_cnc.register_all("default:desert_sandstone",
{crumbly=2, cracky=3, not_in_creative_inventory=1},
{"default_desert_sandstone.png"},
S("Desert Sandstone"))
technic_cnc.register_all("default:desert_sandstone_brick",
{crumbly=2, cracky=3, not_in_creative_inventory=1},
{"default_desert_sandstone_brick.png"},
S("Desert Sandstone Brick"))
technic_cnc.register_all("default:desert_sandstone_block",
{crumbly=2, cracky=3, not_in_creative_inventory=1},
{"default_desert_sandstone_block.png"},
S("Desert Sandstone Block"))
technic_cnc.register_all("default:silver_sandstone",
{crumbly=2, cracky=3, not_in_creative_inventory=1},
{"default_silver_sandstone.png"},
S("Silver Sandstone"))
technic_cnc.register_all("default:silver_sandstone_brick",
{crumbly=2, cracky=3, not_in_creative_inventory=1},
{"default_silver_sandstone_brick.png"},
S("Silver Sandstone Brick"))
technic_cnc.register_all("default:silver_sandstone_block",
{crumbly=2, cracky=3, not_in_creative_inventory=1},
{"default_silver_sandstone_block.png"},
S("Silver Sandstone Block"))
-- LEAVES
---------
technic_cnc.register_all("default:leaves",
{snappy=2, choppy=2, oddly_breakable_by_hand=3, not_in_creative_inventory=1},
{"default_leaves.png"},
S("Leaves"))
-- TREE
-------
technic_cnc.register_all("default:tree",
@ -60,6 +165,29 @@ technic_cnc.register_all("default:tree",
{"default_tree.png"},
S("Tree"))
-- ICE
-------
technic_cnc.register_all("default:ice",
{cracky=3, puts_out_fire=1, cools_lava=1, not_in_creative_inventory=1},
{"default_ice.png"},
S("Ice"))
-- OBSIDIAN
-----------
technic_cnc.register_all("default:obsidian_block",
{cracky=1, level=2, not_in_creative_inventory=1},
{"default_obsidian_block.png"},
S("Obsidian"))
-- WROUGHT IRON
---------------
technic_cnc.register_all("default:steelblock",
{cracky=1, level=2, not_in_creative_inventory=1},
{"technic_wrought_iron_block.png"},
S("Wrought Iron"))
-- Bronze
--------
technic_cnc.register_all("default:bronzeblock",
@ -67,10 +195,23 @@ technic_cnc.register_all("default:bronzeblock",
{"default_bronze_block.png"},
S("Bronze"))
-- Zinc
--------
technic_cnc.register_all("technic:zinc_block",
{cracky=1, level=2, not_in_creative_inventory=1},
{"technic_zinc_block.png"},
S("Zinc"))
local steeltex = "default_steel_block.png"
local steelname = "Steel"
-- Cast Iron
------------
technic_cnc.register_all("technic:cast_iron_block",
{cracky=1, level=2, not_in_creative_inventory=1},
{"technic_cast_iron_block.png"},
S("Cast Iron"))
if technic_cnc.technic_modpath then
steeltex = "technic_wrought_iron_block.png"
steelname = "Wrought Iron"
@ -105,8 +246,6 @@ if technic_cnc.technic_modpath then
S("Blast-resistant concrete"))
end
-- STEEL
---------------
technic_cnc.register_all("default:steelblock",
{cracky=1, level=2, not_in_creative_inventory=1},
{steeltex},
@ -129,3 +268,148 @@ technic_cnc.register_all("basic_materials:brass_block",
{cracky=1, level=2, not_in_creative_inventory=1},
{"basic_materials_brass_block.png"},
S("Brass block"))
-- Brass
--------
technic_cnc.register_all("technic:brass_block",
{cracky=1, level=2, not_in_creative_inventory=1},
{"technic_brass_block.png"},
S("Brass"))
-- Copper
---------
technic_cnc.register_all("default:copperblock",
{cracky=1, level=2, not_in_creative_inventory=1},
{"default_copper_block.png"},
S("Copper"))
-- Tin
------
technic_cnc.register_all("default:tinblock",
{cracky=1, level=2, not_in_creative_inventory=1},
{"default_tin_block.png"},
S("Tin"))
-- Gold
-------
technic_cnc.register_all("default:goldblock",
{cracky=1, level=2, not_in_creative_inventory=1},
{"default_gold_block.png"},
S("Gold"))
if minetest.get_modpath("ethereal") then
-- Glostone
------------
technic_cnc.register_all("ethereal:glostone",
{cracky=1, not_in_creative_inventory=1, light_source=13},
{"glostone.png"},
S("Glo Stone"))
-- Crystal block
----------------
technic_cnc.register_all("ethereal:crystal_block",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"crystal_block.png"},
S("Crystal"))
-- Misc. Wood types
-------------------
technic_cnc.register_all("ethereal:banana_wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"banana_wood.png"},
S("Banana Wood"))
technic_cnc.register_all("ethereal:birch_wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"moretrees_birch_wood.png"},
S("Birch Wood"))
technic_cnc.register_all("ethereal:frost_wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"frost_wood.png"},
S("Frost Wood"))
technic_cnc.register_all("ethereal:palm_wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"moretrees_palm_wood.png"},
S("Palm Wood"))
technic_cnc.register_all("ethereal:willow_wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"willow_wood.png"},
S("Willow Wood"))
technic_cnc.register_all("ethereal:yellow_wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"yellow_wood.png"},
S("Healing Tree Wood"))
technic_cnc.register_all("ethereal:redwood_wood",
{snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
{"redwood_wood.png"},
S("Redwood"))
end
if minetest.get_modpath("moreblocks") then
-- Tiles
------------
technic_cnc.register_all("moreblocks:stone_tile",
{stone=1, cracky=3, not_in_creative_inventory=1},
{"moreblocks_stone_tile.png"},
S("Stone Tile"))
technic_cnc.register_all("moreblocks:split_stone_tile",
{stone=1, cracky=3, not_in_creative_inventory=1},
{"moreblocks_split_stone_tile.png"},
S("Split Stone Tile"))
technic_cnc.register_all("moreblocks:checker_stone_tile",
{stone=1, cracky=3, not_in_creative_inventory=1},
{"moreblocks_checker_stone_tile.png"},
S("Checker Stone Tile"))
technic_cnc.register_all("moreblocks:cactus_checker",
{stone=1, cracky=3, not_in_creative_inventory=1},
{"moreblocks_cactus_checker.png"},
S("Cactus Checker"))
-- Bricks
------------
technic_cnc.register_all("moreblocks:cactus_brick",
{cracky=3, not_in_creative_inventory=1},
{"moreblocks_cactus_brick.png"},
S("Cactus Brick"))
technic_cnc.register_all("moreblocks:grey_bricks",
{cracky=3, not_in_creative_inventory=1},
{"moreblocks_grey_bricks.png"},
S("Grey Bricks"))
-- Metals
------------
technic_cnc.register_all("moreblocks:copperpatina",
{cracky=1, level=2, not_in_creative_inventory=1},
{"moreblocks_copperpatina.png"},
S("Copper Patina"))
-- Clay
------------
technic_cnc.register_all("bakedclay:red",
{cracky=3, not_in_creative_inventory=1},
{"baked_clay_red.png"},
S("Red Clay"))
technic_cnc.register_all("bakedclay:orange",
{cracky=3, not_in_creative_inventory=1},
{"baked_clay_orange.png"},
S("Orange Clay"))
technic_cnc.register_all("bakedclay:grey",
{cracky=3, not_in_creative_inventory=1},
{"baked_clay_grey.png"},
S("Grey Clay"))
end