Skip to content

Commit

Permalink
Add check for Embeddium too
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadiboo committed Jan 14, 2024
1 parent 94e704b commit 148871d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ dependencies {
// implementation fg.deobf("curse.maven:BetterFoliage-228529:3335091")

// implementation fg.deobf("curse.maven:Rubidium-574856:4952685")
// implementation fg.deobf("curse.maven:Embeddium-908741:4984832")

// For unit tests
testImplementation 'org.mockito:mockito-core:4.5.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ public final class NoCubesMixinPlugin implements IMixinConfigPlugin {
private static boolean shouldApplyMixin(String mixinClassName) {
return switch (mixinClassName) {
case "io.github.cadiboo.nocubes.mixin.LevelRendererMixin" -> !isSodiumLoaded();
// Not implemented yet, see comments in MixinAsm#transformSodiumWorldRenderer
// case "io.github.cadiboo.nocubes.mixin.SodiumLevelRendererMixin" -> isSodiumLoaded();
// case "io.github.cadiboo.nocubes.mixin.SodiumWorldRendererMixin" -> isSodiumLoaded();
case "io.github.cadiboo.nocubes.mixin.SodiumLevelRendererMixin" -> isSodiumLoaded();
case "io.github.cadiboo.nocubes.mixin.SodiumWorldRendererMixin" -> isSodiumLoaded();
case "io.github.cadiboo.nocubes.mixin.SodiumChunkBuilderMeshingTaskMixin" -> isSodiumLoaded();
default -> true;
};
}

private static boolean isSodiumLoaded() {
return LoadingModList.get().getModFileById("rubidium") != null;
var mods = LoadingModList.get();
if (mods.getModFileById("rubidium") != null)
return true;
if (mods.getModFileById("embeddium") != null)
return true;
return false;
}

// endregion
Expand Down

0 comments on commit 148871d

Please sign in to comment.