Skip to content

Commit

Permalink
Fix mixin incompatibility with architectury, closes #18
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jul 24, 2021
1 parent 86e022e commit ec77f6b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
------------------------------------------------------
Version 1.6.2
------------------------------------------------------
**Fixes**
- Fixed mixin error with Architectury

------------------------------------------------------
Version 1.6.1
------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ loader_version=0.11.6
fabric_version=0.36.0+1.17

# Mod Properties
mod_version = 1.6.1
mod_version = 1.6.2
owners = Ladysnake
maven_group = io.github.ladysnake
archives_base_name = satin
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/ladysnake/satin/mixin/SatinMixinPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

public final class SatinMixinPlugin implements IMixinConfigPlugin {
private static final boolean ALLOW_RENDER_LAYER_MIXINS;
private static final boolean ENABLE_SHADER_EFFECT_LOCATION_MIXIN;

static {
FabricLoader loader = FabricLoader.getInstance();
Expand All @@ -40,6 +41,8 @@ public final class SatinMixinPlugin implements IMixinConfigPlugin {
}
ALLOW_RENDER_LAYER_MIXINS = true;
}
// Architectury actually does the same change, and they can't exactly depend on Satin so...
ENABLE_SHADER_EFFECT_LOCATION_MIXIN = !loader.isModLoaded("architectury");
}

@Override
Expand All @@ -54,8 +57,10 @@ public String getRefMapperConfig() {

@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
if (targetClassName.startsWith("blockrenderlayer")) {
if (mixinClassName.contains("blockrenderlayer")) {
return ALLOW_RENDER_LAYER_MIXINS;
} else if (mixinClassName.endsWith("gl.JsonEffectGlShaderMixin")) {
return ENABLE_SHADER_EFFECT_LOCATION_MIXIN;
}
return true;
}
Expand Down

0 comments on commit ec77f6b

Please sign in to comment.