Skip to content

Commit

Permalink
eh that doesnt work
Browse files Browse the repository at this point in the history
  • Loading branch information
Treetrain1 committed Oct 16, 2023
1 parent 8061161 commit 37a4e84
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ Make sure to clear this after each release
What's new:
-----------------
- Updated mixins to be more lenient if they can't be applied
- Added compatibility for Embeddium if used on Forge via Sinytra Connector
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import java.util.List;
import java.util.Set;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.Version;
import net.fabricmc.loader.api.VersionParsingException;
import net.frozenblock.lib.FrozenBools;
import net.frozenblock.wilderwild.misc.WilderPreMixinInjectConstants;
import org.jetbrains.annotations.NotNull;
Expand All @@ -32,8 +30,6 @@
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

public class WilderWildMixinPlugin implements IMixinConfigPlugin {
private static final String MIXIN_PATH = "net.frozenblock.wilderwild.mixin.";
private static final boolean FORGE = FabricLoader.getInstance().isModLoaded("connector");

@Override
public void onLoad(String mixinPackage) {
Expand All @@ -49,17 +45,10 @@ public String getRefMapperConfig() {
@Override
public boolean shouldApplyMixin(String targetClassName, @NotNull String mixinClassName) {
if (mixinClassName.contains("sodium")) {
if (FORGE)
try {
return FabricLoader.getInstance().isModLoaded("embeddium") && FabricLoader.getInstance().getModContainer("embeddium").orElseThrow().getMetadata().getVersion().compareTo(Version.parse("0.2")) > 0;
} catch (VersionParsingException e) {
return false;
}
return FrozenBools.HAS_SODIUM && FabricLoader.getInstance().getModContainer("sodium").orElseThrow().getMetadata().getVersion().getFriendlyString().contains("0.5.");
}
if (mixinClassName.contains("LiquidBlockRenderer") || mixinClassName.contains("CloudRenderer") || mixinClassName.contains("EntityRenderDispatcher")) {
if (FORGE) return !FabricLoader.getInstance().isModLoaded("embeddium");
return !FrozenBools.HAS_SODIUM;
return !FabricLoader.getInstance().isModLoaded("embeddium") && !FrozenBools.HAS_SODIUM;
}
if (mixinClassName.contains("fallingleaves")) {
return WilderPreMixinInjectConstants.HAS_FALLINGLEAVES;
Expand Down

0 comments on commit 37a4e84

Please sign in to comment.