Full module source: 1 implementation
Every implementation below is the complete module file, verbatim. Expand a client to read its code.
MelaHack (ThunderHack fork)MISCsrc/main/java/thunder/hack/features/modules/misc/PacketCanceler.javaJava · 33 lines · 1.6 KB
SettingsClickSlotC2SPacketPositionAndOnGroundOnGroundOnlyLookAndOnGround
| 1 | package thunder.hack.features.modules.misc;
|
| 2 |
|
| 3 | import meteordevelopment.orbit.EventHandler;
|
| 4 | import net.minecraft.network.protocol.game.ServerboundContainerClickPacket;
|
| 5 | import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
|
| 6 | import org.jetbrains.annotations.NotNull;
|
| 7 | import thunder.hack.events.impl.PacketEvent;
|
| 8 | import thunder.hack.features.modules.Module;
|
| 9 | import thunder.hack.setting.Setting;
|
| 10 |
|
| 11 | public final class PacketCanceler extends Module {
|
| 12 | private final Setting<Boolean> clickSlot = new Setting<>("ClickSlotC2SPacket", false);
|
| 13 | private final Setting<Boolean> playerMovePosAndOnGround = new Setting<>("PositionAndOnGround", false);
|
| 14 | private final Setting<Boolean> playerMoveOnGroundOnly = new Setting<>("OnGroundOnly", false);
|
| 15 | private final Setting<Boolean> playerMoveLookAndOnGround = new Setting<>("LookAndOnGround", false);
|
| 16 | public PacketCanceler() {
|
| 17 | super("PacketCanceler", Category.MISC);
|
| 18 | }
|
| 19 |
|
| 20 | @EventHandler
|
| 21 | @SuppressWarnings("unused")
|
| 22 | private void onPacketSend(PacketEvent.@NotNull Send e) {
|
| 23 | if (e.getPacket() instanceof ServerboundContainerClickPacket && clickSlot.getValue()) {
|
| 24 | e.cancel();
|
| 25 | } else if (e.getPacket() instanceof ServerboundMovePlayerPacket.Pos && playerMovePosAndOnGround.getValue()) {
|
| 26 | e.cancel();
|
| 27 | } else if (e.getPacket() instanceof ServerboundMovePlayerPacket.StatusOnly && playerMoveOnGroundOnly.getValue()) {
|
| 28 | e.cancel();
|
| 29 | } else if (e.getPacket() instanceof ServerboundMovePlayerPacket.Rot && playerMoveLookAndOnGround.getValue()) {
|
| 30 | e.cancel();
|
| 31 | }
|
| 32 | }
|
| 33 | }
|
Mixins (1)
IPlayerMoveC2SPacket.javaJava · 17 lines · 470 B
@Mixin(ServerboundMovePlayerPacket.class)
| 1 | package thunder.hack.injection.accesors;
|
| 2 |
|
| 3 | import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
|
| 4 | import org.spongepowered.asm.mixin.Mixin;
|
| 5 | import org.spongepowered.asm.mixin.Mutable;
|
| 6 | import org.spongepowered.asm.mixin.gen.Accessor;
|
| 7 |
|
| 8 | @Mixin(ServerboundMovePlayerPacket.class)
|
| 9 | public interface IPlayerMoveC2SPacket {
|
| 10 | @Mutable
|
| 11 | @Accessor("onGround")
|
| 12 | void setOnGround(boolean onGround);
|
| 13 |
|
| 14 | @Mutable
|
| 15 | @Accessor("y")
|
| 16 | void setY(double y);
|
| 17 | }
|