Skip to content

Commit

Permalink
Update to 24w20a
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed May 16, 2024
1 parent 3a03086 commit 0d188f6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
17 changes: 10 additions & 7 deletions src/main/java/net/wurstclient/mixin/GameRendererMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
Expand All @@ -42,8 +43,9 @@ public abstract class GameRendererMixin implements AutoCloseable
*/
@Inject(at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/render/GameRenderer;bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V",
ordinal = 0), method = "renderWorld(FJ)V")
private void onRenderWorldViewBobbing(float tickDelta, long limitTime,
ordinal = 0),
method = "renderWorld(Lnet/minecraft/client/render/RenderTickCounter;)V")
private void onRenderWorldViewBobbing(RenderTickCounter tickCounter,
CallbackInfo ci)
{
CameraTransformViewBobbingEvent event =
Expand Down Expand Up @@ -89,9 +91,10 @@ private void onRenderHand(Camera camera, float tickDelta, Matrix4f matrix4f,
target = "Lnet/minecraft/client/render/GameRenderer;renderHand:Z",
opcode = Opcodes.GETFIELD,
ordinal = 0),
method = "renderWorld(FJ)V")
private void onRenderWorld(float tickDelta, long limitTime, CallbackInfo ci,
@Local(ordinal = 1) Matrix4f matrix4f2)
method = "renderWorld(Lnet/minecraft/client/render/RenderTickCounter;)V")
private void onRenderWorldHandRendering(RenderTickCounter tickCounter,
CallbackInfo ci, @Local(ordinal = 1) Matrix4f matrix4f2,
@Local(ordinal = 1) float tickDelta)
{
MatrixStack matrixStack = new MatrixStack();
matrixStack.multiplyPositionMatrix(matrix4f2);
Expand Down Expand Up @@ -130,8 +133,8 @@ private HitResult liquidsRaycast(Entity instance, double maxDistance,
at = @At(value = "INVOKE",
target = "Lnet/minecraft/util/math/MathHelper;lerp(FFF)F",
ordinal = 0),
method = "renderWorld(FJ)V")
private float wurstNauseaLerp(float delta, float start, float end,
method = "renderWorld(Lnet/minecraft/client/render/RenderTickCounter;)V")
private float onRenderWorldNauseaLerp(float delta, float start, float end,
Operation<Float> original)
{
if(!WurstClient.INSTANCE.getHax().antiWobbleHack.isEnabled())
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/net/wurstclient/mixin/IngameHudMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.DebugHud;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.util.Identifier;
import net.wurstclient.WurstClient;
import net.wurstclient.event.EventManager;
Expand All @@ -32,13 +33,14 @@ public class IngameHudMixin
// runs after renderScoreboardSidebar()
// and before playerListHud.setVisible()
@Inject(at = @At("HEAD"),
method = "renderPlayerList(Lnet/minecraft/client/gui/DrawContext;F)V")
private void onRenderPlayerList(DrawContext context, float tickDelta,
CallbackInfo ci)
method = "renderPlayerList(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/client/render/RenderTickCounter;)V")
private void onRenderPlayerList(DrawContext context,
RenderTickCounter tickCounter, CallbackInfo ci)
{
if(debugHud.shouldShowDebugHud())
return;

float tickDelta = tickCounter.getTickDelta(true);
EventManager.fire(new GUIRenderEvent(context, tickDelta));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
import net.minecraft.client.render.RenderTickCounter;
import net.wurstclient.WurstClient;

@Mixin(RenderTickCounter.class)
public abstract class RenderTickCounterMixin
@Mixin(RenderTickCounter.Dynamic.class)
public abstract class RenderTickCounterDynamicMixin
{
@Shadow
public float lastFrameDuration;

@Inject(at = @At(value = "FIELD",
target = "Lnet/minecraft/client/render/RenderTickCounter;prevTimeMillis:J",
target = "Lnet/minecraft/client/render/RenderTickCounter$Dynamic;prevTimeMillis:J",
opcode = Opcodes.PUTFIELD,
ordinal = 0), method = "beginRenderTick(J)I")
public void onBeginRenderTick(long timeMillis,
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

"depends": {
"fabricloader": ">=0.15.9",
"fabric-api": ">=0.98.1",
"minecraft": "~1.21-alpha.24.19.a",
"fabric-api": ">=0.98.2",
"minecraft": "~1.21-alpha.24.20.a",
"java": ">=21"
},
"suggests": {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/wurst.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"PlayerInventoryMixin",
"PlayerSkinProviderMixin",
"PowderSnowBlockMixin",
"RenderTickCounterMixin",
"RenderTickCounterDynamicMixin",
"ScreenMixin",
"ShulkerBoxScreenMixin",
"SimpleOptionMixin",
Expand Down

0 comments on commit 0d188f6

Please sign in to comment.