Mod
DarknessLib
No reviews yet
Library mod for handling light calculations and similar things
Does not follow a specific thematic focus apart from vanilla Minecraft.
Used for mods with little to no gameplay elements.
Improves or modifies the game's lighting.
Provides a framework or library for other mods to use.
Forge is a popular mod loader for versions 1.1+ of Minecraft.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
Overview
DarknessLib is a library mod with functions for dealing with light calculations and built in support for the most common mods with dynamic lights. As it is a library mod, it does little by itself, but other mods can add support for it in order to reduce the need to create the same kind of code.
Features
This library provides the following:
- Functions for checking the relative light level (which also takes things like standing in soul sand into account)
- Support for Atomic Stryker's Dynamic Lights, Optifine's Dynamic Lights and Smooth Entity Light. Functionality works on a player-to-player basis (if enabled, any player using either of the named dynamic light mods will have that light added to their total light, rather than the client saying it is bright while the server side says it isn't), and there is a configurable list you add additional handheld light sources to (if they haven't already been discovered, as the library has built in functionality to try and determine light sources out of all registered Blocks)
- A built in list of vehicles that mods relying on the library can check for prior to checking the light level (as both minecarts and boats obscure the light level when you're inside one)
- IMC support for mods to add both handheld light sources and vehicles to the respective lists within the mod (or you can open a ticket on the issue tracker with the modid and path to the vehicle entity class, and I'll include it in the internal list)
Configuration
The mod also comes with a few config options:
Dynamic Lights List:
Items/Blocks added to this list will be regarded as handheld light sources while AtomicStryker's Dynamic Lights is present, or Optifine if its Dynamic Lights is enabled (and Dynamic Lights Mode is enabled), or if Smooth Entity Light is present. Most light-emitting Blocks are automatically detected as light sources, so you might not have to add them to this list (check the log as it lists all that it finds)
Format: modid:name:meta;light_level, where meta and light_level are optional (light level is automatically set to 15 if not specified).
Minecraft Restart Required!
S:"Dynamic Lights List" <
>
Dynamic Lights Mode:
If this is enabled (client and server), handheld light sources will be treated as actual light while AtomicStryker's Dynamic Lights is present, or Optifine if its Dynamic Lights is enabled, or Smooth Entity Light is present.
B:"Dynamic Lights Mode"=false
IMC
If you want to add vehicles from your mod to the vehicle list, you can do so with the following code:
FMLInterModComms.sendMessage("darknesslib", "addVehicle", "path.to.mod.Entity"); //or any alternative where you get the exact path
Where the path simply is the path to your vehicle Entity (be sure to check beforehand whether or not the light calculates are affected by it). If your vehicle extends the vanilla Minecart of Boat, they'll automatically get detected by the system. Naturally, if you have a lot of vehicles, you only need to register your base class for them (assuming you have one).
If you want to add handheld light sources from your mod to the dynamic lights list, you can do so with the following code:
FMLInterModComms.sendMessage("darknesslib", "addLightsource", new ItemStack(INSERT_ITEM_REFERENCE_HERE);
FMLInterModComms.sendMessage("darknesslib", "addLightsource", "modid:name:meta;light_level");
Where the ItemStack version will set the light level to 15, and the String version will default to OreDictionary.WILDCARD_VALUE if meta is omitted (and light level will be set to 15 as well if it's omitted).
Mod support
This mod has built in support for:
- Vehicles from MrCrayfish's Vehicle Mod.
Mods that use this library
Hungering Darkness (as of version 1.3.0)
Donating
If you want to support the development of my mods, consider becoming a patron! You can click on the image below to visit my Patreon page.
Server hosting
I'm sponsored by Aim2Game, and you can use the following codes for discounts on your own server!
ABYSSAL25 - 25% off for life for new customers
ABYSSAL50 - 50% off first month for new customers
Modpacks
This mod may be redistributed as part of a modpack, provided proper credit to the author (me, Shinoow) is given, along with a link back to the Curse/CurseForge page for the mod. You are not allowed to redistribute the mod on third party websites (by mirroring the mod or creating a "mod installer"), and legal actions will be taken against websites found violating this.
Discord
I've set up a discord server for my mods (conveniently named "AbyssalCraft"). Click the image below to join!
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers


