Skip to content

Commit

Permalink
Fix missing dependencies causing a crash (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt authored Dec 10, 2023
1 parent 561c309 commit e21975b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/main/java/net/coderbot/iris/mixin/OculusMixinPlugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package net.coderbot.iris.mixin;

import net.minecraftforge.fml.loading.LoadingModList;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

import java.util.List;
import java.util.Set;

public class OculusMixinPlugin implements IMixinConfigPlugin {
@Override
public void onLoad(String s) {

}

@Override
public String getRefMapperConfig() {
return null;
}

@Override
public boolean shouldApplyMixin(String s, String s1) {
// Forge 1.20.1 and older load mixins even if there is a mod loading error, but
// don't load ATs, which causes a ton of support requests from our mixins failing
// to apply. The solution is to just not apply them ourselves if there is an error.
return LoadingModList.get().getErrors().isEmpty();
}

@Override
public void acceptTargets(Set<String> set, Set<String> set1) {

}

@Override
public List<String> getMixins() {
return List.of();
}

@Override
public void preApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {

}

@Override
public void postApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {

}
}
1 change: 1 addition & 0 deletions src/main/resources/mixins.oculus.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "net.coderbot.iris.mixin",
"plugin": "net.coderbot.iris.mixin.OculusMixinPlugin",
"compatibilityLevel": "JAVA_8",
"client": [
"DimensionTypeAccessor",
Expand Down

0 comments on commit e21975b

Please sign in to comment.