This commit is contained in:
Saturn5Vfive 2022-03-30 00:41:50 -05:00
parent f57fbefb4a
commit f6ff797f36
3 changed files with 115 additions and 4 deletions

View file

@ -134,6 +134,7 @@ public class ModuleRegistry {
modules.add(new AdSpammer());
modules.add(new AnimationCrash());
modules.add(new AutoFireball());
modules.add(new AutoFish());
}
public static List<Module> getModules() {

View file

@ -18,7 +18,6 @@ import net.shadow.client.helper.util.Utils;
import java.time.Instant;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicBoolean;
public class DiscordRPC extends Module {
StringSetting details = this.config.create(
@ -31,7 +30,7 @@ public class DiscordRPC extends Module {
.get()
);
StringSetting state = this.config.create(
new StringSetting.Builder("Obliterating children")
new StringSetting.Builder("Obliterating minecraft")
.name("Description")
.description("What to put as the description of the rpc")
.onChanged(s -> {
@ -79,13 +78,13 @@ public class DiscordRPC extends Module {
rp.setDetails(details.getValue());
rp.setState(state.getValue());
rp.setLargeImage("icon", "discord.gg/moles");
rp.setSmallImage("grass", "0x150 the 2nd#8918");
rp.setSmallImage("grass", "made by saturn5Vfive#6767 and 0x150 the 2nd#8918");
rp.setStart(startTime);
DiscordIPC.setActivity(rp);
}
void applyRpc() {
IPCUser user = DiscordIPC.getUser();
Utils.Logging.success("Connected to "+user.username+"#"+user.discriminator);
Utils.Logging.success("Connected to "+ user.username+"#"+user.discriminator);
setState();
Notification.create(3000,"Discord RPC", Notification.Type.SUCCESS, "Connected!");
}

View file

@ -0,0 +1,111 @@
/*
* Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved.
*/
package net.shadow.client.feature.module.impl.world;
import net.minecraft.client.util.math.MatrixStack;
import net.shadow.client.ShadowMain;
import net.shadow.client.feature.config.DoubleSetting;
import net.shadow.client.feature.module.Module;
import net.shadow.client.feature.module.ModuleType;
import net.shadow.client.helper.event.EventType;
import net.shadow.client.helper.event.Events;
import net.shadow.client.helper.event.events.PacketEvent;
import net.shadow.client.helper.util.Utils;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Hand;
import java.util.Random;
public class AutoFish extends Module {
static int delay = 0;
final DoubleSetting lazytime = this.config.create(new DoubleSetting.Builder(1).min(1).max(40).name("Random").description("the randomness added to fishing times").get());
boolean enabled = false;
public AutoFish() {
super("Autofish", "auto catch fish", ModuleType.WORLD);
Events.registerEventHandler(EventType.PACKET_RECEIVE, packete -> {
PacketEvent event = (PacketEvent)packete;
if (event.getPacket() instanceof PlaySoundS2CPacket packet) {
if (packet.getSound().equals(SoundEvents.ENTITY_FISHING_BOBBER_SPLASH)) {
new Thread(() -> {
Utils.sleep(lazyRoundTime() * 100L);
click();
}).start();
}
}
});
}
@Override
public void tick() {
int fishingrod = getFishingRod();
if (fishingrod == -1) {
this.setEnabled(false);
Utils.Logging.message("No Valid Fishing rod found, disabling.");
return;
} else {
ShadowMain.client.player.getInventory().selectedSlot = fishingrod;
}
delay++;
if (delay > lazyRoundTime()) {
delay = 0;
} else {
return;
}
if (ShadowMain.client.player.fishHook == null || ShadowMain.client.player.fishHook.isRemoved()) {
new Thread(() -> {
Utils.sleep(lazyRoundTime() * 50L);
click();
}).start();
}
}
@Override
public void enable() {
enabled = true;
}
@Override
public void disable() {
enabled = false;
}
@Override
public String getContext() {
return null;
}
@Override
public void onWorldRender(MatrixStack matrices) {
}
@Override
public void onHudRender() {
}
private void click() {
ShadowMain.client.player.networkHandler.sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND));
}
public int getFishingRod() {
if (ShadowMain.client.player.getMainHandStack().getItem().equals(Items.FISHING_ROD)) {
return ShadowMain.client.player.getInventory().selectedSlot;
}
for (int i = 0; i < 9; i++) {
if (ShadowMain.client.player.getInventory().getStack(36 + i).getItem().equals(Items.FISHING_ROD)) {
return i;
}
}
return -1;
}
private int lazyRoundTime() {
return (int) Math.round(lazytime.getValue()) + new Random().nextInt(10);
}
}