Skip to content

Commit

Permalink
Redstone Paste compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
FalsePattern committed Mar 27, 2022
1 parent 103b295 commit daa13a2
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
4 changes: 4 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ dependencies {
transitive = false
}
annotationProcessor("org.projectlombok:lombok:1.18.22")

compileOnly("curse.maven:redstone-paste-67508:2211249") {
transitive = false
}
}
10 changes: 9 additions & 1 deletion repositories.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
repositories {}
repositories {
maven {
name = "cursemaven"
url = "https://cursemaven.falsepattern.com/"
content {
includeGroup "curse.maven"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.falsepattern.triangulator.mixin.mixins.client.redstonepaste;

import com.falsepattern.triangulator.api.ToggleableTessellator;
import fyber.redstonepastemod.client.RedstonePasteHighlighter;
import net.minecraft.client.renderer.Tessellator;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(value = RedstonePasteHighlighter.class, remap = false)
public abstract class RedstonePasteHighlighterMixin {
@Inject(method = "drawLineLoop",
at = @At("HEAD"),
require = 1)
private void turnOffTriangulator(CallbackInfo ci) {
((ToggleableTessellator) Tessellator.instance).disableTriangulator();
}
@Inject(method = "drawLineLoop",
at = @At("RETURN"),
require = 1)
private void turnOnTriangulator(CallbackInfo ci) {
((ToggleableTessellator) Tessellator.instance).enableTriangulator();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public enum Mixin {
OFTessellatorVanillaMixin(Side.CLIENT, avoid(TargetedMod.OPTIFINE), "optifine.TessellatorVanillaMixin"),
OFTessellatorOptiFineMixin(Side.CLIENT, require(TargetedMod.OPTIFINE), "optifine.TessellatorOptiFineMixin"),
//END OptiFine->client

//BEGIN RedstonePaste->client
RedstonePasteHighlighterMixin(Side.CLIENT, require(TargetedMod.REDSTONEPASTE), "redstonepaste.RedstonePasteHighlighterMixin"),
//END RedstonePaste->client
;

public final Side side;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public enum TargetedMod {

FOAMFIX("FoamFix", false, startsWith("foamfix")),
OPTIFINE("OptiFine", false, startsWith("optifine")),
REDSTONEPASTE("RedstonePaste", false, startsWith("redstonepaste")),
;

public final String modName;
Expand Down

1 comment on commit daa13a2

@FalsePattern
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolves #10

Please sign in to comment.