Skip to content

Commit 5d4410d

Browse files
committed
LambDynamicLights 1.3.3.
1 parent 95df15f commit 5d4410d

34 files changed

+323
-482
lines changed

CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@
7575
- Updated French translations.
7676
- Fixed memory leak in dynamic light source tracking. ([#30](https://github.com/LambdAurora/LambDynamicLights/issues/30))
7777

78+
# v1.3.3
79+
80+
- Added Italian translations ([#40](https://github.com/LambdAurora/LambDynamicLights/pull/40)).
81+
- Optimized dynamic lighting update methods.
82+
- Fixed crash when leaving world with some minimaps mods. ([#37](https://github.com/LambdAurora/LambDynamicLights/issues/37), [#41](https://github.com/LambdAurora/LambDynamicLights/issues/41))
83+
- Fixed crash with Immersive Portals ([#39](https://github.com/LambdAurora/LambDynamicLights/issues/39)).
84+
- Updated [SpruceUI], and Fabric API dependencies.
85+
7886
[SpruceUI]: https://github.com/LambdAurora/SpruceUI "SpruceUI page"
79-
[Sodium]: https://www.curseforge.com/minecraft/mc-mods/sodium "Sodium CurseForge page"
87+
[Sodium]: https://modrinth.com/mod/sodium "Sodium Modrinth page"
8088
[Canvas Renderer]: https://www.curseforge.com/minecraft/mc-mods/canvas-renderer "Canvas Renderer CurseForge page"

build.gradle

+20-18
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
import net.fabricmc.loom.task.RemapJarTask
22

33
plugins {
4-
id 'fabric-loom' version '0.4-SNAPSHOT'
4+
id 'fabric-loom' version '0.5-SNAPSHOT'
55
id 'java-library'
66
id 'maven-publish'
7+
id 'com.github.johnrengelman.shadow' version '5.1.0'
78
id 'net.minecrell.licenser' version '0.4.1'
89
}
910

1011
group = project.maven_group
11-
version = "${project.mod_version}+${project.minecraft_version}"
12+
version = "${project.mod_version}+${getMCVersionString()}"
1213
archivesBaseName = project.archives_base_name + "-fabric"
1314

15+
def getMCVersionString() {
16+
if (project.minecraft_version.matches("\\d\\dw\\d\\d[a-z]")) {
17+
return project.minecraft_version
18+
}
19+
int lastDot = project.minecraft_version.lastIndexOf('.')
20+
return project.minecraft_version.substring(0, lastDot)
21+
}
22+
1423
minecraft {
1524
}
1625

@@ -55,18 +64,14 @@ dependencies {
5564
modImplementation "com.github.lambdaurora:spruceui:${project.spruceui_version}"
5665
include "com.github.lambdaurora:spruceui:${project.spruceui_version}"
5766

58-
modImplementation "io.github.prospector:modmenu:${project.modmenu_version}"
67+
modImplementation("io.github.prospector:modmenu:${project.modmenu_version}") {
68+
transitive = false
69+
}
5970
//modImplementation "grondag:canvas-mc116:1.0.+"
6071
modImplementation "com.github.jellysquid3:sodium-fabric:mc1.16.3-0.1.0"
6172

6273
shadow "com.electronwill.night-config:core:3.6.3"
6374
shadow "com.electronwill.night-config:toml:3.6.3"
64-
65-
shadow("org.aperlambda:lambdajcommon:1.8.1") {
66-
// Minecraft already has all that google crap.
67-
exclude group: 'com.google.code.gson'
68-
exclude group: 'com.google.guava'
69-
}
7075
}
7176

7277
tasks.withType(JavaCompile) {
@@ -102,16 +107,12 @@ license {
102107
include '**/*.java'
103108
}
104109

105-
task shadowJar(type: Jar) {
106-
archiveClassifier.set("dev")
107-
108-
from sourceSets.main.output
110+
shadowJar {
111+
dependsOn(project(":").jar)
112+
configurations = [project.configurations.shadow]
113+
archiveClassifier.set('dev')
109114

110-
from {
111-
configurations.shadow.collect {
112-
it.isDirectory() ? it : zipTree(it)
113-
}
114-
}
115+
relocate 'com.electronwill.nightconfig', 'me.lambdaurora.lambdynlights.shadow.nightconfig'
115116
}
116117

117118
task shadowRemapJar(type: RemapJarTask) {
@@ -121,6 +122,7 @@ task shadowRemapJar(type: RemapJarTask) {
121122
archiveName = "${archivesBaseName}-${version}.jar"
122123
addNestedDependencies = true
123124
}
125+
build.dependsOn(shadowRemapJar)
124126

125127
// configure the maven publication
126128
publishing {

gradle.properties

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ org.gradle.jvmargs=-Xmx1G
33

44
# Fabric Properties
55
# check these on https://fabricmc.net/use
6-
minecraft_version=1.16.4
7-
yarn_mappings=1.16.4+build.3
8-
loader_version=0.10.6+build.214
6+
minecraft_version=1.16.5
7+
yarn_mappings=1.16.5+build.1
8+
loader_version=0.11.1
99

1010
# Mod Properties
11-
mod_version = 1.3.2
11+
mod_version = 1.3.3
1212
maven_group = me.lambdaurora
1313
archives_base_name = lambdynamiclights
1414

1515
# Dependencies
1616
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
17-
fabric_version=0.25.1+build.416-1.16
18-
spruceui_version=1.6.4
17+
fabric_version=0.29.3+1.16
18+
spruceui_version=2.0.1-1.16
1919
modmenu_version=1.14.6+build.31

src/main/java/me/lambdaurora/lambdynlights/DynamicLightSource.java

+14-15
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,51 @@
1111

1212
import net.minecraft.client.render.WorldRenderer;
1313
import net.minecraft.world.World;
14+
import org.jetbrains.annotations.ApiStatus;
1415
import org.jetbrains.annotations.NotNull;
1516

1617
/**
1718
* Represents a dynamic light source.
1819
*
1920
* @author LambdAurora
20-
* @version 1.3.2
21+
* @version 1.3.3
2122
* @since 1.0.0
2223
*/
23-
public interface DynamicLightSource
24-
{
24+
public interface DynamicLightSource {
2525
/**
2626
* Returns the dynamic light source X coordinate.
2727
*
28-
* @return The X coordinate.
28+
* @return the X coordinate
2929
*/
3030
double getDynamicLightX();
3131

3232
/**
3333
* Returns the dynamic light source Y coordinate.
3434
*
35-
* @return The Y coordinate.
35+
* @return the Y coordinate
3636
*/
3737
double getDynamicLightY();
3838

3939
/**
4040
* Returns the dynamic light source Z coordinate.
4141
*
42-
* @return The Z coordinate.
42+
* @return the Z coordinate
4343
*/
4444
double getDynamicLightZ();
4545

4646
/**
4747
* Returns the dynamic light source world.
4848
*
49-
* @return The world instance.
49+
* @return the world instance
5050
*/
5151
World getDynamicLightWorld();
5252

5353
/**
5454
* Returns whether the dynamic light is enabled or not.
5555
*
56-
* @return True if the dynamic light is enabled, else false.
56+
* @return {@code true} if the dynamic light is enabled, else {@code false}
5757
*/
58-
default boolean isDynamicLightEnabled()
59-
{
58+
default boolean isDynamicLightEnabled() {
6059
return LambDynLights.get().config.getDynamicLightsMode().isEnabled() && LambDynLights.get().containsLightSource(this);
6160
}
6261

@@ -65,10 +64,10 @@ default boolean isDynamicLightEnabled()
6564
* <p>
6665
* Note: please do not call this function in your mod or you will break things.
6766
*
68-
* @param enabled True if the dynamic light is enabled, else false.
67+
* @param enabled {@code true} if the dynamic light is enabled, else {@code false}
6968
*/
70-
default void setDynamicLightEnabled(boolean enabled)
71-
{
69+
@ApiStatus.Internal
70+
default void setDynamicLightEnabled(boolean enabled) {
7271
this.resetDynamicLight();
7372
if (enabled)
7473
LambDynLights.get().addLightSource(this);
@@ -82,7 +81,7 @@ default void setDynamicLightEnabled(boolean enabled)
8281
* Returns the luminance of the light source.
8382
* The maximum is 15, below 1 values are ignored.
8483
*
85-
* @return The luminance of the light source.
84+
* @return the luminance of the light source
8685
*/
8786
int getLuminance();
8887

@@ -94,7 +93,7 @@ default void setDynamicLightEnabled(boolean enabled)
9493
/**
9594
* Returns whether this dynamic light source should update.
9695
*
97-
* @return True if this dynamic light source should update, else false.
96+
* @return {@code true} if this dynamic light source should update, else {@code false}
9897
*/
9998
boolean shouldUpdateDynamicLight();
10099

0 commit comments

Comments
 (0)