#Emergency MSPT Protection
#Acts as a safety net when MSPT gets too high.
#Gradually increases divisor when struggling, decreases when recovering.
#Effective divisor = max(manual global divisor, emergency divisor)
[emergency]
	#Enable emergency MSPT protection
	enabled = true
	#MSPT threshold to trigger emergency mode (milliseconds per tick)
	#50ms = 20 TPS, 55ms ~ 18 TPS, 100ms = 10 TPS
	# Default: 55.0
	# Range: 20.0 ~ 500.0
	msptThreshold = 55.0
	#MSPT threshold to start recovery (decrease divisor)
	#Should be lower than msptThreshold to avoid oscillation
	# Default: 45.0
	# Range: 10.0 ~ 500.0
	recoveryMspt = 45.0
	#How much to increase divisor each step when MSPT is too high
	# Default: 2
	# Range: 1 ~ 50
	increment = 2
	#How much to decrease divisor each step during recovery
	# Default: 1
	# Range: 1 ~ 50
	decrement = 1
	#How often to check MSPT and adjust (in ticks)
	# Default: 10
	# Range: 1 ~ 100
	updateInterval = 10
	#Maximum divisor the emergency system can reach
	# Default: 100
	# Range: 1 ~ 200
	maxDivisor = 100

#Blacklist Configuration
#Block entities in this list will NEVER be throttled by the global divisor.
#They can still have type-specific divisors set manually.
#Use the simple class name (e.g., 'MillstoneBlockEntity')
[blacklist]
	#List of block entity types to exclude from global tick throttling.
	#These will always tick at full speed unless a type-specific divisor is set.
	types = ["PackagerBlockEntity", "StockTickerBlockEntity", "PackagerLinkBlockEntity", "RedstoneRequesterBlockEntity", "StationBlockEntity", "SignalBlockEntity", "TrackBlockEntity", "SequencedGearshiftBlockEntity"]

#Admin Web Dashboard
#Embedded HTTP server providing a lag heatmap of all block entities,
#per-type/per-block profiling and remote control of tick divisors.
#SECURITY: keep bindAddress on 127.0.0.1 and access it via SSH tunnel or
#reverse proxy. If you bind to 0.0.0.0, ALWAYS set a token.
[web]
	#Start the web dashboard when the server starts (can also be started with /tickcontrol web start)
	enabled = false
	#HTTP port for the dashboard
	# Default: 8785
	# Range: 1024 ~ 65535
	port = 8785
	#Bind address. 127.0.0.1 = local only (recommended), 0.0.0.0 = all interfaces
	bindAddress = "127.0.0.1"
	#Permanent admin token. When set, it grants full admin access to the
	#dashboard. Time-limited access keys are generated in game with
	#/lagmap (players, read-only) and /tickcontrol panel (admins).
	token = ""
	#Public base URL used in the clickable links given to players,
	#e.g. 'http://play.myserver.com:8785'. Leave empty to derive it
	#from bindAddress/the server IP (fine for LAN or local use).
	publicUrl = ""

#Compatibility with other mods
[compat]
	#Throttle Sophisticated Storage block entities (controller, link, I/O,
	#input, output, and upgraded containers) with the global/per-type divisors.
	#Only takes effect when Sophisticated Storage is installed.
	sophisticatedStorage = true

#Permission nodes registered through the NeoForge PermissionAPI,
#usable in LuckPerms or any compatible permission mod:
#  'createtickcontroller.lagmap' -> /lagmap (player read-only visualizer link).
#                                   Default: everyone.
#  'createtickcontroller.admin'  -> /tickcontrol, /tc and /tickcontrol panel
#                                   (full admin panel). Default: OP (permission level 2).
#Console and command blocks always fall back to vanilla permission levels.
[permissions]
	#Master switch for the /lagmap player command (overrides the permission node when false)
	allowLagmap = true
