Compare commits
5 Commits
95a64a01ba
...
58552ef274
Author | SHA1 | Date |
---|---|---|
rnd | 58552ef274 | |
rnd | 12d1795b55 | |
rnd | bcc2960983 | |
rnd | 5bee159bbe | |
rnd | fdbbd4c02c |
|
@ -323,6 +323,12 @@ farming.register_plant = function(name, def)
|
|||
pos.y = pos.y+1; minetest.set_node(pos, {name ="default:grass_1"})
|
||||
return
|
||||
end
|
||||
|
||||
-- insta growth possibility with high farming skill
|
||||
if (quality > 100 and math.random(math.ceil(20*100/quality)) == 1) or quality > 2000 then
|
||||
plant_height = 7;
|
||||
end
|
||||
|
||||
minetest.set_node(pos, {name = mname .. ":" .. pname .. "_" .. plant_height + 1})
|
||||
|
||||
if plant_height+1 == 8 then minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z}, {name ="default:dirt"}) end -- rnd: when plant fully grown it creates dirt
|
||||
|
|
|
@ -140,7 +140,10 @@ local function overwrite(name)
|
|||
if not protector.can_dig(5,pos,digger) then return end
|
||||
local name = digger:get_player_name(); if name == nil then return end
|
||||
if playerdata then
|
||||
local dig = playerdata[name].dig/5+200
|
||||
local dig = 0;
|
||||
if playerdata[name] then
|
||||
dig = playerdata[name].dig/5+200
|
||||
end
|
||||
if pos.y<-dig then
|
||||
minetest.set_node(pos, {name="default:stone"})
|
||||
minetest.chat_send_player(name,"With current dig skill you can only dig up to depth "..dig);
|
||||
|
|
|
@ -287,16 +287,18 @@ local function tweak_saplings(name,skill_req) -- farming:seed_wheat
|
|||
end
|
||||
end
|
||||
|
||||
table2.on_punch = function(pos, node, puncher, pointed_thing)
|
||||
local pname = puncher:get_player_name(); if pname==nil then return end
|
||||
table2.can_dig = function(pos, player)
|
||||
local pname = player:get_player_name(); if pname==nil then return false end
|
||||
local skill = playerdata[pname].farming;
|
||||
if skill < skill_req then
|
||||
local inv = puncher:get_inventory();
|
||||
local inv = player:get_inventory();
|
||||
inv:remove_item("main", ItemStack(name.. " 90"))
|
||||
minetest.chat_send_player(pname,"You need " .. skill_req .. " farming before you can dig this sapling .")
|
||||
return
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
minetest.register_node(":"..name, table2);
|
||||
|
||||
|
@ -305,16 +307,16 @@ end
|
|||
|
||||
minetest.after(1, function()
|
||||
tweak_saplings("moretrees:apple_tree_sapling",20);
|
||||
tweak_saplings("moretrees:rubber_tree_sapling",40);
|
||||
tweak_saplings("moretrees:willow_sapling",80);
|
||||
tweak_saplings("moretrees:acacia_sapling",160);
|
||||
tweak_saplings("moretrees:fir_sapling",320);
|
||||
tweak_saplings("moretrees:pine_sapling",640);
|
||||
tweak_saplings("moretrees:spruce_sapling",1000);
|
||||
tweak_saplings("moretrees:birch_sapling",2000);
|
||||
tweak_saplings("moretrees:beech_sapling",3000);
|
||||
tweak_saplings("moretrees:oak_sapling",4000);
|
||||
tweak_saplings("moretrees:sequoia_sapling",5000);
|
||||
tweak_saplings("moretrees:palm_sapling",8000);
|
||||
tweak_saplings("moretrees:rubber_tree_sapling",30);
|
||||
tweak_saplings("moretrees:willow_sapling",45);
|
||||
tweak_saplings("moretrees:acacia_sapling",67);
|
||||
tweak_saplings("moretrees:fir_sapling",101);
|
||||
tweak_saplings("moretrees:pine_sapling",151);
|
||||
tweak_saplings("moretrees:spruce_sapling",227);
|
||||
tweak_saplings("moretrees:birch_sapling",341);
|
||||
tweak_saplings("moretrees:beech_sapling",512);
|
||||
tweak_saplings("moretrees:oak_sapling",768);
|
||||
tweak_saplings("moretrees:sequoia_sapling",1153);
|
||||
tweak_saplings("moretrees:palm_sapling",1729);
|
||||
end
|
||||
)
|
Loading…
Reference in New Issue