diff --git a/mods/classes/textures/classes_lock_pick.png b/mods/classes/textures/classes_lock_pick.png new file mode 100644 index 0000000..b574824 Binary files /dev/null and b/mods/classes/textures/classes_lock_pick.png differ diff --git a/mods/classes/textures/classes_stick.png b/mods/classes/textures/classes_stick.png new file mode 100644 index 0000000..d5d963f Binary files /dev/null and b/mods/classes/textures/classes_stick.png differ diff --git a/mods/default/textures/default_treasure_chest.png b/mods/default/textures/default_treasure_chest.png index cad8daf..56d2352 100644 Binary files a/mods/default/textures/default_treasure_chest.png and b/mods/default/textures/default_treasure_chest.png differ diff --git a/mods/farming/LICENSE.txt b/mods/farming/LICENSE.txt new file mode 100644 index 0000000..6f6a256 --- /dev/null +++ b/mods/farming/LICENSE.txt @@ -0,0 +1,16 @@ +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 + +License for Media +----------------- + +CC-BY-SA 3.0 UNPORTED. Created by cd2 (cdqwertz) diff --git a/mods/farming/init.lua b/mods/farming/init.lua new file mode 100644 index 0000000..06cf4b9 --- /dev/null +++ b/mods/farming/init.lua @@ -0,0 +1,50 @@ +farming = {} + +function farming.register_plant(name, steps, def) + for i = 1, steps, 1 do + minetest.register_node(":farming:"..name.."_"..tostring(i), { + description = def.description .. " " .. tostring(i), + tiles = {def.texture.."_"..tostring(i)..".png"}, + drawtype = "plantlike", + paramtype = "light", + drop = def.drop .. " " .. tostring(i), + groups = {crumbly=3}, + walkable = false, + }) + minetest.register_abm({ + nodenames = {"farming:"..name.."_"..tostring(i)}, + neighbors = {"default:dirt", "default:grass"}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + if i < steps then + minetest.set_node(pos, {name = "farming:"..name.."_"..tostring(i+1)}) + end + end, + }) + end + minetest.register_craftitem(def.drop, { + description = def.drop_description, + inventory_image = def.drop_texture, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.above then + minetest.set_node(pointed_thing.above, {name="farming:"..name.."_1"}) + itemstack:take_item() + end + return itemstack + end, + }) +end + +farming.register_plant("wheat", 5, { + description = "Wheat", + texture = "farming_wheat", + drop = "farming:wheat_seeds", + drop_description = "Wheat Seeds", + drop_texture = "farming_wheat_seeds.png", +}) + +minetest.register_craftitem("farming:flour", { + description = "Flour", + inventory_image = "farming_flour.png", +}) diff --git a/mods/farming/init.lua~ b/mods/farming/init.lua~ new file mode 100644 index 0000000..06cf4b9 --- /dev/null +++ b/mods/farming/init.lua~ @@ -0,0 +1,50 @@ +farming = {} + +function farming.register_plant(name, steps, def) + for i = 1, steps, 1 do + minetest.register_node(":farming:"..name.."_"..tostring(i), { + description = def.description .. " " .. tostring(i), + tiles = {def.texture.."_"..tostring(i)..".png"}, + drawtype = "plantlike", + paramtype = "light", + drop = def.drop .. " " .. tostring(i), + groups = {crumbly=3}, + walkable = false, + }) + minetest.register_abm({ + nodenames = {"farming:"..name.."_"..tostring(i)}, + neighbors = {"default:dirt", "default:grass"}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + if i < steps then + minetest.set_node(pos, {name = "farming:"..name.."_"..tostring(i+1)}) + end + end, + }) + end + minetest.register_craftitem(def.drop, { + description = def.drop_description, + inventory_image = def.drop_texture, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.above then + minetest.set_node(pointed_thing.above, {name="farming:"..name.."_1"}) + itemstack:take_item() + end + return itemstack + end, + }) +end + +farming.register_plant("wheat", 5, { + description = "Wheat", + texture = "farming_wheat", + drop = "farming:wheat_seeds", + drop_description = "Wheat Seeds", + drop_texture = "farming_wheat_seeds.png", +}) + +minetest.register_craftitem("farming:flour", { + description = "Flour", + inventory_image = "farming_flour.png", +}) diff --git a/mods/farming/textures/farming_flour.png b/mods/farming/textures/farming_flour.png new file mode 100644 index 0000000..79a6f10 Binary files /dev/null and b/mods/farming/textures/farming_flour.png differ diff --git a/mods/farming/textures/farming_wheat_1.png b/mods/farming/textures/farming_wheat_1.png new file mode 100644 index 0000000..4216aed Binary files /dev/null and b/mods/farming/textures/farming_wheat_1.png differ diff --git a/mods/farming/textures/farming_wheat_2.png b/mods/farming/textures/farming_wheat_2.png new file mode 100644 index 0000000..56e94f6 Binary files /dev/null and b/mods/farming/textures/farming_wheat_2.png differ diff --git a/mods/farming/textures/farming_wheat_3.png b/mods/farming/textures/farming_wheat_3.png new file mode 100644 index 0000000..6e1ec61 Binary files /dev/null and b/mods/farming/textures/farming_wheat_3.png differ diff --git a/mods/farming/textures/farming_wheat_4.png b/mods/farming/textures/farming_wheat_4.png new file mode 100644 index 0000000..73b3902 Binary files /dev/null and b/mods/farming/textures/farming_wheat_4.png differ diff --git a/mods/farming/textures/farming_wheat_5.png b/mods/farming/textures/farming_wheat_5.png new file mode 100644 index 0000000..af88af5 Binary files /dev/null and b/mods/farming/textures/farming_wheat_5.png differ diff --git a/mods/farming/textures/farming_wheat_seeds.png b/mods/farming/textures/farming_wheat_seeds.png new file mode 100644 index 0000000..2ae02d0 Binary files /dev/null and b/mods/farming/textures/farming_wheat_seeds.png differ