-
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
749aba8
commit 84f7fdc
Showing
11 changed files
with
319 additions
and
279 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
31 changes: 18 additions & 13 deletions
31
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,21 +1,26 @@ | ||
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) | ||
float clipToSpace(float desiredCameraDistance) { | ||
if (!Config.getEnabled(CameraDistance.class)) return desiredCameraDistance; | ||
return CameraDistance.getDistance(); | ||
} | ||
|
||
@Inject(method = "clipToSpace", at = @At("HEAD"), cancellable = true) | ||
void onClipToSpace(float desiredCameraDistance, CallbackInfoReturnable<Float> cir) { | ||
if (!Config.getEnabled(CameraClip.class)) return; | ||
cir.setReturnValue(desiredCameraDistance); | ||
} | ||
} |
31 changes: 17 additions & 14 deletions
31
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,23 +1,26 @@ | ||
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.ModifyVariable; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ChatHud.class) | ||
public abstract class ChatHudMixin { | ||
@Shadow | ||
protected abstract boolean isChatFocused(); | ||
@ModifyVariable(method = "render", at = @At("HEAD"), argsOnly = true) | ||
boolean isFocused(boolean focused) { | ||
if (Config.getEnabled(NoChatFade.class)) return true; | ||
return focused; | ||
} | ||
|
||
// @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(); | ||
// } | ||
@Inject(method = "removeMessage", at = @At("HEAD"), cancellable = true) | ||
void onHideMessage(MessageSignatureData signature, CallbackInfo ci) { | ||
if (Config.getEnabled(NoMessageHiding.class)) ci.cancel(); | ||
} | ||
} |
37 changes: 23 additions & 14 deletions
37
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,23 +1,32 @@ | ||
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> { | ||
// 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(); | ||
// } | ||
@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, float tickDelta, CallbackInfo ci) { | ||
if (Titles.tamableOwner.value() && (entity instanceof TameableEntity || entity instanceof AbstractHorseEntity)) | ||
ci.cancel(); | ||
} | ||
} |
Oops, something went wrong.