From e2cee05a21918cdefaeebbff77b41c0f4afcc8ef Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 22 Feb 2017 14:46:21 +0100 Subject: [PATCH] Melon stems roughly have the drop chances like MC --- mods/ITEMS/mcl_farming/melon.lua | 35 +++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_farming/melon.lua b/mods/ITEMS/mcl_farming/melon.lua index d62088fa6b..d4bd3d0827 100644 --- a/mods/ITEMS/mcl_farming/melon.lua +++ b/mods/ITEMS/mcl_farming/melon.lua @@ -37,12 +37,33 @@ minetest.register_node("mcl_farming:melon", { sounds = mcl_sounds.node_sound_wood_defaults(), }) +local stemdrop = { + max_items = 1, + -- FIXME: The probabilities are slightly off from the original. + -- Update this drop list when the Minetest drop probability system + -- is more powerful. + items = { + -- 1 seed: Approximation to 20/125 chance + -- 20/125 = 0.16 + -- Approximation: 1/6 = ca. 0.166666666666667 + { items = {"mcl_farming:melon_seeds 1"}, rarity = 6 }, + + -- 2 seeds: Approximation to 4/125 chance + -- 4/125 = 0.032 + -- Approximation: 1/31 = ca. 0.032258064516129 + { items = {"mcl_farming:melon_seeds 2"}, rarity = 31 }, + + -- 3 seeds: 1/125 chance + { items = {"mcl_farming:melon_seeds 3"}, rarity = 125 }, + }, +} + minetest.register_node("mcl_farming:melontige_1", { paramtype = "light", walkable = false, drawtype = "plantlike", sunlight_propagates = true, - drop = "", + drop = stemdrop, tiles = {"farming_tige_1.png"}, selection_box = { type = "fixed", @@ -59,7 +80,7 @@ minetest.register_node("mcl_farming:melontige_2", { walkable = false, drawtype = "plantlike", sunlight_propagates = true, - drop = "", + drop = stemdrop, tiles = {"farming_tige_2.png"}, selection_box = { type = "fixed", @@ -75,7 +96,7 @@ minetest.register_node("mcl_farming:melontige_unconnect", { paramtype = "light", walkable = false, sunlight_propagates = true, - drop = "", + drop = stemdrop, drawtype = "plantlike", tiles = {"farming_tige_end.png"}, groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1}, @@ -86,7 +107,7 @@ minetest.register_node("mcl_farming:melontige_linked_r", { paramtype = "light", sunlight_propagates = true, walkable = false, - drop = "", + drop = stemdrop, drawtype = "nodebox", paramtype = "light", paramtype2 = "wallmounted", @@ -116,7 +137,7 @@ minetest.register_node("mcl_farming:melontige_linked_l", { paramtype = "light", walkable = false, sunlight_propagates = true, - drop = "", + drop = stemdrop, drawtype = "nodebox", paramtype = "light", paramtype2 = "wallmounted", @@ -146,7 +167,7 @@ minetest.register_node("mcl_farming:melontige_linked_t", { paramtype = "light", walkable = false, sunlight_propagates = true, - drop = "", + drop = stemdrop, drawtype = "nodebox", paramtype = "light", paramtype2 = "wallmounted", @@ -176,7 +197,7 @@ minetest.register_node("mcl_farming:melontige_linked_b", { paramtype = "light", walkable = false, sunlight_propagates = true, - drop = "", + drop = stemdrop, drawtype = "nodebox", paramtype = "light", paramtype2 = "wallmounted",