Skip to content

Commit

Permalink
add distance limit to player detector
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tour-ist committed Nov 30, 2024
1 parent 0695489 commit 6611c1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion moremesecons_adjustable_player_detector/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ local object_detector_scan = function (pos)
local scanname = meta:get_string("scanname")
local scan_all = scanname == ""
local scan_names = scanname:split(',')
local radius = meta:get_int("radius")
local max_radius = moremesecons.setting("adjustable_player_detector", "max_radius", 16, 0)
local radius = math.min(meta:get_int("radius"), max_radius)
if radius <= 0 then
radius = 6
end
Expand Down
4 changes: 4 additions & 0 deletions settingtypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# Minimal interval authorized. Any lower will be set to it.
moremesecons_adjustable_blinky_plant.min_interval (Minimum Interval) float 0.5

[Adjustable Player Detector]

moremesecons_adjustable_player_detector.max_radius (Maximum adjustable player detector radius) float 16 0

[Craftable Commandblock]

# Space-separated list of authorized commands
Expand Down

0 comments on commit 6611c1b

Please sign in to comment.