[Mod] Growth Limiter [20120828] [growth_limiter]

Post Reply
User avatar
Ragnarok
Member
Posts: 216
Joined: Thu Mar 22, 2012 12:56
Location: Poland
Contact:

[Mod] Growth Limiter [20120828] [growth_limiter]

by Ragnarok » Post

If you have any problem with limitless trees, papyrus or any other living node growing to the sky this mod is exactly for you. It simple cut selected nodes located more than 7 nodes over the ground (by default). You can adjust settings in the init.lua file. No more hard work with axe and timber mod! Big thanks to cornernote for help with this code here.

WARNING! Use with care. If you have any construction made of trunks (or any other nodes specified in init.lua) more than 7 nodes over the ground this mod damage it!

Changes:
  • selected nodes are also removed properly over: stone, cobble, mossycobble, water_source, water_flowing, sand, sandstone, desert_sand, desert_stone and gravel
  • source code changes - thanks PilzAdam
License:
Sourcecode: WTFPL, http://sam.zoy.org/wtfpl/

Mod dependencies: default

ZIP: http://db.tt/XlxCPhrZ
MD5: http://db.tt/B566WeWT be9bf85306e34ded16ff105601842f81

Screenshots:

BEFORE:

Image

AFTER:

Image

Old versions:
Last edited by Ragnarok on Tue Aug 28, 2012 13:07, edited 1 time in total.

User avatar
TheLoLMan
Member
Posts: 190
Joined: Sat Jun 16, 2012 13:43

by TheLoLMan » Post

LOL :D

User avatar
Ragnarok
Member
Posts: 216
Joined: Thu Mar 22, 2012 12:56
Location: Poland
Contact:

by Ragnarok » Post

Updated. Can anybody give me a tip how do this part using "for" loop? table?

Code: Select all

if (current_node == "default:dirt"
 or current_node == "default:dirt_with_grass"
 or current_node == "default:stone"
 or current_node == "default:cobble"
 or current_node == "default:mossycobble"
 or current_node == "default:water_source"
 or current_node == "default:water_flowing"
 or current_node == "default:sand"
 or current_node == "default:sandstone"
 or current_node == "default:desert_sand"
 or current_node == "default:desert_stone") then
    return
end

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

Ragnarok wrote:Updated. Can anybody give me a tip how do this part using "for" loop? table?

Code: Select all

if (current_node == "default:dirt"
 or current_node == "default:dirt_with_grass"
 or current_node == "default:stone"
 or current_node == "default:cobble"
 or current_node == "default:mossycobble"
 or current_node == "default:water_source"
 or current_node == "default:water_flowing"
 or current_node == "default:sand"
 or current_node == "default:sandstone"
 or current_node == "default:desert_sand"
 or current_node == "default:desert_stone") then
    return
end

Code: Select all

local nodes = {"default:stone", "add the other nodes", "another node"}
for _,nodename in ipairs(nodes) do
    if current_node == nodename then
        [code here]
        break
    end
end

User avatar
Ragnarok
Member
Posts: 216
Joined: Thu Mar 22, 2012 12:56
Location: Poland
Contact:

by Ragnarok » Post

Thanks :) Update soon.

Post Reply

Who is online

Users browsing this forum: Google [Bot], PiJeyEe and 5 guests