Minor updates and code cleaning.
parent
6e2d66ed70
commit
1e88b4a878
20
init.lua
20
init.lua
|
@ -11,50 +11,50 @@ dofile(minetest.get_modpath('tombs')..'/chisel.lua')
|
|||
--support for other mods
|
||||
if minetest.get_modpath('bakedclay') and (minetest.settings:get_bool('tombs.load_bakedclay')) then
|
||||
dofile(minetest.get_modpath('tombs')..'/bakedclay.lua')
|
||||
print 'Tombs loaded bakedclay support.'
|
||||
minetest.log('action', 'Tombs loaded support for bakedclay.')
|
||||
end
|
||||
|
||||
if minetest.get_modpath('caverealms') and (minetest.settings:get_bool('tombs.load_caverealms')) then
|
||||
dofile(minetest.get_modpath('tombs')..'/caverealms.lua')
|
||||
print 'Tombs loaded caverealms support.'
|
||||
minetest.log('action', 'Tombs loaded support for caverealms.')
|
||||
end
|
||||
|
||||
if minetest.get_modpath('darkage') and (minetest.settings:get_bool('tombs.load_darkage')) then
|
||||
dofile(minetest.get_modpath('tombs')..'/darkage.lua')
|
||||
print 'Tombs loaded darkage support.'
|
||||
minetest.log('action', 'Tombs loaded support for darkage.')
|
||||
end
|
||||
|
||||
if minetest.get_modpath('default') and (minetest.settings:get_bool('tombs.load_default')) then
|
||||
dofile(minetest.get_modpath('tombs')..'/default.lua')
|
||||
print 'Tombs loaded default support.'
|
||||
minetest.log('action', 'Tombs loaded support for default.')
|
||||
end
|
||||
|
||||
if minetest.get_modpath('ethereal') and (minetest.settings:get_bool('tombs.load_ethereal')) then
|
||||
dofile(minetest.get_modpath('tombs')..'/ethereal.lua')
|
||||
print 'Tombs loaded ethereal support.'
|
||||
minetest.log('action', 'Tombs loaded support for ethereal.')
|
||||
end
|
||||
|
||||
if minetest.get_modpath('geominer') and (minetest.settings:get_bool('tombs.load_geominer')) then
|
||||
dofile(minetest.get_modpath('tombs')..'/geominer.lua')
|
||||
print 'Tombs loaded geominer support.'
|
||||
minetest.log('action', 'Tombs loaded support for geominer.')
|
||||
end
|
||||
|
||||
if minetest.get_modpath('maple') and (minetest.settings:get_bool('tombs.load_maple')) then
|
||||
dofile(minetest.get_modpath('tombs')..'/maple.lua')
|
||||
print 'Tombs loaded maple support.'
|
||||
minetest.log('action', 'Tombs loaded support for maple.')
|
||||
end
|
||||
|
||||
if minetest.get_modpath('moreores') and (minetest.settings:get_bool('tombs.load_moreores')) then
|
||||
dofile(minetest.get_modpath('tombs')..'/moreores.lua')
|
||||
print 'Tombs loaded moreores support.'
|
||||
minetest.log('action', 'Tombs loaded support for moreores.')
|
||||
end
|
||||
|
||||
if minetest.get_modpath('moretrees') and (minetest.settings:get_bool('tombs.load_moretrees')) then
|
||||
dofile(minetest.get_modpath('tombs')..'/moretrees.lua')
|
||||
print 'Tombs loaded moretrees support.'
|
||||
minetest.log('action', 'Tombs loaded support for moretrees.')
|
||||
end
|
||||
|
||||
if minetest.get_modpath('wool') and (minetest.settings:get_bool('tombs.load_wool')) then
|
||||
dofile(minetest.get_modpath('tombs')..'/wool.lua')
|
||||
print 'loaded wool support.'
|
||||
minetest.log('action', 'Tombs loaded support for wool.')
|
||||
end
|
||||
|
|
18
machine.lua
18
machine.lua
|
@ -104,6 +104,13 @@ minetest.register_node('tombs:machine', {
|
|||
end
|
||||
inv:set_stack('tool',1,tool_stack)
|
||||
inv:set_stack('input',1,input_stack)
|
||||
local stone_stack = inv:get_stack(listname, index)
|
||||
if not stone_stack:is_empty() and stone_stack:get_name()~=stack:get_name() then
|
||||
local player_inv = player:get_inventory()
|
||||
if player_inv:room_for_item('main', stone_stack) then
|
||||
player_inv:add_item('main', stone_stack)
|
||||
end
|
||||
end
|
||||
if inv:is_empty('input') then
|
||||
inv:set_list('output', {})
|
||||
elseif inv:is_empty('tool') then
|
||||
|
@ -113,6 +120,16 @@ minetest.register_node('tombs:machine', {
|
|||
end
|
||||
end
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local input_stack = inv:get_stack(listname, index)
|
||||
local player_inv = player:get_inventory()
|
||||
if not player_inv:room_for_item('main', input_stack) then
|
||||
return 0
|
||||
else return stack:get_count()
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
function tombs.populate_output(pos)
|
||||
|
@ -125,6 +142,7 @@ function tombs.populate_output(pos)
|
|||
if tombs.nodes[input] then
|
||||
if tool_stack:get_name() == 'bones:bones' or tool_stack:get_name() == 'tombs:chisel'
|
||||
or tool_stack:get_name() == 'mychisel:chisel' then
|
||||
inv:set_list('output', {})
|
||||
inv:set_list('output', tombs.crafting(input, var))
|
||||
end
|
||||
else
|
||||
|
|
1
mod.conf
1
mod.conf
|
@ -2,3 +2,4 @@ name = tombs
|
|||
description = Adds many shapes and styles of tombstones.
|
||||
depends = default
|
||||
optional_depends = bakedclay, bones, caverealms, darkage, ethereal, geominer, maple, moreores, moretrees, mychisel, wool
|
||||
author = Nathan Salapat
|
||||
|
|
Loading…
Reference in New Issue