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.
This library provides the following:
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
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).
This mod has built in support for:
Hungering Darkness (as of version 1.3.0)
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.
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
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.
I've set up a discord server for my mods (conveniently named "AbyssalCraft"). Click the image below to join!
No files available for download.