aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgpcf <gpcf@gpcf.eu>2024-09-22 16:29:07 +0200
committergpcf <gpcf@gpcf.eu>2024-09-22 16:29:07 +0200
commit9175c407d3804811443955ffb5f0668d8969cc88 (patch)
tree0548282b1a82da5a7f4692b95e54dd408e1e6483
parent56231bc870fd5c324cd39232fe1afccc3a51be59 (diff)
downloadcurrency-master.tar.gz
currency-master.tar.bz2
currency-master.zip
remove basic incomeHEADmaster
-rw-r--r--income.lua44
-rw-r--r--init.lua7
2 files changed, 1 insertions, 50 deletions
diff --git a/income.lua b/income.lua
deleted file mode 100644
index cbbd5d8..0000000
--- a/income.lua
+++ /dev/null
@@ -1,44 +0,0 @@
-players_income = {}
-
--- internationalization boilerplate
-local MP = minetest.get_modpath(minetest.get_current_modname())
-local S, NS = dofile(MP.."/intllib.lua")
-
-local timer = 0
-minetest.register_globalstep(function(dtime)
- timer = timer + dtime;
- if timer >= 720 then --720 for one day
- timer = 0
- for _,player in ipairs(minetest.get_connected_players()) do
- local name = player:get_player_name()
- if players_income[name] == nil then
- players_income[name] = 0
- end
- players_income[name] = 1
- minetest.log("info", "[Currency] "..S("basic income for @1", name))
- end
- end
-end)
-
-earn_income = function(player)
- if not player or player.is_fake_player then return end
- local name = player:get_player_name()
- if players_income[name] == nil then
- players_income[name] = 0
- end
- if players_income[name] > 0 then
- count = players_income[name]
- local inv = player:get_inventory()
- inv:add_item("main", {name="currency:minegeld_5", count=count})
- players_income[name] = 0
- minetest.log("info", "[Currency] "..S("added basic income for @1 to inventory", name))
- end
-end
-
-minetest.register_on_dignode(function(pos, oldnode, digger)
- earn_income(digger)
-end)
-
-minetest.register_on_placenode(function(pos, node, placer)
- earn_income(placer)
-end)
diff --git a/init.lua b/init.lua
index 6dbf3a9..e740d60 100644
--- a/init.lua
+++ b/init.lua
@@ -16,9 +16,4 @@ minetest.log("info", "[Currency] "..S("Safe Loaded!"))
dofile(modpath.."/crafting.lua")
minetest.log("info", "[Currency] "..S("Crafting Loaded!"))
-if minetest.settings:get_bool("creative_mode") then
- minetest.log("info", "[Currency] "..S("Creative mode in use, skipping basic income."))
-else
- dofile(modpath.."/income.lua")
- minetest.log("info", "[Currency] "..S("Income Loaded!"))
-end
+