diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..64b9f06 --- /dev/null +++ b/description.txt @@ -0,0 +1 @@ +Adds fruit to trees \ No newline at end of file diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..9cfd07d --- /dev/null +++ b/init.lua @@ -0,0 +1,132 @@ + +minetest.register_node("fruit:leaves_with_pear", { + description = "Leaves with Pear", + drawtype = "allfaces", + tiles = { + "default_leaves.png^fruit_pear_leaves.png", + }, + paramtype = "light", + groups = {snappy=1, oddly_breakeable_by_hand=1, not_in_creative_inventory=1}, + drop = "default:leaves", + on_destruct = function(pos) + minetest.add_item(pos, "fruit:pear") + end, + sounds = default.node_sound_leaves_defaults() +}) + +minetest.register_node("fruit:leaves_with_plum", { + description = "Leaves with Plum", + drawtype = "allfaces", + tiles = { + "default_leaves.png^fruit_plum_leaves.png", + }, + paramtype = "light", + groups = {snappy=1, oddly_breakeable_by_hand=1, not_in_creative_inventory=1}, + drop = "default:leaves", + on_destruct = function(pos) + minetest.add_item(pos, "fruit:plum") + end, + sounds = default.node_sound_leaves_defaults() +}) + +minetest.register_node("fruit:leaves_with_peach", { + description = "Leaves with Peach", + drawtype = "allfaces", + tiles = { + "default_leaves.png^fruit_peach_leaves.png", + }, + paramtype = "light", + groups = {snappy=1, oddly_breakeable_by_hand=1, not_in_creative_inventory=1}, + drop = "default:leaves", + on_destruct = function(pos) + minetest.add_item(pos, "fruit:peach") + end, + sounds = default.node_sound_leaves_defaults() +}) + +minetest.register_node("fruit:leaves_with_orange", { + description = "Leaves with Orange", + drawtype = "allfaces", + tiles = { + "default_acacia_leaves.png^fruit_orange_leaves.png", + }, + paramtype = "light", + groups = {snappy=1, oddly_breakeable_by_hand=1, not_in_creative_inventory=1}, + drop = "default:acacia_leaves", + on_destruct = function(pos) + minetest.add_item(pos, "fruit:orange") + end, + sounds = default.node_sound_leaves_defaults() +}) + +minetest.register_craftitem("fruit:pear", { + description = "Pear", + inventory_image = "fruit_pear.png", + on_use = minetest.item_eat(2) +}) + +minetest.register_craftitem("fruit:plum", { + description = "Plum", + inventory_image = "fruit_plum.png", + on_use = minetest.item_eat(1) +}) + +minetest.register_craftitem("fruit:peach", { + description = "Peach", + inventory_image = "fruit_peach.png", + on_use = minetest.item_eat(2) +}) + +minetest.register_craftitem("fruit:orange", { + description = "Orange", + inventory_image = "fruit_orange.png", + on_use = minetest.item_eat(2) +}) + +fruit = {} + +function fruit.register_ores() + minetest.register_ore({ + ore_type = "blob", + ore = "fruit:leaves_with_orange", + wherein = "default:acacia_leaves", + clust_scarcity = 15 * 15 * 15, + clust_num_ores = 6, + clust_size = 5, + y_min = 0, + y_max = 31000, + }) + + minetest.register_ore({ + ore_type = "blob", + ore = "fruit:leaves_with_peach", + wherein = "default:leaves", + clust_scarcity = 15 * 15 * 15, + clust_num_ores = 6, + clust_size = 5, + y_min = 0, + y_max = 31000, + }) + + minetest.register_ore({ + ore_type = "blob", + ore = "fruit:leaves_with_pear", + wherein = "default:leaves", + clust_scarcity = 15 * 15 * 15, + clust_num_ores = 6, + clust_size = 5, + y_min = 0, + y_max = 31000, + }) + + minetest.register_ore({ + ore_type = "blob", + ore = "fruit:leaves_with_plum", + wherein = "default:leaves", + clust_scarcity = 15 * 15 * 15, + clust_num_ores = 6, + clust_size = 5, + y_min = 0, + y_max = 31000, + }) +end \ No newline at end of file diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..78cc847 --- /dev/null +++ b/license.txt @@ -0,0 +1,24 @@ + +License for Code +---------------- + +Copyright (C) 2017 D00Med + +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. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +License for Textures, Models and Sounds +--------------------------------------- + +CC-BY-SA 3.0 UNPORTED. Created by D00Med diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..634cbf8 Binary files /dev/null and b/screenshot.png differ diff --git a/screenshot2.png b/screenshot2.png new file mode 100644 index 0000000..e65d1ac Binary files /dev/null and b/screenshot2.png differ diff --git a/textures/fruit_orange.png b/textures/fruit_orange.png new file mode 100644 index 0000000..7d7c4d0 Binary files /dev/null and b/textures/fruit_orange.png differ diff --git a/textures/fruit_orange_leaves.png b/textures/fruit_orange_leaves.png new file mode 100644 index 0000000..2d385ca Binary files /dev/null and b/textures/fruit_orange_leaves.png differ diff --git a/textures/fruit_peach.png b/textures/fruit_peach.png new file mode 100644 index 0000000..c962205 Binary files /dev/null and b/textures/fruit_peach.png differ diff --git a/textures/fruit_peach_leaves.png b/textures/fruit_peach_leaves.png new file mode 100644 index 0000000..c5f85f5 Binary files /dev/null and b/textures/fruit_peach_leaves.png differ diff --git a/textures/fruit_pear.png b/textures/fruit_pear.png new file mode 100644 index 0000000..3db0471 Binary files /dev/null and b/textures/fruit_pear.png differ diff --git a/textures/fruit_pear_leaves.png b/textures/fruit_pear_leaves.png new file mode 100644 index 0000000..0a88fad Binary files /dev/null and b/textures/fruit_pear_leaves.png differ diff --git a/textures/fruit_plum.png b/textures/fruit_plum.png new file mode 100644 index 0000000..7c1b668 Binary files /dev/null and b/textures/fruit_plum.png differ diff --git a/textures/fruit_plum_leaves.png b/textures/fruit_plum_leaves.png new file mode 100644 index 0000000..be678d6 Binary files /dev/null and b/textures/fruit_plum_leaves.png differ