Skip to content

Commit

Permalink
Update to 24w05a
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Feb 1, 2024
1 parent 7bd23bc commit e5bedfe
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/wurstclient/hacks/AutoArmorHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ private int getArmorValue(ArmorItem item, ItemStack stack)
{
int armorPoints = item.getProtection();
int prtPoints = 0;
int armorToughness = (int)item.toughness;
int armorType = item.getMaterial().getProtection(Type.LEGGINGS);
int armorToughness = (int)item.getToughness();
int armorType = item.getMaterial().value().getProtection(Type.LEGGINGS);

if(useEnchantments.isChecked())
{
Expand Down
33 changes: 17 additions & 16 deletions src/main/java/net/wurstclient/mixin/GameRendererMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
*/
package net.wurstclient.mixin;

import org.joml.Matrix4f;
import org.objectweb.asm.Opcodes;
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;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;

import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.MathHelper;
import net.wurstclient.WurstClient;
import net.wurstclient.event.EventManager;
import net.wurstclient.events.CameraTransformViewBobbingListener.CameraTransformViewBobbingEvent;
Expand All @@ -42,10 +42,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(FJLnet/minecraft/client/util/math/MatrixStack;)V")
ordinal = 0), method = "renderWorld(FJ)V")
private void onRenderWorldViewBobbing(float tickDelta, long limitTime,
MatrixStack matrices, CallbackInfo ci)
CallbackInfo ci)
{
CameraTransformViewBobbingEvent event =
new CameraTransformViewBobbingEvent();
Expand Down Expand Up @@ -78,9 +77,8 @@ private void onBobView(MatrixStack matrices, float tickDelta,
* after the view-bobbing call.
*/
@Inject(at = @At("HEAD"),
method = "renderHand(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/Camera;F)V")
private void onRenderHand(MatrixStack matrices, Camera camera,
float tickDelta, CallbackInfo ci)
method = "renderHand(Lnet/minecraft/client/render/Camera;F)V")
private void onRenderHand(Camera camera, float tickDelta, CallbackInfo ci)
{
cancelNextBobView = false;
}
Expand All @@ -90,11 +88,13 @@ private void onRenderHand(MatrixStack matrices, Camera camera,
target = "Lnet/minecraft/client/render/GameRenderer;renderHand:Z",
opcode = Opcodes.GETFIELD,
ordinal = 0),
method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V")
private void onRenderWorld(float tickDelta, long limitTime,
MatrixStack matrices, CallbackInfo ci)
method = "renderWorld(FJ)V")
private void onRenderWorld(float tickDelta, long limitTime, CallbackInfo ci,
@Local(ordinal = 1) Matrix4f matrix4f2)
{
RenderEvent event = new RenderEvent(matrices, tickDelta);
MatrixStack matrixStack = new MatrixStack();
matrixStack.multiplyPositionMatrix(matrix4f2);
RenderEvent event = new RenderEvent(matrixStack, tickDelta);
EventManager.fire(event);
}

Expand Down Expand Up @@ -125,15 +125,16 @@ private HitResult liquidsRaycast(Entity instance, double maxDistance,
return original.call(instance, maxDistance, tickDelta, true);
}

@Redirect(
@WrapOperation(
at = @At(value = "INVOKE",
target = "Lnet/minecraft/util/math/MathHelper;lerp(FFF)F",
ordinal = 0),
method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V")
private float wurstNauseaLerp(float delta, float start, float end)
method = "renderWorld(FJ)V")
private float wurstNauseaLerp(float delta, float start, float end,
Operation<Float> original)
{
if(!WurstClient.INSTANCE.getHax().antiWobbleHack.isEnabled())
return MathHelper.lerp(delta, start, end);
return original.call(delta, start, end);

return 0;
}
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.3",
"fabric-api": ">=0.91.5",
"minecraft": "~1.20.5-alpha.24.3.a",
"fabric-api": ">=0.95.4",
"minecraft": "~1.20.5-alpha.24.5.a",
"java": ">=17"
},
"suggests": {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/wurst.accesswidener
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ accessible field net/minecraft/client/network/ClientPlayerInteractionManager bre
accessible field net/minecraft/client/network/ClientPlayerInteractionManager currentBreakingProgress F
accessible field net/minecraft/client/toast/ToastManager toastQueue Ljava/util/Deque;
accessible field net/minecraft/entity/Entity movementMultiplier Lnet/minecraft/util/math/Vec3d;
accessible field net/minecraft/item/ArmorItem toughness F
accessible field net/minecraft/network/packet/s2c/play/ChunkDeltaUpdateS2CPacket sectionPos Lnet/minecraft/util/math/ChunkSectionPos;

0 comments on commit e5bedfe

Please sign in to comment.