Skip to content

Commit

Permalink
Merge dev/next into 1.21.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed Nov 26, 2024
2 parents 8c7f850 + b7404d8 commit 44b359d
Show file tree
Hide file tree
Showing 121 changed files with 3,463 additions and 940 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@
- Fixed dynamic lighting of various projectiles.
- Fixed water-sensitive items lighting up underwater while they shouldn't.

### 3.1.3

- Fixed item frames and other "block-attached" entities not ticking properly on the integrated server.

## 3.2.0

- Updated to Minecraft 1.21.2.
Expand All @@ -232,16 +236,33 @@
- Fixed dynamic lighting of various projectiles.
- Fixed water-sensitive items lighting up underwater while they shouldn't.

### 3.2.3

- Same changes as v3.1.3 but for 1.21.3.
- Fixed item frames and other "block-attached" entities not ticking properly on the integrated server.

## 4.0.0

- Added the ability to define entity light sources in resource packs.
- Please refer yourself to the documentation for more details.
- Added display entities dynamic lighting ([#209](https://github.com/LambdAurora/LambDynamicLights/issues/209)).
- This affects both block and item displays.
- If a custom brightness is defined then dynamic lighting disables itself.
- Added a new API to define fully custom dynamic lighting of varying shapes.
- Added dynamic lighting to beacon beams ([#115]).
- Added dynamic lighting to End gateway beams ([#115]).
- Added dynamic lighting to guardian lasers ([#115]).
- Added debug settings and renderers to facilitate debugging.
- Added a debug renderer to active dynamic lighting cells.
- Added a debug renderer to display chunk rebuilds.
- Added a debug renderer to display the bounding boxes of custom dynamic light sources.
- Updated the data displayed in the F3 HUD to show more information about dynamic lighting.
- Refactored heavily the ticking of entity dynamic lighting to make it more abstract.
- Refactored heavily how chunk rebuilds are queued and how dynamic light sources are represented.
- Fixed API publication for loom-based setups.

[SpruceUI]: https://github.com/LambdAurora/SpruceUI "SpruceUI page"
[pridelib]: https://github.com/Queerbric/pridelib "Pridelib page"
[Sodium]: https://modrinth.com/mod/sodium "Sodium Modrinth page"
[Canvas Renderer]: https://www.curseforge.com/minecraft/mc-mods/canvas-renderer "Canvas Renderer CurseForge page"
[#115]: https://github.com/LambdAurora/LambDynamicLights/issues/115
64 changes: 39 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@ Searching other mods to replace OptiFine? [Check out this list!](https://optifin
## ✅ Features:

- Dynamic lighting.
- Settings to select how smooth the dynamic lighting is.
- Works with some modded items.
- Settings to select how smoothly the dynamic lighting updates.
- Any entity holding an item which emits light will emit light!
- Magma cubes emit light.
- Spectral arrows emit light.
- Item lighting can be customized through resource-packs and can work with modded items!
- Some items like torches, soul torches, etc. will not light up in water.
- Various entities will naturally emit light, like:
- Allays
- Blazes
- Fireballs
- Glow squids
- Magma cubes
- Spectral arrows
- Burning entities emit light.
- Blazes emit light.
- Some items like torches, soul torches, etc. will not light up in water.
- Quick and simple API for developers and resource pack makers.
- Check out [the documentation][documentation] for more details!
- And more!

## Screenshots
Expand All @@ -47,38 +52,46 @@ Searching other mods to replace OptiFine? [Check out this list!](https://optifin

Dropped items which already emit light as a block, will also dynamically emit light!

![Torch](images/torch.png)
![Dropped lantern](assets/lantern_study.png)

### Held items emit light

Light is emitted when entities hold light emitting items.

![Fox holding lantern](images/fox_holding_lantern.png)
![Torch](assets/torch.png)
![Fox holding glowberries](assets/fox_holding.png)

### Fire! Fire! Fire!

Any entity on fire will emit light!

![Skeleton on fire!](images/fire_skeleton.png)
![An Aurora is on fire!](assets/fire.png)
![Arrow on fire!](assets/fire_arrow.png)

### Spectral arrows
### Explosion imminent!

Spectral arrows will emit a very weak light!
Creepers can make their imminent explosions more apparent through a progressive emission of light!

![Spectral arrows](images/spectral_arrow.png)
![Quick! Need to protect myself from this Creeper!](assets/creeper.png)

### Different luminance!
### Glow Squids!

Light emitted from items depend on the light emitted from their respective blocks!
The infamous glow squids finally glow in your world!

![light levels](images/light_levels.png)
![A group of glow squids](assets/glow_squid.png)

### Guardian Lasers!

Wait... what? **Lasers?!** They do pack a punch...

![light levels](assets/guardian_laser.png)

### Configuration GUI

As of v2.1.0.
As of v4.0.0.

![Configuration GUI](images/settings_main.png)
![Entities Configuration](images/settings_entities.png)
![Configuration GUI](assets/settings_main.png)
![Entities Configuration](assets/settings_entities.png)

## 📖 Usage

Expand All @@ -91,19 +104,19 @@ You can also configure the mod by editing the file in `config/lambdynlights.toml

Need help? Come check out [my Discord server][LambdAurora Discord].

<!-- modrinth_exclude.start -->
### Build
## 📖 Is there an API? How to use it as a developer?

Just do `./gradlew build` and everything should build just fine!
<!-- modrinth_exclude.end -->
[Check out this in-depth documentation][documentation].

## 📖 How does it work internally?

Check [this documentation](https://github.com/LambdAurora/LambDynamicLights/blob/1.21/HOW_DOES_IT_WORK.md).
[Check out this document I've written on the fundamentals of it](https://github.com/LambdAurora/LambDynamicLights/blob/1.21/HOW_DOES_IT_WORK.md).

## 📖 Is there an API? How to use it as a developer?
<!-- modrinth_exclude.start -->
### Build

Check [this documentation](https://lambdaurora.dev/projects/lambdynamiclights/docs/v4/).
Just do `./gradlew build` and everything should build just fine!
<!-- modrinth_exclude.end -->

<!-- modrinth_exclude.long_start -->
## Downloads
Expand Down Expand Up @@ -139,4 +152,5 @@ GitHub
[Fabric API]: https://www.curseforge.com/minecraft/mc-mods/fabric-api "Fabric API CurseForge page"
[ModMenu]: https://modrinth.com/mod/modmenu
[Sodium]: https://www.curseforge.com/minecraft/mc-mods/sodium "Sodium CurseForge page"
[documentation]: https://lambdaurora.dev/projects/lambdynamiclights/docs/v4/ "The documentation page of LambDynamicLights"
[LambdAurora Discord]: https://discord.lambdaurora.dev
39 changes: 39 additions & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import lambdynamiclights.Constants
import lambdynamiclights.data.Nmt
import lambdynamiclights.task.GenerateNmtTask

plugins {
id("lambdynamiclights")
Expand All @@ -22,6 +24,43 @@ tasks.generateFmj.configure {
}
}

val generateNmt = tasks.register("generateNmt", GenerateNmtTask::class) {
this.nmt.set(tasks.generateFmj.flatMap {
it.fmj.map { fmj ->
fmj.derive(::Nmt)
.withLoaderVersion("[2,)")
.withDepend("minecraft", "[" + libs.versions.minecraft.get() + ",)")
}
})
outputDir.set(project.file("build/generated/generated_resources/"))
}

tasks.generateFmj.configure {
dependsOn(generateNmt)
}

tasks.ideaSyncTask.configure {
dependsOn(generateNmt)
}

tasks.getByName("sourcesJar") {
dependsOn(generateNmt)
}

val mojmap by sourceSets.creating {}

java {
registerFeature("mojmap") {
usingSourceSet(mojmap)
withSourcesJar()

afterEvaluate {
configurations["mojmapApiElements"].extendsFrom(configurations["apiElements"])
configurations["mojmapRuntimeElements"].extendsFrom(configurations["runtimeElements"])
}
}
}

// Configure the maven publication.
publishing {
publications {
Expand Down
60 changes: 60 additions & 0 deletions api/moj_xplat/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import lambdynamiclights.Constants
import net.fabricmc.loom.LoomGradleExtension
import net.fabricmc.loom.api.mappings.layered.MappingsNamespace
import net.fabricmc.loom.task.RemapJarTask
import net.fabricmc.loom.task.RemapSourcesJarTask

plugins {
id("lambdynamiclights-common")
}

base.archivesName.set(Constants.NAME + "-api-mojmap")

dependencies {
mappings(loom.officialMojangMappings())
}

val apiProject = project(":api")

tasks.remapJar {
val remapJar = apiProject.tasks.named("remapJar", RemapJarTask::class)
dependsOn(remapJar)

classpath.setFrom((loom as LoomGradleExtension).getMinecraftJarsCollection(MappingsNamespace.INTERMEDIARY))
inputFile.convention(remapJar.flatMap { it.archiveFile })
sourceNamespace = "intermediary"
targetNamespace = "named"
}

// Add the remapped JAR artifact
apiProject.configurations["mojmapApiElements"].artifacts.removeIf{
true
}
apiProject.artifacts.add("mojmapApiElements", tasks.remapJar) {
classifier = "mojmap"
}
apiProject.configurations["mojmapRuntimeElements"].artifacts.removeIf{
true
}
apiProject.artifacts.add("mojmapRuntimeElements", tasks.remapJar) {
classifier = "mojmap"
}

tasks.remapSourcesJar {
val remapJar = apiProject.tasks.named("remapSourcesJar", RemapSourcesJarTask::class)
dependsOn(remapJar)

classpath.setFrom((loom as LoomGradleExtension).getMinecraftJarsCollection(MappingsNamespace.INTERMEDIARY))
inputFile.convention(remapJar.flatMap { it.archiveFile })
archiveClassifier = "sources"
sourceNamespace = "intermediary"
targetNamespace = "named"
}

// Add the remapped sources artifact
apiProject.configurations["mojmapSourcesElements"].artifacts.removeIf {
true
}
apiProject.artifacts.add("mojmapSourcesElements", tasks.remapSourcesJar) {
classifier = "mojmap-sources"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright © 2024 LambdAurora <[email protected]>
*
* This file is part of LambDynamicLights.
*
* Licensed under the Lambda License. For more information,
* see the LICENSE file.
*/

package dev.lambdaurora.lambdynlights.api;

import dev.lambdaurora.lambdynlights.api.entity.EntityLightSourceManager;
import dev.lambdaurora.lambdynlights.api.behavior.DynamicLightBehaviorManager;
import dev.lambdaurora.lambdynlights.api.item.ItemLightSourceManager;

/**
* Represents the dynamic lights context, containing references to managers for each source type provided by this API.
*
* @author LambdAurora
* @version 4.0.0
* @since 4.0.0
*/
public interface DynamicLightsContext {
/**
* {@return the manager for item light sources}
*/
ItemLightSourceManager itemLightSourceManager();

/**
* {@return the manager for entity light sources}
*/
EntityLightSourceManager entityLightSourceManager();

/**
* {@return the manager for dynamic light behaviors and associated light sources}
*/
DynamicLightBehaviorManager dynamicLightBehaviorManager();
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

package dev.lambdaurora.lambdynlights.api;

import dev.lambdaurora.lambdynlights.api.entity.EntityLightSourceManager;
import dev.lambdaurora.lambdynlights.api.item.ItemLightSourceManager;

/**
* Represents the entrypoint for LambDynamicLights' API.
*
Expand All @@ -21,10 +18,21 @@
*/
public interface DynamicLightsInitializer {
/**
* Called when LambDynamicLights is initialized to register custom dynamic light handlers and item light sources.
* The entrypoint key for LambDynamicLights' API, whose value is {@value}.
*
* @since 4.0.0
*/
String ENTRYPOINT_KEY = "lambdynlights:initializer";

/**
* Called when LambDynamicLights is initialized to register various objects related to dynamic lighting such as:
* <ul>
* <li>entity luminance providers;</li>
* <li>item and entity light sources;</li>
* <li>custom dynamic lighting behavior.</li>
* </ul>
*
* @param itemLightSourceManager the manager for item light sources
* @param entityLightSourceManager the manager for entity light sources
* @param context the dynamic lights context, containing references to managers for each source type provided by the API
*/
void onInitializeDynamicLights(ItemLightSourceManager itemLightSourceManager, EntityLightSourceManager entityLightSourceManager);
void onInitializeDynamicLights(DynamicLightsContext context);
}
Loading

0 comments on commit 44b359d

Please sign in to comment.