master #7

Merged
milan merged 2 commits from master into milan2018 2020-04-24 20:09:09 +02:00
3 changed files with 177 additions and 4 deletions
Showing only changes of commit d70a6367c4 - Show all commits

View file

@ -224,7 +224,7 @@ minetest.register_node("basic_machines:constructor", {
}, },
}) })
--[[
minetest.register_craft({ minetest.register_craft({
output = "basic_machines:constructor", output = "basic_machines:constructor",
recipe = { recipe = {
@ -232,5 +232,126 @@ minetest.register_craft({
{"default:steel_ingot","default:copperblock","default:steel_ingot"}, {"default:steel_ingot","default:copperblock","default:steel_ingot"},
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"}, {"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
}
})
--]]
---------------------------
-- !!! replace nodes !!! --
---------------------------
local function replace_node(t)
minetest.register_abm({
label = "replace node",
nodenames = t.names or {t.name},
neighbors = t.need or nil,
interval = t.i or 2,
chance = t.ch or 3,
action = function(pos)
local node = minetest.get_node(pos)
node.name = t.to or t.to_name or "air"
minetest.swap_node(pos, node)
end
})
end
-- receptor --
replace_node({name = "basic_machines:keypad", to = "default:wood"})
replace_node({name = "clock_generator", to = "default:diamondblock"})
-- effector --
replace_node({name = "basic_machines:light_on", to = "mesecons_lightstone:lightstone_white_on"})
replace_node({name = "basic_machines:light_off", to = "mesecons_lightstone:lightstone_white_off"})
-- conductor --
minetest.register_craft({
output = "basic_machines:distributor",
recipe = {
{"default:steel_ingot","mesecons:wire_00000000_off", "default:steel_ingot"},
{"mesecons:wire_00000000_off","default:mese","mesecons:wire_00000000_off"},
{"default:steel_ingot","mesecons:wire_00000000_off","default:steel_ingot"},
}
})
replace_node({name = "basic_machines:detector", to = "default:mese"})
-- machines --
replace_node({name = "basic_machines:mover", to = "default:mese", need = {"air"}})
replace_node({name = "basic_machines:constructor", to = "default:copperblock", need = {"air"}})
-- inventory machines --
replace_node({name = "basic_machines:autocrafter", to = "pipeworks:autocrafter"})
minetest.register_craft({
output = "basic_machines:grinder",
recipe = {
{"default:diamond","default:mese","default:diamond"},
{"default:mese","default:diamondblock","default:mese"},
{"default:diamond","default:mese","default:diamond"},
}
})
minetest.register_craft({
output = "basic_machines:recycler",
recipe = {
{"default:mese_crystal","default:mese_crystal","default:mese_crystal"},
{"default:mese_crystal","default:diamondblock","default:mese_crystal"},
{"default:mese_crystal","default:mese_crystal","default:mese_crystal"},
}
})
-- power --
minetest.register_craft({
output = "basic_machines:generator",
recipe = {
{"default:diamondblock","default:goldblock","default:diamondblock"},
{"default:goldblock","default:diamondblock","default:goldblock"},
{"default:diamondblock","default:goldblock","default:diamondblock"},
}
})
minetest.register_craft({
output = "basic_machines:battery_0",
recipe = {
{"default:bronzeblock","default:mese","default:bronzeblock"},
{"","default:diamond",""},
{"","",""},
}
})
minetest.register_craft({
output = "basic_machines:power_block 5",
recipe = {
{"basic_machines:power_rod","",""},
{"","",""},
{"","",""},
}
})
minetest.register_craft({
output = "basic_machines:power_cell 5",
recipe = {
{"basic_machines:power_block","",""},
{"","",""},
{"","",""},
}
})
minetest.register_craft({
output = "default:coal_lump",
recipe = {
{"basic_machines:power_cell","basic_machines:power_cell",""},
{"","",""},
{"","",""},
}
})
minetest.register_craft({
output = "default:coal_lump",
recipe = {
{"basic_machines:power_cell","",""},
{"basic_machines:power_cell","",""},
{"","",""},
} }
}) })

View file

@ -269,8 +269,25 @@ minetest.register_node("basic_machines:battery_0", {
can_dig = function(pos) can_dig = function(pos)
local meta = minetest.get_meta(pos); local meta = minetest.get_meta(pos);
if meta:get_int("upgrade")~=0 then return false else return true end if meta:get_int("upgrade")~=0 then return false else return true end
end end,
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("fuel", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int("split_material_stacks") == 1 then
stack = stack:peek_item(1)
end
return inv:room_for_item("fuel", stack)
end,
input_inventory = "upgrade",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
}) })
@ -387,8 +404,25 @@ minetest.register_node("basic_machines:generator", {
can_dig = function(pos) can_dig = function(pos)
local meta = minetest.get_meta(pos); local meta = minetest.get_meta(pos);
if meta:get_int("upgrade")~=0 then return false else return true end if meta:get_int("upgrade")~=0 then return false else return true end
end end,
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("fuel", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int("split_material_stacks") == 1 then
stack = stack:peek_item(1)
end
return inv:room_for_item("fuel", stack)
end,
input_inventory = "upgrade",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
}) })

View file

@ -79,4 +79,22 @@ netest/mods/mobs/api.lua:689: bad argument #2 to 'random' (interval is empty)
2020-04-24 09:08:03: ERROR[Main]: /home/minetest/.minetest/mods/mobs/api.lua:689: in function 'item_drop' 2020-04-24 09:08:03: ERROR[Main]: /home/minetest/.minetest/mods/mobs/api.lua:689: in function 'item_drop'
2020-04-24 09:08:03: ERROR[Main]: /home/minetest/.minetest/mods/mobs/api.lua:769: in function 'check_for_death' 2020-04-24 09:08:03: ERROR[Main]: /home/minetest/.minetest/mods/mobs/api.lua:769: in function 'check_for_death'
2020-04-24 09:08:03: ERROR[Main]: /home/minetest/.minetest/mods/mobs/api.lua:971: in function 'do_env_damage' 2020-04-24 09:08:03: ERROR[Main]: /home/minetest/.minetest/mods/mobs/api.lua:971: in function 'do_env_damage'
2020-04-24 09:08:03: ERROR[Main]: /home/minetest/.minetest/mods/mobs/api.lua:3237: in function </home/minetest/.minetest/mods/mobs/api.lua:3104> 2020-04-24 09:08:03: ERROR[Main]: /home/minetest/.minetest/mods/mobs/api.lua:3237: in function </home/minetest/.minetest/mods/mobs/api.lua:3104>
-------------
Separator
-------------
2020-04-24 19:15:52: [Main]: Automatically selecting world at [/home/minetest/.minetest/worlds/world]
2020-04-24 19:15:52: WARNING[Main]: Mod name conflict detected: "farming"
2020-04-24 19:15:52: WARNING[Main]: Will not load: /home/minetest/.minetest/games/minetest/mods/farming
2020-04-24 19:15:52: WARNING[Main]: Overridden by: /home/minetest/.minetest/mods/farming
2020-04-24 19:15:54: WARNING[Main]: Undeclared global variable "player_api" accessed at /home/minetest/.minetest/mods/playeranim/init.lua:12
2020-04-24 19:15:54: WARNING[Main]: Undeclared global variable "description3" accessed at /home/minetest/.minetest/mods/nixie_tubes/init.lua:147
2020-04-24 19:15:54: ERROR[Main]: ModError: Failed to load and run script from /home/minetest/.minetest/mods/basic_machines/init.lua:
2020-04-24 19:15:54: ERROR[Main]: /home/minetest/.minetest/mods/basic_machines/technic_power.lua:274: '}' expected (to close '{' at line 117) near 'tube'
2020-04-24 19:15:54: ERROR[Main]: stack traceback:
2020-04-24 19:15:54: ERROR[Main]: [C]: in function 'dofile'
2020-04-24 19:15:54: ERROR[Main]: ...home/minetest/.minetest/mods/basic_machines/init.lua:24: in main chunk