commit 0bbd0ba18a047b8f3549ae73a1b0919e97f8ca44 Author: ezhh Date: Thu Jul 21 22:07:52 2016 +0100 First commit diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..fbd3ff8 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,7 @@ + + +Torch model: CC-BY 3.0 BlockMen, from the mod: https://github.com/BlockMen/torches + +Original torch textures from minetest_game/default + +Recoloured textures and edits by Shara RedCat \ No newline at end of file diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..c7d5fda --- /dev/null +++ b/init.lua @@ -0,0 +1,119 @@ + +local colour_list = { + {"black", "Darkened",}, {"blue", "Blue",}, + {"cyan", "Cyan",}, {"green", "Green",}, + {"magenta", "Magenta",}, {"orange", "Orange",}, + {"purple", "Purple",}, {"red", "Red",}, + {"yellow", "Yellow",}, {"white", "Frosted",}, +} + +for i in ipairs(colour_list) do + local colour = colour_list[i][1] + local desc = colour_list[i][2] + + minetest.register_craftitem("abritorch:torch_"..colour, { + description = desc.." Torch", + inventory_image = "abritorch_torch_on_floor_"..colour..".png", + wield_image = "abritorch_torch_on_floor_"..colour..".png", + wield_scale = {x = 1, y = 1, z = 1 + 1/16}, + liquids_pointable = false, + on_place = function(itemstack, placer, pointed_thing) + local above = pointed_thing.above + local under = pointed_thing.under + local wdir = minetest.dir_to_wallmounted({x = under.x - above.x, y = under.y - above.y, z = under.z - above.z}) + if wdir < 1 and not torches.enable_ceiling then + return itemstack + end + local fakestack = itemstack + local retval = false + if wdir <= 1 then + retval = fakestack:set_name("abritorch:floor_"..colour) + else + retval = fakestack:set_name("abritorch:wall_"..colour) + end + if not retval then + return itemstack + end + itemstack, retval = minetest.item_place(fakestack, placer, pointed_thing, dir) + itemstack:set_name("abritorch:torch_"..colour) + + return itemstack + end + }) + + minetest.register_node("abritorch:floor_"..colour, { + description = desc.." Torch", + inventory_image = "abritorch_torch_on_floor_"..colour..".png", + wield_image = "abritorch_torch_on_floor_"..colour..".png", + wield_scale = {x = 1, y = 1, z = 1 + 1/16}, + drawtype = "mesh", + mesh = "torch_floor.obj", + tiles = { + { + name = "abritorch_torch_on_floor_animated_"..colour..".png", + animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3} + } + }, + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + walkable = false, + light_source = 13, + groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1}, + drop = "abritorch:torch_"..colour, + selection_box = { + type = "wallmounted", + wall_top = {-1/16, -2/16, -1/16, 1/16, 0.5, 1/16}, + wall_bottom = {-1/16, -0.5, -1/16, 1/16, 2/16, 1/16}, + }, + }) + + minetest.register_node("abritorch:wall_"..colour, { + inventory_image = "abritorch_torch_on_floor_"..colour..".png", + wield_image = "abritorch_torch_on_floor_"..colour..".png", + wield_scale = {x = 1, y = 1, z = 1 + 1/16}, + drawtype = "mesh", + mesh = "torch_wall.obj", + tiles = { + { + name = "abritorch_torch_on_floor_animated_"..colour..".png", + animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3} + } + }, + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + walkable = false, + light_source = 13, + groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1}, + drop = "abritorch:torch_"..colour, + selection_box = { + type = "wallmounted", + wall_top = {-0.1, -0.1, -0.1, 0.1, 0.5, 0.1}, + wall_bottom = {-0.1, -0.5, -0.1, 0.1, 0.1, 0.1}, + wall_side = {-0.5, -0.3, -0.1, -0.2, 0.3, 0.1}, + }, + }) + + minetest.register_abm({ + nodenames = {"abritorch:torch_"..colour}, + interval = 1, + chance = 1, + action = function(pos) + local n = minetest.get_node(pos) + local def = minetest.registered_nodes[n.name] + if n and def then + local wdir = n.param2 + local node_name = "abritorch:wall_"..colour + if wdir < 1 and not torches.enable_ceiling then + minetest.remove_node(pos) + return + elseif wdir <= 1 then + node_name = "abritorch:floor_"..colour + end + minetest.set_node(pos, {name = node_name, param2 = wdir}) + end + end + }) +end + diff --git a/models/torch_floor.obj b/models/torch_floor.obj new file mode 100644 index 0000000..bb82af5 --- /dev/null +++ b/models/torch_floor.obj @@ -0,0 +1,48 @@ +# Blender v2.73 (sub 0) OBJ File: 'mt_torch_full_vertices3.blend' +# www.blender.org +mtllib mt_torch_full_vertices3.mtl +o Cube_Cube.001 +v 0.061653 -0.496733 0.061674 +v 0.061653 -0.496733 -0.062460 +v -0.059258 -0.496733 0.061674 +v -0.059258 -0.496733 -0.062460 +v -0.059994 -0.497234 0.497315 +v -0.059994 -0.497234 -0.498102 +v -0.059994 0.507706 -0.498102 +v -0.059994 0.507706 0.497315 +v -0.494900 0.507706 0.061709 +v -0.494900 -0.497234 0.061709 +v 0.497295 0.507706 0.061709 +v 0.497295 -0.497234 0.061709 +v 0.062686 0.507706 -0.498102 +v 0.062686 -0.497234 -0.498102 +v 0.062686 0.507706 0.497315 +v 0.062686 -0.497234 0.497315 +v -0.494900 0.507706 -0.063149 +v -0.494900 -0.497234 -0.063149 +v 0.497295 0.507706 -0.063149 +v 0.497295 -0.497234 -0.063149 +v -0.058217 0.134520 0.060216 +v -0.058217 0.135872 -0.061813 +v 0.061944 0.135872 -0.061813 +v 0.061944 0.134520 0.060216 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 0.437500 0.500000 +vt 0.562500 0.500000 +vt 0.562500 0.625000 +vt 0.437541 0.625000 +vt 0.437541 0.000000 +vt 0.562500 0.000000 +vt 0.562500 0.125000 +vt 0.437500 0.125000 +usemtl None +s off +f 11/1 9/2 10/3 12/4 +f 22/5 21/6 24/7 23/8 +f 17/2 19/1 20/4 18/3 +f 13/2 15/1 16/4 14/3 +f 3/9 4/10 2/11 1/12 +f 8/1 7/2 6/3 5/4 diff --git a/models/torch_wall.obj b/models/torch_wall.obj new file mode 100644 index 0000000..2385563 --- /dev/null +++ b/models/torch_wall.obj @@ -0,0 +1,48 @@ +# Blender v2.73 (sub 0) OBJ File: 'mt_torch_full_vertices3.blend' +# www.blender.org +mtllib torch_wall4.mtl +o Cube_Cube.001 +v 0.061653 -0.554493 -0.328908 +v 0.061653 -0.442208 -0.381835 +v -0.059258 -0.554493 -0.328908 +v -0.059258 -0.442208 -0.381835 +v -0.059994 -0.948766 -0.143618 +v -0.059994 -0.048361 -0.568031 +v -0.059994 0.380112 0.340988 +v -0.059994 -0.520293 0.765401 +v -0.494900 -0.126265 0.579672 +v -0.494900 -0.554738 -0.329346 +v 0.497295 -0.126265 0.579672 +v 0.497295 -0.554738 -0.329346 +v 0.062686 0.380112 0.340988 +v 0.062686 -0.048361 -0.568031 +v 0.062686 -0.520293 0.765401 +v 0.062686 -0.948766 -0.143618 +v -0.494900 -0.013324 0.526437 +v -0.494900 -0.441797 -0.382582 +v 0.497295 -0.013324 0.526437 +v 0.497295 -0.441797 -0.382582 +v -0.058217 -0.284029 0.241470 +v -0.058217 -0.173071 0.190665 +v 0.061944 -0.173071 0.190665 +v 0.061944 -0.284029 0.241470 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 0.437500 0.500000 +vt 0.562500 0.500000 +vt 0.562500 0.625000 +vt 0.437541 0.625000 +vt 0.437541 0.000000 +vt 0.562500 0.000000 +vt 0.562500 0.125000 +vt 0.437500 0.125000 +usemtl None +s off +f 11/1 9/2 10/3 12/4 +f 22/5 21/6 24/7 23/8 +f 17/2 19/1 20/4 18/3 +f 13/2 15/1 16/4 14/3 +f 3/9 4/10 2/11 1/12 +f 8/1 7/2 6/3 5/4 diff --git a/textures/abritorch_torch_on_floor_animated_black.png b/textures/abritorch_torch_on_floor_animated_black.png new file mode 100644 index 0000000..459faae Binary files /dev/null and b/textures/abritorch_torch_on_floor_animated_black.png differ diff --git a/textures/abritorch_torch_on_floor_animated_blue.png b/textures/abritorch_torch_on_floor_animated_blue.png new file mode 100644 index 0000000..811063a Binary files /dev/null and b/textures/abritorch_torch_on_floor_animated_blue.png differ diff --git a/textures/abritorch_torch_on_floor_animated_cyan.png b/textures/abritorch_torch_on_floor_animated_cyan.png new file mode 100644 index 0000000..79ab160 Binary files /dev/null and b/textures/abritorch_torch_on_floor_animated_cyan.png differ diff --git a/textures/abritorch_torch_on_floor_animated_green.png b/textures/abritorch_torch_on_floor_animated_green.png new file mode 100644 index 0000000..88f9b1a Binary files /dev/null and b/textures/abritorch_torch_on_floor_animated_green.png differ diff --git a/textures/abritorch_torch_on_floor_animated_magenta.png b/textures/abritorch_torch_on_floor_animated_magenta.png new file mode 100644 index 0000000..8aaba65 Binary files /dev/null and b/textures/abritorch_torch_on_floor_animated_magenta.png differ diff --git a/textures/abritorch_torch_on_floor_animated_orange.png b/textures/abritorch_torch_on_floor_animated_orange.png new file mode 100644 index 0000000..714bfc9 Binary files /dev/null and b/textures/abritorch_torch_on_floor_animated_orange.png differ diff --git a/textures/abritorch_torch_on_floor_animated_purple.png b/textures/abritorch_torch_on_floor_animated_purple.png new file mode 100644 index 0000000..4b3fbc7 Binary files /dev/null and b/textures/abritorch_torch_on_floor_animated_purple.png differ diff --git a/textures/abritorch_torch_on_floor_animated_red.png b/textures/abritorch_torch_on_floor_animated_red.png new file mode 100644 index 0000000..a7c8841 Binary files /dev/null and b/textures/abritorch_torch_on_floor_animated_red.png differ diff --git a/textures/abritorch_torch_on_floor_animated_white.png b/textures/abritorch_torch_on_floor_animated_white.png new file mode 100644 index 0000000..3e1d42a Binary files /dev/null and b/textures/abritorch_torch_on_floor_animated_white.png differ diff --git a/textures/abritorch_torch_on_floor_animated_yellow.png b/textures/abritorch_torch_on_floor_animated_yellow.png new file mode 100644 index 0000000..be3010a Binary files /dev/null and b/textures/abritorch_torch_on_floor_animated_yellow.png differ diff --git a/textures/abritorch_torch_on_floor_black.png b/textures/abritorch_torch_on_floor_black.png new file mode 100644 index 0000000..308f2a5 Binary files /dev/null and b/textures/abritorch_torch_on_floor_black.png differ diff --git a/textures/abritorch_torch_on_floor_blue.png b/textures/abritorch_torch_on_floor_blue.png new file mode 100644 index 0000000..029e69a Binary files /dev/null and b/textures/abritorch_torch_on_floor_blue.png differ diff --git a/textures/abritorch_torch_on_floor_cyan.png b/textures/abritorch_torch_on_floor_cyan.png new file mode 100644 index 0000000..1ee049f Binary files /dev/null and b/textures/abritorch_torch_on_floor_cyan.png differ diff --git a/textures/abritorch_torch_on_floor_green.png b/textures/abritorch_torch_on_floor_green.png new file mode 100644 index 0000000..0e41638 Binary files /dev/null and b/textures/abritorch_torch_on_floor_green.png differ diff --git a/textures/abritorch_torch_on_floor_magenta.png b/textures/abritorch_torch_on_floor_magenta.png new file mode 100644 index 0000000..4a701cc Binary files /dev/null and b/textures/abritorch_torch_on_floor_magenta.png differ diff --git a/textures/abritorch_torch_on_floor_orange.png b/textures/abritorch_torch_on_floor_orange.png new file mode 100644 index 0000000..099d37d Binary files /dev/null and b/textures/abritorch_torch_on_floor_orange.png differ diff --git a/textures/abritorch_torch_on_floor_purple.png b/textures/abritorch_torch_on_floor_purple.png new file mode 100644 index 0000000..c797d1b Binary files /dev/null and b/textures/abritorch_torch_on_floor_purple.png differ diff --git a/textures/abritorch_torch_on_floor_red.png b/textures/abritorch_torch_on_floor_red.png new file mode 100644 index 0000000..ec82370 Binary files /dev/null and b/textures/abritorch_torch_on_floor_red.png differ diff --git a/textures/abritorch_torch_on_floor_white.png b/textures/abritorch_torch_on_floor_white.png new file mode 100644 index 0000000..308f2a5 Binary files /dev/null and b/textures/abritorch_torch_on_floor_white.png differ diff --git a/textures/abritorch_torch_on_floor_yellow.png b/textures/abritorch_torch_on_floor_yellow.png new file mode 100644 index 0000000..1e07760 Binary files /dev/null and b/textures/abritorch_torch_on_floor_yellow.png differ