Skip to content

Commit e21975b

Browse files
authored
Fix missing dependencies causing a crash (#507)
1 parent 561c309 commit e21975b

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package net.coderbot.iris.mixin;
2+
3+
import net.minecraftforge.fml.loading.LoadingModList;
4+
import org.objectweb.asm.tree.ClassNode;
5+
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
6+
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
7+
8+
import java.util.List;
9+
import java.util.Set;
10+
11+
public class OculusMixinPlugin implements IMixinConfigPlugin {
12+
@Override
13+
public void onLoad(String s) {
14+
15+
}
16+
17+
@Override
18+
public String getRefMapperConfig() {
19+
return null;
20+
}
21+
22+
@Override
23+
public boolean shouldApplyMixin(String s, String s1) {
24+
// Forge 1.20.1 and older load mixins even if there is a mod loading error, but
25+
// don't load ATs, which causes a ton of support requests from our mixins failing
26+
// to apply. The solution is to just not apply them ourselves if there is an error.
27+
return LoadingModList.get().getErrors().isEmpty();
28+
}
29+
30+
@Override
31+
public void acceptTargets(Set<String> set, Set<String> set1) {
32+
33+
}
34+
35+
@Override
36+
public List<String> getMixins() {
37+
return List.of();
38+
}
39+
40+
@Override
41+
public void preApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {
42+
43+
}
44+
45+
@Override
46+
public void postApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {
47+
48+
}
49+
}

src/main/resources/mixins.oculus.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"required": true,
33
"minVersion": "0.8",
44
"package": "net.coderbot.iris.mixin",
5+
"plugin": "net.coderbot.iris.mixin.OculusMixinPlugin",
56
"compatibilityLevel": "JAVA_8",
67
"client": [
78
"DimensionTypeAccessor",

0 commit comments

Comments
 (0)