k1lly0u
Automatically turns ON and OFF lanterns after sunset and sunrise

Supported Games

Night Lantern automatically turns ON lanterns after sunset and then turns them OFF after sunrise.

Sunset and sunrise hours can be set in configuration file; default values are 7.5 and 18.5. These values determine when lights should be turned on and off.

Enable which light types you would like to have automated by changing "This type is enabled" for the various types in the configuration.

Choose to make lights consume fuel, or run free of charge by changing "This type consumes fuel" for the various light types in the configuration.

Allow players to toggle what types of lights they want to be automated by changing "This type can be toggled by the owner" in the config. This only affects lights they have placed themselves.

Option to require that only players with the correct permission can toggle their own lights type by changing "This type requires permission to be toggled by the owner" in the configuration.

When a player toggles on/off a light type all of their lights of that type will also be turned on/off (if within the automation time span).

Has inbuilt support for No Fuel Requirements

Permissions

  • nightlantern.global- Required to toggle auto-lights across the entire server
  • nightlantern.campfire - Required to toggle automation on campfires you own
  • nightlantern.firepit - Required to toggle automation on firepits you own
  • nightlantern.fireplace - Required to toggle automation on fireplaces you own
  • nightlantern.furnace - Required to toggle automation on furnaces you own
  • nightlantern.largefurnace - Required to toggle automation on large funacaes you own
  • nightlantern.lanterns - Required to toggle automation on lanterns you own
  • nightlantern.jackolantern - Required to toggle automation on jack'o'lanterns you own
  • nightlantern.tunalight - Required to toggle automation on tuna can lamps you own
  • nightlantern.searchlight - Required to toggle automation on searchlights you own
  • nightlantern.refinery- Required to toggle automation on refineries you own
  • nightlantern.cursedcauldren- Required to toggle automation on cursed cauldrens you own
  • nightlantern.chineselantern- Required to toggle automation on chinese lanterns you own

Chat Commands

  • /lantern global - Toggle lights and automation on/off across the whole server
  • /lantern campfire - Toggle automation on campfires you own
  • /lantern firepit - Toggle automation on firepits you own
  • /lantern fireplace - Toggle automation on fireplaces you own
  • /lantern furnace - Toggle automation on furnaces you own
  • /lantern largefurnace - Toggle automation on large funaces you own
  • /lantern lanterns - Toggle automation on lanterns you own
  • /lantern jackolantern - Toggle automation on jack'o'lanterns you own
  • /lantern tunalight - Toggle automation on tuna can lights you own
  • /lantern searchlight - Toggle automation on searchlights you own
  • /lantern refinery - Toggle automation on refineries you own
  • /lantern cursedcauldren - Toggle automation on cursed cauldrens you own
  • /lantern chineselantern - Toggle automation on chinese lanterns you own

Configuration

{
  "Light Settings": {
    "Campfire": {
      "This type is enabled": true,
      "This type consumes fuel": false,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    },   
    "Firepit": {
      "This type is enabled": true,
      "This type consumes fuel": false,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    },
    "Fireplace": {
      "This type is enabled": true,
      "This type consumes fuel": false,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    },
    "Furnace": {
      "This type is enabled": true,
      "This type consumes fuel": false,
      "This type can be toggled by the owner": false,
      "This type requires permission to be toggled by the owner": false
    },
    "JackOLantern": {
      "This type is enabled": true,
      "This type consumes fuel": false,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    },
    "Lanterns": {
      "This type is enabled": true,
      "This type consumes fuel": false,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    },
    "LargeFurnace": {
      "This type is enabled": true,
      "This type consumes fuel": false,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    },
    "Searchlight": {
      "This type is enabled": true,
      "This type consumes fuel": false,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    },
    "TunaLight": {
      "This type is enabled": true,
      "This type consumes fuel": false,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    },
    "Refinery": {
      "This type is enabled": true,
      "This type consumes fuel": true,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    },
    "ChineseLantern": {
      "This type is enabled": true,
      "This type consumes fuel": true,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    },
    "CursedCauldren": {
      "This type is enabled": true,
      "This type consumes fuel": true,
      "This type can be toggled by the owner": true,
      "This type requires permission to be toggled by the owner": true
    }

  },
  "Time autolights are disabled": 7.5,
  "Time autolights are enabled": 18.5,
  "Version": {
    "Major": 2,
    "Minor": 0,
    "Patch": 9
  }
}

For Developers

Hooks

object OnNightLanternToggle(BaseEntity entity, bool toggleOn) // Called prior to toggling a light

MIT License


Copyright (c) 2020 k1lly0u


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.