-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0541de
commit aa04fd8
Showing
33 changed files
with
293 additions
and
652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 13 additions & 20 deletions
33
src/main/java/com/connorcode/sigmautils/mixin/CameraMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,21 @@ | ||
package com.connorcode.sigmautils.mixin; | ||
|
||
import com.connorcode.sigmautils.config.Config; | ||
import com.connorcode.sigmautils.modules.misc.CameraClip; | ||
import com.connorcode.sigmautils.modules.misc.CameraDistance; | ||
import net.minecraft.client.render.Camera; | ||
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.ModifyVariable; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(Camera.class) | ||
public class CameraMixin { | ||
@ModifyVariable(method = "clipToSpace", at = @At("HEAD"), argsOnly = true) | ||
double clipToSpace(double desiredCameraDistance) { | ||
if (!Config.getEnabled(CameraDistance.class)) | ||
return desiredCameraDistance; | ||
return CameraDistance.getDistance(); | ||
} | ||
|
||
@Inject(method = "clipToSpace", at = @At("HEAD"), cancellable = true) | ||
void onClipToSpace(double desiredCameraDistance, CallbackInfoReturnable<Double> cir) { | ||
if (!Config.getEnabled(CameraClip.class)) | ||
return; | ||
cir.setReturnValue(desiredCameraDistance); | ||
} | ||
// @ModifyVariable(method = "clipToSpace", at = @At("HEAD"), argsOnly = true) | ||
// double clipToSpace(double desiredCameraDistance) { | ||
// if (!Config.getEnabled(CameraDistance.class)) | ||
// return desiredCameraDistance; | ||
// return CameraDistance.getDistance(); | ||
// } | ||
// | ||
// @Inject(method = "clipToSpace", at = @At("HEAD"), cancellable = true) | ||
// void onClipToSpace(double desiredCameraDistance, CallbackInfoReturnable<Double> cir) { | ||
// if (!Config.getEnabled(CameraClip.class)) | ||
// return; | ||
// cir.setReturnValue(desiredCameraDistance); | ||
// } | ||
} |
30 changes: 11 additions & 19 deletions
30
src/main/java/com/connorcode/sigmautils/mixin/ChatHudMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,23 @@ | ||
package com.connorcode.sigmautils.mixin; | ||
|
||
import com.connorcode.sigmautils.config.Config; | ||
import com.connorcode.sigmautils.modules._interface.NoChatFade; | ||
import com.connorcode.sigmautils.modules.chat.NoMessageHiding; | ||
import net.minecraft.client.gui.hud.ChatHud; | ||
import net.minecraft.network.message.MessageSignatureData; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ChatHud.class) | ||
public abstract class ChatHudMixin { | ||
@Shadow | ||
protected abstract boolean isChatFocused(); | ||
|
||
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;isChatFocused()Z")) | ||
boolean isChatFocused(ChatHud instance) { | ||
if (Config.getEnabled(NoChatFade.class)) | ||
return true; | ||
return isChatFocused(); | ||
} | ||
|
||
@Inject(method = "removeMessage", at = @At("HEAD"), cancellable = true) | ||
void onHideMessage(MessageSignatureData signature, CallbackInfo ci) { | ||
if (Config.getEnabled(NoMessageHiding.class)) ci.cancel(); | ||
} | ||
// @Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;isChatFocused()Z")) | ||
// boolean isChatFocused(ChatHud instance) { | ||
// if (Config.getEnabled(NoChatFade.class)) | ||
// return true; | ||
// return isChatFocused(); | ||
// } | ||
// | ||
// @Inject(method = "removeMessage", at = @At("HEAD"), cancellable = true) | ||
// void onHideMessage(MessageSignatureData signature, CallbackInfo ci) { | ||
// if (Config.getEnabled(NoMessageHiding.class)) ci.cancel(); | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 14 additions & 25 deletions
39
src/main/java/com/connorcode/sigmautils/mixin/EntityRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,23 @@ | ||
package com.connorcode.sigmautils.mixin; | ||
|
||
import com.connorcode.sigmautils.config.Config; | ||
import com.connorcode.sigmautils.modules.rendering.Deadmau5Ears; | ||
import com.connorcode.sigmautils.modules.rendering.Titles; | ||
import net.minecraft.client.render.VertexConsumerProvider; | ||
import net.minecraft.client.render.entity.EntityRenderer; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.passive.AbstractHorseEntity; | ||
import net.minecraft.entity.passive.TameableEntity; | ||
import net.minecraft.text.Text; | ||
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.Redirect; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(EntityRenderer.class) | ||
public class EntityRendererMixin<T extends Entity> { | ||
@Redirect(method = "renderLabelIfPresent", at = @At(value = "INVOKE", target = "Ljava/lang/String;equals(Ljava/lang/Object;)Z")) | ||
private boolean isDeadmau5(String stringA, Object stringB) { | ||
if (Config.getEnabled(Deadmau5Ears.class)) | ||
return true; | ||
return stringA.equals(stringB); | ||
} | ||
|
||
@Inject(method = "renderLabelIfPresent", at = @At("HEAD"), cancellable = true) | ||
private void renderLabelIfPresent(T entity, Text text, MatrixStack matrices, VertexConsumerProvider vertexConsumers, | ||
int light, CallbackInfo ci) { | ||
if (Titles.tamableOwner.value() && (entity instanceof TameableEntity || entity instanceof AbstractHorseEntity)) | ||
ci.cancel(); | ||
} | ||
// TODO: fix | ||
// @Redirect(method = "renderLabelIfPresent", at = @At(value = "INVOKE", target = "Ljava/lang/String;equals(Ljava/lang/Object;)Z")) | ||
// private boolean isDeadmau5(String stringA, Object stringB) { | ||
// if (Config.getEnabled(Deadmau5Ears.class)) | ||
// return true; | ||
// return stringA.equals(stringB); | ||
// } | ||
// | ||
// @Inject(method = "renderLabelIfPresent", at = @At("HEAD"), cancellable = true) | ||
// private void renderLabelIfPresent(T entity, Text text, MatrixStack matrices, VertexConsumerProvider vertexConsumers, | ||
// int light, CallbackInfo ci) { | ||
// if (Titles.tamableOwner.value() && (entity instanceof TameableEntity || entity instanceof AbstractHorseEntity)) | ||
// ci.cancel(); | ||
// } | ||
} |
20 changes: 0 additions & 20 deletions
20
src/main/java/com/connorcode/sigmautils/mixin/EntryListWidgetMixin.java
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
src/main/java/com/connorcode/sigmautils/mixin/InGameHudAccessor.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.