mirror of
https://notabug.org/TenPlus1/protector.git
synced 2025-01-09 17:17:31 +01:00
added protector_show_interval setting to minetest.conf, code tidy
This commit is contained in:
parent
7b5d7a3987
commit
8a5739486f
@ -55,6 +55,7 @@ Change log:
|
||||
- 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.7 - Remove protection field entity when protector has been dug
|
||||
- 2.8 - Added 'protector_show_interval' setting to minetest.conf, default is 5
|
||||
|
||||
Lucky Blocks: 10
|
||||
|
||||
@ -114,6 +115,9 @@ protector_hurt = 2
|
||||
protector_flip = true
|
||||
- When true players who dig inside a protected area will flipped around to stop them using lag to grief into someone else's build
|
||||
|
||||
protector_show_interval
|
||||
- Number of seconds the protection field is visible, defaults to 5 seconds.
|
||||
|
||||
|
||||
Protector Tool
|
||||
|
||||
|
5
init.lua
5
init.lua
@ -17,6 +17,7 @@ local protector_flip = minetest.settings:get_bool("protector_flip") or false
|
||||
local protector_hurt = tonumber(minetest.settings:get("protector_hurt")) or 0
|
||||
local protector_spawn = tonumber(minetest.settings:get("protector_spawn")
|
||||
or minetest.settings:get("protector_pvp_spawn")) or 0
|
||||
local protector_show = tonumber(minetest.settings:get("protector_show_interval")) or 5
|
||||
|
||||
-- get static spawn position
|
||||
local statspawn = minetest.string_to_pos(minetest.settings:get("static_spawnpoint"))
|
||||
@ -616,7 +617,7 @@ minetest.register_entity("protector:display", {
|
||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
||||
visual = "wielditem",
|
||||
-- wielditem seems to be scaled to 1.5 times original node size
|
||||
visual_size = {x = 1.0 / 1.5, y = 1.0 / 1.5},
|
||||
visual_size = {x = 0.67, y = 0.67},
|
||||
textures = {"protector:display_node"},
|
||||
timer = 0,
|
||||
|
||||
@ -625,7 +626,7 @@ minetest.register_entity("protector:display", {
|
||||
self.timer = self.timer + dtime
|
||||
|
||||
-- remove after 5 seconds
|
||||
if self.timer > 5 then
|
||||
if self.timer > protector_show then
|
||||
self.object:remove()
|
||||
end
|
||||
end,
|
||||
|
Loading…
Reference in New Issue
Block a user