Skip to content

Commit

Permalink
Update README and documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed Oct 9, 2024
1 parent 6b48dee commit 4e971c1
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 10 deletions.
20 changes: 20 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ Block entity dynamic lighting is non-recommended if avoidable with block states.

If your entity re-implements tick without calling the super method the dynamic light handler will not work.

## Gradle Setup

To work with the mod you should add the following to your buildscript:

```gradle
repositories {
maven {
name = "Gegy"
url = uri("https://maven.gegy.dev")
}
}
dependencies {
/* Stuff */
// For now only this line is needed, in the future this should evolve into separate API and runtime JARs.
modImplementation("dev.lambdaurora.lambdynamiclights:lambdynamiclights-runtime:<version>")
}
```

## LambDynamicLights entrypoint

Any API calls should be done in the custom entrypoint.
Expand Down
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![CurseForge](http://cf.way2muchnoise.eu/title/393442.svg)](https://www.curseforge.com/minecraft/mc-mods/lambdynamiclights)
<!-- modrinth_exclude.end -->

A dynamic lights mod for Quilt and Fabric.
A dynamic lighting mod for Fabric.

## 📖 What's this mod?

Expand All @@ -29,7 +29,7 @@ Searching other mods to replace OptiFine? [Check out this list!](https://optifin

## ✅ Features:

- Dynamic lights.
- Dynamic lighting.
- Settings to select how smooth the dynamic lighting is.
- Works with some modded items.
- Any entity holding an item which emits light will emit light!
Expand All @@ -38,7 +38,7 @@ Searching other mods to replace OptiFine? [Check out this list!](https://optifin
- 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.
- Quick and simple API for developers and resource pack makers.
- And more!

## Screenshots
Expand Down Expand Up @@ -105,19 +105,40 @@ Check [this documentation](https://github.com/LambdAurora/LambDynamicLights/blob

Check [this documentation](https://github.com/LambdAurora/LambDynamicLights/blob/1.17/API.md).

<!-- modrinth_exclude.long_start -->
## Downloads

<div>
<a href="https://modrinth.com/mod/lambdynamiclights" style="display: inline-flex; align-items: center;">
<svg aria-hidden="true" viewBox="16 -2 150 150" data-view-component="true" width="42" height="42"><path fill-rule="evenodd" fill="#1bd96a" d="M159.07,89.29A70.94,70.94,0,1,0,20,63.52H32A58.78,58.78,0,0,1,145.23,49.93l-11.66,3.12a46.54,46.54,0,0,0-29-26.52l-2.15,12.13a34.31,34.31,0,0,1,2.77,63.26l3.19,11.9a46.52,46.52,0,0,0,28.33-49l11.62-3.1A57.94,57.94,0,0,1,147.27,85Z"></path><path fill-rule="evenodd" fill="#1bd96a" d="M108.92,139.3A70.93,70.93,0,0,1,19.79,76h12a59.48,59.48,0,0,0,1.78,9.91,58.73,58.73,0,0,0,3.63,9.91l10.68-6.41a46.58,46.58,0,0,1,44.72-65L90.43,36.54A34.38,34.38,0,0,0,57.36,79.75C57.67,80.88,58,82,58.43,83l13.66-8.19L68,63.93l12.9-13.25,16.31-3.51L101.9,53l-7.52,7.61-6.55,2.06-4.69,4.82,2.3,6.38s4.64,4.94,4.65,4.94l6.57-1.74,4.67-5.13,10.2-3.24,3,6.84L104.05,88.43,86.41,94l-7.92-8.81L64.7,93.48a34.44,34.44,0,0,0,28.72,11.59L96.61,117A46.6,46.6,0,0,1,54.13,99.83l-10.64,6.38a58.81,58.81,0,0,0,99.6-9.77l11.8,4.29A70.77,70.77,0,0,1,108.92,139.3Z"></path></svg>
<span style="display: inline-block; width: 4px;"></span>
Modrinth
</a>
<span style="display: inline-block; width: 1em"></span>
<a href="https://www.curseforge.com/minecraft/mc-mods/lambdynamiclights" style="display: inline-flex; align-items: center">
<svg aria-hidden="true" viewBox="-2017 853 43 23" data-view-component="true" src="https://www.curseforge.com/Content/2-0-8083-18015/Skins/CurseForge/images/anvil.svg" width="42" height="42" style="fill: var(--ls_theme_primary)"><path fill-rule="evenodd" d="M-2005.7,853l0.7,3c-3.5,0-12,0-12,0s0.2,0.9,0.3,1c0.3,0.5,0.6,1.1,1,1.5c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"></span>
<a href="https://github.com/LambdAurora/LambDynamicLights/releases" style="display: inline-flex; align-items: center">
<svg aria-hidden="true" viewBox="0 0 16 16" data-view-component="true" width="42" height="42" style="fill: var(--ls_theme_primary)"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
<span style="display: inline-block; width: 4px;"></span>
GitHub
</a>
</div>
<!-- modrinth_exclude.long_end -->

# 📖 Compatibility

- [Sodium] is recommended for better performances.
- [Canvas] is compatible but still WIP: expect huge lag spike with it until a proper lighting API is done in Canvas.
- **OptiFabric is obviously incompatible.**


**<p style="color: red">Please, when you write the name of this mod, don't add spaces.</p>**

[fabric]: https://fabricmc.net
[Mod loader: Fabric]: https://img.shields.io/badge/modloader-Fabric-1976d2?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxu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Q6MGVkYjFjMmMtZmY4Yy1lNDQxLTkzMWYtNDk1ZDRmMTRjNzYwIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MGVkYjFjMmMtZmY4Yy1lNDQxLTkzMWYtNDk1ZDRmMTRjNzYwIj4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDowZWRiMWMyYy1mZjhjLWU0NDEtOTMxZi00OTVkNGYxNGM3NjAiIHN0RXZ0OndoZW49IjIwMTgtMTItMTZUMTY6NTQ6MTctMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE4IChXaW5kb3dzKSIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4/HiGMAAAAtUlEQVRYw+XXrQqAMBQF4D2P2eBL+QIG8RnEJFaNBjEum+0+zMQLtwwv+wV3ZzhhMDgfJ0wUSinxZUQWgKos1JP/AbD4OneIDyQPwCFniA+EJ4CaXm4TxAXCC0BNHgLhAdAnx9hC8PwGSRtAFVMQjF7cNTWED8B1cgwW20yfJgAvrssAsZ1cB3g/xckAxr6FmCDU5N6f488BrpCQ4rQBJkiMYh4ACmLzwOQF0CExinkCsvw7vgGikl+OotaKRwAAAABJRU5ErkJggg==
[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"
[Canvas]: https://www.curseforge.com/minecraft/mc-mods/canvas-renderer "Canvas CurseForge page"
[LambdAurora Discord]: https://discord.gg/abEbzzv
[LambdAurora Discord]: https://discord.lambdaurora.dev
26 changes: 23 additions & 3 deletions build_logic/src/main/kotlin/lambdynamiclights/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,32 @@ import org.gradle.api.Project

object Utils {
fun parseReadme(project: Project): String {
val excludeRegex = "(?m)<!-- modrinth_exclude\\.start -->(.|\n)*?<!-- modrinth_exclude\\.end -->"
val linkRegex = "!\\[([A-z_ ]+)]\\((images\\/[A-z.\\/_]+)\\)"

var readme = project.rootProject.file("README.md").readText()
readme = readme.replace(excludeRegex.toRegex(), "")
readme = readme.replace(linkRegex.toRegex(), "![\$1](https://raw.githubusercontent.com/LambdAurora/LambDynamicLights/1.19/\$2)")
val lines = readme.split("\n").toMutableList()
val it = lines.listIterator()

var shouldRemove = false;
while (it.hasNext()) {
val line = it.next();

if (line == "<!-- modrinth_exclude.long_start -->") {
shouldRemove = true
}

if (shouldRemove) {
it.remove()
}

if (line == "<!-- modrinth_exclude.long_end -->") {
shouldRemove = false
}
}

readme = lines.joinToString("\n")
readme = readme.replace(linkRegex.toRegex(), "![\$1](https://raw.githubusercontent.com/LambdAurora/LambDynamicLights/1.21/\$2)")
project.logger.lifecycle("Readme: {}", readme)
return readme
}

Expand Down

0 comments on commit 4e971c1

Please sign in to comment.