This commit is contained in:
Saturn5Vfive 2022-04-10 14:33:52 -05:00
parent e7a339e552
commit d0249e904b
4 changed files with 30 additions and 2 deletions

View file

@ -21,6 +21,8 @@ import net.shadow.client.helper.util.Utils;
public class Fling extends Module {
boolean not = false;
final DoubleSetting delay = this.config.create(new DoubleSetting.Builder(250).min(1).max(500).precision(0).name("Delay").description("The delay before going back down").get());
final DoubleSetting updist = this.config.create(new DoubleSetting.Builder(3).min(1).max(3).precision(2).name("Power").description("The power of the fling").get());
@ -61,8 +63,10 @@ public class Fling extends Module {
@EventListener(type = EventType.PACKET_SEND)
void sendPacket(PacketEvent event) {
if (!this.isEnabled()) return;
if(!not) return;
if (event.getPacket() instanceof PlayerInteractItemC2SPacket) {
if (client.player.getInventory().getMainHandStack().getItem() == Items.FISHING_ROD && (client.player.fishHook != null || !client.player.fishHook.isRemoved())) {
if (client.player.getInventory().getMainHandStack().getItem() == Items.FISHING_ROD && (client.player.fishHook != null)) {
if(client.player.fishHook.isRemoved()) return;
client.player.setVelocity(Vec3d.ZERO);
event.setCancelled(true);
new Thread(() -> {
@ -74,7 +78,9 @@ public class Fling extends Module {
client.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(client.player.getX(), staticy, client.player.getZ(), true));
}
Utils.sleep(delay.getValue().longValue());
not = false;
client.player.networkHandler.getConnection().send(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND));
not = true;
Utils.sleep(delay.getValue().longValue());
for (int i = 0; i < updist.getValue(); i++) {
staticy = staticy - 9;

View file

@ -10,7 +10,7 @@ import net.shadow.client.feature.module.Module;
import net.shadow.client.feature.module.ModuleType;
public class Reach extends Module {
// TODO: 10.04.22 finish this
// TODO: 10.04.22 finish this WHERE TF THE MIXIN GO????????
final DoubleSetting reachDist = this.config.create(new DoubleSetting.Builder(3).min(3).max(10).precision(1).name("Distance").description("How far to reach").get());

View file

@ -13,6 +13,7 @@ import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.registry.Registry;

View file

@ -6,12 +6,18 @@ package net.shadow.client.mixin;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.shadow.client.feature.module.ModuleRegistry;
import net.shadow.client.feature.module.impl.combat.Reach;
import net.shadow.client.feature.module.impl.world.NoBreakDelay;
import org.objectweb.asm.Opcodes;
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.Redirect;
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.callback.CallbackInfoReturnable;
import java.util.Objects;
@ -26,4 +32,19 @@ public class ClientPlayerInteractionManagerMixin {
int cd = this.blockBreakingCooldown;
return Objects.requireNonNull(ModuleRegistry.getByClass(NoBreakDelay.class)).isEnabled() ? 0 : cd;
}
@Inject(method = {"getReachDistance()F"}, at = {@At("HEAD")}, cancellable = true)
private void onReachDistance(CallbackInfoReturnable<Float> cir) {
if (ModuleRegistry.getByClass(Reach.class).isEnabled()) {
cir.setReturnValue((float)ModuleRegistry.getByClass(Reach.class).getReachDistance());
}
}
@Inject(method = {"hasExtendedReach()Z"}, at = {@At("HEAD")}, cancellable = true)
private void onExtendedReach(CallbackInfoReturnable<Boolean> cir) {
if (ModuleRegistry.getByClass(Reach.class).isEnabled()) {
cir.setReturnValue(true);
}
}
}