added farming mod (own mod not from minetest_game)
BIN
mods/classes/textures/classes_lock_pick.png
Normal file
After Width: | Height: | Size: 262 B |
BIN
mods/classes/textures/classes_stick.png
Normal file
After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 495 B After Width: | Height: | Size: 283 B |
16
mods/farming/LICENSE.txt
Normal file
@ -0,0 +1,16 @@
|
||||
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
|
||||
|
||||
License for Media
|
||||
-----------------
|
||||
|
||||
CC-BY-SA 3.0 UNPORTED. Created by cd2 (cdqwertz)
|
50
mods/farming/init.lua
Normal file
@ -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",
|
||||
})
|
50
mods/farming/init.lua~
Normal file
@ -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",
|
||||
})
|
BIN
mods/farming/textures/farming_flour.png
Normal file
After Width: | Height: | Size: 241 B |
BIN
mods/farming/textures/farming_wheat_1.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
mods/farming/textures/farming_wheat_2.png
Normal file
After Width: | Height: | Size: 219 B |
BIN
mods/farming/textures/farming_wheat_3.png
Normal file
After Width: | Height: | Size: 226 B |
BIN
mods/farming/textures/farming_wheat_4.png
Normal file
After Width: | Height: | Size: 233 B |
BIN
mods/farming/textures/farming_wheat_5.png
Normal file
After Width: | Height: | Size: 299 B |
BIN
mods/farming/textures/farming_wheat_seeds.png
Normal file
After Width: | Height: | Size: 203 B |