Skip to content

Commit

Permalink
Dont CapturingTessalator if OF/FC is loaded (#50)
Browse files Browse the repository at this point in the history
* Dont CapturingTessalator if OF/FC is loaded

* spotless
  • Loading branch information
Caedis authored Aug 18, 2024
1 parent 5157c9c commit 48c6281
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import com.gtnewhorizon.gtnhlib.core.transformer.TessellatorRedirectorTransformer;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.FMLLaunchHandler;

public class MixinCompatHackTweaker implements ITweaker {
Expand All @@ -34,7 +35,7 @@ public String[] getLaunchArguments() {
final boolean rfbLoaded = Launch.blackboard.getOrDefault("gtnhlib.rfbPluginLoaded", Boolean.FALSE)
== Boolean.TRUE;

if (!rfbLoaded) {
if (!rfbLoaded && !(Loader.isModLoaded("Optifine") || Loader.isModLoaded("FastCraft"))) {
// Run after Mixins, but before LWJGl3ify
Launch.classLoader.registerTransformer(TessellatorRedirectorTransformer.class.getName());
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/gtnewhorizon/gtnhlib/mixins/Mixins.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
public enum Mixins {

TESSELLATOR(new Builder("Sodium").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT).setPhase(Phase.EARLY)
.setApplyIf(() -> true).addMixinClasses("MixinTessellator")),
.setApplyIf(() -> true).addExcludedMod(TargetedMod.OPTIFINE).addExcludedMod(TargetedMod.FASTCRAFT)
.addMixinClasses("MixinTessellator")),
WAVEFRONT_VBO(new Builder("WavefrontObject").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
.setPhase(Phase.EARLY).setApplyIf(() -> true).addMixinClasses("MixinWavefrontObject")),;
.setPhase(Phase.EARLY).setApplyIf(() -> true).addExcludedMod(TargetedMod.OPTIFINE)
.addExcludedMod(TargetedMod.FASTCRAFT).addMixinClasses("MixinWavefrontObject")),;

private final List<String> mixinClasses;
private final Supplier<Boolean> applyIf;
Expand Down

0 comments on commit 48c6281

Please sign in to comment.