Skip to content

Commit

Permalink
This should fix compat with OF & FT; (#55)
Browse files Browse the repository at this point in the history
* This should fix compat with OF & FT; no reason to transform the Tessellator itself anyway...

* Shouldn't need this now with the other fix

* remove these checks too
  • Loading branch information
mitchej123 authored Aug 22, 2024
1 parent d73623f commit 5d4f711
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public void resetOffset() {
}

static {
final Field rbs = ReflectionHelper.findField(Tessellator.class, "rawBufferSize");
// Optifine breaks the remapping of this, so look for the obf name as well
final Field rbs = ReflectionHelper.findField(Tessellator.class, "rawBufferSize", "field_78388_E");
rbs.setAccessible(true);
try {
sRawBufferSize = MethodHandles.lookup().unreflectSetter(rbs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

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 @@ -35,7 +34,7 @@ public String[] getLaunchArguments() {
final boolean rfbLoaded = Launch.blackboard.getOrDefault("gtnhlib.rfbPluginLoaded", Boolean.FALSE)
== Boolean.TRUE;

if (!rfbLoaded && !(Loader.isModLoaded("Optifine") || Loader.isModLoaded("FastCraft"))) {
if (!rfbLoaded) {
// Run after Mixins, but before LWJGl3ify
Launch.classLoader.registerTransformer(TessellatorRedirectorTransformer.class.getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public class TessellatorRedirectorTransformer implements IClassTransformer {
"com.gtnewhorizons.angelica.glsm.",
"com.gtnewhorizons.angelica.transform",
"me.eigenraven.lwjgl3ify",
"com.gtnewhorizon.gtnhlib");
"com.gtnewhorizon.gtnhlib",
"net.minecraft.client.renderer.Tessellator");

public static List<String> getTransformerExclusions() {
return Collections.unmodifiableList(TransformerExclusions);
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/gtnewhorizon/gtnhlib/mixins/Mixins.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
public enum Mixins {

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

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

0 comments on commit 5d4f711

Please sign in to comment.