added furnace
16
mods/furnace/LICENSE.txt
Normal 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
@ -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
@ -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",
|
||||
})
|
BIN
mods/furnace/textures/furnace_diamond_rod.png
Normal file
After Width: | Height: | Size: 254 B |
BIN
mods/furnace/textures/furnace_gold_rod.png
Normal file
After Width: | Height: | Size: 254 B |
BIN
mods/furnace/textures/furnace_iron_rod.png
Normal file
After Width: | Height: | Size: 244 B |
BIN
mods/furnace/textures/furnace_pattern_rod.png
Normal file
After Width: | Height: | Size: 309 B |
BIN
mods/furnace/textures/furnace_pick_top.png
Normal file
After Width: | Height: | Size: 285 B |
BIN
mods/furnace/textures/furnace_stone_front.png
Normal file
After Width: | Height: | Size: 230 B |
BIN
mods/furnace/textures/furnace_stone_tile.png
Normal file
After Width: | Height: | Size: 195 B |