Added a config option 'ta_apiary_abm_enabled' to control if the ABMs are enabled or not

This commit is contained in:
Lesya-cpp 2023-08-23 03:55:14 +07:00
parent 851e6c1759
commit 32de288068
3 changed files with 53 additions and 44 deletions

View File

@ -317,6 +317,8 @@ minetest.register_craft({
}, },
}) })
if ta_apiary.abm_enabled then
minetest.register_abm({ minetest.register_abm({
label = "spawn bee particles", label = "spawn bee particles",
nodenames = {"ta_apiary:bee_hive"}, nodenames = {"ta_apiary:bee_hive"},
@ -367,3 +369,5 @@ minetest.register_abm({
end end
}) })
end

View File

@ -15,6 +15,9 @@ local M = minetest.get_meta
ta_apiary = {} ta_apiary = {}
ta_apiary.abm_enabled = minetest.settings:get_bool("ta_apiary_abm_enabled") ~= false
ta_apiary.S = minetest.get_translator("ta_apiary") ta_apiary.S = minetest.get_translator("ta_apiary")
ta_apiary.CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer or {} end ta_apiary.CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer or {} end

2
settingtypes.txt Normal file
View File

@ -0,0 +1,2 @@
# Disables ABMs (to potentially increase performance)
ta_apiary_abm_enabled(Enable Apiary ABMs) bool true