Description
LightAutomation
A Hytale mod for automating lighting systems. We've all been there, having to go around the whole world at dawn and dusk just to turn lights on and off.
Features
- Automatic Street Lights: Lights turn on at dusk and off at dawn
- Smart Time Detection: Uses sunlight factor to detect precise dawn/dusk transitions
- Player Light Tracking: Automatically tracks player-placed light sources
- Persistence: Saves tracked lights across server restarts
- Configurable Timing: Adjust when lights activate/deactivate
- Easy Configuration: Simple configuration file with sensible defaults
- Outdoor lights only: Lights placed indoors/in caves etc will not be automated
Installation
- Place the LightAutomation.jar file in your Hytale server's
mods/directory - Start your server
- A configuration file will be automatically created
- Edit the configuration as needed
Player usage
Depending on the DefaultLogic configuration option all lights placed outdoors will either be automated by default, or not. A player can choose to interact with the light (turn it on, or off, depending on its state) once during the first 10 seconds it has been placed to either opt out of automation, or opt-in, again depending on what the default value is.
(This might seem complicated, but I found no way of detecting when a player changes the state of just any light in the current Hytale API)
Why are not all lights toggleable by default?
Most players probably assume torches won't go on and off, even if they're outdoors. Feedback on the mod will help decide what the configuration file default arrays will be here.
Configuration Options
The mod supports the following configuration options:
EnableLightAutomation: Enable/disable light automation functionality (true/false)DefaultLogic: Whether placed lights are automated by default, or vice versa (on/off)LoggingLevel: Level of logging detail (off, processing, debug)DawnThreshold: Percentage of sunlight required to turn off lights (>0.000 and <1.000)DuskThreshold: Percentage of sunlight required to turn on lights (>0.000 and <1.000)ToggleableLightTypes: Array containing lights the mod should automateStaticLightTypes: Array containing lights the mod should not automate
Caveat regarding dusk: Currently the Hytale API reports 0 sunlight well before the sun actually sets. I assume this to be a bug, but until it's fixed you'll likely want this to be 0.004 or something in that range.
Commands
/lightautomation- displays available commands/lightautomation --version- displays version/lightautomation --reload- reloads and applies updated configuration/lightautomation --config- displays current configuration settings/lightautomation --lights- shows tracked lights summary/lightautomation --lights list- lists all tracked lights/lightautomation --lights count- shows count of tracked lights/lightautomation --lights types- lists trackable light types/lightautomation --save- manually saves tracked lights/lightautomation --clear- clears all tracked lights/lightautomation --info- shows persistence information
License
Creative Commons Zero


