mirror of
https://repo.or.cz/minetest_playereffects.git
synced 2025-06-28 22:36:39 +02:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
512528fc46 | |||
5fe79310b3 | |||
1ef5d93ffc | |||
397286e12f | |||
e058592e3a | |||
22324f3a6c | |||
1cd8491447 | |||
2d9ab0d4c9 | |||
e1bc0e23c8 | |||
0f92ce7b10 |
2
.mailmap
Normal file
2
.mailmap
Normal file
@ -0,0 +1,2 @@
|
||||
Wuzzy <Wuzzy@disroot.org> <Wuzzy2@mail.ru>
|
||||
Wuzzy <Wuzzy@disroot.org> <almikes@aol.com>
|
@ -14,9 +14,7 @@ This is an framework for assigning temporary status effects to players. This mod
|
||||
This mod alone is not aimed directly at players. Briefly, the point of this mod is to help other mods to implement temporary status effects for players in a clean and consistant way.
|
||||
Here is the information which may be relevant to you: Your current status effects are shown on the HUD on the right side, along with a timer which shows the time until the effect gets disabled. It is possible for the server to disable this feature entirely. Some status effects may also be hidden and are never exposed to the HUD.
|
||||
|
||||
You only have to install this mod iff you have a mod which implements Player Effects. Here is a list of known mods which do:
|
||||
|
||||
* Magic Beans—Wuzzy’s Fork [`magicbeans_w`]
|
||||
You only have to install this mod iff you have a mod which implements Player Effects.
|
||||
|
||||
## Information for server operators
|
||||
By default, this mod stores the effects into the file `playereffects.mt` in the current world path every 10 seconds. On a regular server shutdown, this file is also written to. The data in this file is read when the mod is started.
|
||||
|
@ -1 +0,0 @@
|
||||
Framework for temporary effects for players.
|
12
init.lua
12
init.lua
@ -56,10 +56,10 @@ do
|
||||
if(string ~= nil) then
|
||||
local savetable = minetest.deserialize(string)
|
||||
playereffects.inactive_effects = savetable.inactive_effects
|
||||
minetest.debug("[playereffects] playereffects.mt successfully read.")
|
||||
minetest.debug("[playereffects] inactive_effects = "..dump(playereffects.inactive_effects))
|
||||
minetest.log("action", "[playereffects] playereffects.mt successfully read.")
|
||||
minetest.log("verbose", "[playereffects] inactive_effects = "..dump(playereffects.inactive_effects))
|
||||
playereffects.last_effect_id = savetable.last_effect_id
|
||||
minetest.debug("[playereffects] last_effect_id = "..dump(playereffects.last_effect_id))
|
||||
minetest.log("verbose", "[playereffects] last_effect_id = "..dump(playereffects.last_effect_id))
|
||||
|
||||
end
|
||||
end
|
||||
@ -355,7 +355,7 @@ function playereffects.save_to_file()
|
||||
if file then
|
||||
file:write(savestring)
|
||||
io.close(file)
|
||||
minetest.log("action", "[playereffects] Wrote playereffects data into "..filepath..".")
|
||||
minetest.log("info", "[playereffects] Wrote playereffects data into "..filepath..".")
|
||||
else
|
||||
minetest.log("error", "[playereffects] Failed to write playereffects data into "..filepath..".")
|
||||
end
|
||||
@ -393,7 +393,7 @@ minetest.register_on_leaveplayer(function(player)
|
||||
end)
|
||||
|
||||
minetest.register_on_shutdown(function()
|
||||
minetest.log("action", "[playereffects] Server shuts down. Rescuing data into playereffects.mt")
|
||||
minetest.log("info", "[playereffects] Server shuts down. Rescuing data into playereffects.mt")
|
||||
playereffects.save_to_file()
|
||||
end)
|
||||
|
||||
@ -427,7 +427,7 @@ minetest.register_globalstep(function(dtime)
|
||||
-- Autosave into file
|
||||
if(playereffects.use_autosave == true and playereffects.autosave_timer >= playereffects.autosave_time) then
|
||||
playereffects.autosave_timer = 0
|
||||
minetest.log("action", "[playereffects] Autosaving mod data to playereffects.mt ...")
|
||||
minetest.log("info", "[playereffects] Autosaving mod data to playereffects.mt ...")
|
||||
playereffects.save_to_file()
|
||||
end
|
||||
end)
|
||||
|
Reference in New Issue
Block a user