code tidy, make protection field glow in dark
This commit is contained in:
parent
8a5739486f
commit
08a07a76a9
2 changed files with 8 additions and 6 deletions
|
|
@ -55,7 +55,7 @@ Change log:
|
||||||
- 2.5 - Added HUD text to show when player is inside a protected area (updates every 5 seconds)
|
- 2.5 - Added HUD text to show when player is inside a protected area (updates every 5 seconds)
|
||||||
- 2.6 - Add protection against CSM tampering, updated Intllib support (thanks codexp), tweaked block textures
|
- 2.6 - Add protection against CSM tampering, updated Intllib support (thanks codexp), tweaked block textures
|
||||||
- 2.7 - Remove protection field entity when protector has been dug
|
- 2.7 - Remove protection field entity when protector has been dug
|
||||||
- 2.8 - Added 'protector_show_interval' setting to minetest.conf, default is 5
|
- 2.8 - Added 'protector_show_interval' setting to minetest.conf [default is 5], make protection field glow in dark.
|
||||||
|
|
||||||
Lucky Blocks: 10
|
Lucky Blocks: 10
|
||||||
|
|
||||||
|
|
|
||||||
12
init.lua
12
init.lua
|
|
@ -5,10 +5,11 @@ local S = dofile(MP .. "/intllib.lua")
|
||||||
local F = minetest.formspec_escape
|
local F = minetest.formspec_escape
|
||||||
|
|
||||||
|
|
||||||
protector = {}
|
protector = {
|
||||||
protector.mod = "redo"
|
mod = "redo",
|
||||||
protector.modpath = MP
|
modpath = MP,
|
||||||
protector.intllib = S
|
intllib = S
|
||||||
|
}
|
||||||
|
|
||||||
local protector_max_share_count = 12
|
local protector_max_share_count = 12
|
||||||
-- get minetest.conf settings
|
-- get minetest.conf settings
|
||||||
|
|
@ -620,12 +621,13 @@ minetest.register_entity("protector:display", {
|
||||||
visual_size = {x = 0.67, y = 0.67},
|
visual_size = {x = 0.67, y = 0.67},
|
||||||
textures = {"protector:display_node"},
|
textures = {"protector:display_node"},
|
||||||
timer = 0,
|
timer = 0,
|
||||||
|
glow = 10,
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
|
|
||||||
self.timer = self.timer + dtime
|
self.timer = self.timer + dtime
|
||||||
|
|
||||||
-- remove after 5 seconds
|
-- remove after set number of seconds
|
||||||
if self.timer > protector_show then
|
if self.timer > protector_show then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue