From 9a6491a36684db22b9b18f59f378b37aa5272ef5 Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Fri, 22 Aug 2014 17:07:27 +1000 Subject: [PATCH] Moved ferns "'module' loaded" asserts to top of files --- ferns/fern.lua | 4 ++-- ferns/gianttreefern.lua | 4 ++-- ferns/horsetail.lua | 4 ++-- ferns/treefern.lua | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ferns/fern.lua b/ferns/fern.lua index e54f576..7e6bd2d 100644 --- a/ferns/fern.lua +++ b/ferns/fern.lua @@ -13,6 +13,8 @@ -- http://www.mygarden.net.au/gardening/athyrium-yokoscense/3900/1 ----------------------------------------------------------------------------------------------- +assert(abstract_ferns.config.enable_lady_fern == true) + abstract_ferns.grow_fern = function(pos) local fern_size = math.random(1,4) local right_here = {x=pos.x, y=pos.y+1, z=pos.z} @@ -102,8 +104,6 @@ minetest.register_node("ferns:fern_01", { -- Spawning ----------------------------------------------------------------------------------------------- -assert(abstract_ferns.config.enable_lady_fern == true) - if abstract_ferns.config.lady_ferns_near_tree == true then plantslib:register_generate_plant({ -- near trees (woodlands) surface = { diff --git a/ferns/gianttreefern.lua b/ferns/gianttreefern.lua index 773963f..5b6feee 100644 --- a/ferns/gianttreefern.lua +++ b/ferns/gianttreefern.lua @@ -8,6 +8,8 @@ -- Supports: vines ----------------------------------------------------------------------------------------------- +assert(abstract_ferns.config.enable_giant_treefern == true) + -- lot of code, lot to load abstract_ferns.grow_giant_tree_fern = function(pos) @@ -275,8 +277,6 @@ minetest.register_abm({ -- GENERATE GIANT TREE FERN ----------------------------------------------------------------------------------------------- -assert(abstract_ferns.config.enable_giant_treefern == true) - -- in jungles if abstract_ferns.config.enable_giant_treeferns_in_jungle == true then plantslib:register_generate_plant({ diff --git a/ferns/horsetail.lua b/ferns/horsetail.lua index 6c11057..b89bf7c 100644 --- a/ferns/horsetail.lua +++ b/ferns/horsetail.lua @@ -9,6 +9,8 @@ -- Supports: dryplants, stoneage, sumpf ----------------------------------------------------------------------------------------------- +assert(abstract_ferns.config.enable_horsetails == true) + abstract_ferns.grow_horsetail = function(pos) local horsetail_size = math.random(1,4) if horsetail_size == 1 then @@ -125,8 +127,6 @@ end -- Generating ----------------------------------------------------------------------------------------------- -assert(abstract_ferns.config.enable_horsetails == true) - if abstract_ferns.config.enable_horsetails_on_grass == true then plantslib:register_generate_plant({ surface = { diff --git a/ferns/treefern.lua b/ferns/treefern.lua index 62bcd0e..74ccd72 100644 --- a/ferns/treefern.lua +++ b/ferns/treefern.lua @@ -7,6 +7,8 @@ -- Looked at code from: default , trees ----------------------------------------------------------------------------------------------- +assert(abstract_ferns.config.enable_treefern == true) + abstract_ferns.grow_tree_fern = function(pos) local size = math.random(1,5) local crown = math.random(1,2) @@ -189,8 +191,6 @@ minetest.register_abm({ -- GENERATE TREE FERN ----------------------------------------------------------------------------------------------- -assert(abstract_ferns.config.enable_treefern == true) - -- in jungles if abstract_ferns.config.enable_treeferns_in_jungle == true then plantslib:register_generate_plant({