Compare commits

...

3 Commits

Author SHA1 Message Date
Antonio Navarro c2eb9b6f6a Merge remote-tracking branch 'origin/master' into Lantern_Item_Feature 2020-08-07 23:57:46 +02:00
Antonio Navarro e6f4243497 First mesh version of lantern item
First version of lantern item defined with a mesh
2020-08-07 23:28:59 +02:00
Antonio Navarro c3d7780ce6 First approach to Lantern item for Mineclone2 2020-07-23 18:26:56 +02:00
13 changed files with 560 additions and 0 deletions

View File

@ -0,0 +1,40 @@
Minetest mod "Lantern"
======================
(c) Copyright Antonio Navarro (antonio at hunos dot net) (2020)
About this mod:
~~~~~~~~~~~~~~~
This mod add the 'lantern' item to mineclone. It is based in the mcl_torches mod and
developed with minetest 5.2.0. It is possible that works in previous versions, but I've not tested it.
License:
~~~~~~~~
Models:
CC-BY 3.0
Code:
Licensed under the GNU LGPL version 2.1 or higher.
You can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License
as published by the Free Software Foundation;
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt
Github:
~~~~~~~
Forum:
~~~~~~
Changelog:
~~~~~~~~~~
see changelog.txt

View File

@ -0,0 +1,3 @@
mcl_core
mcl_sounds
doc?

View File

@ -0,0 +1 @@
It's just a clone of Minecraft lantern. For decorative purposes only.

View File

@ -0,0 +1,154 @@
-- support for MT game translation.
local S = minetest.get_translator("mcl_lantern")
local function on_flood(pos, oldnode, newnode)
minetest.add_item(pos, ItemStack("mcl_lantern:lantern_iron 1"))
-- Play flame-extinguish sound if liquid is not an 'igniter'
local nodedef = minetest.registered_items[newnode.name]
if not (nodedef and nodedef.groups and
nodedef.groups.igniter and nodedef.groups.igniter > 0) then
minetest.sound_play(
"default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.1},
true
)
end
return false
end
minetest.register_node("mcl_lantern:lantern_iron", {
description = S("Lantern"),
_tt_help = S("You can use it as a source of light"),
_doc_items_longdesc = S("Lanterns are light sources which can be placed on top or on the bottom of most blocks."),
_doc_items_usagehelp = S("Lanterns can be placed above or below most solid blocks."),
drawtype = "mesh",
mesh = "Minetest_Lantern_floor.obj",
inventory_image = "mcl_lantern_lantern_iron_inventory.png",
wield_image = "mcl_lantern_lantern_iron_inventory.png",
tiles = {{
name = "mcl_lantern_lantern_iron_anim.png",
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 4}
}},
is_ground_content = false,
stack_max = 64,
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
liquids_pointable = false,
light_source = minetest.LIGHT_MAX,
groups = {dig_immediate=3, flammable=0, attached_node=1, torch=1, deco_block=1},
drop = "mcl_lantern:lantern_iron",
selection_box = {
type = "wallmounted",
wall_bottom = {-4/16, -8/16, -4/16, 4/16, 2/16, 4/16},
},
sounds = mcl_sounds.node_sound_metal_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local under = pointed_thing.under
local node = minetest.get_node(under)
local def = minetest.registered_nodes[node.name]
if def and def.on_rightclick and
not (placer and placer:is_player() and
placer:get_player_control().sneak) then
return def.on_rightclick(under, node, placer, itemstack,
pointed_thing) or itemstack
end
local above = pointed_thing.above
local wdir = minetest.dir_to_wallmounted(vector.subtract(under, above))
local fakestack = itemstack
if wdir == 0 then
fakestack:set_name("mcl_lantern:lantern_iron_ceiling")
elseif wdir == 1 then
fakestack:set_name("mcl_lantern:lantern_iron")
else
-- fakestack:set_name("mcl_lantern:lantern_iron_wall")
return itemstack
end
itemstack = minetest.item_place(fakestack, placer, pointed_thing, wdir)
itemstack:set_name("mcl_lantern:lantern_iron")
return itemstack
end,
floodable = true,
on_flood = on_flood,
on_rotate = false
})
--minetest.register_node("mcl_lantern:lantern_iron_wall", {
-- drawtype = "mesh",
-- mesh = "Minetest_Lantern_wall.obj",
-- tiles = {{
-- name = "mcl_lantern_lantern_iron_anim.png",
-- animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 4}
-- }},
-- paramtype = "light",
-- paramtype2 = "wallmounted",
-- sunlight_propagates = true,
-- walkable = false,
-- light_source = 12,
-- groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1},
-- drop = "mcl_lantern:lantern_iron",
-- selection_box = {
-- type = "wallmounted",
-- wall_side = {-3/16, -8/16, -3/16, 3/16, 2/16, 3/16},
-- },
-- sounds = mcl_sounds.node_sound_metal_defaults(),
-- floodable = true,
-- on_flood = on_flood,
-- on_rotate = false
--})
minetest.register_node("mcl_lantern:lantern_iron_ceiling", {
drawtype = "mesh",
mesh = "Minetest_Lantern_ceiling.obj",
tiles = {{
name = "mcl_lantern_lantern_iron_anim.png",
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 4}
}},
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
light_source = minetest.LIGHT_MAX,
groups = {dig_immediate=3, flammable=0, attached_node=1, torch=1, deco_block=1},
drop = "mcl_lantern:lantern_iron",
selection_box = {
type = "wallmounted",
wall_top = {-4/16, -7/16, -4/16, 4/16, 3/16, 4/16},
},
sounds = mcl_sounds.node_sound_metal_defaults(),
floodable = true,
on_flood = on_flood,
on_rotate = false
})
minetest.register_lbm({
name = "mcl_lantern:3dlantern",
nodenames = {"mcl_lantern:lantern_iron", "mcl_lantern:lantern_iron_ceiling", "mcl_lantern:lantern_iron_wall"},
action = function(pos, node)
if node.param2 == 0 then
minetest.set_node(pos, {name = "mcl_lantern:lantern_iron_ceiling",
param2 = node.param2})
elseif node.param2 == 1 then
minetest.set_node(pos, {name = "mcl_lantern:lantern_iron",
param2 = node.param2})
else
-- minetest.set_node(pos, {name = "mcl_lantern:lantern_iron_wall",
-- param2 = node.param2})
end
end
})
minetest.register_craft({
output = "mcl_lantern:lantern_iron",
recipe = {
{"mcl_core:iron_nugget", "mcl_core:iron_nugget", "mcl_core:iron_nugget"},
{"mcl_core:iron_nugget", "mcl_torches:torch", "mcl_core:iron_nugget"},
{"mcl_core:iron_nugget", "mcl_core:iron_nugget", "mcl_core:iron_nugget"}
}
})

View File

@ -0,0 +1,5 @@
# textdomain: mcl_lantern
Lantern=Laternen
Lanterns are light sources which can be placed on top or on the bottom of most blocks.=Laternen sind Lichtquellen, die oben oder unten auf den meisten Blöcken platziert werden können.
You can use it as a source of light=Sie können es als Lichtquelle verwenden
Lanterns can be placed above or below most solid blocks=Laternen können über oder unter den meisten festen Blöcken platziert werden

View File

@ -0,0 +1,5 @@
# textdomain: mcl_lantern
Lantern=Linterna
Lanterns are light sources which can be placed on top or on the bottom of most blocks.=Las linternas son fuentes de luz que se pueden colocar en la parte superior o inferior de la mayoría de los bloques.
You can use it as a source of light=Puedes usarlo como fuente de luz
Lanterns can be placed above or below most solid blocks=Las linternas se pueden colocar encima o debajo de la mayoría de los bloques sólidos

View File

@ -0,0 +1,5 @@
# textdomain: mcl_lantern
Lantern=Lanternes
Lanterns are light sources which can be placed on top or on the bottom of most blocks.=Les lanternes sont des sources lumineuses qui peuvent être placées au-dessus ou au-dessous de la plupart des blocs.
You can use it as a source of light=Vous pouvez l'utiliser comme source de lumière
Lanterns can be placed above or below most solid blocks=Les lanternes peuvent être placées au-dessus ou au-dessous de la plupart des blocs solides

View File

@ -0,0 +1,6 @@
# textdomain: mcl_lantern
Lantern=
Lanterns are light sources which can be placed on top or on the bottom of most blocks.=
You can use it as a source of light=
Lanterns can be placed above or below most solid blocks=

View File

@ -0,0 +1 @@
name = mcl_lantern

View File

@ -0,0 +1,170 @@
# Blender v2.83.3 OBJ File: ''
# www.blender.org
o Lantern_3D_mesh
v 0.166158 -0.165734 0.166158
v 0.166158 -0.331892 0.166158
v 0.166158 -0.331892 0.001376
v 0.166158 -0.331892 -0.166158
v 0.166158 -0.165734 -0.166158
v -0.166158 -0.165734 0.166158
v -0.166158 -0.331892 0.166158
v 0.083079 -0.331892 0.083079
v 0.083079 -0.331892 0.000000
v 0.061325 -0.331892 -0.166158
v -0.000000 -0.331892 0.083079
v -0.000000 -0.331892 0.000000
v -0.083079 -0.331892 0.000000
v -0.083079 -0.331892 -0.083079
v -0.000000 -0.331892 -0.083079
v -0.166158 -0.331892 -0.166158
v -0.166158 -0.165734 -0.166158
v 0.249237 -0.165734 0.249237
v 0.249237 -0.165734 -0.249237
v -0.249237 -0.165734 -0.249237
v -0.249237 -0.165734 0.249237
v -0.249237 -0.165734 -0.052499
v -0.166158 -0.165734 0.000597
v -0.083079 -0.498049 0.000000
v -0.000000 -0.498049 0.000000
v -0.083079 -0.498049 -0.083079
v -0.000000 -0.498049 -0.083079
v 0.083079 -0.498049 0.083079
v 0.083079 -0.498049 0.000000
v -0.000000 -0.498049 0.083079
v 0.249237 0.415819 0.249237
v 0.249237 0.415819 -0.249237
v -0.249237 0.415819 -0.249237
v -0.249237 0.415819 0.249237
vt 0.559635 0.007639
vt 0.559635 0.242131
vt 0.442389 0.242131
vt 0.442389 0.125856
vt 0.442389 0.007639
vt 0.932177 0.309300
vt 0.811455 0.309300
vt 0.752581 0.249434
vt 0.812446 0.249434
vt 0.812446 0.189569
vt 0.872311 0.189569
vt 0.932177 0.233759
vt 0.559299 0.431940
vt 0.502592 0.431940
vt 0.502592 0.318526
vt 0.559299 0.318526
vt 0.559824 0.319448
vt 0.559824 0.432862
vt 0.503117 0.432862
vt 0.503117 0.319448
vt 0.503117 0.318575
vt 0.559824 0.318575
vt 0.559824 0.431989
vt 0.503117 0.431989
vt 0.502030 0.432103
vt 0.502030 0.318689
vt 0.558737 0.318689
vt 0.558737 0.432103
vt 0.004535 0.426423
vt 0.004535 0.007365
vt 0.363727 0.007365
vt 0.363727 0.426423
vt 0.812375 0.250656
vt 0.752510 0.250656
vt 0.752510 0.190791
vt 0.812375 0.190791
vt 0.442046 0.008131
vt 0.559292 0.008131
vt 0.559292 0.124956
vt 0.559292 0.242623
vt 0.442046 0.242623
vt 0.932463 0.069371
vt 0.693001 0.069371
vt 0.693001 0.189532
vt 0.633136 0.151271
vt 0.633136 0.009505
vt 0.992328 0.009505
vt 0.992328 0.368697
vt 0.932463 0.308832
vt 0.441825 0.007496
vt 0.559071 0.007496
vt 0.559071 0.241988
vt 0.441825 0.241988
vt 0.441825 0.168015
vt 0.559242 0.318845
vt 0.559242 0.432259
vt 0.502535 0.432259
vt 0.502535 0.318845
vt 0.559497 0.241759
vt 0.442251 0.241759
vt 0.442251 0.007267
vt 0.559497 0.007267
vt 0.559522 0.432730
vt 0.502815 0.432730
vt 0.502815 0.319316
vt 0.559522 0.319316
vt 0.501664 0.432400
vt 0.501664 0.318986
vt 0.558371 0.318986
vt 0.558371 0.432400
vt 0.003846 0.007306
vt 0.363038 0.007306
vt 0.363038 0.426363
vt 0.003846 0.426363
vt 0.363082 0.007724
vt 0.363082 0.426781
vt 0.003890 0.426781
vt 0.003890 0.007724
vt 0.363082 0.007115
vt 0.363082 0.426172
vt 0.221316 0.426172
vt 0.003890 0.426172
vt 0.003890 0.007115
vt 0.992328 0.369399
vt 0.633136 0.369399
vt 0.633136 0.010207
vt 0.992328 0.010207
vt 0.693001 0.308832
vt 0.633136 0.368697
vt 0.559020 0.318462
vt 0.559020 0.431876
vt 0.502313 0.431876
vt 0.502313 0.318462
vt 0.812446 0.129704
vt 0.752581 0.189569
vt 0.692715 0.309300
vt 0.692715 0.069838
vt 0.932177 0.069838
vt 0.872311 0.129704
vt 0.872240 0.190520
vt 0.812375 0.190520
vt 0.812375 0.130654
vt 0.872240 0.130654
vn 1.0000 -0.0000 0.0000
vn -0.0000 -1.0000 -0.0000
vn 0.0000 -0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 1.0000 0.0000
s off
f 5/1/1 1/2/1 2/3/1 3/4/1 4/5/1
f 4/6/2 3/7/2 8/8/2 9/9/2 12/10/2 15/11/2 10/12/2
f 14/13/3 15/14/3 27/15/3 26/16/3
f 27/17/1 15/18/1 12/19/1 25/20/1
f 29/21/3 25/22/3 12/23/3 9/24/3
f 28/25/4 8/26/4 11/27/4 30/28/4
f 31/29/1 18/30/1 19/31/1 32/32/1
f 26/33/2 27/34/2 25/35/2 24/36/2
f 7/37/5 6/38/5 23/39/5 17/40/5 16/41/5
f 5/42/2 17/43/2 23/44/2 22/45/2 20/46/2 19/47/2 18/48/2 1/49/2
f 16/50/3 17/51/3 5/52/3 4/53/3 10/54/3
f 29/55/1 9/56/1 8/57/1 28/58/1
f 6/59/4 7/60/4 2/61/4 1/62/4
f 25/63/5 30/64/5 11/65/5 12/66/5
f 25/67/4 12/68/4 13/69/4 24/70/4
f 19/71/3 20/72/3 33/73/3 32/74/3
f 18/75/4 31/76/4 34/77/4 21/78/4
f 33/79/5 20/80/5 22/81/5 21/82/5 34/83/5
f 32/84/6 33/85/6 34/86/6 31/87/6
f 23/44/2 6/88/2 1/49/2 18/48/2 21/89/2 22/45/2
f 14/90/5 26/91/5 24/92/5 13/93/5
f 13/94/2 12/10/2 11/95/2 8/8/2 3/7/2 2/96/2 7/97/2 16/98/2 10/12/2 15/11/2 14/99/2
f 25/100/2 29/101/2 28/102/2 30/103/2

View File

@ -0,0 +1,170 @@
# Blender v2.83.3 OBJ File: ''
# www.blender.org
o Lantern_3D_mesh
v -0.166158 0.082230 0.166158
v -0.166158 0.248388 0.166158
v -0.166158 0.248388 0.001376
v -0.166158 0.248388 -0.166158
v -0.166158 0.082230 -0.166158
v 0.166158 0.082230 0.166158
v 0.166158 0.248388 0.166158
v -0.083079 0.248388 0.083079
v -0.083079 0.248388 0.000000
v -0.061325 0.248388 -0.166158
v 0.000000 0.248388 0.083079
v 0.000000 0.248388 0.000000
v 0.083079 0.248388 0.000000
v 0.083079 0.248388 -0.083079
v 0.000000 0.248388 -0.083079
v 0.166158 0.248388 -0.166158
v 0.166158 0.082230 -0.166158
v -0.249237 0.082230 0.249237
v -0.249237 0.082230 -0.249237
v 0.249237 0.082230 -0.249237
v 0.249237 0.082230 0.249237
v 0.249237 0.082230 -0.052499
v 0.166158 0.082230 0.000597
v 0.083079 0.414545 0.000000
v 0.000000 0.414545 0.000000
v 0.083079 0.414545 -0.083079
v 0.000000 0.414545 -0.083079
v -0.083079 0.414545 0.083079
v -0.083079 0.414545 0.000000
v 0.000000 0.414545 0.083079
v -0.249237 -0.499323 0.249237
v -0.249237 -0.499323 -0.249237
v 0.249237 -0.499323 -0.249237
v 0.249237 -0.499323 0.249237
vt 0.559635 0.007639
vt 0.559635 0.242131
vt 0.442389 0.242131
vt 0.442389 0.125856
vt 0.442389 0.007639
vt 0.932177 0.309300
vt 0.811455 0.309300
vt 0.752581 0.249434
vt 0.812446 0.249434
vt 0.812446 0.189569
vt 0.872311 0.189569
vt 0.932177 0.233759
vt 0.559299 0.431940
vt 0.502592 0.431940
vt 0.502592 0.318526
vt 0.559299 0.318526
vt 0.559824 0.319448
vt 0.559824 0.432862
vt 0.503117 0.432862
vt 0.503117 0.319448
vt 0.503117 0.318575
vt 0.559824 0.318575
vt 0.559824 0.431989
vt 0.503117 0.431989
vt 0.502030 0.432103
vt 0.502030 0.318689
vt 0.558737 0.318689
vt 0.558737 0.432103
vt 0.004535 0.426423
vt 0.004535 0.007365
vt 0.363727 0.007365
vt 0.363727 0.426423
vt 0.812375 0.250656
vt 0.752510 0.250656
vt 0.752510 0.190791
vt 0.812375 0.190791
vt 0.442046 0.008131
vt 0.559292 0.008131
vt 0.559292 0.124956
vt 0.559292 0.242623
vt 0.442046 0.242623
vt 0.932463 0.069371
vt 0.693001 0.069371
vt 0.693001 0.189532
vt 0.633136 0.151271
vt 0.633136 0.009505
vt 0.992328 0.009505
vt 0.992328 0.368697
vt 0.932463 0.308832
vt 0.441825 0.007496
vt 0.559071 0.007496
vt 0.559071 0.241988
vt 0.441825 0.241988
vt 0.441825 0.168015
vt 0.559242 0.318845
vt 0.559242 0.432259
vt 0.502535 0.432259
vt 0.502535 0.318845
vt 0.559497 0.241759
vt 0.442251 0.241759
vt 0.442251 0.007267
vt 0.559497 0.007267
vt 0.559522 0.432730
vt 0.502815 0.432730
vt 0.502815 0.319316
vt 0.559522 0.319316
vt 0.501664 0.432400
vt 0.501664 0.318986
vt 0.558371 0.318986
vt 0.558371 0.432400
vt 0.003846 0.007306
vt 0.363038 0.007306
vt 0.363038 0.426363
vt 0.003846 0.426363
vt 0.363082 0.007724
vt 0.363082 0.426781
vt 0.003890 0.426781
vt 0.003890 0.007724
vt 0.363082 0.007115
vt 0.363082 0.426172
vt 0.221316 0.426172
vt 0.003890 0.426172
vt 0.003890 0.007115
vt 0.992328 0.369399
vt 0.633136 0.369399
vt 0.633136 0.010207
vt 0.992328 0.010207
vt 0.693001 0.308832
vt 0.633136 0.368697
vt 0.559020 0.318462
vt 0.559020 0.431876
vt 0.502313 0.431876
vt 0.502313 0.318462
vt 0.812446 0.129704
vt 0.752581 0.189569
vt 0.692715 0.309300
vt 0.692715 0.069838
vt 0.932177 0.069838
vt 0.872311 0.129704
vt 0.872240 0.190520
vt 0.812375 0.190520
vt 0.812375 0.130654
vt 0.872240 0.130654
vn -1.0000 -0.0000 0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 -0.0000 1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 -1.0000 0.0000
s off
f 5/1/1 1/2/1 2/3/1 3/4/1 4/5/1
f 4/6/2 3/7/2 8/8/2 9/9/2 12/10/2 15/11/2 10/12/2
f 14/13/3 15/14/3 27/15/3 26/16/3
f 27/17/1 15/18/1 12/19/1 25/20/1
f 29/21/3 25/22/3 12/23/3 9/24/3
f 28/25/4 8/26/4 11/27/4 30/28/4
f 31/29/1 18/30/1 19/31/1 32/32/1
f 26/33/2 27/34/2 25/35/2 24/36/2
f 7/37/5 6/38/5 23/39/5 17/40/5 16/41/5
f 5/42/2 17/43/2 23/44/2 22/45/2 20/46/2 19/47/2 18/48/2 1/49/2
f 16/50/3 17/51/3 5/52/3 4/53/3 10/54/3
f 29/55/1 9/56/1 8/57/1 28/58/1
f 6/59/4 7/60/4 2/61/4 1/62/4
f 25/63/5 30/64/5 11/65/5 12/66/5
f 25/67/4 12/68/4 13/69/4 24/70/4
f 19/71/3 20/72/3 33/73/3 32/74/3
f 18/75/4 31/76/4 34/77/4 21/78/4
f 33/79/5 20/80/5 22/81/5 21/82/5 34/83/5
f 32/84/6 33/85/6 34/86/6 31/87/6
f 23/44/2 6/88/2 1/49/2 18/48/2 21/89/2 22/45/2
f 14/90/5 26/91/5 24/92/5 13/93/5
f 13/94/2 12/10/2 11/95/2 8/8/2 3/7/2 2/96/2 7/97/2 16/98/2 10/12/2 15/11/2 14/99/2
f 25/100/2 29/101/2 28/102/2 30/103/2

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB