update basic_materials, biome_lib, technic, digilines, digistuff,

gloopblocks, homedecor, moreblocks, pipeworks, prefab_redo
This commit is contained in:
Vanessa Dannenberg 2018-12-01 09:06:00 -05:00
parent 2d8ff9f889
commit 856b86858e
112 changed files with 2007 additions and 1577 deletions

View File

@ -72,7 +72,8 @@ minetest.register_craft({
minetest.register_alias("homedecor:ic", "basic_materials:ic")
minetest.register_alias("homedecor:motor", "basic_materials:motor")
minetest.register_alias("technic:motor", "basic_materials:motor")
minetest.register_alias("homedecor:heating_element", "basic_materials:heating_element")
minetest.register_alias("homedecor:power_crystal", "basic_materials:energy_crystal_simple")
minetest.register_alias("homedecor:power_crystal", "basic_materials:energy_crystal_simple")
minetest.register_alias_force("mesecons_materials:silicon", "basic_materials:silicon")

View File

@ -262,7 +262,7 @@ minetest.register_craft( {
minetest.register_alias("homedecor:copper_wire", "basic_materials:copper_wire")
minetest.register_alias("technic:fine_copper_wire", "basic_materials:copper_wire")
minetest.register_alias("technic:fine_silver_wire", "basic_materials:silver_wire")
minetest.register_alias("technic:fine_gold_wire", "basic_materialsgold_wire")
minetest.register_alias("technic:fine_gold_wire", "basic_materials:gold_wire")
minetest.register_alias("homedecor:steel_wire", "basic_materials:steel_wire")
@ -282,3 +282,4 @@ minetest.register_alias("chains:chain_brass", "basic_materials:chai
minetest.register_alias("pipeworks:gear", "basic_materials:gear_steel")
minetest.register_alias("technic:rebar", "basic_materials:steel_bar")

View File

@ -34,8 +34,12 @@ biome_lib.queue_run_ratio = tonumber(minetest.settings:get("biome_lib_queue_run_
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
if minetest.global_exists("intllib") then
if intllib.make_gettext_pair then
S = intllib.make_gettext_pair()
else
S = intllib.Getter()
end
else
S = function(s) return s end
end

View File

@ -1,4 +1,4 @@
default
basic_materials
intllib?
moreblocks?

View File

@ -61,6 +61,20 @@ minetest.register_node(":technic:blast_resistant_concrete", {
end,
})
if minetest.get_modpath("moreblocks") then
stairsplus:register_all("technic","blast_resistant_concrete","technic:blast_resistant_concrete",{
description = "Blast-resistant Concrete",
tiles = {"technic_blast_resistant_concrete_block.png",},
groups = {cracky=1, level=3, concrete=1},
sounds = default.node_sound_stone_defaults(),
on_blast = function(pos, intensity)
if intensity > 1 then
minetest.remove_node(pos)
minetest.add_item(pos, "technic:blast_resistant_concrete")
end
end,
})
end
local box_platform = {-0.5, 0.3, -0.5, 0.5, 0.5, 0.5}
local box_post = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}

View File

@ -128,16 +128,49 @@ local clearscreen = function(pos)
end
end
local set_texture = function(ent)
local meta = minetest.get_meta(ent.object:get_pos())
local text = meta:get_string("text")
ent.object:set_properties({
textures = {
generate_texture(create_lines(text))
}
})
end
local get_entity = function(pos)
local lcd_entity
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, o in ipairs(objects) do
local o_entity = o:get_luaentity()
if o_entity and o_entity.name == "digilines_lcd:text" then
if not lcd_entity then
lcd_entity = o_entity
else
-- Remove extras, if any
o:remove()
end
end
end
return lcd_entity
end
local spawn_entity = function(pos)
if not get_entity(pos) then
local lcd_info = lcds[minetest.get_node(pos).param2]
if not lcd_info then
return
end
local text = minetest.add_entity(vector.add(pos, lcd_info.delta), "digilines_lcd:text")
text:set_yaw(lcd_info.yaw or 0)
end
end
local prepare_writing = function(pos)
local lcd_info = lcds[minetest.get_node(pos).param2]
if lcd_info == nil then return end
local text = minetest.add_entity(
{x = pos.x + lcd_info.delta.x,
y = pos.y + lcd_info.delta.y,
z = pos.z + lcd_info.delta.z}, "digilines_lcd:text")
text:setyaw(lcd_info.yaw or 0)
--* text:setpitch(lcd_info.yaw or 0)
return text
local entity = get_entity(pos)
if entity then
set_texture(entity)
end
end
local on_digiline_receive = function(pos, _, channel, msg)
@ -147,7 +180,7 @@ local on_digiline_receive = function(pos, _, channel, msg)
meta:set_string("text", msg)
meta:set_string("infotext", msg)
clearscreen(pos)
if msg ~= "" then
prepare_writing(pos)
end
@ -165,30 +198,28 @@ minetest.register_node("digilines:lcd", {
inventory_image = "lcd_lcd.png",
wield_image = "lcd_lcd.png",
tiles = {"lcd_anyside.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 6,
paramtype2 = "wallmounted",
node_box = lcd_box,
selection_box = lcd_box,
groups = {choppy = 3, dig_immediate = 2},
after_place_node = function (pos)
after_place_node = function(pos)
local param2 = minetest.get_node(pos).param2
if param2 == 0 or param2 == 1 then
minetest.add_node(pos, {name = "digilines:lcd", param2 = 3})
end
prepare_writing (pos)
spawn_entity(pos)
prepare_writing(pos)
end,
on_construct = function(pos)
reset_meta(pos)
on_construct = reset_meta,
on_destruct = clearscreen,
on_punch = function(pos, node, puncher, pointed_thing)
if minetest.is_player(puncher) then
spawn_entity(pos)
end
end,
on_destruct = function(pos)
clearscreen(pos)
end,
on_receive_fields = function(pos, _, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then
@ -199,28 +230,27 @@ minetest.register_node("digilines:lcd", {
minetest.get_meta(pos):set_string("channel", fields.channel)
end
end,
digiline =
{
digiline = {
receptor = {},
effector = {
action = on_digiline_receive
},
},
})
light_source = 6,
minetest.register_lbm({
label = "Replace Missing Text Entities",
name = "digilines:replace_text",
nodenames = {"digilines:lcd"},
run_at_every_load = true,
action = spawn_entity,
})
minetest.register_entity(":digilines_lcd:text", {
collisionbox = { 0, 0, 0, 0, 0, 0 },
visual = "upright_sprite",
textures = {},
on_activate = function(self)
local meta = minetest.get_meta(self.object:getpos())
local text = meta:get_string("text")
self.object:set_properties({textures={generate_texture(create_lines(text))}})
end
on_activate = set_texture,
})
minetest.register_craft({

160
digistuff/button.lua Normal file
View File

@ -0,0 +1,160 @@
digistuff.button_turnoff = function (pos)
local node = minetest.get_node(pos)
if node.name=="digistuff:button_on" then --has not been dug
minetest.swap_node(pos, {name = "digistuff:button_off", param2=node.param2})
if minetest.get_modpath("mesecons") then minetest.sound_play("mesecons_button_pop", {pos=pos}) end
end
end
minetest.register_node("digistuff:button", {
drawtype = "nodebox",
tiles = {
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_off.png"
},
paramtype = "light",
paramtype2 = "facedir",
legacy_wallmounted = true,
walkable = false,
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = { -6/16, -6/16, 5/16, 6/16, 6/16, 8/16 }
},
node_box = {
type = "fixed",
fixed = {
{ -6/16, -6/16, 6/16, 6/16, 6/16, 8/16 }, -- the thin plate behind the button
{ -4/16, -2/16, 4/16, 4/16, 2/16, 6/16 } -- the button itself
}
},
digiline =
{
receptor = {}
},
groups = {dig_immediate=2},
description = "Digilines Button",
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec","size[8,4;]field[1,1;6,2;channel;Channel;${channel}]field[1,2;6,2;msg;Message;${msg}]button_exit[2.25,3;3,1;submit;Save]")
end,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
if fields.channel and fields.msg and fields.channel ~= "" and fields.msg ~= "" then
meta:set_string("channel",fields.channel)
meta:set_string("msg",fields.msg)
meta:set_string("formspec","")
minetest.swap_node(pos, {name = "digistuff:button_off", param2=minetest.get_node(pos).param2})
else
minetest.chat_send_player(sender:get_player_name(),"Channel and message must both be set!")
end
end,
sounds = default and default.node_sound_stone_defaults(),
})
minetest.register_node("digistuff:button_off", {
drawtype = "nodebox",
tiles = {
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_off.png"
},
paramtype = "light",
paramtype2 = "facedir",
legacy_wallmounted = true,
walkable = false,
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = { -6/16, -6/16, 5/16, 6/16, 6/16, 8/16 }
},
node_box = {
type = "fixed",
fixed = {
{ -6/16, -6/16, 6/16, 6/16, 6/16, 8/16 }, -- the thin plate behind the button
{ -4/16, -2/16, 4/16, 4/16, 2/16, 6/16 } -- the button itself
}
},
digiline =
{
receptor = {}
},
groups = {dig_immediate=2, not_in_creative_inventory=1},
drop = "digistuff:button",
description = "Digilines Button (off state - you hacker you!)",
on_rightclick = function (pos, node, clicker)
local meta = minetest.get_meta(pos)
digiline:receptor_send(pos, digiline.rules.default, meta:get_string("channel"), meta:get_string("msg"))
minetest.swap_node(pos, {name = "digistuff:button_on", param2=node.param2})
if minetest.get_modpath("mesecons") then minetest.sound_play("mesecons_button_push", {pos=pos}) end
minetest.after(0.5, digistuff.button_turnoff, pos)
end,
sounds = default and default.node_sound_stone_defaults(),
})
minetest.register_node("digistuff:button_on", {
drawtype = "nodebox",
tiles = {
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_sides.png",
"digistuff_digibutton_on.png"
},
paramtype = "light",
paramtype2 = "facedir",
legacy_wallmounted = true,
walkable = false,
light_source = 7,
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = { -6/16, -6/16, 5/16, 6/16, 6/16, 8/16 }
},
node_box = {
type = "fixed",
fixed = {
{ -6/16, -6/16, 6/16, 6/16, 6/16, 8/16 },
{ -4/16, -2/16, 11/32, 4/16, 2/16, 6/16 }
}
},
digiline =
{
receptor = {}
},
groups = {dig_immediate=2, not_in_creative_inventory=1},
drop = 'digistuff:button',
on_rightclick = function (pos, node, clicker)
local meta = minetest.get_meta(pos)
digiline:receptor_send(pos, digiline.rules.default, meta:get_string("channel"), meta:get_string("msg"))
if minetest.get_modpath("mesecons") then minetest.sound_play("mesecons_button_push", {pos=pos}) end
end,
description = "Digilines Button (on state - you hacker you!)",
sounds = default and default.node_sound_stone_defaults(),
})
minetest.register_craft({
output = "digistuff:digimese",
recipe = {
{"digilines:wire_std_00000000","digilines:wire_std_00000000","digilines:wire_std_00000000"},
{"digilines:wire_std_00000000","default:mese","digilines:wire_std_00000000"},
{"digilines:wire_std_00000000","digilines:wire_std_00000000","digilines:wire_std_00000000"}
}
})
minetest.register_craft({
output = "digistuff:button",
recipe = {
{"mesecons_button:button_off"},
{"mesecons_luacontroller:luacontroller0000"},
{"digilines:wire_std_00000000"}
}
})

98
digistuff/camera.lua Normal file
View File

@ -0,0 +1,98 @@
minetest.register_node("digistuff:camera", {
tiles = {
"digistuff_camera_top.png",
"digistuff_camera_bottom.png",
"digistuff_camera_right.png",
"digistuff_camera_left.png",
"digistuff_camera_back.png",
"digistuff_camera_front.png",
},
digiline =
{
receptor = {}
},
groups = {cracky=2},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.5,-0.28,0.1,-0.3,0.3}, --Camera Body
{-0.045,-0.42,-0.34,0.045,-0.36,-0.28}, -- Lens
{-0.05,-0.9,-0.05,0.05,-0.5,0.05}, --Pole
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.1,-0.5,-0.34,0.1,-0.3,0.3}, --Camera Body
}
},
description = "Digilines Camera",
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec","size[8,6;]field[1,1;6,2;channel;Channel;${channel}]field[1,2;6,2;radius;Radius (max 10);${radius}]field[1,3;6,2;distance;Distance (max 20);${distance}]button_exit[2.25,4;3,1;submit;Save]")
end,
on_receive_fields = function(pos, formname, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
minetest.record_protection_violation(pos,name)
return
end
local meta = minetest.get_meta(pos)
if fields.channel then meta:set_string("channel",fields.channel) end
if fields.distance and tonumber(fields.distance) then meta:set_int("distance",math.max(math.min(20,fields.distance),0)) end
if fields.radius and tonumber(fields.radius) then meta:set_int("radius",math.max(math.min(10,fields.radius),1)) end
end,
sounds = default and default.node_sound_stone_defaults()
})
minetest.register_abm({
nodenames = {"digistuff:camera"},
interval = 1.0,
chance = 1,
action = function(pos,node)
local meta = minetest.get_meta(pos)
local channel = meta:get_string("channel")
local radius = meta:get_int("radius")
local distance = meta:get_int("distance")
local dir = vector.multiply(minetest.facedir_to_dir(node.param2),-1)
local spot = vector.add(pos,vector.multiply(dir,distance))
local i = 0
while i <= 10 and minetest.get_node(spot).name == "air" do
--Downward search for ground level
spot = vector.add(spot,vector.new(0,-1,0))
i = i + 1
end
if minetest.get_node(spot).name == "air" or minetest.get_node(spot).name == "ignore" then
--Ground not in range
return
end
local found_any = false
local players_found = {}
local objs = minetest.get_objects_inside_radius(spot,radius)
if objs then
local _,obj
for _,obj in ipairs(objs) do
if obj:is_player() then
table.insert(players_found,obj:get_player_name())
found_any = true
end
end
if found_any then
digiline:receptor_send({x=pos.x,y=pos.y-1,z=pos.z}, digiline.rules.default, channel, players_found)
end
end
end
})
minetest.register_craft({
output = "digistuff:camera",
recipe = {
{"homedecor:plastic_sheeting","homedecor:plastic_sheeting","homedecor:plastic_sheeting"},
{"default:glass","homedecor:ic","mesecons_luacontroller:luacontroller0000"},
{"homedecor:plastic_sheeting","homedecor:plastic_sheeting","homedecor:plastic_sheeting"},
}
})

62
digistuff/conductors.lua Normal file
View File

@ -0,0 +1,62 @@
minetest.register_node("digistuff:digimese", {
description = "Digimese",
tiles = {"digistuff_digimese.png"},
paramtype = "light",
light_source = 3,
groups = {cracky = 3, level = 2},
is_ground_content = false,
sounds = default and default.node_sound_stone_defaults(),
digiline = { wire = { rules = {
{x = 1, y = 0, z = 0},
{x =-1, y = 0, z = 0},
{x = 0, y = 1, z = 0},
{x = 0, y =-1, z = 0},
{x = 0, y = 0, z = 1},
{x = 0, y = 0, z =-1}}}}
})
minetest.register_node("digistuff:junctionbox", {
description = "Digilines Junction Box",
tiles = {"digistuff_junctionbox.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3},
is_ground_content = false,
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.1,-0.15,0.35,0.1,0.15,0.5},
}
},
sounds = default and default.node_sound_stone_defaults(),
digiline = {
receptor = {},
wire = {
rules = {
{x = 1,y = 0,z = 0},
{x = -1,y = 0,z = 0},
{x = 0,y = 0,z = 1},
{x = 0,y = 0,z = -1},
{x = 0,y = 1,z = 0},
{x = 0,y = -1,z = 0},
{x = 0,y = -2,z = 0},
{x = 0,y = 2,z = 0},
{x = -2,y = 0,z = 0},
{x = 2,y = 0,z = 0},
{x = 0,y = 0,z = -2},
{x = 0,y = 0,z = 2},
}
},
},
})
minetest.register_craft({
output = "digistuff:junctionbox",
recipe = {
{"homedecor:plastic_sheeting","digilines:wire_std_00000000","homedecor:plastic_sheeting",},
{"digilines:wire_std_00000000","digilines:wire_std_00000000","digilines:wire_std_00000000",},
{"homedecor:plastic_sheeting","digilines:wire_std_00000000","homedecor:plastic_sheeting",},
}
})

View File

@ -1,3 +1,4 @@
default?
digilines
mesecons?
mesecons_mvps?

63
digistuff/detector.lua Normal file
View File

@ -0,0 +1,63 @@
minetest.register_node("digistuff:detector", {
tiles = {
"digistuff_digidetector.png"
},
digiline =
{
receptor = {}
},
groups = {cracky=2},
description = "Digilines Player Detector",
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec","size[8,4;]field[1,1;6,2;channel;Channel;${channel}]field[1,2;6,2;radius;Radius;${radius}]button_exit[2.25,3;3,1;submit;Save]")
end,
on_receive_fields = function(pos, formname, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
minetest.record_protection_violation(pos,name)
return
end
local meta = minetest.get_meta(pos)
if fields.channel then meta:set_string("channel",fields.channel) end
if fields.msg then meta:set_string("msg",fields.msg) end
if fields.radius then meta:set_string("radius",fields.radius) end
end,
sounds = default and default.node_sound_stone_defaults()
})
minetest.register_abm({
nodenames = {"digistuff:detector"},
interval = 1.0,
chance = 1,
action = function(pos)
local meta = minetest.get_meta(pos)
local channel = meta:get_string("channel")
local radius = meta:get_string("radius")
local found_any = false
local players_found = {}
if not radius or not tonumber(radius) or tonumber(radius) < 1 or tonumber(radius) > 10 then radius = 6 end
local objs = minetest.get_objects_inside_radius(pos, radius)
if objs then
local _,obj
for _,obj in ipairs(objs) do
if obj:is_player() then
table.insert(players_found,obj:get_player_name())
found_any = true
end
end
if found_any then
digiline:receptor_send(pos, digiline.rules.default, channel, players_found)
end
end
end
})
minetest.register_craft({
output = "digistuff:detector",
recipe = {
{"mesecons_detector:object_detector_off"},
{"mesecons_luacontroller:luacontroller0000"},
{"digilines:wire_std_00000000"}
}
})

File diff suppressed because it is too large Load Diff

71
digistuff/light.lua Normal file
View File

@ -0,0 +1,71 @@
for i=0,14,1 do
local mult = 255 - ((14-i)*12)
minetest.register_node("digistuff:light_"..i, {
drop = "digistuff:light_0",
description = "Digilines Dimmable Light"..(i > 0 and " (on state - you hacker you!)" or ""),
tiles = {"digistuff_light.png"},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.25,0.4,-0.25,0.25,0.5,0.25},
}
},
groups = i > 0 and {cracky = 1, not_in_creative_inventory = 1} or {cracky = 1},
is_ground_content = false,
light_source = i,
color = {r = mult,g = mult,b = mult},
sounds = default and default.node_sound_glass_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec","field[channel;Channel;${channel}")
end,
on_receive_fields = function(pos, formname, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
minetest.record_protection_violation(pos,name)
return
end
local meta = minetest.get_meta(pos)
if fields.channel then meta:set_string("channel",fields.channel) end
end,
digiline = {
receptor = {},
wire = {
rules = {
{x = 1,y = 0,z = 0},
{x = -1,y = 0,z = 0},
{x = 0,y = 0,z = 1},
{x = 0,y = 0,z = -1},
{x = 0,y = 1,z = 0},
{x = 0,y = -1,z = 0},
{x = 2,y = 0,z = 0},
{x = -2,y = 0,z = 0},
{x = 0,y = 0,z = 2},
{x = 0,y = 0,z = -2},
{x = 0,y = 2,z = 0},
{x = 0,y = -2,z = 0},
}
},
effector = {
action = function(pos,node,channel,msg)
local meta = minetest.get_meta(pos)
if meta:get_string("channel") ~= channel then return end
local value = tonumber(msg)
if (not value) or value > 14 or value < 0 then return end
node.name = "digistuff:light_"..math.floor(value)
minetest.swap_node(pos,node)
end
},
},
})
end
minetest.register_craft({
output = "digistuff:light_0",
recipe = {
{"digilines:wire_std_00000000","mesecons_lamp:lamp_off",},
}
})

69
digistuff/nic.lua Normal file
View File

@ -0,0 +1,69 @@
local http = ...
minetest.register_node("digistuff:nic", {
description = "Digilines NIC",
groups = {cracky=3},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec","field[channel;Channel;${channel}")
end,
tiles = {
"digistuff_nic_top.png",
"jeija_microcontroller_bottom.png",
"jeija_microcontroller_sides.png",
"jeija_microcontroller_sides.png",
"jeija_microcontroller_sides.png",
"jeija_microcontroller_sides.png"
},
drawtype = "nodebox",
selection_box = {
--From luacontroller
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, -5/16, 8/16 },
},
node_box = {
--From Luacontroller
type = "fixed",
fixed = {
{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16}, -- Bottom slab
{-5/16, -7/16, -5/16, 5/16, -6/16, 5/16}, -- Circuit board
{-3/16, -6/16, -3/16, 3/16, -5/16, 3/16}, -- IC
}
},
paramtype = "light",
sunlight_propagates = true,
on_receive_fields = function(pos, formname, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
minetest.record_protection_violation(pos,name)
return
end
local meta = minetest.get_meta(pos)
if fields.channel then meta:set_string("channel",fields.channel) end
end,
digiline =
{
receptor = {},
effector = {
action = function(pos,node,channel,msg)
local meta = minetest.get_meta(pos)
if meta:get_string("channel") ~= channel then return end
if type(msg) ~= "string" then return end
http.fetch({
url = msg,
timeout = 5,
user_agent = "Minetest Digilines Modem",
},
function(res)
digiline:receptor_send(pos, digiline.rules.default, channel, res)
end)
end
},
},
})
minetest.register_craft({
output = "digistuff:nic",
recipe = {
{"","","mesecons:wire_00000000_off"},
{"digilines:wire_std_00000000","mesecons_luacontroller:luacontroller0000","mesecons:wire_00000000_off"}
}
})

64
digistuff/noteblock.lua Normal file
View File

@ -0,0 +1,64 @@
if not minetest.get_modpath("mesecons_noteblock") then
minetest.log("error","mesecons_noteblock is not installed - digilines noteblock will not be available!")
return
end
local validnbsounds = dofile(minetest.get_modpath(minetest.get_current_modname())..DIR_DELIM.."nbsounds.lua")
minetest.register_node("digistuff:noteblock", {
description = "Digilines Noteblock",
groups = {cracky=3},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec","field[channel;Channel;${channel}")
end,
on_destruct = function(pos)
local pos_hash = minetest.hash_node_position(pos)
if digistuff.sounds_playing[pos_hash] then
minetest.sound_stop(digistuff.sounds_playing[pos_hash])
digistuff.sounds_playing[pos_hash] = nil
end
end,
tiles = {
"mesecons_noteblock.png"
},
on_receive_fields = function(pos, formname, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
minetest.record_protection_violation(pos,name)
return
end
local meta = minetest.get_meta(pos)
if fields.channel then meta:set_string("channel",fields.channel) end
end,
digiline =
{
receptor = {},
effector = {
action = function(pos,node,channel,msg)
local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel")
if channel ~= setchan then return end
if msg == "get_sounds" then
local soundnames = {}
for i in pairs(validnbsounds) do
table.insert(soundnames,i)
end
digiline:receptor_send(pos, digiline.rules.default, channel, soundnames)
return
end
if type(msg) == "string" then
local sound = validnbsounds[msg]
if sound then minetest.sound_play(sound,{pos=pos}) end
elseif type(msg) == "table" then
if type(msg.sound) ~= "string" then return end
local sound = validnbsounds[msg.sound]
local volume = 1
if type(msg.volume) == "number" then
volume = math.max(0,math.min(1,msg.volume))
end
if sound then minetest.sound_play({name=sound,gain=volume},{pos=pos}) end
end
end
},
},
})

151
digistuff/panel.lua Normal file
View File

@ -0,0 +1,151 @@
digistuff.update_panel_formspec = function (pos,dispstr)
local meta = minetest.get_meta(pos)
local locked = meta:get_int("locked") == 1
local fs = "size[10,8]"..
"background[0,0;0,0;digistuff_panel_bg.png;true]"..
"label[0,0;%s]"..
(locked and "image_button[9,3;1,1;digistuff_panel_locked.png;unlock;]" or "image_button[9,3;1,1;digistuff_panel_unlocked.png;lock;]")..
"image_button[2,4.5;1,1;digistuff_adwaita_go-up.png;up;]"..
"image_button[1,5;1,1;digistuff_adwaita_go-previous.png;left;]"..
"image_button[3,5;1,1;digistuff_adwaita_go-next.png;right;]"..
"image_button[2,5.5;1,1;digistuff_adwaita_go-down.png;down;]"..
"image_button[1,6.5;1,1;digistuff_adwaita_edit-undo.png;back;]"..
"image_button[3,6.5;1,1;digistuff_adwaita_emblem-default.png;enter;]"..
"field[6,5.75;2,1;channel;Channel;${channel}]"..
"button[8,5.5;1,1;savechan;Set]"
fs = fs:format(minetest.formspec_escape(dispstr)):gsub("|","\n")
meta:set_string("formspec",fs)
meta:set_string("text",dispstr)
end
digistuff.panel_on_digiline_receive = function (pos, node, channel, msg)
local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel")
if channel ~= setchan then return end
if type(msg) ~= "string" then return end
digistuff.update_panel_formspec(pos,msg)
end
digistuff.panel_on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel")
local playername = sender:get_player_name()
local locked = meta:get_int("locked") == 1
local can_bypass = minetest.check_player_privs(playername,{protection_bypass=true})
local is_protected = minetest.is_protected(pos,playername)
if fields.savechan then
if can_bypass or not is_protected then
meta:set_string("channel",fields.channel)
local helpmsg = "Channel has been set. Waiting for data..."
digistuff.update_panel_formspec(pos,helpmsg)
else
minetest.record_protection_violation(pos,playername)
minetest.chat_send_player(playername,"You are not authorized to change the channel of this panel.")
end
elseif fields.up then
if can_bypass or not is_protected or not locked then
digiline:receptor_send(pos, digiline.rules.default, setchan, "up")
else
minetest.record_protection_violation(pos,playername)
minetest.chat_send_player(playername,"You are not authorized to use this panel.")
end
elseif fields.down then
if can_bypass or not is_protected or not locked then
digiline:receptor_send(pos, digiline.rules.default, setchan, "down")
else
minetest.record_protection_violation(pos,playername)
minetest.chat_send_player(playername,"You are not authorized to use this panel.")
end
elseif fields.left then
if can_bypass or not is_protected or not locked then
digiline:receptor_send(pos, digiline.rules.default, setchan, "left")
else
minetest.record_protection_violation(pos,playername)
minetest.chat_send_player(playername,"You are not authorized to use this panel.")
end
elseif fields.right then
if can_bypass or not is_protected or not locked then
digiline:receptor_send(pos, digiline.rules.default, setchan, "right")
else
minetest.record_protection_violation(pos,playername)
minetest.chat_send_player(playername,"You are not authorized to use this panel.")
end
elseif fields.back then
if can_bypass or not is_protected or not locked then
digiline:receptor_send(pos, digiline.rules.default, setchan, "back")
else
minetest.record_protection_violation(pos,playername)
minetest.chat_send_player(playername,"You are not authorized to use this panel.")
end
elseif fields.enter then
if can_bypass or not is_protected or not locked then
digiline:receptor_send(pos, digiline.rules.default, setchan, "enter")
else
minetest.record_protection_violation(pos,playername)
minetest.chat_send_player(playername,"You are not authorized to use this panel.")
end
elseif fields.lock then
if can_bypass or not is_protected then
meta:set_int("locked",1)
minetest.chat_send_player(playername,"This panel has been locked. Access will now be controlled according to area protection.")
digistuff.update_panel_formspec(pos,meta:get_string("text"))
else
minetest.record_protection_violation(pos,playername)
minetest.chat_send_player(playername,"You are not authorized to lock this panel.")
end
elseif fields.unlock then
if can_bypass or not is_protected then
meta:set_int("locked",0)
minetest.chat_send_player(playername,"This panel has been unlocked. It can now be used (but not locked or have the channel changed) by anyone.")
digistuff.update_panel_formspec(pos,meta:get_string("text"))
else
minetest.record_protection_violation(pos,playername)
minetest.chat_send_player(playername,"You are not authorized to unlock this panel.")
end
end
end
minetest.register_node("digistuff:panel", {
description = "Digilines Control Panel",
groups = {cracky=3},
on_construct = function(pos)
local helpmsg = "Please set a channel."
digistuff.update_panel_formspec(pos,helpmsg)
minetest.get_meta(pos):set_int("locked",0)
end,
drawtype = "nodebox",
tiles = {
"digistuff_panel_back.png",
"digistuff_panel_back.png",
"digistuff_panel_back.png",
"digistuff_panel_back.png",
"digistuff_panel_back.png",
"digistuff_panel_front.png"
},
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
}
},
on_receive_fields = digistuff.panel_on_receive_fields,
digiline =
{
receptor = {},
effector = {
action = digistuff.panel_on_digiline_receive
},
},
})
minetest.register_craft({
output = "digistuff:panel",
recipe = {
{"","digistuff:button",""},
{"digistuff:button","digilines:lcd","digistuff:button"},
{"","digistuff:button",""}
}
})

80
digistuff/piezo.lua Normal file
View File

@ -0,0 +1,80 @@
digistuff.sounds_playing = {}
minetest.register_node("digistuff:piezo", {
description = "Digilines Piezoelectric Beeper",
groups = {cracky=3},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec","field[channel;Channel;${channel}")
end,
on_destruct = function(pos)
local pos_hash = minetest.hash_node_position(pos)
if digistuff.sounds_playing[pos_hash] then
minetest.sound_stop(digistuff.sounds_playing[pos_hash])
digistuff.sounds_playing[pos_hash] = nil
end
end,
tiles = {
"digistuff_piezo_top.png",
"digistuff_piezo_sides.png",
"digistuff_piezo_sides.png",
"digistuff_piezo_sides.png",
"digistuff_piezo_sides.png",
"digistuff_piezo_sides.png"
},
on_receive_fields = function(pos, formname, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
minetest.record_protection_violation(pos,name)
return
end
local meta = minetest.get_meta(pos)
if fields.channel then meta:set_string("channel",fields.channel) end
end,
digiline =
{
receptor = {},
effector = {
action = function(pos,node,channel,msg)
local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel")
if channel ~= setchan then return end
if msg == "shortbeep" then
local pos_hash = minetest.hash_node_position(pos)
if digistuff.sounds_playing[pos_hash] then
minetest.sound_stop(digistuff.sounds_playing[pos_hash])
digistuff.sounds_playing[pos_hash] = nil
end
minetest.sound_play({name = "digistuff_piezo_short_single",gain = 0.2},{pos = pos,max_hear_distance = 16})
elseif msg == "longbeep" then
local pos_hash = minetest.hash_node_position(pos)
if digistuff.sounds_playing[pos_hash] then
minetest.sound_stop(digistuff.sounds_playing[pos_hash])
digistuff.sounds_playing[pos_hash] = nil
end
minetest.sound_play({name = "digistuff_piezo_long_single",gain = 0.2},{pos = pos,max_hear_distance = 16})
elseif msg == "fastrepeat" then
local pos_hash = minetest.hash_node_position(pos)
if digistuff.sounds_playing[pos_hash] then
minetest.sound_stop(digistuff.sounds_playing[pos_hash])
digistuff.sounds_playing[pos_hash] = nil
end
digistuff.sounds_playing[pos_hash] = minetest.sound_play({name = "digistuff_piezo_fast_repeat",gain = 0.2},{pos = pos,max_hear_distance = 16,loop = true})
elseif msg == "slowrepeat" then
local pos_hash = minetest.hash_node_position(pos)
if digistuff.sounds_playing[pos_hash] then
minetest.sound_stop(digistuff.sounds_playing[pos_hash])
digistuff.sounds_playing[pos_hash] = nil
end
digistuff.sounds_playing[pos_hash] = minetest.sound_play({name = "digistuff_piezo_slow_repeat",gain = 0.2},{pos = pos,max_hear_distance = 16,loop = true})
elseif msg == "stop" then
local pos_hash = minetest.hash_node_position(pos)
if digistuff.sounds_playing[pos_hash] then
minetest.sound_stop(digistuff.sounds_playing[pos_hash])
digistuff.sounds_playing[pos_hash] = nil
end
end
end
},
},
})

222
digistuff/piston.lua Normal file
View File

@ -0,0 +1,222 @@
if not minetest.get_modpath("mesecons_mvps") then
minetest.log("error","mesecons_mvps is not installed - digilines piston will not be available!")
return
end
local function extend(pos,node,max)
local meta = minetest.get_meta(pos):to_table()
local facedir = minetest.facedir_to_dir(node.param2)
local actiondir = vector.multiply(facedir,-1)
local ppos = vector.add(pos,actiondir)
local success,stack,oldstack = mesecon.mvps_push(ppos,actiondir,max)
if not success then return end
minetest.sound_play("digistuff_piston_extend",{pos = pos,max_hear_distance = 20,gain = 0.6})
minetest.swap_node(pos,{name = "digistuff:piston_ext",param2 = node.param2})
minetest.swap_node(ppos,{name = "digistuff:piston_pusher",param2 = node.param2})
mesecon.mvps_process_stack(stack)
mesecon.mvps_move_objects(ppos,actiondir,oldstack)
minetest.get_meta(pos):from_table(meta)
end
local function retract(pos,node,max,allsticky)
local facedir = minetest.facedir_to_dir(node.param2)
local actiondir = vector.multiply(facedir,-1)
local ppos = vector.add(pos,actiondir)
minetest.swap_node(pos,{name = "digistuff:piston",param2 = node.param2})
if minetest.get_node(ppos).name == "digistuff:piston_pusher" then
minetest.remove_node(ppos)
end
minetest.sound_play("digistuff_piston_retract",{pos = pos,max_hear_distance = 20,gain = 0.6})
minetest.check_for_falling(ppos)
if type(max) ~= "number" or max <= 0 then return end
local pullpos = vector.add(pos,vector.multiply(actiondir,2))
local success,stack,oldstack
if allsticky then
success,stack,oldstack = mesecon.mvps_pull_all(pullpos,facedir,max)
else
success,stack,oldstack = mesecon.mvps_pull_single(pullpos,facedir,max)
end
if success then
mesecon.mvps_move_objects(pullpos,actiondir,oldstack,-1)
end
end
minetest.register_node("digistuff:piston", {
description = "Digilines Piston",
groups = {cracky=3},
paramtype2 = "facedir",
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec","field[channel;Channel;${channel}")
end,
tiles = {
"digistuff_piston_sides.png^[transformR180",
"digistuff_piston_sides.png",
"digistuff_piston_sides.png^[transformR90",
"digistuff_piston_sides.png^[transformR270",
"digistuff_camera_pole.png",
"digistuff_camera_pole.png",
},
on_receive_fields = function(pos, formname, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
minetest.record_protection_violation(pos,name)
return
end
local meta = minetest.get_meta(pos)
if fields.channel then meta:set_string("channel",fields.channel) end
end,
digiline = {
wire = {
rules = {
{x = 1, y = 0, z = 0},
{x =-1, y = 0, z = 0},
{x = 0, y = 1, z = 0},
{x = 0, y =-1, z = 0},
{x = 0, y = 0, z = 1},
{x = 0, y = 0, z =-1},
},
},
receptor = {},
effector = {
action = function(pos,node,channel,msg)
local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel")
if channel ~= setchan then return end
if msg == "extend" then
extend(pos,node,16)
elseif type(msg) == "table" and msg.action == "extend" then
local max = 16
if type(msg.max) == "number" then
max = math.max(0,math.min(16,math.floor(msg.max)))
end
extend(pos,node,max)
end
end
},
},
})
minetest.register_node("digistuff:piston_ext", {
description = "Digilines Piston (extended state - you hacker you!)",
groups = {cracky = 3,not_in_creative_inventory = 1},
paramtype2 = "facedir",
tiles = {
"digistuff_piston_sides.png^[transformR180",
"digistuff_piston_sides.png",
"digistuff_piston_sides.png^[transformR90",
"digistuff_piston_sides.png^[transformR270",
"digistuff_camera_pole.png",
"digistuff_camera_pole.png",
},
drop = "digistuff:piston",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.3,0.5,0.5,0.5},
{-0.2,-0.2,-0.5,0.2,0.2,-0.3},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-1.5,0.5,0.5,0.5},
}
},
on_rotate = function() return false end,
on_receive_fields = function(pos, formname, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
minetest.record_protection_violation(pos,name)
return
end
local meta = minetest.get_meta(pos)
if fields.channel then meta:set_string("channel",fields.channel) end
end,
after_dig_node = function(pos,node)
local pdir = vector.multiply(minetest.facedir_to_dir(node.param2),-1)
local ppos = vector.add(pos,pdir)
if minetest.get_node(ppos).name == "digistuff:piston_pusher" then
minetest.remove_node(ppos)
end
end,
digiline = {
wire = {
rules = {
{x = 1, y = 0, z = 0},
{x =-1, y = 0, z = 0},
{x = 0, y = 1, z = 0},
{x = 0, y =-1, z = 0},
{x = 0, y = 0, z = 1},
{x = 0, y = 0, z =-1},
},
},
receptor = {},
effector = {
action = function(pos,node,channel,msg)
local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel")
if channel ~= setchan then return end
if msg == "retract" then
retract(pos,node)
elseif msg == "retract_sticky" then
retract(pos,node,16)
elseif type(msg) == "table" and msg.action == "retract" then
local max = 16
if type(msg.max) == "number" then
max = math.max(0,math.min(16,math.floor(msg.max)))
elseif msg.max == nil then
max = 0
end
retract(pos,node,max,msg.allsticky)
end
end
},
},
})
minetest.register_node("digistuff:piston_pusher", {
description = "Digilines Piston Pusher (you hacker you!)",
groups = {not_in_creative_inventory=1},
paramtype = "light",
sunlight_propagates = true,
paramtype2 = "facedir",
tiles = {
"digistuff_piston_sides.png^[transformR180",
"digistuff_piston_sides.png",
"digistuff_piston_sides.png^[transformR90",
"digistuff_piston_sides.png^[transformR270",
"digistuff_camera_pole.png",
"digistuff_camera_pole.png",
},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.5,-0.3},
{-0.2,-0.2,-0.3,0.2,0.2,0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{0,0,0,0,0,0},
}
},
digiline = {
wire = {
rules = {
{x = 1, y = 0, z = 0},
{x =-1, y = 0, z = 0},
{x = 0, y = 1, z = 0},
{x = 0, y =-1, z = 0},
{x = 0, y = 0, z = 1},
{x = 0, y = 0, z =-1},
},
},
},
})
mesecon.register_mvps_stopper("digistuff:piston_ext")
mesecon.register_mvps_stopper("digistuff:piston_pusher")

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

279
digistuff/touchscreen.lua Normal file
View File

@ -0,0 +1,279 @@
digistuff.update_ts_formspec = function (pos)
local meta = minetest.get_meta(pos)
local fs = "size[10,8]"..
"background[0,0;0,0;digistuff_ts_bg.png;true]"
if meta:get_int("init") == 0 then
fs = fs.."field[3.75,3;3,1;channel;Channel;]"..
"button_exit[4,3.75;2,1;save;Save]"
else
local data = minetest.deserialize(meta:get_string("data")) or {}
for _,field in pairs(data) do
if field.type == "image" then
fs = fs..string.format("image[%s,%s;%s,%s;%s]",field.X,field.Y,field.W,field.H,field.texture_name)
elseif field.type == "field" then
fs = fs..string.format("field[%s,%s;%s,%s;%s;%s;%s]",field.X,field.Y,field.W,field.H,field.name,field.label,field.default)
elseif field.type == "pwdfield" then
fs = fs..string.format("pwdfield[%s,%s;%s,%s;%s;%s]",field.X,field.Y,field.W,field.H,field.name,field.label)
elseif field.type == "textarea" then
fs = fs..string.format("textarea[%s,%s;%s,%s;%s;%s;%s]",field.X,field.Y,field.W,field.H,field.name,field.label,field.default)
elseif field.type == "label" then
fs = fs..string.format("label[%s,%s;%s]",field.X,field.Y,field.label)
elseif field.type == "vertlabel" then
fs = fs..string.format("vertlabel[%s,%s;%s]",field.X,field.Y,field.label)
elseif field.type == "button" then
fs = fs..string.format("button[%s,%s;%s,%s;%s;%s]",field.X,field.Y,field.W,field.H,field.name,field.label)
elseif field.type == "button_exit" then
fs = fs..string.format("button_exit[%s,%s;%s,%s;%s;%s]",field.X,field.Y,field.W,field.H,field.name,field.label)
elseif field.type == "image_button" then
fs = fs..string.format("image_button[%s,%s;%s,%s;%s;%s;%s]",field.X,field.Y,field.W,field.H,field.image,field.name,field.label)
elseif field.type == "image_button_exit" then
fs = fs..string.format("image_button_exit[%s,%s;%s,%s;%s;%s;%s]",field.X,field.Y,field.W,field.H,field.image,field.name,field.label)
elseif field.type == "dropdown" then
local choices = ""
for _,i in ipairs(field.choices) do
if type(i) == "string" then
choices = choices..minetest.formspec_escape(i)..","
end
end
choices = string.sub(choices,1,-2)
fs = fs..string.format("dropdown[%s,%s;%s,%s;%s;%s;%s]",field.X,field.Y,field.W,field.H,field.name,choices,field.selected_id)
end
end
end
meta:set_string("formspec",fs)
end
digistuff.ts_on_receive_fields = function (pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel")
local playername = sender:get_player_name()
local locked = meta:get_int("locked") == 1
local can_bypass = minetest.check_player_privs(playername,{protection_bypass=true})
local is_protected = minetest.is_protected(pos,playername)
if (locked and is_protected) and not can_bypass then
minetest.record_protection_violation(pos,playername)
minetest.chat_send_player(playername,"You are not authorized to use this screen.")
return
end
local init = meta:get_int("init") == 1
if not init then
if fields.save then
meta:set_string("channel",fields.channel)
meta:set_int("init",1)
digistuff.update_ts_formspec(pos)
end
else
fields.clicker = sender:get_player_name()
digiline:receptor_send(pos, digiline.rules.default, setchan, fields)
end
end
digistuff.process_command = function (meta, data, msg)
if msg.command == "clear" then
data = {}
elseif msg.command == "addimage" then
for _,i in pairs({"X","Y","W","H"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
if not msg.texture_name or type(msg.texture_name) ~= "string" then
return
end
local field = {type="image",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,texture_name=minetest.formspec_escape(msg.texture_name)}
table.insert(data,field)
elseif msg.command == "addfield" then
for _,i in pairs({"X","Y","W","H"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
for _,i in pairs({"name","label","default"}) do
if not msg[i] or type(msg[i]) ~= "string" then
return
end
end
local field = {type="field",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,name=minetest.formspec_escape(msg.name),label=minetest.formspec_escape(msg.label),default=minetest.formspec_escape(msg.default)}
table.insert(data,field)
elseif msg.command == "addpwdfield" then
for _,i in pairs({"X","Y","W","H"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
for _,i in pairs({"name","label"}) do
if not msg[i] or type(msg[i]) ~= "string" then
return
end
end
local field = {type="pwdfield",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,name=minetest.formspec_escape(msg.name),label=minetest.formspec_escape(msg.label)}
table.insert(data,field)
elseif msg.command == "addtextarea" then
for _,i in pairs({"X","Y","W","H"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
for _,i in pairs({"name","label","default"}) do
if not msg[i] or type(msg[i]) ~= "string" then
return
end
end
local field = {type="textarea",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,name=minetest.formspec_escape(msg.name),label=minetest.formspec_escape(msg.label),default=minetest.formspec_escape(msg.default)}
table.insert(data,field)
elseif msg.command == "addlabel" then
for _,i in pairs({"X","Y"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
if not msg.label or type(msg.label) ~= "string" then
return
end
local field = {type="label",X=msg.X,Y=msg.Y,label=minetest.formspec_escape(msg.label)}
table.insert(data,field)
elseif msg.command == "addvertlabel" then
for _,i in pairs({"X","Y"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
if not msg.label or type(msg.label) ~= "string" then
return
end
local field = {type="vertlabel",X=msg.X,Y=msg.Y,label=minetest.formspec_escape(msg.label)}
table.insert(data,field)
elseif msg.command == "addbutton" then
for _,i in pairs({"X","Y","W","H"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
for _,i in pairs({"name","label"}) do
if not msg[i] or type(msg[i]) ~= "string" then
return
end
end
local field = {type="button",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,name=minetest.formspec_escape(msg.name),label=minetest.formspec_escape(msg.label)}
table.insert(data,field)
elseif msg.command == "addbutton_exit" then
for _,i in pairs({"X","Y","W","H"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
for _,i in pairs({"name","label"}) do
if not msg[i] or type(msg[i]) ~= "string" then
return
end
end
local field = {type="button_exit",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,name=minetest.formspec_escape(msg.name),label=minetest.formspec_escape(msg.label)}
table.insert(data,field)
elseif msg.command == "addimage_button" then
for _,i in pairs({"X","Y","W","H"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
for _,i in pairs({"image","name","label"}) do
if not msg[i] or type(msg[i]) ~= "string" then
return
end
end
local field = {type="image_button",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,image=minetest.formspec_escape(msg.image),name=minetest.formspec_escape(msg.name),label=minetest.formspec_escape(msg.label)}
table.insert(data,field)
elseif msg.command == "addimage_button_exit" then
for _,i in pairs({"X","Y","W","H"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
for _,i in pairs({"image","name","label"}) do
if not msg[i] or type(msg[i]) ~= "string" then
return
end
end
local field = {type="image_button_exit",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,image=minetest.formspec_escape(msg.image),name=minetest.formspec_escape(msg.name),label=minetest.formspec_escape(msg.label)}
table.insert(data,field)
elseif msg.command == "adddropdown" then
for _,i in pairs({"X","Y","W","H","selected_id"}) do
if not msg[i] or type(msg[i]) ~= "number" then
return
end
end
if not msg.name or type(msg.name) ~= "string" then
return
end
if not msg.choices or type(msg.choices) ~= "table" or #msg.choices < 1 then
return
end
local field = {type="dropdown",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,name=msg.name,selected_id=msg.selected_id,choices=msg.choices}
table.insert(data,field)
elseif msg.command == "lock" then
meta:set_int("locked",1)
elseif msg.command == "unlock" then
meta:set_int("locked",0)
end
return data
end
digistuff.ts_on_digiline_receive = function (pos, node, channel, msg)
local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel")
if channel ~= setchan then return end
if type(msg) ~= "table" then return end
local data = minetest.deserialize(meta:get_string("data")) or {}
if msg.command then
data = digistuff.process_command(meta,data,msg)
else
for _,i in ipairs(msg) do
if i.command then
data = digistuff.process_command(meta,data,i) or data
end
end
end
meta:set_string("data",minetest.serialize(data))
digistuff.update_ts_formspec(pos)
end
minetest.register_node("digistuff:touchscreen", {
description = "Digilines Touchscreen",
groups = {cracky=3},
on_construct = function(pos)
digistuff.update_ts_formspec(pos,true)
end,
drawtype = "nodebox",
tiles = {
"digistuff_panel_back.png",
"digistuff_panel_back.png",
"digistuff_panel_back.png",
"digistuff_panel_back.png",
"digistuff_panel_back.png",
"digistuff_ts_front.png"
},
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
}
},
on_receive_fields = digistuff.ts_on_receive_fields,
digiline =
{
receptor = {},
effector = {
action = digistuff.ts_on_digiline_receive
},
},
})
minetest.register_craft({
output = "digistuff:touchscreen",
recipe = {
{"mesecons_luacontroller:luacontroller0000","default:glass","default:glass"},
{"default:glass","digilines:lcd","default:glass"},
{"default:glass","default:glass","default:glass"}
}
})

View File

@ -57,12 +57,6 @@ if minetest.get_modpath("moreblocks") then
tiles={"technic_stainless_steel_block.png"},
})
stairsplus:register_all("technic", "brass_block", "basic_materials:brass_block", {
description=S("Brass Block"),
groups={cracky=1, not_in_creative_inventory=1},
tiles={"basic_materials_brass_block.png"},
})
function register_technic_stairs_alias(modname, origname, newmod, newname)
minetest.register_alias(modname .. ":slab_" .. origname, newmod..":slab_" .. newname)
minetest.register_alias(modname .. ":slab_" .. origname .. "_inverted", newmod..":slab_" .. newname .. "_inverted")
@ -199,7 +193,6 @@ end
minetest.register_node(":technic:insulator_clip", iclip_def)
minetest.register_node(":technic:insulator_clip_fencepost", iclipfence_def)
minetest.register_node(":technic:steel_strut_with_insulator_clip", sclip_def)
minetest.register_craft({
output = "technic:insulator_clip",
@ -221,33 +214,35 @@ minetest.register_craft({
local steelmod = minetest.get_modpath("steel")
if steelmod then
minetest.register_craft({
output = "technic:steel_strut_with_insulator_clip",
recipe = {
{"technic:insulator_clip_fencepost"},
{"steel:strut_mount"}
}
})
if streetsmod or steelmod then
minetest.register_node(":technic:steel_strut_with_insulator_clip", sclip_def)
minetest.register_craft({
output = "technic:steel_strut_with_insulator_clip",
recipe = {
{"technic:insulator_clip_fencepost", "" },
{"steel:strut", "default:steel_ingot" },
}
})
if steelmod then
minetest.register_craft({
output = "technic:steel_strut_with_insulator_clip",
recipe = {
{"technic:insulator_clip_fencepost"},
{"steel:strut_mount"}
}
})
end
minetest.register_craft({
output = "technic:steel_strut_with_insulator_clip",
recipe = {
{"technic:insulator_clip_fencepost", "" },
{"steel:strut", "default:steel_ingot" },
}
})
if streetsmod then
minetest.register_craft({
output = "technic:steel_strut_with_insulator_clip",
recipe = {
{"technic:insulator_clip_fencepost", "" },
{"streets:steel_support", "default:steel_ingot" },
}
})
elseif streetsmod then
minetest.register_craft({
output = "technic:steel_strut_with_insulator_clip",
recipe = {
{"technic:insulator_clip_fencepost", "" },
{"streets:steel_support", "default:steel_ingot" },
}
})
end
end
if minetest.get_modpath("unifieddyes") then

View File

@ -441,14 +441,6 @@ if minetest.get_modpath("moreblocks") then
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "cement", "basic_materials:cement_block", {
description = S("Cement"),
tiles = {"basic_materials_cement_block.png"},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "pavement", "gloopblocks:pavement", {
description = S("Pavement"),
tiles = {"gloopblocks_pavement.png"},

View File

@ -1541,7 +1541,7 @@ minetest.register_craft( {
recipe = {
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:ic" },
{ "default:steel_ingot", "bucket:bucket_water", "default:steel_ingot" },
{ "default:steel_ingot", "technic:motor", "default:steel_ingot" }
{ "default:steel_ingot", "basic_materials:motor", "default:steel_ingot" }
},
})
@ -1558,7 +1558,7 @@ minetest.register_craft( {
output = "homedecor:dryer",
recipe = {
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:ic" },
{ "default:steel_ingot", "bucket:bucket_empty", "technic:motor" },
{ "default:steel_ingot", "bucket:bucket_empty", "basic_materials:motor" },
{ "default:steel_ingot", "basic_materials:heating_element", "default:steel_ingot" }
},
})
@ -1587,7 +1587,7 @@ minetest.register_craft( {
output = "homedecor:dishwasher",
recipe = {
{ "basic_materials:ic", "homedecor:fence_chainlink", "default:steel_ingot", },
{ "default:steel_ingot", "homedecor:shower_head", "technic:motor" },
{ "default:steel_ingot", "homedecor:shower_head", "basic_materials:motor" },
{ "default:steel_ingot", "basic_materials:heating_element", "bucket:bucket_water" }
},
})
@ -1888,8 +1888,8 @@ minetest.register_craft({
output = "homedecor:air_conditioner",
recipe = {
{ "default:steel_ingot", "building_blocks:grate", "default:steel_ingot" },
{ "default:steel_ingot", "technic:motor", "default:steel_ingot" },
{ "default:steel_ingot", "technic:motor", "default:steel_ingot" },
{ "default:steel_ingot", "basic_materials:motor", "default:steel_ingot" },
{ "default:steel_ingot", "basic_materials:motor", "default:steel_ingot" },
},
})
@ -1905,7 +1905,7 @@ minetest.register_craft({
minetest.register_craft({
output = "homedecor:ceiling_fan",
recipe = {
{ "technic:motor" },
{ "basic_materials:motor" },
{ "homedecor:fan_blades" },
{ "homedecor:glowlight_small_cube" }
}
@ -1989,7 +1989,7 @@ minetest.register_craft({
output = "homedecor:dvd_player 2",
recipe = {
{ "", "basic_materials:plastic_sheet", "" },
{ "default:obsidian_glass", "technic:motor", "technic:motor" },
{ "default:obsidian_glass", "basic_materials:motor", "basic_materials:motor" },
{ "default:mese_crystal_fragment", "basic_materials:ic", "basic_materials:energy_crystal_simple" },
},
})

View File

@ -7,14 +7,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
## [1.2.0] - 2018-11-24
### Added
- Stairs+ nodes for `basic_materials`'s concrete, cement and brass blocks.
- Listring add for circular saw.
- Stairs+: New API function:
`stairsplus:register_custom_subset(subset, modname, subname, recipeitem, fields)`
- **Stairs+:** New API function
`stairsplus:register_custom_subset(subset, modname, subname, recipeitem, fields)`.
### Fixed
- The papyrus crafting recipe override is now properly applied over the
`default` mod's recipe.
- Centered wooden tiles are now craftable.
- Wool Stairs+ nodes can no longer be used in crafting.
- The circular saw can no longer replace items from the player's inventory
when it is full.
@ -52,5 +58,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Initial versioned release.
[Unreleased]: https://github.com/minetest-mods/moreblocks/compare/v1.1.0...HEAD
[Unreleased]: https://github.com/minetest-mods/moreblocks/compare/v1.2.0...HEAD
[1.2.0]: https://github.com/minetest-mods/moreblocks/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/minetest-mods/moreblocks/compare/v1.0.0...v1.1.0

View File

@ -1,6 +1,6 @@
# zlib license
Copyright (c) 2011-2017 Hugo Locurcio and contributors
Copyright (c) 2011-2018 Hugo Locurcio and contributors
**This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.**

View File

@ -65,7 +65,7 @@ versions than 0.4.16 will generally not be fixed.
## License
Copyright © 2011-2017 Hugo Locurcio and contributors
Copyright © 2011-2018 Hugo Locurcio and contributors
- More Blocks code is licensed under the zlib license, see
[`LICENSE.md`](LICENSE.md) for details.

View File

@ -1,7 +1,7 @@
--[[
More Blocks: alias definitions
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: circular saw
Copyright (c) 2011-2017 Hugo Locurcio, Sokomine and contributors.
Copyright (c) 2011-2018 Hugo Locurcio, Sokomine and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: configuration handling
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: crafting recipes
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -3,3 +3,4 @@ intllib?
stairs?
farming?
wool?
basic_materials?

View File

@ -3,7 +3,7 @@
** More Blocks **
By Calinou, with the help of ShadowNinja and VanessaE.
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
=====================================================================
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: node definitions
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: ownership handling
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: redefinitions of default stuff
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: alias definitions
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: conversion
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: Stairs+
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: microblock definitions
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: panel definitions
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: Stairs+
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]
@ -440,4 +440,4 @@ stairsplus.register_recipes = function(category, alternate, modname, subname, re
})
end
end
end
end

View File

@ -1,7 +1,7 @@
--[[
More Blocks: registrations
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]
@ -112,6 +112,36 @@ if minetest.get_modpath("wool") then
end
end
-- basic_materials, keeping the original other-mod-oriented names
-- for backwards compatibility
if minetest.get_modpath("basic_materials") then
stairsplus:register_all("technic","concrete","basic_materials:concrete_block",{
description = "Concrete",
tiles = {"basic_materials_concrete_block.png",},
groups = {cracky=1, level=2, concrete=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_alias("prefab:concrete_stair","technic:stair_concrete")
minetest.register_alias("prefab:concrete_slab","technic:slab_concrete")
stairsplus:register_all("gloopblocks", "cement", "basic_materials:cement_block", {
description = "Cement",
tiles = {"basic_materials_cement_block.png"},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("technic", "brass_block", "basic_materials:brass_block", {
description="Brass Block",
groups={cracky=1, not_in_creative_inventory=1},
tiles={"basic_materials_brass_block.png"},
})
end
-- Alias cuts of split_stone_tile_alt which was renamed checker_stone_tile.
stairsplus:register_alias_all("moreblocks", "split_stone_tile_alt", "moreblocks", "checker_stone_tile")

View File

@ -1,7 +1,7 @@
--[[
More Blocks: slab definitions
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: slope definitions
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -1,7 +1,7 @@
--[[
More Blocks: stair definitions
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Copyright (c) 2011-2018 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

View File

@ -122,7 +122,7 @@ end
-- when they are updated.
function pipeworks.on_rotate(pos, node, user, mode, new_param2)
node.param2 = new_param2
minetest.set_node(pos, node)
minetest.swap_node(pos, node)
pipeworks.scan_for_tube_objects(pos)
return true
end

View File

@ -1,4 +1,3 @@
default
doors
basic_materials
moreblocks

View File

@ -5,8 +5,6 @@
minetest.register_alias("prefab:concrete","technic:concrete")
minetest.register_alias("prefab:concrete_wall","prefab_redo:concrete_wall")
minetest.register_alias("prefab:concrete_with_grass","prefab_redo:concrete_with_grass")
minetest.register_alias("prefab:concrete_stair","technic:stair_concrete")
minetest.register_alias("prefab:concrete_slab","technic:slab_concrete")
minetest.register_alias("prefab:concrete_ladder","prefab_redo:concrete_ladder")
minetest.register_alias("prefab:concrete_door_a","doors:door_concrete_a")
minetest.register_alias("prefab:concrete_door_b","doors:door_concrete_b")
@ -17,26 +15,6 @@ minetest.register_alias("prefab:concrete_railing_corner","prefab_redo:concrete_r
minetest.register_alias("prefab:concrete_catwalk","prefab_redo:concrete_catwalk")
minetest.register_alias("prefab:concrete_bench","prefab_redo:concrete_bench")
stairsplus:register_all("technic","concrete","basic_materials:concrete_block",{
description = "Concrete",
tiles = {"basic_materials_concrete_block.png",},
groups = {cracky=1, level=2, concrete=1},
sounds = default.node_sound_stone_defaults(),
})
stairsplus:register_all("technic","blast_resistant_concrete","technic:blast_resistant_concrete",{
description = "Blast-resistant Concrete",
tiles = {"technic_blast_resistant_concrete_block.png",},
groups = {cracky=1, level=3, concrete=1},
sounds = default.node_sound_stone_defaults(),
on_blast = function(pos, intensity)
if intensity > 1 then
minetest.remove_node(pos)
minetest.add_item(pos, "technic:blast_resistant_concrete")
end
end,
})
minetest.register_node("prefab_redo:concrete_with_grass", {
description = "Concrete with Grass",
sounds = default.node_sound_glass_defaults(),

View File

@ -44,6 +44,12 @@ minetest.clear_craft({
output = "basic_materials:brass_ingot",
})
minetest.register_craft( {
type = "shapeless",
output = "basic_materials:brass_ingot 9",
recipe = { "basic_materials:brass_block" },
})
-- tubes crafting recipes
minetest.register_craft({

View File

@ -67,7 +67,6 @@ Disabled =
%s Alloy Furnace = %s Legierungsofen
%s Battery Box = %s Batteriebox
%s Cable = %s Kabel
%s CNC Machine = %s CNC-Maschine
%s Compressor = %s Kompressor
%s Extractor = %s Extraktor
%s Forcefield Emitter = %s Kraftfeld-Emitter
@ -121,41 +120,6 @@ Digging finished =
Digging %d m above machine =
Digging %d m below machine =
## CNC
Cylinder = Zylinder
Element Cross = Halbes Kreuzelement
Element Cross Double = Kreuzelement
Element Edge = Halbes Eckelement
Element Edge Double = Eckelement
Element End = Halbes Endelement
Element End Double = Endelement
Element Straight = Halbes aufrechtes Element
Element Straight Double = Aufrechtes Element
Element T = Halbes T-Element
Element T Double = T-Element
Horizontal Cylinder = Liegender Zylinder
One Curved Edge Block = Block mit einer abgerundeten Kante
Pyramid = Pyramide
Slope = Schraege
Slope Edge = Schraege mit Ecke
Slope Inner Edge = Schraege mit Innenecke
Slope Lying = Liegende Schraege
Slope Upside Down = Umgedrehte Schraege
Slope Upside Down Edge = Umgedrehte Schraege mit Ecke
Slope Upside Down Inner Edge = Umgedrehte Schraege mit Innenecke
Sphere = Kugel
Spike = Spitze
Stick = Stange
Two Curved Edge Block = Block mit zwei abgerundeten Kanten
Brick = Ziegel:
Cobble = Pflasterstein:
Dirt = Erde:
Leaves = Laub:
Sandstone = Sandstein:
Stone = Stein:
Tree = Baumstamm:
Wooden = Holz:
## Grinder Recipes
# $1: Name
%s Dust = %sstaub

View File

@ -63,7 +63,6 @@ Disabled =
%s Alloy Furnace = Horno de Aleacion %s
%s Battery Box = Caja de Bateria %s
%s Cable = Cable %s
%s CNC Machine = Maquina CNC %s
%s Compressor = Compresor %s
%s Extractor = Extractor %s
%s Forcefield Emitter = Emisor de Campo de Fuerza %s
@ -115,40 +114,6 @@ Digging finished =
Digging %d m above machine =
Digging %d m below machine =
## CNC Machine
Element Edge = Elemento Borde
Tree = Arbol
Element Cross Double = Elemento Cruz Doble
Spike = Pica
Element Edge Double = Elemento Borde Doble
Two Curved Edge Block = Dos Bloques de Borde Curvados
Pyramid = Piramide
Slope Upside Down Inner Edge = Borde Interno de Rampa Al Reves
Slope Upside Down Edge = Borde de Rampa Al Reves
Element Straight Double = Elemento Doble Recto
Sphere = Esfera
Element End Double = Doble Fin de Elemento
Element Straight = Recta de Elemento
Horizontal Cylinder = Cilindro Horizontal
Slope Inner Edge = Borde Interno de Rampa
One Curved Edge Block = Un Bloque de Borde Curvado
Element Cross = Cruce de Elementos
Stick = Varita
Element End = Fin de Elemento
Slope Lying = Rampa en Reposo
Slope Upside Down = Rampa Al Reves
Slope Edge = Borde de Rampa
Slope = Rampa
Element T = Elemento T
Cylinder = Cilindro
Cobble = Adoquines
Stone = Piedra
Brick = Ladrillo
Dirt = Tierra
Sandstone = Arenisca
Wooden = Madera
Leaves = Hojas
## Grinder Recipes
# $1: Name
%s Dust = Polvo de %s

View File

@ -64,7 +64,6 @@ Disabled = Disabilitato
%s Alloy Furnace = %s Fornace per leghe
%s Battery Box = %s Box batterie
%s Cable = Cavo %s
%s CNC Machine = Tornio CNC %s
%s Compressor = Compressore %s
%s Extractor = Estrattore %s
%s Forcefield Emitter = Emettitore di campo di forza %s
@ -118,41 +117,6 @@ Digging finished = Scavo finito
Digging %d m above machine = Scavo di %d m sopra la macchina
Digging %d m below machine = Scavo di %d m sotto la macchina
## CNC
Cylinder = Cilindro
Element Cross = Elemento a croce
Element Cross Double = Elemento a croce doppio
Element Edge = Elemento bordo
Element Edge Double = Elemento bordo doppio
Element End = Elemento finale
Element End Double = Elemento finale doppio
Element Straight = Elemento dritto
Element Straight Double = Elemento dritto doppio
Element T = Elemento a T
Element T Double = Elemento a T doppio
Horizontal Cylinder = Cilindro orizzontale
One Curved Edge Block = Blocco con bordo curvo
Pyramid = Piramide
Slope = Inclinato
Slope Edge = Bordo inclinato
Slope Inner Edge = Bordo interno inclinato
Slope Lying = Pendenza bugiarda
Slope Upside Down = Pendenza capovolta
Slope Upside Down Edge = Bordo inclinato capovolto
Slope Upside Down Inner Edge = Bordo interno inclinato capovolto
Sphere = Sfera
Spike = Spuntone
Stick = Bastone
Two Curved Edge Block = Blocco con bordo a doppia curva
Brick = Mattone
Cobble = Ciottolato
Dirt = Terra
Leaves = Foglie
Sandstone = Arenaria
Stone = Pietra
Tree = Albero
Wooden = Legno
## Grinder Recipes
# $1: Name
%s Dust = Polvere di %s

View File

@ -71,7 +71,6 @@ Disabled =
%s Alloy Furnace =
%s Battery Box =
%s Cable =
%s CNC Machine =
%s Centrifuge =
%s Compressor =
%s Extractor =
@ -127,40 +126,6 @@ Digging %d m above machine =
Digging %d m below machine =
@1 (@2 @3 -> @4 @5) =
## CNC
Cylinder =
Element Cross =
Element Cross Double =
Element Edge =
Element Edge Double =
Element End =
Element End Double =
Element Straight =
Element Straight Double =
Element T =
Element T Double =
Horizontal Cylinder =
One Curved Edge Block =
Pyramid =
Slope =
Slope Edge =
Slope Inner Edge =
Slope Lying =
Slope Upside Down =
Slope Upside Down Edge =
Slope Upside Down Inner Edge =
Sphere =
Spike =
Stick =
Two Curved Edge Block =
Brick =
Cobble =
Dirt =
Leaves =
Sandstone =
Stone =
Tree =
Wooden =
## Grinder Recipes
# $1: Name

View File

@ -1,91 +0,0 @@
-- REGISTER MATERIALS AND PROPERTIES FOR NONCUBIC ELEMENTS:
-----------------------------------------------------------
local S = technic.getter
-- DIRT
-------
technic.cnc.register_all("default:dirt",
{snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
{"default_grass.png", "default_dirt.png", "default_grass.png"},
S("Dirt"))
-- WOOD
-------
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"))
-- STONE
--------
technic.cnc.register_all("default:stone",
{cracky=3, not_in_creative_inventory=1},
{"default_stone.png"},
S("Stone"))
-- COBBLE
---------
technic.cnc.register_all("default:cobble",
{cracky=3, not_in_creative_inventory=1},
{"default_cobble.png"},
S("Cobble"))
-- BRICK
--------
technic.cnc.register_all("default:brick",
{cracky=3, not_in_creative_inventory=1},
{"default_brick.png"},
S("Brick"))
-- SANDSTONE
------------
technic.cnc.register_all("default:sandstone",
{crumbly=2, cracky=3, not_in_creative_inventory=1},
{"default_sandstone.png"},
S("Sandstone"))
-- 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",
{snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, wood=1, not_in_creative_inventory=1},
{"default_tree.png"},
S("Tree"))
-- 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",
{cracky=1, level=2, not_in_creative_inventory=1},
{"default_bronze_block.png"},
S("Bronze"))
-- Stainless Steel
--------
technic.cnc.register_all("technic:stainless_steel_block",
{cracky=1, level=2, not_in_creative_inventory=1},
{"technic_stainless_steel_block.png"},
S("Stainless Steel"))
-- Marble
------------
technic.cnc.register_all("technic:marble",
{cracky=3, not_in_creative_inventory=1},
{"technic_marble.png"},
S("Marble"))
-- Granite
------------
technic.cnc.register_all("technic:granite",
{cracky=1, not_in_creative_inventory=1},
{"technic_granite.png"},
S("Granite"))

View File

@ -22,8 +22,3 @@ dofile(path.."/extractor.lua")
dofile(path.."/compressor.lua")
dofile(path.."/music_player.lua")
dofile(path.."/cnc.lua")
dofile(path.."/cnc_api.lua")
dofile(path.."/cnc_nodes.lua")

View File

@ -117,6 +117,19 @@ local function clear_networks(pos)
end
end
local function item_place_override_node(itemstack, placer, pointed, node)
-- Call the default on_place function with a fake itemstack
local temp_itemstack = ItemStack(itemstack)
temp_itemstack:set_name(node.name)
local original_count = temp_itemstack:get_count()
temp_itemstack =
minetest.item_place(temp_itemstack, placer, pointed, node.param2) or
temp_itemstack
-- Remove the same number of items from the real itemstack
itemstack:take_item(original_count - temp_itemstack:get_count())
return itemstack
end
function technic.register_cable(tier, size)
local ltier = string.lower(tier)
cable_tier["technic:"..ltier.."_cable"] = tier
@ -228,11 +241,10 @@ function technic.register_cable(tier, size)
num = xyz[((fine_pointed[bigger] < 0 and "-") or "") .. bigger]
end
end
minetest.set_node(pointed_thing.above, {name = "technic:"..ltier.."_cable_plate_"..num})
if not (creative and creative.is_enabled_for(placer)) then
itemstack:take_item()
end
return itemstack
return item_place_override_node(
itemstack, placer, pointed_thing,
{name = "technic:"..ltier.."_cable_plate_"..num}
)
end
else
def.groups.not_in_creative_inventory = 1

View File

@ -7,18 +7,70 @@
-- 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 S = technic.getter
local S = technic_cnc.getter
local allow_metadata_inventory_put
local allow_metadata_inventory_take
local allow_metadata_inventory_move
local can_dig
local desc_tr = S("CNC Machine")
minetest.register_craft({
output = 'technic:cnc',
recipe = {
{'default:glass', 'technic:diamond_drill_head', 'default:glass'},
{'technic:control_logic_unit', 'technic:machine_casing', 'basic_materials:motor'},
{'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'},
},
})
if technic_cnc.use_technic then
minetest.register_craft({
output = 'technic:cnc',
recipe = {
{'default:glass', 'technic:diamond_drill_head', 'default:glass'},
{'technic:control_logic_unit', 'technic:machine_casing', 'basic_materials:motor'},
{'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'},
},
})
allow_metadata_inventory_put = technic.machine_inventory_put
allow_metadata_inventory_take = technic.machine_inventory_take
allow_metadata_inventory_move = technic.machine_inventory_move
can_dig = technic.machine_can_dig
desc_tr = S("%s CNC Machine"):format("LV")
else
minetest.register_craft({
output = 'technic:cnc',
recipe = {
{'default:glass', 'default:diamond', 'default:glass'},
{'basic_materials:ic', 'default:steelblock', 'basic_materials:motor'},
{'default:steel_ingot', 'default:mese', 'default:steel_ingot'},
},
})
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
return stack:get_count()
end
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
return stack:get_count()
end
allow_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
return stack:get_count()
end
can_dig = function(pos, player)
if player and minetest.is_protected(pos, player:get_player_name()) then return false end
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("dst")
and inv:is_empty("src")
and default.can_interact_with_node(player, pos)
end
end
local shape = {}
local onesize_products = {
@ -40,7 +92,7 @@ local onesize_products = {
twocurvededge = 1,
}
local twosize_products = {
element_straight = 4,
element_straight = 2,
element_end = 2,
element_cross = 1,
element_t = 1,
@ -90,30 +142,32 @@ local cnc_formspec =
"listring[current_name;src]"..
"listring[current_player;main]"
local size = 1;
-- The form handler is declared here because we need it in both the inactive and active modes
-- in order to be able to change programs wile it is running.
local function form_handler(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
-- REGISTER MILLING PROGRAMS AND OUTPUTS:
------------------------------------------
-- Program for half/full size
if fields["full"] then
size = 1
meta:set_int("size", 1)
return
end
if fields["half"] then
size = 2
meta:set_int("size", 2)
return
end
-- Resolve the node name and the number of items to make
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local inputstack = inv:get_stack("src", 1)
local inputname = inputstack:get_name()
local multiplier = 0
local size = meta:get_int("size")
if size < 1 then size = 1 end
for k, _ in pairs(fields) do
-- Set a multipier for the half/full size capable blocks
if twosize_products[k] ~= nil then
@ -139,7 +193,19 @@ local function form_handler(pos, formname, fields, sender)
break
end
end
return
if not technic_cnc.use_technic then
local result = meta:get_string("cnc_product")
if not inv:is_empty("src")
and minetest.registered_nodes[result]
and inv:room_for_item("dst", result) then
local srcstack = inv:get_stack("src", 1)
srcstack:take_item()
inv:set_stack("src", 1, srcstack)
inv:add_item("dst", result.." "..meta:get_int("cnc_multiplier"))
end
end
end
-- Action code performing the transformation
@ -147,7 +213,7 @@ local run = function(pos, node)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local eu_input = meta:get_int("LV_EU_input")
local machine_name = S("%s CNC Machine"):format("LV")
local machine_name = desc_tr
local machine_node = "technic:cnc"
local demand = 450
@ -181,8 +247,8 @@ local run = function(pos, node)
end
-- The actual block inactive state
minetest.register_node("technic:cnc", {
description = S("%s CNC Machine"):format("LV"),
minetest.register_node(":technic:cnc", {
description = desc_tr,
tiles = {"technic_cnc_top.png", "technic_cnc_bottom.png", "technic_cnc_side.png",
"technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front.png"},
groups = {cracky=2, technic_machine=1, technic_lv=1},
@ -191,40 +257,44 @@ minetest.register_node("technic:cnc", {
legacy_facedir_simple = true,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("%s CNC Machine"):format("LV"))
meta:set_string("infotext", desc_tr)
meta:set_float("technic_power_machine", 1)
meta:set_string("formspec", cnc_formspec)
local inv = meta:get_inventory()
inv:set_size("src", 1)
inv:set_size("dst", 4)
end,
can_dig = technic.machine_can_dig,
allow_metadata_inventory_put = technic.machine_inventory_put,
allow_metadata_inventory_take = technic.machine_inventory_take,
allow_metadata_inventory_move = technic.machine_inventory_move,
can_dig = can_dig,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_take = allow_metadata_inventory_take,
allow_metadata_inventory_move = allow_metadata_inventory_move,
on_receive_fields = form_handler,
technic_run = run,
technic_run = technic_cnc.use_technic and run,
})
-- Active state block
minetest.register_node("technic:cnc_active", {
description = S("%s CNC Machine"):format("LV"),
tiles = {"technic_cnc_top_active.png", "technic_cnc_bottom.png", "technic_cnc_side.png",
"technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front_active.png"},
groups = {cracky=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
connect_sides = {"bottom", "back", "left", "right"},
paramtype2 = "facedir",
drop = "technic:cnc",
legacy_facedir_simple = true,
can_dig = technic.machine_can_dig,
allow_metadata_inventory_put = technic.machine_inventory_put,
allow_metadata_inventory_take = technic.machine_inventory_take,
allow_metadata_inventory_move = technic.machine_inventory_move,
on_receive_fields = form_handler,
technic_run = run,
technic_disabled_machine_name = "technic:cnc",
})
if technic_cnc.use_technic then
technic.register_machine("LV", "technic:cnc", technic.receiver)
technic.register_machine("LV", "technic:cnc_active", technic.receiver)
minetest.register_node(":technic:cnc_active", {
description = desc_tr,
tiles = {"technic_cnc_top_active.png", "technic_cnc_bottom.png", "technic_cnc_side.png",
"technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front_active.png"},
groups = {cracky=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
connect_sides = {"bottom", "back", "left", "right"},
paramtype2 = "facedir",
drop = "technic:cnc",
legacy_facedir_simple = true,
can_dig = can_dig,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_take = allow_metadata_inventory_take,
allow_metadata_inventory_move = allow_metadata_inventory_move,
on_receive_fields = form_handler,
technic_run = run,
technic_disabled_machine_name = "technic:cnc",
})
technic.register_machine("LV", "technic:cnc", technic.receiver)
technic.register_machine("LV", "technic:cnc_active", technic.receiver)
else
minetest.register_alias("technic:cnc_active", "technic:cnc")
end

View File

@ -1,16 +1,14 @@
-- API for the technic CNC machine
-- Again code is adapted from the NonCubic Blocks MOD v1.4 by yves_de_beck
local S = technic.getter
technic.cnc = {}
local S = technic_cnc.getter
-- REGISTER NONCUBIC FORMS, CREATE MODELS AND RECIPES:
------------------------------------------------------
-- Define slope boxes for the various nodes
-------------------------------------------
technic.cnc.programs = {
technic_cnc.programs = {
{ suffix = "technic_cnc_stick",
model = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15},
desc = S("Stick")
@ -83,7 +81,7 @@ technic.cnc.programs = {
},
{ suffix = "technic_cnc_oblate_spheroid",
model = "technic_oblate_spheroid.obj",
model = "technic_cnc_oblate_spheroid.obj",
desc = S("Oblate spheroid"),
cbox = {
type = "fixed",
@ -96,32 +94,32 @@ technic.cnc.programs = {
},
{ suffix = "technic_cnc_sphere",
model = "technic_sphere.obj",
model = "technic_cnc_sphere.obj",
desc = S("Sphere")
},
{ suffix = "technic_cnc_cylinder_horizontal",
model = "technic_cylinder_horizontal.obj",
model = "technic_cnc_cylinder_horizontal.obj",
desc = S("Horizontal Cylinder")
},
{ suffix = "technic_cnc_cylinder",
model = "technic_cylinder.obj",
model = "technic_cnc_cylinder.obj",
desc = S("Cylinder")
},
{ suffix = "technic_cnc_twocurvededge",
model = "technic_two_curved_edge.obj",
model = "technic_cnc_two_curved_edge.obj",
desc = S("Two Curved Edge/Corner Block")
},
{ suffix = "technic_cnc_onecurvededge",
model = "technic_one_curved_edge.obj",
model = "technic_cnc_one_curved_edge.obj",
desc = S("One Curved Edge Block")
},
{ suffix = "technic_cnc_spike",
model = "technic_pyramid_spike.obj",
model = "technic_cnc_pyramid_spike.obj",
desc = S("Spike"),
cbox = {
type = "fixed",
@ -135,7 +133,7 @@ technic.cnc.programs = {
},
{ suffix = "technic_cnc_pyramid",
model = "technic_pyramid.obj",
model = "technic_cnc_pyramid.obj",
desc = S("Pyramid"),
cbox = {
type = "fixed",
@ -149,7 +147,7 @@ technic.cnc.programs = {
},
{ suffix = "technic_cnc_slope_inner_edge_upsdown",
model = "technic_innercorner_upsdown.obj",
model = "technic_cnc_innercorner_upsdown.obj",
desc = S("Slope Upside Down Inner Edge/Corner"),
sbox = {
type = "fixed",
@ -170,7 +168,7 @@ technic.cnc.programs = {
},
{ suffix = "technic_cnc_slope_edge_upsdown",
model = "technic_outercorner_upsdown.obj",
model = "technic_cnc_outercorner_upsdown.obj",
desc = S("Slope Upside Down Outer Edge/Corner"),
cbox = {
type = "fixed",
@ -184,7 +182,7 @@ technic.cnc.programs = {
},
{ suffix = "technic_cnc_slope_inner_edge",
model = "technic_innercorner.obj",
model = "technic_cnc_innercorner.obj",
desc = S("Slope Inner Edge/Corner"),
sbox = {
type = "fixed",
@ -205,7 +203,7 @@ technic.cnc.programs = {
},
{ suffix = "technic_cnc_slope_edge",
model = "technic_outercorner.obj",
model = "technic_cnc_outercorner.obj",
desc = S("Slope Outer Edge/Corner"),
cbox = {
type = "fixed",
@ -219,7 +217,7 @@ technic.cnc.programs = {
},
{ suffix = "technic_cnc_slope_upsdown",
model = "technic_slope_upsdown.obj",
model = "technic_cnc_slope_upsdown.obj",
desc = S("Slope Upside Down"),
cbox = {
type = "fixed",
@ -233,7 +231,7 @@ technic.cnc.programs = {
},
{ suffix = "technic_cnc_slope_lying",
model = "technic_slope_horizontal.obj",
model = "technic_cnc_slope_horizontal.obj",
desc = S("Slope Lying"),
cbox = {
type = "fixed",
@ -247,7 +245,7 @@ technic.cnc.programs = {
},
{ suffix = "technic_cnc_slope",
model = "technic_slope.obj",
model = "technic_cnc_slope.obj",
desc = S("Slope"),
cbox = {
type = "fixed",
@ -263,7 +261,7 @@ technic.cnc.programs = {
}
-- Allow disabling certain programs for some node. Default is allowing all types for all nodes
technic.cnc.programs_disable = {
technic_cnc.programs_disable = {
-- ["default:brick"] = {"technic_cnc_stick"}, -- Example: Disallow the stick for brick
-- ...
["default:dirt"] = {"technic_cnc_oblate_spheroid", "technic_cnc_slope_upsdown", "technic_cnc_edge",
@ -273,7 +271,7 @@ technic.cnc.programs_disable = {
}
-- Generic function for registering all the different node types
function technic.cnc.register_program(recipeitem, suffix, model, groups, images, description, cbox, sbox)
function technic_cnc.register_program(recipeitem, suffix, model, groups, images, description, cbox, sbox)
local dtype
local nodeboxdef
@ -308,12 +306,12 @@ function technic.cnc.register_program(recipeitem, suffix, model, groups, images,
end
-- function to iterate over all the programs the CNC machine knows
function technic.cnc.register_all(recipeitem, groups, images, description)
for _, data in ipairs(technic.cnc.programs) do
function technic_cnc.register_all(recipeitem, groups, images, description)
for _, data in ipairs(technic_cnc.programs) do
-- Disable node creation for disabled node types for some material
local do_register = true
if technic.cnc.programs_disable[recipeitem] ~= nil then
for __, disable in ipairs(technic.cnc.programs_disable[recipeitem]) do
if technic_cnc.programs_disable[recipeitem] ~= nil then
for __, disable in ipairs(technic_cnc.programs_disable[recipeitem]) do
if disable == data.suffix then
do_register = false
end
@ -321,49 +319,49 @@ function technic.cnc.register_all(recipeitem, groups, images, description)
end
-- Create the node if it passes the test
if do_register then
technic.cnc.register_program(recipeitem, data.suffix, data.model,
technic_cnc.register_program(recipeitem, data.suffix, data.model,
groups, images, description.." "..data.desc, data.cbox, data.sbox)
end
end
end
-- REGISTER NEW TECHNIC_CNC_API's PART 2: technic.cnc..register_element_end(subname, recipeitem, groups, images, desc_element_xyz)
-- REGISTER NEW TECHNIC_CNC_API's PART 2: technic_cnc..register_element_end(subname, recipeitem, groups, images, desc_element_xyz)
-----------------------------------------------------------------------------------------------------------------------
function technic.cnc.register_slope_edge_etc(recipeitem, groups, images, desc_slope, desc_slope_lying, desc_slope_upsdown, desc_slope_edge, desc_slope_inner_edge, desc_slope_upsdwn_edge, desc_slope_upsdwn_inner_edge, desc_pyramid, desc_spike, desc_onecurvededge, desc_twocurvededge, desc_cylinder, desc_cylinder_horizontal, desc_spheroid, desc_element_straight, desc_element_edge, desc_element_t, desc_element_cross, desc_element_end)
function technic_cnc.register_slope_edge_etc(recipeitem, groups, images, desc_slope, desc_slope_lying, desc_slope_upsdown, desc_slope_edge, desc_slope_inner_edge, desc_slope_upsdwn_edge, desc_slope_upsdwn_inner_edge, desc_pyramid, desc_spike, desc_onecurvededge, desc_twocurvededge, desc_cylinder, desc_cylinder_horizontal, desc_spheroid, desc_element_straight, desc_element_edge, desc_element_t, desc_element_cross, desc_element_end)
technic.cnc.register_slope(recipeitem, groups, images, desc_slope)
technic.cnc.register_slope_lying(recipeitem, groups, images, desc_slope_lying)
technic.cnc.register_slope_upsdown(recipeitem, groups, images, desc_slope_upsdown)
technic.cnc.register_slope_edge(recipeitem, groups, images, desc_slope_edge)
technic.cnc.register_slope_inner_edge(recipeitem, groups, images, desc_slope_inner_edge)
technic.cnc.register_slope_edge_upsdown(recipeitem, groups, images, desc_slope_upsdwn_edge)
technic.cnc.register_slope_inner_edge_upsdown(recipeitem, groups, images, desc_slope_upsdwn_inner_edge)
technic.cnc.register_pyramid(recipeitem, groups, images, desc_pyramid)
technic.cnc.register_spike(recipeitem, groups, images, desc_spike)
technic.cnc.register_onecurvededge(recipeitem, groups, images, desc_onecurvededge)
technic.cnc.register_twocurvededge(recipeitem, groups, images, desc_twocurvededge)
technic.cnc.register_cylinder(recipeitem, groups, images, desc_cylinder)
technic.cnc.register_cylinder_horizontal(recipeitem, groups, images, desc_cylinder_horizontal)
technic.cnc.register_spheroid(recipeitem, groups, images, desc_spheroid)
technic.cnc.register_element_straight(recipeitem, groups, images, desc_element_straight)
technic.cnc.register_element_edge(recipeitem, groups, images, desc_element_edge)
technic.cnc.register_element_t(recipeitem, groups, images, desc_element_t)
technic.cnc.register_element_cross(recipeitem, groups, images, desc_element_cross)
technic.cnc.register_element_end(recipeitem, groups, images, desc_element_end)
technic_cnc.register_slope(recipeitem, groups, images, desc_slope)
technic_cnc.register_slope_lying(recipeitem, groups, images, desc_slope_lying)
technic_cnc.register_slope_upsdown(recipeitem, groups, images, desc_slope_upsdown)
technic_cnc.register_slope_edge(recipeitem, groups, images, desc_slope_edge)
technic_cnc.register_slope_inner_edge(recipeitem, groups, images, desc_slope_inner_edge)
technic_cnc.register_slope_edge_upsdown(recipeitem, groups, images, desc_slope_upsdwn_edge)
technic_cnc.register_slope_inner_edge_upsdown(recipeitem, groups, images, desc_slope_upsdwn_inner_edge)
technic_cnc.register_pyramid(recipeitem, groups, images, desc_pyramid)
technic_cnc.register_spike(recipeitem, groups, images, desc_spike)
technic_cnc.register_onecurvededge(recipeitem, groups, images, desc_onecurvededge)
technic_cnc.register_twocurvededge(recipeitem, groups, images, desc_twocurvededge)
technic_cnc.register_cylinder(recipeitem, groups, images, desc_cylinder)
technic_cnc.register_cylinder_horizontal(recipeitem, groups, images, desc_cylinder_horizontal)
technic_cnc.register_spheroid(recipeitem, groups, images, desc_spheroid)
technic_cnc.register_element_straight(recipeitem, groups, images, desc_element_straight)
technic_cnc.register_element_edge(recipeitem, groups, images, desc_element_edge)
technic_cnc.register_element_t(recipeitem, groups, images, desc_element_t)
technic_cnc.register_element_cross(recipeitem, groups, images, desc_element_cross)
technic_cnc.register_element_end(recipeitem, groups, images, desc_element_end)
end
-- REGISTER STICKS: noncubic.register_xyz(recipeitem, groups, images, desc_element_xyz)
------------------------------------------------------------------------------------------------------------
function technic.cnc.register_stick_etc(recipeitem, groups, images, desc_stick)
technic.cnc.register_stick(recipeitem, groups, images, desc_stick)
function technic_cnc.register_stick_etc(recipeitem, groups, images, desc_stick)
technic_cnc.register_stick(recipeitem, groups, images, desc_stick)
end
function technic.cnc.register_elements(recipeitem, groups, images, desc_element_straight_double, desc_element_edge_double, desc_element_t_double, desc_element_cross_double, desc_element_end_double)
technic.cnc.register_element_straight_double(recipeitem, groups, images, desc_element_straight_double)
technic.cnc.register_element_edge_double(recipeitem, groups, images, desc_element_edge_double)
technic.cnc.register_element_t_double(recipeitem, groups, images, desc_element_t_double)
technic.cnc.register_element_cross_double(recipeitem, groups, images, desc_element_cross_double)
technic.cnc.register_element_end_double(recipeitem, groups, images, desc_element_end_double)
function technic_cnc.register_elements(recipeitem, groups, images, desc_element_straight_double, desc_element_edge_double, desc_element_t_double, desc_element_cross_double, desc_element_end_double)
technic_cnc.register_element_straight_double(recipeitem, groups, images, desc_element_straight_double)
technic_cnc.register_element_edge_double(recipeitem, groups, images, desc_element_edge_double)
technic_cnc.register_element_t_double(recipeitem, groups, images, desc_element_t_double)
technic_cnc.register_element_cross_double(recipeitem, groups, images, desc_element_cross_double)
technic_cnc.register_element_end_double(recipeitem, groups, images, desc_element_end_double)
end

View File

@ -0,0 +1,131 @@
-- REGISTER MATERIALS AND PROPERTIES FOR NONCUBIC ELEMENTS:
-----------------------------------------------------------
local S = technic_cnc.getter
-- DIRT
-------
technic_cnc.register_all("default:dirt",
{snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
{"default_dirt.png"},
S("Dirt"))
-- (DIRT WITH) GRASS
--------------------
technic_cnc.register_all("default:dirt_with_grass",
{snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
{"default_grass.png"},
S("Grassy dirt"))
-- WOOD
-------
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"))
-- STONE
--------
technic_cnc.register_all("default:stone",
{cracky=3, not_in_creative_inventory=1},
{"default_stone.png"},
S("Stone"))
-- COBBLE
---------
technic_cnc.register_all("default:cobble",
{cracky=3, not_in_creative_inventory=1},
{"default_cobble.png"},
S("Cobble"))
-- BRICK
--------
technic_cnc.register_all("default:brick",
{cracky=3, not_in_creative_inventory=1},
{"default_brick.png"},
S("Brick"))
-- SANDSTONE
------------
technic_cnc.register_all("default:sandstone",
{crumbly=2, cracky=3, not_in_creative_inventory=1},
{"default_sandstone.png"},
S("Sandstone"))
-- 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",
{snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, wood=1, not_in_creative_inventory=1},
{"default_tree.png"},
S("Tree"))
-- Bronze
--------
technic_cnc.register_all("default:bronzeblock",
{cracky=1, level=2, not_in_creative_inventory=1},
{"default_bronze_block.png"},
S("Bronze"))
local steeltex = "default_steel_block.png"
local steelname = "Steel"
if technic_cnc.technic_modpath then
steeltex = "technic_wrought_iron_block.png"
steelname = "Wrought Iron"
-- Stainless Steel
--------
technic_cnc.register_all("technic:stainless_steel_block",
{cracky=1, level=2, not_in_creative_inventory=1},
{"technic_stainless_steel_block.png"},
S("Stainless Steel"))
-- Marble
------------
technic_cnc.register_all("technic:marble",
{cracky=3, not_in_creative_inventory=1},
{"technic_marble.png"},
S("Marble"))
-- Granite
------------
technic_cnc.register_all("technic:granite",
{cracky=1, not_in_creative_inventory=1},
{"technic_granite.png"},
S("Granite"))
-- Blast-resistant concrete
---------------------------
technic_cnc.register_all("technic:blast_resistant_concrete",
{cracky=2, level=2, not_in_creative_inventory=1},
{"technic_blast_resistant_concrete_block.png"},
S("Blast-resistant concrete"))
end
-- STEEL
---------------
technic_cnc.register_all("default:steelblock",
{cracky=1, level=2, not_in_creative_inventory=1},
{steeltex},
S(steelname))
-- CONCRETE AND CEMENT
----------------------
technic_cnc.register_all("basic_materials:concrete_block",
{cracky=2, level=2, not_in_creative_inventory=1},
{"basic_materials_concrete_block.png"},
S("Concrete"))
technic_cnc.register_all("basic_materials:cement_block",
{cracky=2, level=2, not_in_creative_inventory=1},
{"basic_materials_cement_block.png"},
S("Cement"))
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"))

3
technic_cnc/depends.txt Normal file
View File

@ -0,0 +1,3 @@
default
basic_materials
technic?

18
technic_cnc/init.lua Normal file
View File

@ -0,0 +1,18 @@
local modpath = minetest.get_modpath("technic_cnc")
technic_cnc = {}
technic_cnc.technic_modpath = minetest.get_modpath("technic")
technic_cnc.use_technic = technic_cnc.technic_modpath
and minetest.settings:get_bool("technic_cnc_use_technic") ~= false
if rawget(_G, "intllib") then
technic_cnc.getter = intllib.Getter()
else
technic_cnc.getter = function(s,a,...)if a==nil then return s end a={a,...}return s:gsub("(@?)@(%(?)(%d+)(%)?)",function(e,o,n,c)if e==""then return a[tonumber(n)]..(o==""and c or"")else return"@"..o..n..c end end) end
end
dofile(modpath.."/cnc.lua")
dofile(modpath.."/cnc_api.lua")
dofile(modpath.."/cnc_materials.lua")

36
technic_cnc/locale/de.txt Normal file
View File

@ -0,0 +1,36 @@
## CNC
CNC Machine = CNC-Maschine
%s CNC Machine = %s CNC-Maschine
Cylinder = Zylinder
Element Cross = Halbes Kreuzelement
Element Cross Double = Kreuzelement
Element Edge = Halbes Eckelement
Element Edge Double = Eckelement
Element End = Halbes Endelement
Element End Double = Endelement
Element Straight = Halbes aufrechtes Element
Element Straight Double = Aufrechtes Element
Element T = Halbes T-Element
Element T Double = T-Element
Horizontal Cylinder = Liegender Zylinder
One Curved Edge Block = Block mit einer abgerundeten Kante
Pyramid = Pyramide
Slope = Schraege
Slope Edge = Schraege mit Ecke
Slope Inner Edge = Schraege mit Innenecke
Slope Lying = Liegende Schraege
Slope Upside Down = Umgedrehte Schraege
Slope Upside Down Edge = Umgedrehte Schraege mit Ecke
Slope Upside Down Inner Edge = Umgedrehte Schraege mit Innenecke
Sphere = Kugel
Spike = Spitze
Stick = Stange
Two Curved Edge Block = Block mit zwei abgerundeten Kanten
Brick = Ziegel:
Cobble = Pflasterstein:
Dirt = Erde:
Leaves = Laub:
Sandstone = Sandstein:
Stone = Stein:
Tree = Baumstamm:
Wooden = Holz:

35
technic_cnc/locale/es.txt Normal file
View File

@ -0,0 +1,35 @@
## CNC
CNC Machine = Maquina CNC
%s CNC Machine = Maquina CNC %s
Element Edge = Elemento Borde
Tree = Arbol
Element Cross Double = Elemento Cruz Doble
Spike = Pica
Element Edge Double = Elemento Borde Doble
Two Curved Edge Block = Dos Bloques de Borde Curvados
Pyramid = Piramide
Slope Upside Down Inner Edge = Borde Interno de Rampa Al Reves
Slope Upside Down Edge = Borde de Rampa Al Reves
Element Straight Double = Elemento Doble Recto
Sphere = Esfera
Element End Double = Doble Fin de Elemento
Element Straight = Recta de Elemento
Horizontal Cylinder = Cilindro Horizontal
Slope Inner Edge = Borde Interno de Rampa
One Curved Edge Block = Un Bloque de Borde Curvado
Element Cross = Cruce de Elementos
Stick = Varita
Element End = Fin de Elemento
Slope Lying = Rampa en Reposo
Slope Upside Down = Rampa Al Reves
Slope Edge = Borde de Rampa
Slope = Rampa
Element T = Elemento T
Cylinder = Cilindro
Cobble = Adoquines
Stone = Piedra
Brick = Ladrillo
Dirt = Tierra
Sandstone = Arenisca
Wooden = Madera
Leaves = Hojas

36
technic_cnc/locale/it.txt Normal file
View File

@ -0,0 +1,36 @@
## CNC
CNC Machine = Tornio CNC
%s CNC Machine = Tornio CNC %s
Cylinder = Cilindro
Element Cross = Elemento a croce
Element Cross Double = Elemento a croce doppio
Element Edge = Elemento bordo
Element Edge Double = Elemento bordo doppio
Element End = Elemento finale
Element End Double = Elemento finale doppio
Element Straight = Elemento dritto
Element Straight Double = Elemento dritto doppio
Element T = Elemento a T
Element T Double = Elemento a T doppio
Horizontal Cylinder = Cilindro orizzontale
One Curved Edge Block = Blocco con bordo curvo
Pyramid = Piramide
Slope = Inclinato
Slope Edge = Bordo inclinato
Slope Inner Edge = Bordo interno inclinato
Slope Lying = Pendenza bugiarda
Slope Upside Down = Pendenza capovolta
Slope Upside Down Edge = Bordo inclinato capovolto
Slope Upside Down Inner Edge = Bordo interno inclinato capovolto
Sphere = Sfera
Spike = Spuntone
Stick = Bastone
Two Curved Edge Block = Blocco con bordo a doppia curva
Brick = Mattone
Cobble = Ciottolato
Dirt = Terra
Leaves = Foglie
Sandstone = Arenaria
Stone = Pietra
Tree = Albero
Wooden = Legno

View File

@ -0,0 +1,36 @@
## CNC
CNC Machine =
%s CNC Machine =
Cylinder =
Element Cross =
Element Cross Double =
Element Edge =
Element Edge Double =
Element End =
Element End Double =
Element Straight =
Element Straight Double =
Element T =
Element T Double =
Horizontal Cylinder =
One Curved Edge Block =
Pyramid =
Slope =
Slope Edge =
Slope Inner Edge =
Slope Lying =
Slope Upside Down =
Slope Upside Down Edge =
Slope Upside Down Inner Edge =
Sphere =
Spike =
Stick =
Two Curved Edge Block =
Brick =
Cobble =
Dirt =
Leaves =
Sandstone =
Stone =
Tree =
Wooden =

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 997 B

After

Width:  |  Height:  |  Size: 997 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

View File

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Some files were not shown because too many files have changed in this diff Show More