added stairs and slabs
This commit is contained in:
parent
1ac0dde74e
commit
cb54002497
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 |
BIN
mods/default/textures/moon.png
Normal file
BIN
mods/default/textures/moon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 291 B |
BIN
mods/default/textures/sun.png
Normal file
BIN
mods/default/textures/sun.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 298 B |
@ -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
|
||||
|
@ -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
11
mods/stairs/LICENSE.txt
Normal 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
2
mods/stairs/depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
default
|
||||
lava
|
2
mods/stairs/depends.txt~
Normal file
2
mods/stairs/depends.txt~
Normal file
@ -0,0 +1,2 @@
|
||||
default
|
||||
lava
|
55
mods/stairs/init.lua
Normal file
55
mods/stairs/init.lua
Normal 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
55
mods/stairs/init.lua~
Normal 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")
|
Loading…
x
Reference in New Issue
Block a user