Loading...
Beta Modpages Unclaimed

DarknessLib

Library mod for handling light calculations and similar things

0 Likes
5848600 Downloads
Created by Shinoow

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:

 

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!


AD Become Premium to remove Ads!

What means Verified?

  • Compatibility: The mod should be compatible with the latest version of Minecraft and be clearly labeled with its supported versions.
  • Functionality: The mod should work as advertised and not cause any game-breaking bugs or crashes.
  • Security: The mod should not contain any malicious code or attempts to steal personal information.
  • Performance: The mod should not cause a significant decrease in the game's performance, such as by causing lag or reducing frame rates.
  • Originality: The mod should be original and not a copy of someone else's work.
  • Up-to-date: The mod should be regularly updated to fix bugs, improve performance, and maintain compatibility with the latest version of Minecraft.
  • Support: The mod should have an active developer who provides support and troubleshooting assistance to users.
  • License: The mod should be released under a clear and open source license that allows others to use, modify, and redistribute the code.
  • Documentation: The mod should come with clear and detailed documentation on how to install and use it.

AD Become Premium to remove Ads!

How to Install

1

Download Forge & Java

Download Forge from the offical Site or here. If you dont have Java installed then install it now from here. After Downloading Forge you can run the file with Java.

2

Prepare

Lounch Minecraft and select your Forge istallation as Version this will create a Folder called Mods.

3

Add Mods

Type Win+R and type %appdata% and open the .minecraft Folder. There will you find your Folder called Mods. Place all Mods you want to play in this Folder

4

Enjoy

You are now Ready. Re-start your Game and start Playing.

More Mods like this

Mantle

Shared code for Forge mods

AutoRegLib

A library to ease menial tasks in mod development.

CraftTweaker

CraftTweaker allows modpacks and servers to customize the game. With CraftTweaker you can change recipes, script events, add new commands and even change item properties!

CoFH Core

Contains Core Functionality for all Team CoFH mods. Also does some really cool stuff on its own!

Patchouli

Accessible, Data-Driven, Dependency-Free Documentation for Minecraft Modders and Pack Makers

Baubles

An addon module and API for Thaumcraft