Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
LambDynamicLights 1.3.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed Jan 16, 2021
1 parent 95df15f commit 5d4410d
Show file tree
Hide file tree
Showing 34 changed files with 323 additions and 482 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@
- Updated French translations.
- Fixed memory leak in dynamic light source tracking. ([#30](https://github.com/LambdAurora/LambDynamicLights/issues/30))

# v1.3.3

- Added Italian translations ([#40](https://github.com/LambdAurora/LambDynamicLights/pull/40)).
- Optimized dynamic lighting update methods.
- 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))
- Fixed crash with Immersive Portals ([#39](https://github.com/LambdAurora/LambDynamicLights/issues/39)).
- Updated [SpruceUI], and Fabric API dependencies.

[SpruceUI]: https://github.com/LambdAurora/SpruceUI "SpruceUI page"
[Sodium]: https://www.curseforge.com/minecraft/mc-mods/sodium "Sodium CurseForge 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"
38 changes: 20 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import net.fabricmc.loom.task.RemapJarTask

plugins {
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'fabric-loom' version '0.5-SNAPSHOT'
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '5.1.0'
id 'net.minecrell.licenser' version '0.4.1'
}

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

def getMCVersionString() {
if (project.minecraft_version.matches("\\d\\dw\\d\\d[a-z]")) {
return project.minecraft_version
}
int lastDot = project.minecraft_version.lastIndexOf('.')
return project.minecraft_version.substring(0, lastDot)
}

minecraft {
}

Expand Down Expand Up @@ -55,18 +64,14 @@ dependencies {
modImplementation "com.github.lambdaurora:spruceui:${project.spruceui_version}"
include "com.github.lambdaurora:spruceui:${project.spruceui_version}"

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

shadow "com.electronwill.night-config:core:3.6.3"
shadow "com.electronwill.night-config:toml:3.6.3"

shadow("org.aperlambda:lambdajcommon:1.8.1") {
// Minecraft already has all that google crap.
exclude group: 'com.google.code.gson'
exclude group: 'com.google.guava'
}
}

tasks.withType(JavaCompile) {
Expand Down Expand Up @@ -102,16 +107,12 @@ license {
include '**/*.java'
}

task shadowJar(type: Jar) {
archiveClassifier.set("dev")

from sourceSets.main.output
shadowJar {
dependsOn(project(":").jar)
configurations = [project.configurations.shadow]
archiveClassifier.set('dev')

from {
configurations.shadow.collect {
it.isDirectory() ? it : zipTree(it)
}
}
relocate 'com.electronwill.nightconfig', 'me.lambdaurora.lambdynlights.shadow.nightconfig'
}

task shadowRemapJar(type: RemapJarTask) {
Expand All @@ -121,6 +122,7 @@ task shadowRemapJar(type: RemapJarTask) {
archiveName = "${archivesBaseName}-${version}.jar"
addNestedDependencies = true
}
build.dependsOn(shadowRemapJar)

// configure the maven publication
publishing {
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.16.4
yarn_mappings=1.16.4+build.3
loader_version=0.10.6+build.214
minecraft_version=1.16.5
yarn_mappings=1.16.5+build.1
loader_version=0.11.1

# Mod Properties
mod_version = 1.3.2
mod_version = 1.3.3
maven_group = me.lambdaurora
archives_base_name = lambdynamiclights

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.25.1+build.416-1.16
spruceui_version=1.6.4
fabric_version=0.29.3+1.16
spruceui_version=2.0.1-1.16
modmenu_version=1.14.6+build.31
29 changes: 14 additions & 15 deletions src/main/java/me/lambdaurora/lambdynlights/DynamicLightSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,51 @@

import net.minecraft.client.render.WorldRenderer;
import net.minecraft.world.World;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/**
* Represents a dynamic light source.
*
* @author LambdAurora
* @version 1.3.2
* @version 1.3.3
* @since 1.0.0
*/
public interface DynamicLightSource
{
public interface DynamicLightSource {
/**
* Returns the dynamic light source X coordinate.
*
* @return The X coordinate.
* @return the X coordinate
*/
double getDynamicLightX();

/**
* Returns the dynamic light source Y coordinate.
*
* @return The Y coordinate.
* @return the Y coordinate
*/
double getDynamicLightY();

/**
* Returns the dynamic light source Z coordinate.
*
* @return The Z coordinate.
* @return the Z coordinate
*/
double getDynamicLightZ();

/**
* Returns the dynamic light source world.
*
* @return The world instance.
* @return the world instance
*/
World getDynamicLightWorld();

/**
* Returns whether the dynamic light is enabled or not.
*
* @return True if the dynamic light is enabled, else false.
* @return {@code true} if the dynamic light is enabled, else {@code false}
*/
default boolean isDynamicLightEnabled()
{
default boolean isDynamicLightEnabled() {
return LambDynLights.get().config.getDynamicLightsMode().isEnabled() && LambDynLights.get().containsLightSource(this);
}

Expand All @@ -65,10 +64,10 @@ default boolean isDynamicLightEnabled()
* <p>
* Note: please do not call this function in your mod or you will break things.
*
* @param enabled True if the dynamic light is enabled, else false.
* @param enabled {@code true} if the dynamic light is enabled, else {@code false}
*/
default void setDynamicLightEnabled(boolean enabled)
{
@ApiStatus.Internal
default void setDynamicLightEnabled(boolean enabled) {
this.resetDynamicLight();
if (enabled)
LambDynLights.get().addLightSource(this);
Expand All @@ -82,7 +81,7 @@ default void setDynamicLightEnabled(boolean enabled)
* Returns the luminance of the light source.
* The maximum is 15, below 1 values are ignored.
*
* @return The luminance of the light source.
* @return the luminance of the light source
*/
int getLuminance();

Expand All @@ -94,7 +93,7 @@ default void setDynamicLightEnabled(boolean enabled)
/**
* Returns whether this dynamic light source should update.
*
* @return True if this dynamic light source should update, else false.
* @return {@code true} if this dynamic light source should update, else {@code false}
*/
boolean shouldUpdateDynamicLight();

Expand Down
Loading

0 comments on commit 5d4410d

Please sign in to comment.