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

Eclipse auto cleanup

This commit is contained in:
Alexander01998 2023-12-15 13:19:14 +01:00
parent 1683582c15
commit 7cce8e6b8c
3 changed files with 15 additions and 16 deletions

View File

@ -17,12 +17,15 @@ import net.wurstclient.settings.CheckboxSetting;
@SearchTags({"auto sprint"}) @SearchTags({"auto sprint"})
public final class AutoSprintHack extends Hack implements UpdateListener public final class AutoSprintHack extends Hack implements UpdateListener
{ {
private final CheckboxSetting allDirections = new CheckboxSetting( private final CheckboxSetting allDirections =
"Omnidirectional Sprint", "Sprint in all directions, not just forward.", false); new CheckboxSetting("Omnidirectional Sprint",
private final CheckboxSetting attack = new CheckboxSetting( "Sprint in all directions, not just forward.", false);
"Attack Sprint", "Keep sprinting when attacking.", false);
private final CheckboxSetting hungry = new CheckboxSetting( private final CheckboxSetting attack = new CheckboxSetting("Attack Sprint",
"Hungry Sprint", "Sprint even on low hunger.", false); "Keep sprinting when attacking.", false);
private final CheckboxSetting hungry = new CheckboxSetting("Hungry Sprint",
"Sprint even on low hunger.", false);
public AutoSprintHack() public AutoSprintHack()
{ {
@ -57,8 +60,8 @@ public final class AutoSprintHack extends Hack implements UpdateListener
return; return;
if(player.forwardSpeed > 0 if(player.forwardSpeed > 0
|| (allDirections.isChecked() || allDirections.isChecked() && (MC.player.getVelocity().x != 0
&& (MC.player.getVelocity().x != 0 || MC.player.getVelocity().z != 0))) || MC.player.getVelocity().z != 0))
player.setSprinting(true); player.setSprinting(true);
} }

View File

@ -168,10 +168,8 @@ public class ClientPlayerEntityMixin extends AbstractClientPlayerEntity
client.currentScreen = tempCurrentScreen; client.currentScreen = tempCurrentScreen;
tempCurrentScreen = null; tempCurrentScreen = null;
} }
@Inject(at = {@At("HEAD")}, @Inject(at = @At("HEAD"), method = "canSprint()Z", cancellable = true)
method = {"canSprint()Z"},
cancellable = true)
private void canSprint(CallbackInfoReturnable<Boolean> cir) private void canSprint(CallbackInfoReturnable<Boolean> cir)
{ {
if(WurstClient.INSTANCE.getHax().autoSprintHack.shouldSprintHungry()) if(WurstClient.INSTANCE.getHax().autoSprintHack.shouldSprintHungry())

View File

@ -22,8 +22,7 @@ public class PlayerEntityMixin
@Redirect(at = @At(value = "INVOKE", @Redirect(at = @At(value = "INVOKE",
target = "Lnet/minecraft/entity/player/PlayerEntity;setVelocity(Lnet/minecraft/util/math/Vec3d;)V", target = "Lnet/minecraft/entity/player/PlayerEntity;setVelocity(Lnet/minecraft/util/math/Vec3d;)V",
opcode = Opcodes.INVOKEVIRTUAL, opcode = Opcodes.INVOKEVIRTUAL,
ordinal = 0), ordinal = 0), method = "attack(Lnet/minecraft/entity/Entity;)V")
method = "attack(Lnet/minecraft/entity/Entity;)V")
private void setVelocityOfAttacker(PlayerEntity entity, Vec3d velocity) private void setVelocityOfAttacker(PlayerEntity entity, Vec3d velocity)
{ {
if(!WurstClient.INSTANCE.getHax().autoSprintHack.shouldSprintAttack()) if(!WurstClient.INSTANCE.getHax().autoSprintHack.shouldSprintAttack())
@ -33,8 +32,7 @@ public class PlayerEntityMixin
@Redirect(at = @At(value = "INVOKE", @Redirect(at = @At(value = "INVOKE",
target = "Lnet/minecraft/entity/player/PlayerEntity;setSprinting(Z)V", target = "Lnet/minecraft/entity/player/PlayerEntity;setSprinting(Z)V",
opcode = Opcodes.INVOKEVIRTUAL, opcode = Opcodes.INVOKEVIRTUAL,
ordinal = 0), ordinal = 0), method = "attack(Lnet/minecraft/entity/Entity;)V")
method = "attack(Lnet/minecraft/entity/Entity;)V")
private void setAttackerSprinting(PlayerEntity entity, boolean sprinting) private void setAttackerSprinting(PlayerEntity entity, boolean sprinting)
{ {
if(!WurstClient.INSTANCE.getHax().autoSprintHack.shouldSprintAttack()) if(!WurstClient.INSTANCE.getHax().autoSprintHack.shouldSprintAttack())