Added table top lamps.

master
NathanSalapat 2015-05-13 20:05:34 -05:00
parent ce909d3ebc
commit c239ed78be
9 changed files with 269 additions and 420 deletions

View File

@ -93,6 +93,20 @@ minetest.register_craft({
recipe = {'more_fire:flintstone', 'default:steel_ingot'}
})
minetest.register_craft({
output = 'more_fire:oil_lamp_off 1',
recipe = {
{'more_fire:oil_lamp_table_off'}
}
})
minetest.register_craft({
output = 'more_fire:oil_lamp_table_off 1',
recipe = {
{'more_fire:oil_lamp_off'}
}
})
-- cooking recipes
minetest.register_craft({
type = 'cooking',

Binary file not shown.

BIN
models/lamp.blend1 Normal file

Binary file not shown.

View File

@ -0,0 +1,160 @@
# Blender v2.74 (sub 5) OBJ File: 'lamp.blend'
# www.blender.org
o TabletopLamp_Cube.002
v 0.140000 -0.399025 -0.139882
v 0.200000 0.200975 -0.199882
v 0.140000 -0.399025 0.140118
v 0.200000 0.200975 0.200118
v -0.140000 -0.399025 -0.139882
v -0.200000 0.200975 -0.199882
v -0.140000 -0.399025 0.140118
v -0.200000 0.200975 0.200118
v 0.196000 -0.399025 -0.195882
v 0.196000 -0.399025 0.196118
v -0.196000 -0.399025 -0.195882
v -0.196000 -0.399025 0.196118
v 0.196000 -0.498858 -0.195882
v 0.196000 -0.498858 0.196118
v -0.196000 -0.498857 -0.195882
v -0.196000 -0.498857 0.196118
v 0.063585 -0.434677 0.063703
v 0.063585 -0.434677 -0.063467
v -0.063585 -0.434677 0.063703
v -0.063585 -0.434677 -0.063467
v 0.000000 -0.362197 -0.068012
v 0.000000 -0.362197 0.067749
v 0.000000 -0.296697 -0.029923
v 0.000000 -0.296697 0.029661
v 0.067880 -0.362197 -0.068012
v 0.067880 -0.362197 0.067749
v 0.029792 -0.296697 -0.029923
v 0.029792 -0.296697 0.029661
v -0.067880 -0.362197 -0.068011
v -0.067880 -0.362197 0.067749
v -0.029792 -0.296697 -0.029923
v -0.029792 -0.296697 0.029661
v 0.000000 -0.095525 -0.000131
v 0.000000 -0.414885 -0.000131
v 0.029792 -0.296697 -0.000131
v 0.067880 -0.362197 -0.000131
v -0.067880 -0.362197 -0.000131
v -0.029792 -0.296697 -0.000131
vt 0.000184 0.100646
vt 0.245094 0.025548
vt 0.321566 0.406010
vt 0.150129 0.458578
vt 0.500000 0.000184
vt 0.500000 0.388255
vt 0.754906 0.025548
vt 0.678434 0.406010
vt 0.999816 0.100646
vt 0.849871 0.458578
vt 0.126413 0.785921
vt 0.324583 0.785910
vt 0.364220 0.825542
vt 0.086781 0.825558
vt 0.364204 0.548103
vt 0.086765 0.548119
vt 0.086761 0.477462
vt 0.364200 0.477446
vt 0.324572 0.587740
vt 0.126401 0.587751
vt 0.538369 0.694413
vt 0.828479 0.694413
vt 0.828479 0.984522
vt 0.538370 0.984522
vt 0.434861 0.548099
vt 0.434876 0.825538
vt 0.016124 0.825562
vt 0.016108 0.548123
vt 0.364224 0.896199
vt 0.086785 0.896215
vt 0.128242 0.782956
vt 0.128359 0.588263
vt 0.184733 0.643133
vt 0.183276 0.726280
vt 0.266422 0.644797
vt 0.267527 0.727647
vt 0.321989 0.589472
vt 0.323247 0.783309
vt 0.710670 0.483156
vt 0.731303 0.458009
vt 0.938416 0.548420
vt 0.722804 0.505829
vt 0.668840 0.608672
vt 0.623856 0.671057
vt 0.584008 0.546251
vt 0.665070 0.585205
vt 0.730212 0.636289
vt 0.709888 0.610891
vt 0.722299 0.588369
vt 0.669598 0.484873
vt 0.665541 0.508292
vt 0.625380 0.421942
vt 0.710294 0.566741
vt 0.676652 0.564725
vt 0.670759 0.546782
vt 0.721862 0.547095
vt 0.710535 0.527308
vt 0.676871 0.528913
vn 0.995000 -0.099500 -0.000000
vn 0.000000 -0.099500 0.995000
vn -0.995000 -0.099500 0.000000
vn -0.000000 -0.099500 -0.995000
vn 0.000000 1.000000 0.000000
vn -0.000000 0.000000 -1.000000
vn -0.000000 -1.000000 0.000000
vn -1.000000 0.000000 0.000000
vn 1.000000 -0.000000 -0.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 0.906200 0.422800
vn 0.422800 0.906200 -0.000000
vn -0.422800 0.906200 0.000000
vn -0.000000 0.906200 -0.422800
vn 0.692100 0.205000 -0.692100
vn -0.340200 -0.876600 -0.340200
vn -0.692100 0.205000 -0.692100
vn 0.864500 0.502700 -0.000000
vn 0.340200 -0.876600 -0.340200
vn -0.864500 0.502700 0.000000
vn -0.000000 0.502700 -0.864500
vn 0.000000 0.502700 0.864500
vn 0.692100 0.205000 0.692100
vn -0.340200 -0.876600 0.340200
vn -0.692100 0.205000 0.692100
vn 0.340200 -0.876600 0.340200
s off
f 2/1/1 4/2/1 3/3/1 1/4/1
f 4/2/2 8/5/2 7/6/2 3/3/2
f 8/5/3 6/7/3 5/8/3 7/6/3
f 6/7/4 2/9/4 1/10/4 5/8/4
f 3/11/5 7/12/5 12/13/5 10/14/5
f 11/15/6 9/16/6 13/17/6 15/18/6
f 5/19/5 1/20/5 9/16/5 11/15/5
f 7/12/5 5/19/5 11/15/5 12/13/5
f 1/20/5 3/11/5 10/14/5 9/16/5
f 13/21/7 14/22/7 16/23/7 15/24/7
f 12/13/8 11/15/8 15/25/8 16/26/8
f 9/16/9 10/14/9 14/27/9 13/28/9
f 10/14/10 12/13/10 16/29/10 14/30/10
f 1/31/11 5/32/11 20/33/11 18/34/11
f 19/35/5 17/36/5 18/34/5 20/33/5
f 5/32/12 7/37/12 19/35/12 20/33/12
f 3/38/13 1/31/13 18/34/13 17/36/13
f 7/37/14 3/38/14 17/36/14 19/35/14
f 27/39/15 23/40/15 33/41/15 35/42/15
f 29/43/16 21/44/16 34/45/16 37/46/16
f 23/47/17 31/48/17 38/49/17 33/41/17
f 25/50/18 27/39/18 35/42/18 36/51/18
f 21/52/19 25/50/19 36/51/19 34/45/19
f 31/48/20 29/43/20 37/46/20 38/49/20
f 27/39/21 25/50/21 21/52/21 23/40/21
f 32/53/22 30/54/22 22/55/22 24/56/22
f 35/42/23 33/41/23 24/56/23 28/57/23
f 37/46/24 34/45/24 22/55/24 30/54/24
f 23/47/21 21/44/21 29/43/21 31/48/21
f 24/56/22 22/55/22 26/58/22 28/57/22
f 33/41/25 38/49/25 32/53/25 24/56/25
f 36/51/18 35/42/18 28/57/18 26/58/18
f 34/45/26 36/51/26 26/58/26 22/55/26
f 38/49/20 37/46/20 30/54/20 32/53/20

View File

@ -323,7 +323,7 @@ end,
minetest.register_node('more_fire:oil_lamp_on', {
description = 'oil lamp',
drawtype = 'mesh',
mesh = 'more_fire_lamp.obj',
mesh = 'more_fire_lamp_wall.obj',
tiles = {'more_fire_lamp.png'},
groups = {choppy=2, dig_immediate=2, not_in_creative_inventory=1},
paramtype = 'light',
@ -364,7 +364,7 @@ minetest.register_node('more_fire:oil_lamp_on', {
minetest.register_node('more_fire:oil_lamp_off', {
description = 'oil lamp',
drawtype = 'mesh',
mesh = 'more_fire_lamp.obj',
mesh = 'more_fire_lamp_wall.obj',
tiles = {'more_fire_lamp.png'},
groups = {choppy=2, dig_immediate=2,},
paramtype = 'light',
@ -414,3 +414,96 @@ minetest.register_node('more_fire:oil_lamp_off', {
return true
end,
})
minetest.register_node('more_fire:oil_lamp_table_on', {
description = 'oil lamp',
drawtype = 'mesh',
mesh = 'more_fire_lamp_table.obj',
tiles = {'more_fire_lamp.png'},
groups = {choppy=2, dig_immediate=2, not_in_creative_inventory=1},
paramtype = 'light',
paramtype2 = 'facedir',
walkable = false,
light_source = LIGHT_MAX,
drop = 'more_fire:oil_lamp_off',
selection_box = {
type = 'fixed',
fixed = {-.2, -.5, -0.2, 0.2, .25, .2}, -- Right, Bottom, Back, Left, Top, Front
},
on_timer = function(pos, itemstack)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if inv:contains_item('fuel', 'more_fire:oil') then
local fuelstack = inv:get_stack('fuel', 1)
timer:start(12*60)
fuelstack:take_item()
inv:set_stack('fuel', 1, fuelstack)
if inv:is_empty('fuel') then
minetest.set_node(pos, {name = 'more_fire:oil_lamp_table_off'})
end
timer:stop()
elseif inv:is_empty('fuel') then
minetest.set_node(pos, {name = 'more_fire:oil_lamp_table_off'})
timer:stop()
end
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty('fuel')
end,
})
minetest.register_node('more_fire:oil_lamp_table_off', {
description = 'oil lamp',
drawtype = 'mesh',
mesh = 'more_fire_lamp_table.obj',
tiles = {'more_fire_lamp.png'},
groups = {choppy=2, dig_immediate=2,},
paramtype = 'light',
paramtype2 = 'facedir',
walkable = false,
inventory_image = 'more_fire_lamp_table_inv.png',
wield_image = 'more_fire_lamp_table_inv.png',
light_source = 1,
selection_box = {
type = 'fixed',
fixed = {-.2, -.4, -0.1, 0.2, .35, .5},
},
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
inv:set_size('main', 8*4)
inv:set_size('fuel', 1)
meta:set_string('formspec',
'size[8,6]'..
'label[2,.75;Add lantern oil for a brighter flame.]' ..
'list[current_name;fuel;1,.5;1,1]'..
'list[current_player;main;0,2;8,4;]')
meta:set_string('infotext', 'Oil Lantern')
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if inv:contains_item('fuel', 'more_fire:oil') then
minetest.swap_node(pos, {name = 'more_fire:oil_lamp_table_on'})
timer:start(12*60) --one oil unit will burn for 12 minutes
meta:set_string('infotext', 'Burning Oil Lamp')
meta:set_string('formspec',
'size[8,6]'..
'label[2,.75;keep filled with lantern oil for a bright flame.]' ..
'list[current_name;fuel;1,.5;1,1]'..
'list[current_player;main;0,2;8,4;]')
end
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty('fuel') then
return false
end
return true
end,
})

View File

@ -1,418 +0,0 @@
minetest.override_item('default:gravel', {
drop = {
max_items = 1,
items = {
{
items = {'more_fire:flintstone'},
rarity = 15,
},
{
items = {'default:gravel'},
}
}
},
})
minetest.register_node(':default:torch', {
description = 'Torch',
drawtype = 'nodebox',
tiles = {
{name = 'more_fire_torch_top.png'},
{name = 'more_fire_torch_bottom.png'},
{name = 'more_fire_torch_side.png'},
},
inventory_image = 'more_fire_torch_inv.png',
wield_image = 'more_fire_torch_inv.png',
paramtype = 'light',
paramtype2 = 'wallmounted',
sunlight_propagates = true,
is_ground_content = false,
walkable = false,
light_source = LIGHT_MAX - 1,
node_box = {
type = 'wallmounted',
wall_top = {-0.0625, -0.0625, -0.0625, 0.0625, 0.5 , 0.0625},
wall_bottom = {-0.0625, -0.5 , -0.0625, 0.0625, 0.0625, 0.0625},
wall_side = {-0.5 , -0.5 , -0.0625, -0.375, 0.0625, 0.0625},
},
selection_box = {
type = 'wallmounted',
wall_top = {-0.1, -0.05, -0.1, 0.1, 0.5 , 0.1},
wall_bottom = {-0.1, -0.5 , -0.1, 0.1, 0.0625, 0.1},
wall_side = {-0.35, -0.5 , -0.1, -0.5, 0.0625, 0.1},
},
groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1, hot = 2},
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
if finite_torches == true then
local timer = minetest.get_node_timer(pos)
timer:start(960)
end
end,
on_timer = function(pos, elapsed)
local timer = minetest.get_node_timer(pos)
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = 'more_fire:torch_stub', param2 = node.param2})
timer:stop()
end,
})
minetest.register_node('more_fire:torch_stub', {
description = 'burnt out torch',
drawtype = 'nodebox',
tiles = {
{name = 'more_fire_torch_stub_top.png'},
{name = 'more_fire_torch_stub_bottom.png'},
{name = 'more_fire_torch_stub_side.png'},
},
inventory_image = 'more_fire_torch_stub_inv.png',
wield_image = 'more_fire_torch_stub_inv.png',
paramtype = 'light',
paramtype2 = 'wallmounted',
sunlight_propagates = true,
is_ground_content = false,
walkable = false,
node_box = {
type = 'wallmounted',
wall_top = {-0.0625, 0.2, -0.0625, 0.0625, 0.5 , 0.0625},
wall_bottom = {-0.0625, -0.5 , -0.0625, 0.0625, -0.2, 0.0625},
wall_side = {-0.5 , -0.5 , -0.0625, -0.375, -0.2, 0.0625},
},
selection_box = {
type = 'wallmounted',
wall_top = {-0.1, 0.2, -0.1, 0.1, 0.5 , 0.1},
wall_bottom = {-0.1, -0.5 , -0.1, 0.1, -0.2, 0.1},
wall_side = {-0.35, -0.5 , -0.1, -0.5, -0.2, 0.1},
},
groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1, not_in_creative_inventory =1},
sounds = default.node_sound_wood_defaults(),})
minetest.register_node('more_fire:charcoal_block', {
description = 'Charcoal Block',
tiles = {'more_fire_charcoal_block.png'},
is_ground_content = true,
groups = {oddly_breakable_by_hand=2,cracky=3,flammable=1,},
})
minetest.register_node('more_fire:kindling', {
description = 'Kindling',
drawtype = 'mesh',
mesh = 'more_fire_kindling.obj',
tiles = {'more_fire_campfire_logs.png'},
inventory_image = 'more_fire_kindling.png',
wield_image = 'more_fire_kindling.png',
walkable = false,
is_ground_content = true,
groups = {dig_immediate=2, flammable=1,},
paramtype = 'light',
selection_box = {
type = 'fixed',
fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 }, -- Right, Bottom, Back, Left, Top, Front
},
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
-- meta:set_string('formspec', more_fire.embers_formspec)
local inv = meta:get_inventory()
inv:set_size('fuel', 4)
end,
})
minetest.register_node('more_fire:embers', {
description = 'Campfire',
drawtype = 'mesh',
mesh = 'more_fire_kindling.obj',
tiles = {'more_fire_campfire_logs.png'},
inventory_image = 'more_fire_campfire.png',
wield_image = 'more_fire_campfire.png',
walkable = false,
is_ground_content = true,
groups = {dig_immediate=3, flammable=1,},
paramtype = 'light',
light_source = 5,
drop = 'more_fire:kindling',
selection_box = {
type = 'fixed',
fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 },
},
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local timer = minetest.get_node_timer(pos)
meta:set_string('formspec', more_fire.embers_formspec)
meta:set_string('infotext', 'Campfire');
local inv = meta:get_inventory()
inv:set_size('fuel', 1)
timer:start(180)
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty('fuel') then
return false
end
return true
end,
on_timer = function(pos, elapsed)
local timer = minetest.get_node_timer(pos)
timer:stop()
minetest.set_node(pos, {name = 'more_fire:kindling'})
end,
after_place_node = function(pos)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local fuel = nil
local fuellist = inv:get_list('fuel')
if fuellist then
fuel = minetest.get_craft_result({method = 'fuel', width = 1, items = fuellist})
end
if fuel.time <= 0 then
if inv:is_empty('fuel') then
timer:start(180)
end
end
end,
})
minetest.register_node('more_fire:campfire', {
description = 'Burning Campfire',
drawtype = 'mesh',
mesh = 'more_fire_campfire.obj',
tiles = {
{name='fire_basic_flame_animated.png', animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='more_fire_campfire_logs.png'}},
inventory_image = 'more_fire_campfire.png',
wield_image = 'more_fire_campfire.png',
paramtype = 'light',
walkable = false,
damage_per_second = 1,
light_source = 14,
is_ground_content = true,
groups = {cracky=2,hot=2,attached_node=1,igniter=1,not_in_creative_inventory=1},
selection_box = {
type = 'fixed',
fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 },
},
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty('fuel') then
return false
end
return true
end,
get_staticdata = function(self)
end,
})
minetest.register_node('more_fire:kindling_contained', {
description = 'Contained Kindling',
drawtype = 'mesh',
mesh = 'more_fire_kindling_contained.obj',
tiles = {'more_fire_campfire_logs.png'},
inventory_image = 'more_fire_kindling_contained.png',
wield_image = 'more_fire_kindling.png',
walkable = false,
is_ground_content = true,
groups = {dig_immediate=3,flammable=1},
paramtype = 'light',
selection_box = {
type = 'fixed',
fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 },
},
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
inv:set_size('fuel', 4)
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty('fuel') then
return false
end
return true
end,
})
minetest.register_node('more_fire:embers_contained', {
description = 'Contained Campfire',
drawtype = 'mesh',
mesh = 'more_fire_kindling_contained.obj',
tiles = {'more_fire_campfire_logs.png'},
walkable = false,
is_ground_content = true,
groups = {dig_immediate=3, flammable=1, not_in_creative_inventory=1},
paramtype = 'light',
light_source = 5,
drop = 'more_fire:kindling_contained',
inventory_image = 'more_fire_campfire_contained.png',
wield_image = 'more_fire_campfire_contained.png',
selection_box = {
type = 'fixed',
fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 },
},
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local timer = minetest.get_node_timer(pos)
meta:set_string('formspec', more_fire.embers_formspec)
meta:set_string('infotext', 'Campfire');
local inv = meta:get_inventory()
inv:set_size('fuel', 4)
timer:start(190)
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty('fuel') then
return false
end
return true
end,
on_timer = function(pos, elapsed)
local timer = minetest.get_node_timer(pos)
timer:stop()
minetest.set_node(pos, {name = 'more_fire:kindling_contained'})
end,
after_place_node = function(pos)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local fuel = nil
local fuellist = inv:get_list('fuel')
if fuellist then
fuel = minetest.get_craft_result({method = 'fuel', width = 1, items = fuellist})
end
if fuel.time <= 0 then
if inv:is_empty('fuel') then
timer:start(190)
end
end
end,
})
minetest.register_node('more_fire:campfire_contained', {
description = 'Contained Campfire',
drawtype = 'mesh',
mesh = 'more_fire_contained_campfire.obj',
tiles = {
{name='fire_basic_flame_animated.png', animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='more_fire_campfire_logs.png'}},
inventory_image = 'more_fire_campfire_contained.png',
wield_image = 'more_fire_campfire_contained.png',
paramtype = 'light',
walkable = false,
damage_per_second = 1,
drop = 'more_fire:charcoal',
light_source = 14,
is_ground_content = true,
groups = {cracky=2,hot=2,attached_node=1,dig_immediate=3,not_in_creative_inventory=1},
selection_box = {
type = 'fixed',
fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 },
},
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty('fuel') then
return false
end
return true
end,
get_staticdata = function(self)
end,
})
minetest.register_node('more_fire:oil_lamp_on', {
description = 'oil lamp',
drawtype = 'mesh',
mesh = 'more_fire_lamp.obj',
tiles = {'more_fire_lamp.png'},
groups = {choppy=2, dig_immediate=2, not_in_creative_inventory=1},
paramtype = 'light',
paramtype2 = 'facedir',
walkable = false,
light_source = LIGHT_MAX,
drop = 'more_fire:oil_lamp_off',
selection_box = {
type = 'fixed',
fixed = {-.2, -.4, -0.1, 0.2, .35, .5},
},
on_timer = function(pos, itemstack)
local node = minetest.get_node(pos)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if inv:contains_item('fuel', 'more_fire:oil') then
local fuelstack = inv:get_stack('fuel', 1)
timer:start(12*60)
fuelstack:take_item()
inv:set_stack('fuel', 1, fuelstack)
if inv:is_empty('fuel') then
minetest.set_node(pos, {name = 'more_fire:oil_lamp_off', param2=node.param2})
end
timer:stop()
elseif inv:is_empty('fuel') then
minetest.set_node(pos, {name = 'more_fire:oil_lamp_off', param2=node.param2})
timer:stop()
end
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty('fuel')
end,
})
minetest.register_node('more_fire:oil_lamp_off', {
description = 'oil lamp',
drawtype = 'mesh',
mesh = 'more_fire_lamp.obj',
tiles = {'more_fire_lamp.png'},
groups = {choppy=2, dig_immediate=2,},
paramtype = 'light',
paramtype2 = 'facedir',
walkable = false,
inventory_image = 'more_fire_lamp_inv.png',
wield_image = 'more_fire_lamp_inv.png',
light_source = 1,
selection_box = {
type = 'fixed',
fixed = {-.2, -.4, -0.1, 0.2, .35, .5},
},
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
inv:set_size('main', 8*4)
inv:set_size('fuel', 1)
meta:set_string('formspec',
'size[8,6]'..
'label[2,.75;Add lantern oil for a brighter flame.]' ..
'list[current_name;fuel;1,.5;1,1]'..
'list[current_player;main;0,2;8,4;]')
meta:set_string('infotext', 'Oil Lantern')
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
local node = minetest.get_node(pos)
if inv:contains_item('fuel', 'more_fire:oil') then
minetest.swap_node(pos, {name = 'more_fire:oil_lamp_on', param2=node.param2})
timer:start(12*60) --one oil unit will burn for 12 minutes
meta:set_string('infotext', 'Burning Oil Lamp')
meta:set_string('formspec',
'size[8,6]'..
'label[2,.75;keep filled with lantern oil for a bright flame.]' ..
'list[current_name;fuel;1,.5;1,1]'..
'list[current_player;main;0,2;8,4;]')
end
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty('fuel') then
return false
elseif not inv:is_empty("main") then
return false
end
return true
end,
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 828 B

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B