| 1 | package thunder.hack.features.modules.misc;
|
| 2 |
|
| 3 | import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
|
| 4 | import meteordevelopment.orbit.EventHandler;
|
| 5 | import net.minecraft.network.HashedStack;
|
| 6 | import net.minecraft.network.protocol.game.ServerboundContainerClickPacket;
|
| 7 | import net.minecraft.network.protocol.game.ServerboundEditBookPacket;
|
| 8 | import net.minecraft.world.inventory.ContainerInput;
|
| 9 | import net.minecraft.world.item.Items;
|
| 10 | import thunder.hack.features.modules.Module;
|
| 11 | import thunder.hack.events.impl.EventPostTick;
|
| 12 |
|
| 13 | import java.util.List;
|
| 14 | import java.util.Optional;
|
| 15 |
|
| 16 | public class PastedPaperDupe extends Module {
|
| 17 |
|
| 18 | public PastedPaperDupe() {
|
| 19 | super("PastedPaperDupe", Category.MISC);
|
| 20 | }
|
| 21 |
|
| 22 | @EventHandler
|
| 23 | private void onTick(EventPostTick event) {
|
| 24 | if(!(mc.player.getMainHandItem().getItem() == Items.WRITABLE_BOOK)) {
|
| 25 | disable("Please hold a writable book!");
|
| 26 | return;
|
| 27 | }
|
| 28 | for (int i = 9; i < 44; i++) {
|
| 29 | if (36 + mc.player.getInventory().getSelectedSlot() == i) continue;
|
| 30 | mc.player.connection.send(new ServerboundContainerClickPacket(
|
| 31 | mc.player.containerMenu.containerId,
|
| 32 | mc.player.containerMenu.getStateId(),
|
| 33 | (short) i,
|
| 34 | (byte) 1,
|
| 35 | ContainerInput.THROW,
|
| 36 | Int2ObjectMaps.emptyMap(),
|
| 37 | HashedStack.EMPTY
|
| 38 | ));
|
| 39 | }
|
| 40 | mc.player.connection.send(new ServerboundEditBookPacket(
|
| 41 | mc.player.getInventory().getSelectedSlot(), List.of(""), Optional.of("The quick brown fox jumps over the lazy dog"
|
| 42 | )));
|
| 43 | toggle();
|
| 44 | }
|
| 45 | }
|
| 46 |
|