From cb54002497d492fe0a976cf995f149bf56ab0b99 Mon Sep 17 00:00:00 2001 From: cale Date: Sun, 31 Jan 2016 12:18:27 +0100 Subject: [PATCH] added stairs and slabs --- mods/default/textures/default_ice.png | Bin 200 -> 305 bytes mods/default/textures/gui_hotbar.png | Bin 233 -> 252 bytes mods/default/textures/moon.png | Bin 0 -> 291 bytes mods/default/textures/sun.png | Bin 0 -> 298 bytes mods/quests/init.lua | 27 +++++++++++++ mods/quests/init.lua~ | 27 +++++++++++++ mods/stairs/LICENSE.txt | 11 ++++++ mods/stairs/depends.txt | 2 + mods/stairs/depends.txt~ | 2 + mods/stairs/init.lua | 55 ++++++++++++++++++++++++++ mods/stairs/init.lua~ | 55 ++++++++++++++++++++++++++ 11 files changed, 179 insertions(+) create mode 100644 mods/default/textures/moon.png create mode 100644 mods/default/textures/sun.png create mode 100644 mods/stairs/LICENSE.txt create mode 100644 mods/stairs/depends.txt create mode 100644 mods/stairs/depends.txt~ create mode 100644 mods/stairs/init.lua create mode 100644 mods/stairs/init.lua~ diff --git a/mods/default/textures/default_ice.png b/mods/default/textures/default_ice.png index b54a445073ef458c87905aaff3d1baddf9bdcc04..338198a5c9a7b79fd013f1ad89dafbbd00cd9be5 100644 GIT binary patch delta 212 zcmV;_04x8<0kHy*K?olSB?)nKjF*u~D1WO-L_t(Y$IX>d4uBvGL$RkI-v45LNH~T+ zeh@_{TbIZu8LzmyvK?nhkqaq!{Xn49>M6kV@Sd}$0HO4efQ0@jz#L}ieF5@n#=l5Q z?+9q=nn82T0YkUXftlWZ6C&vCzA=kPx;=|Xx;KlMVo2zN0fL0C$)f4Y!wT>Q%0Z&S z(=mk7p91eL``yNX#n7kD!%3$e{cfFvehV17%zI;r>m}zAO1B8C_VWVU)`sja5KA8b O0000<9d+a(WSXw-$$YGREB$q zNn%C%gIl-UQ;m{5W~I3vEPb!#<^Tg9ybX*V?Yhp&zhwvSmuIII1Tp}Dr>mdKI;Vst E00T28;Q#;t diff --git a/mods/default/textures/gui_hotbar.png b/mods/default/textures/gui_hotbar.png index c5362f93903e8edd6922e6f5db11bfc63d62301f..1396bd8011bd84a3d06bf98f61a804ca14554485 100644 GIT binary patch delta 197 zcmaFK_=jysgef@nNX)bl%BioBkGcYi8c)B=-RNQ)dMUk<=K!oAqe?tkAqc0pp=j9=!8hbm=x9VFu$FDGWUf222My i7?cS!w6QAsXLGn$puu#-y)8gTF?hQAxvX{XE z)7O>#0i!$@yIOsq=XRjbAx{^_kcwMxZ$IQbtRUk0a7zg{d$AjPabH=p)91K1+;z|M z6%ICkUzO0ueBhkTB7KSEJ^w8m?p0^-oWGmSz-YA~;@R^#@$DFkww6Pf$9uxJa&TC~{O%g(JFad9#_MGcTm3$qpTHr& dz_9!$gUkXQk+x-r{sMi&;OXk;vd$@?2>=7(WuX87 literal 0 HcmV?d00001 diff --git a/mods/default/textures/sun.png b/mods/default/textures/sun.png new file mode 100644 index 0000000000000000000000000000000000000000..8cee4fbcf0d2c213261c3a1c5bc70361166fef69 GIT binary patch literal 298 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#0i!$@vw30f8b_eeNlzEYkcwMxZ#(ie8Hl(BvIvVExw6!-B-1ZefO)aC!NmV7 z=YP4Q$+^V5c71M88>7Sdm__;(cJJQT^Cj$DyU?&_?|BBM5{Hdv@^8O>{kd{pkhLQV z#|6f%*M4TO|GCAfi6ON1P%cPhTT6I-u%#>a%!a+(9;YIp00i_>zopr00r=9XaE2J literal 0 HcmV?d00001 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")