added stairs and slabs

This commit is contained in:
cale 2016-01-31 12:18:27 +01:00
parent 1ac0dde74e
commit cb54002497
11 changed files with 179 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

View File

@ -2,6 +2,33 @@
quests = {}
quests.player_quests = {}
quests.file = minetest.get_worldpath() .. "/quests"
function quests.load_quests()
local input = io.open(quests.file, "r")
if input then
local str = input:read("*all")
if str then
if minetest.deserialize(str) then
quests.player_quests = minetest.deserialize(str)
end
else
print("[WARNING] quest file is empty")
end
io.close(input)
else
print("[ERROR] couldnt find quest file")
end
end
function quests.save_quests()
if quests.player_quests then
local output = io.open(quests.file, "w")
local str = minetest.serialize(quests.player_quests)
output:write(str)
io.close(output)
end
end
function quests.add_quest(player, quest)
if not quests.player_quests[player] then

View File

@ -2,6 +2,33 @@
quests = {}
quests.player_quests = {}
quests.file = minetest.get_worldpath() .. "/quests"
function quests.load_quests()
local input = io.open(quests.file, "r")
if input then
local str = input:read("*all")
if str then
if minetest.deserialize(str) then
quests.player_quests = minetest.deserialize(str)
end
else
print("[WARNING] quest file is empty")
end
io.close(input)
else
print("[ERROR] couldnt find story file")
end
end
function quests.save_quests()
if quests.player_quests then
local output = io.open(quests.file, "w")
local str = minetest.serialize(quests.player_quests)
output:write(str)
io.close(output)
end
end
function quests.add_quest(player, quest)
if not quests.player_quests[player] then

11
mods/stairs/LICENSE.txt Normal file
View File

@ -0,0 +1,11 @@
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

2
mods/stairs/depends.txt Normal file
View File

@ -0,0 +1,2 @@
default
lava

2
mods/stairs/depends.txt~ Normal file
View File

@ -0,0 +1,2 @@
default
lava

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

@ -0,0 +1,55 @@
stairs = {}
function stairs.register_stair_and_slab(name, base)
if not minetest.registered_nodes[base] then
return
end
minetest.register_node(name.."_slab", {
description = minetest.registered_nodes[base].description .. " Slab",
tiles = minetest.registered_nodes[base].tiles,
groups = minetest.registered_nodes[base].groups,
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
},
})
minetest.register_node(name.."_stair", {
description = minetest.registered_nodes[base].description .. " Stair",
tiles = minetest.registered_nodes[base].tiles,
groups = minetest.registered_nodes[base].groups,
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, -0.5, 0, 0.5, 0.5, 0.5},
},
},
})
minetest.register_craft({
output = name.."_stair 3",
recipe = {
{base, ""},
{base, base},
}
})
minetest.register_craft({
output = name.."_slab 4",
recipe = {
{base, base},
}
})
end
stairs.register_stair_and_slab("stairs:stonebrick", "default:stonebrick")
stairs.register_stair_and_slab("stairs:stone_tile", "default:stone_tile")
stairs.register_stair_and_slab("stairs:stone", "default:stone")
stairs.register_stair_and_slab("stairs:basalt", "lava:basalt")
stairs.register_stair_and_slab("stairs:wood", "default:wood")
stairs.register_stair_and_slab("stairs:wooden_planks", "default:wooden_planks")

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

@ -0,0 +1,55 @@
stairs = {}
function stairs.register_stair_and_slab(name, base)
if not minetest.registered_nodes[base] then
return
end
minetest.register_node(name.."_slab", {
description = minetest.registered_nodes[base].description .. " Slab",
tiles = minetest.registered_nodes[base].tiles,
groups = minetest.registered_nodes[base].groups,
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
},
})
minetest.register_node(name.."_stair", {
description = minetest.registered_nodes[base].description .. " Stair",
tiles = minetest.registered_nodes[base].tiles,
groups = minetest.registered_nodes[base].groups,
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, -0.5, 0, 0.5, 0.5, 0.5},
},
},
})
minetest.register_craft({
output = name.."_stair 3",
recipe = {
{base, ""},
{base, base},
}
})
minetest.register_craft({
output = name.."_slab 4",
recipe = {
{base, base},
}
})
end
stairs.register_stair_and_slab("stairs:stonebrick", "default:stonebrick")
stairs.register_stair_and_slab("stairs:stone_tile", "default:stone_tile")
stairs.register_stair_and_slab("stairs:stone", "default:stone")
stairs.register_stair_and_slab("stairs:basalt", "lava:basalt")
stairs.register_stair_and_slab("stairs:wood", "default:wood")
stairs.register_stair_and_slab("stairs:wooden_planks", "default:wooden_planks")