From 1a60d08a3726c58dd7972380a8cadb18e15e201f Mon Sep 17 00:00:00 2001 From: AFCMS Date: Thu, 11 Mar 2021 23:39:26 +0100 Subject: [PATCH] mcl_farming make plantlist copy global and mcl_jukebox cleanup Sorry, I forgot to commit between the 2 features :-( --- mods/ITEMS/mcl_farming/shared_functions.lua | 15 +++++++++------ mods/ITEMS/mcl_jukebox/depends.txt | 2 -- mods/ITEMS/mcl_jukebox/description.txt | 1 - mods/ITEMS/mcl_jukebox/mod.conf | 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 mods/ITEMS/mcl_jukebox/depends.txt delete mode 100644 mods/ITEMS/mcl_jukebox/description.txt diff --git a/mods/ITEMS/mcl_farming/shared_functions.lua b/mods/ITEMS/mcl_farming/shared_functions.lua index 90f7d3373..187238ec3 100644 --- a/mods/ITEMS/mcl_farming/shared_functions.lua +++ b/mods/ITEMS/mcl_farming/shared_functions.lua @@ -1,4 +1,6 @@ -local plant_lists = {} +mcl_farming.plant_lists = {} +local plantlist = {} + local plant_nodename_to_id_list = {} local function get_intervals_counter(pos, interval, chance) @@ -51,11 +53,12 @@ local function get_avg_light_level(pos) end function mcl_farming:add_plant(identifier, full_grown, names, interval, chance) - plant_lists[identifier] = {} - plant_lists[identifier].full_grown = full_grown - plant_lists[identifier].names = names - plant_lists[identifier].interval = interval - plant_lists[identifier].chance = chance + mcl_farming.plant_lists[identifier] = {} + mcl_farming.plant_lists[identifier].full_grown = full_grown + mcl_farming.plant_lists[identifier].names = names + mcl_farming.plant_lists[identifier].interval = interval + mcl_farming.plant_lists[identifier].chance = chance + plant_lists = mcl_farming.plant_lists minetest.register_abm({ label = string.format("Farming plant growth (%s)", identifier), nodenames = names, diff --git a/mods/ITEMS/mcl_jukebox/depends.txt b/mods/ITEMS/mcl_jukebox/depends.txt deleted file mode 100644 index 97bf51069..000000000 --- a/mods/ITEMS/mcl_jukebox/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -mcl_core -mcl_sounds diff --git a/mods/ITEMS/mcl_jukebox/description.txt b/mods/ITEMS/mcl_jukebox/description.txt deleted file mode 100644 index 143812e1d..000000000 --- a/mods/ITEMS/mcl_jukebox/description.txt +++ /dev/null @@ -1 +0,0 @@ -Jukebox and music discs are used to play background music on a per-player basis. diff --git a/mods/ITEMS/mcl_jukebox/mod.conf b/mods/ITEMS/mcl_jukebox/mod.conf index ec39a7be9..ad1f8c06a 100644 --- a/mods/ITEMS/mcl_jukebox/mod.conf +++ b/mods/ITEMS/mcl_jukebox/mod.conf @@ -1 +1,3 @@ name = mcl_jukebox +description = Jukebox and music discs are used to play background music on a per-player basis. +depends = mcl_core, mcl_sounds