added furnace

This commit is contained in:
cale 2016-01-11 18:37:58 +01:00
parent 2e455dffd4
commit 93a3f94f47
10 changed files with 126 additions and 0 deletions

16
mods/furnace/LICENSE.txt Normal file
View File

@ -0,0 +1,16 @@
License for Code
----------------
Copyright (C) 2016 cd2 (cdqwertz) <cdqwertz@gmail.com>
This program is free software; 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; either version 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License for Media
-----------------
CC-BY-SA 3.0 UNPORTED. Created by cd2 (cdqwertz)

55
mods/furnace/init.lua Normal file
View File

@ -0,0 +1,55 @@
minetest.register_node("furnace:furnace", {
description = "Furnace",
tiles = {"furnace_stone_tile.png", "furnace_stone_tile.png", "furnace_stone_tile.png", "furnace_stone_tile.png","furnace_stone_tile.png","furnace_stone_front.png"},
groups = {cracky = 2},
paramtype2 = "facedir",
})
minetest.register_abm({
nodenames = {"furnace:furnace"},
neighbors = {"group:pattern"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local lavapos = pos
lavapos.y = lavapos.y - 2
if minetest.get_node(lavapos).name == "lava:lava_source" then
local patternpos = pos
patternpos.y = patternpos.y + 1
local p = {
x = pos.x + math.random(0, 5)/5 - 0.5,
y = pos.y + 3,
z = pos.z + math.random(0, 5)/5 - 0.5
}
local pattern = minetest.get_node(patternpos).name
if pattern == "furnace:pattern_rod" then
minetest.add_item(p, {name = "furnace:iron_rod"})
print("rod")
end
end
end,
})
minetest.register_node("furnace:pattern_rod", {
description = "Pattern for a Rod",
tiles = {"furnace_pattern_rod.png", "default_wooden_planks.png"},
groups = {snappy = 3, pattern = 1},
})
minetest.register_craftitem("furnace:iron_rod", {
description = "Iron Rod",
inventory_image = "furnace_iron_rod.png",
})
minetest.register_craftitem("furnace:gold_rod", {
description = "Gold Rod",
inventory_image = "furnace_gold_rod.png",
})
minetest.register_craftitem("furnace:diamond_rod", {
description = "Diamond Rod",
inventory_image = "furnace_diamond_rod.png",
})

55
mods/furnace/init.lua~ Normal file
View File

@ -0,0 +1,55 @@
minetest.register_node("furnace:furnace", {
description = "Furnace",
tiles = {"furnace_stone_tile.png", "furnace_stone_tile.png", "furnace_stone_tile.png", "furnace_stone_tile.png","furnace_stone_tile.png","furnace_stone_front.png"},
groups = {cracky = 2},
paramtype2 = "facedir",
})
minetest.register_abm({
nodenames = {"furnace:furnace"},
neighbors = {"group:pattern"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local lavapos = pos
lavapos.y = lavapos.y - 2
if minetest.get_node(lavapos).name == "lava:lava_source" then
local patternpos = pos
patternpos.y = patternpos.y + 1
local p = {
x = pos.x + math.random(0, 5)/5 - 0.5,
y = pos.y + 3,
z = pos.z + math.random(0, 5)/5 - 0.5
}
local pattern = minetest.get_node(patternpos).name
if pattern == "furnace:pattern_rod" then
minetest.add_item(p, {name = "furnace:iron_rod"})
print("rod")
end
end
end,
})
minetest.register_node("furnace:pattern_rod", {
description = "Pattern for a Rod",
tiles = {"furnace_pattern_rod.png", "default_wooden_planks.png"},
groups = {snappy = 3, pattern = 1},
})
minetest.register_craftitem("furnace:iron_rod", {
description = "Iron Rod",
inventory_image = "furnace_iron_rod.png",
})
minetest.register_craftitem("furnace:gold_rod", {
description = "Gold Rod",
inventory_image = "furnace_gold_rod.png",
})
minetest.register_craftitem("furnace:diamond_rod", {
description = "Diamond Rod",
inventory_image = "furnace_diamond_rod.png",
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B