diff --git a/mods/default/textures/default_ice.png b/mods/default/textures/default_ice.png index b54a445..338198a 100644 Binary files a/mods/default/textures/default_ice.png and b/mods/default/textures/default_ice.png differ diff --git a/mods/default/textures/gui_hotbar.png b/mods/default/textures/gui_hotbar.png index c5362f9..1396bd8 100644 Binary files a/mods/default/textures/gui_hotbar.png and b/mods/default/textures/gui_hotbar.png differ diff --git a/mods/default/textures/moon.png b/mods/default/textures/moon.png new file mode 100644 index 0000000..1e975e1 Binary files /dev/null and b/mods/default/textures/moon.png differ diff --git a/mods/default/textures/sun.png b/mods/default/textures/sun.png new file mode 100644 index 0000000..8cee4fb Binary files /dev/null and b/mods/default/textures/sun.png differ diff --git a/mods/quests/init.lua b/mods/quests/init.lua index f575cfa..ce6fe48 100644 --- a/mods/quests/init.lua +++ b/mods/quests/init.lua @@ -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 diff --git a/mods/quests/init.lua~ b/mods/quests/init.lua~ index f575cfa..2a5b493 100644 --- a/mods/quests/init.lua~ +++ b/mods/quests/init.lua~ @@ -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 diff --git a/mods/stairs/LICENSE.txt b/mods/stairs/LICENSE.txt new file mode 100644 index 0000000..dc44a2b --- /dev/null +++ b/mods/stairs/LICENSE.txt @@ -0,0 +1,11 @@ +License for Code +---------------- + +Copyright (C) 2016 cd2 (cdqwertz) + +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 diff --git a/mods/stairs/depends.txt b/mods/stairs/depends.txt new file mode 100644 index 0000000..bbd4a9d --- /dev/null +++ b/mods/stairs/depends.txt @@ -0,0 +1,2 @@ +default +lava diff --git a/mods/stairs/depends.txt~ b/mods/stairs/depends.txt~ new file mode 100644 index 0000000..bbd4a9d --- /dev/null +++ b/mods/stairs/depends.txt~ @@ -0,0 +1,2 @@ +default +lava diff --git a/mods/stairs/init.lua b/mods/stairs/init.lua new file mode 100644 index 0000000..0e123b9 --- /dev/null +++ b/mods/stairs/init.lua @@ -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") diff --git a/mods/stairs/init.lua~ b/mods/stairs/init.lua~ new file mode 100644 index 0000000..0e123b9 --- /dev/null +++ b/mods/stairs/init.lua~ @@ -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")