Skip to content

Commit c4984f4

Browse files
committed
Fix crash due to Mixin plugin (#239).
1 parent 8facd0f commit c4984f4

File tree

5 files changed

+45
-13
lines changed

5 files changed

+45
-13
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@
191191
- This may be re-introduced if a valid use-case is found.
192192
- Switched license to [Lambda License](https://github.com/LambdAurora/LambDynamicLights/blob/bbefb8860bca2e797f8a2ba8a59d1120b6e1c7b4/LICENSE).
193193

194+
### 3.0.1
195+
196+
- Fixed crash due to Mixin plugin ([#239](https://github.com/LambdAurora/LambDynamicLights/issues/239)).
197+
194198
[SpruceUI]: https://github.com/LambdAurora/SpruceUI "SpruceUI page"
195199
[pridelib]: https://github.com/Queerbric/pridelib "Pridelib page"
196200
[Sodium]: https://modrinth.com/mod/sodium "Sodium Modrinth page"

build_logic/src/main/kotlin/lambdynamiclights/Constants.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.gradle.accessors.dm.LibrariesForLibs
55
object Constants {
66
const val GROUP = "dev.lambdaurora"
77
const val NAME = "lambdynamiclights"
8-
const val VERSION = "3.0.0"
8+
const val VERSION = "3.0.1"
99
const val JAVA_VERSION = 21
1010

1111
private var minecraftVersion: String? = null

src/main/java/dev/lambdaurora/lambdynlights/LambDynLights.java

+3-10
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,14 @@
4949
* Represents the LambDynamicLights mod.
5050
*
5151
* @author LambdAurora
52-
* @version 3.0.0
52+
* @version 3.0.1
5353
* @since 1.0.0
5454
*/
5555
public class LambDynLights implements ClientModInitializer {
56-
public static final String NAMESPACE = "lambdynlights";
5756
private static final Logger LOGGER = LoggerFactory.getLogger("LambDynamicLights");
5857
private static final double MAX_RADIUS = 7.75;
5958
private static final double MAX_RADIUS_SQUARED = MAX_RADIUS * MAX_RADIUS;
60-
public static final EventManager<Identifier> EVENT_MANAGER = new EventManager<>(Identifier.of(NAMESPACE, "default"), Identifier::parse);
59+
public static final EventManager<Identifier> EVENT_MANAGER = new EventManager<>(Identifier.of(LambDynLightsConstants.NAMESPACE, "default"), Identifier::parse);
6160
private static LambDynLights INSTANCE;
6261
public final DynamicLightsConfig config = new DynamicLightsConfig(this);
6362
public final ItemLightSources itemLightSources = new ItemLightSources();
@@ -81,7 +80,7 @@ public void onInitializeClient() {
8180
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(new SimpleSynchronousResourceReloadListener() {
8281
@Override
8382
public Identifier getFabricId() {
84-
return Identifier.of(NAMESPACE, "dynamiclights_resources");
83+
return Identifier.of(LambDynLightsConstants.NAMESPACE, "dynamiclights_resources");
8584
}
8685

8786
@Override
@@ -98,12 +97,6 @@ public void reload(ResourceManager manager) {
9897
DynamicLightHandlers.registerDefaultHandlers();
9998
}
10099

101-
public static boolean isDevMode() {
102-
return FabricLoader.getInstance().getModContainer(NAMESPACE)
103-
.map(modContainer -> modContainer.getMetadata().getVersion().getFriendlyString().endsWith("-local"))
104-
.orElse(true);
105-
}
106-
107100
/**
108101
* Updates all light sources.
109102
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright © 2024 LambdAurora <[email protected]>
3+
*
4+
* This file is part of LambDynamicLights.
5+
*
6+
* Licensed under the Lambda License. For more information,
7+
* see the LICENSE file.
8+
*/
9+
10+
package dev.lambdaurora.lambdynlights;
11+
12+
import net.fabricmc.loader.api.FabricLoader;
13+
14+
/**
15+
* Contains constants about LambDynamicLights.
16+
*
17+
* @author LambdAurora
18+
* @version 3.0.1
19+
* @since 3.0.1
20+
*/
21+
public final class LambDynLightsConstants {
22+
/**
23+
* The namespace of this mod, whose value is {@value}.
24+
*/
25+
public static final String NAMESPACE = "lambdynlights";
26+
27+
/**
28+
* {@return {@code true} if this mod is in development mode, or {@code false} otherwise}
29+
*/
30+
public static boolean isDevMode() {
31+
return FabricLoader.getInstance().getModContainer(NAMESPACE)
32+
.map(modContainer -> modContainer.getMetadata().getVersion().getFriendlyString().endsWith("-local"))
33+
.orElse(true);
34+
}
35+
}

src/main/java/dev/lambdaurora/lambdynlights/LambDynLightsMixinPlugin.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* LambDynamicLights mixin plugin for conditional mixins.
2323
*
2424
* @author LambdAurora
25-
* @version 3.0.0
25+
* @version 3.0.1
2626
* @since 1.0.0
2727
*/
2828
public class LambDynLightsMixinPlugin implements IMixinConfigPlugin {
@@ -34,7 +34,7 @@ public LambDynLightsMixinPlugin() {
3434
this.conditionalMixins.put("dev.lambdaurora.lambdynlights.mixin.sodium.FlatLightPipelineMixin", sodium05XInstalled);
3535
this.conditionalMixins.put("dev.lambdaurora.lambdynlights.mixin.sodium.LightDataAccessMixin", sodium05XInstalled);
3636

37-
this.conditionalMixins.put("dev.lambdaurora.lambdynlights.mixin.DevModeMixin", LambDynLights.isDevMode());
37+
this.conditionalMixins.put("dev.lambdaurora.lambdynlights.mixin.DevModeMixin", LambDynLightsConstants.isDevMode());
3838
}
3939

4040
@Override

0 commit comments

Comments
 (0)