Back to mods
DarknessLib project artwork

CurseForge · Minecraft mod

DarknessLib

Library mod for handling light calculations and similar things

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which DarknessLib release matches 1.12.2 Forge?

Updated 3 years ago
Best match for your filters DarknessLib-1.12.2-1.1.1.jar
Game version 1.12.2
Loader Forge

DarknessLib-1.12.2-1.1.1.jar targets 1.12.2 with Forge. The project page does not say whether it belongs on the client. The project page does not say whether it belongs on the dedicated server. No extra mods listed for this file.

Where it goes

Is DarknessLib required on the client, server, or both?

The project page does not say whether it belongs on the client. The project page does not say whether it belongs on the dedicated server.

Client Source doesn’t say
Dedicated server Source doesn’t say
Loader for this release Forge
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source does not explicitly classify this release as client-only or server-only.

What else does DarknessLib-1.12.2-1.1.1.jar need?

DarknessLib-1.12.2-1.1.1.jar on 1.12.2 Forge. Every mod below is checked against that same setup.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

Dynamic Lights Optional for DarknessLib-1.12.2-1.1.1.jar
optional
No matching file
Smooth Entity Light Optional for DarknessLib-1.12.2-1.1.1.jar
optional
Matching file found Matched file: SmoothEntityLight-4.0.4-MC1.12.2

We only count dependency files that match this setup. A file for another loader does not fill the gap.

Before you install it

Add DarknessLib without breaking your instance.

Built for DarknessLib-1.12.2-1.1.1.jar on 1.12.2 Forge. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use DarknessLib-1.12.2-1.1.1.jar. It targets 1.12.2 with Forge; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    The project page does not say whether it belongs on the client. The project page does not say whether it belongs on the dedicated server.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside DarknessLib-1.12.2-1.1.1.jar. It opens that exact file at the source.

About this project

What does DarknessLib add?

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:

Mods that use this library

Grue (as of version 1.6.0)

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.

Patreon

Server hosting

A2G

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!

Project description from CurseForge.

Pick your setup

DarknessLib by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

2 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

DarknessLib versions and loaders

1 of 4 releases match
Clear filters

Looking for an older file? The official CurseForge project page is in Resources.