Melon stems roughly have the drop chances like MC

This commit is contained in:
Wuzzy 2017-02-22 14:46:21 +01:00
parent 6080a3a64b
commit e2cee05a21
1 changed files with 28 additions and 7 deletions

View File

@ -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",