0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-20 01:12:13 +02:00

Add NoHurtcamHack

Closes #14
This commit is contained in:
Alexander01998 2020-02-04 12:54:30 +01:00
parent af73dbeff5
commit c7e386bd8e
3 changed files with 34 additions and 1 deletions

View File

@ -105,7 +105,7 @@ public final class HackList implements UpdateListener
public final NavigatorHack navigatorHack = new NavigatorHack();
// public final NoClipHack noClipHack = new NoClipHack();
public final NoFallHack noFallHack = new NoFallHack();
// public final NoHurtcamHack noHurtcamHack = new NoHurtcamHack();
public final NoHurtcamHack noHurtcamHack = new NoHurtcamHack();
// public final NoOverlayHack noOverlayHack = new NoOverlayHack();
// public final NoSlowdownHack noSlowdownHack = new NoSlowdownHack();
// public final NoWeatherHack noWeatherHack = new NoWeatherHack();

View File

@ -0,0 +1,22 @@
/*
* Copyright (C) 2014 - 2020 | Alexander01998 | All rights reserved.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.hacks;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.hack.Hack;
@SearchTags({"no hurtcam", "no hurt cam"})
public final class NoHurtcamHack extends Hack
{
public NoHurtcamHack()
{
super("NoHurtcam", "Disables the shaking effect when you get hurt.");
setCategory(Category.RENDER);
}
}

View File

@ -99,6 +99,17 @@ public abstract class GameRendererMixin
return 0;
}
@Inject(at = {@At("HEAD")},
method = {
"bobViewWhenHurt(Lnet/minecraft/client/util/math/MatrixStack;F)V"},
cancellable = true)
private void onBobViewWhenHurt(MatrixStack matrixStack, float f,
CallbackInfo ci)
{
if(WurstClient.INSTANCE.getHax().noHurtcamHack.isEnabled())
ci.cancel();
}
@Shadow
private void bobView(MatrixStack matrixStack, float partalTicks)
{