From af7008a8b0e422de88653b7e4e23245dc7e51440 Mon Sep 17 00:00:00 2001 From: "Paddyk45@iMac" Date: Fri, 31 Mar 2023 15:15:27 +0200 Subject: [PATCH 1/8] Add VehicleOneHit --- .../meteorclient/systems/modules/Modules.java | 1 + .../systems/modules/misc/VehicleOneHit.java | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java index a70086c0e1..ce7197c7f7 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java @@ -566,6 +566,7 @@ private void initMisc() { add(new Spam()); add(new ServerSpoof()); add(new InventoryTweaks()); + add(new VehicleOneHit()); } public static class ModuleRegistry extends SimpleRegistry { diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java new file mode 100644 index 0000000000..2940312c95 --- /dev/null +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java @@ -0,0 +1,45 @@ +package meteordevelopment.meteorclient.systems.modules.misc; + +import meteordevelopment.meteorclient.events.packets.PacketEvent; +import meteordevelopment.meteorclient.settings.EnumSetting; +import meteordevelopment.meteorclient.settings.IntSetting; +import meteordevelopment.meteorclient.settings.Setting; +import meteordevelopment.meteorclient.settings.SettingGroup; +import meteordevelopment.meteorclient.systems.modules.Categories; +import meteordevelopment.meteorclient.systems.modules.Module; +import meteordevelopment.orbit.EventHandler; +import net.minecraft.entity.Entity; +import net.minecraft.entity.vehicle.BoatEntity; +import net.minecraft.entity.vehicle.MinecartEntity; +import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; +import net.minecraft.util.hit.EntityHitResult; + +public class VehicleOneHit extends Module { + boolean ignorePIEPacket = false; + private final SettingGroup sgGeneral = settings.getDefaultGroup(); + private final Setting amount = sgGeneral.add(new IntSetting.Builder() + .name("amount") + .description("The amount of packets to send") + .defaultValue(15) + .range(1, 100) + .sliderRange(1, 20) + .build() + ); + public VehicleOneHit() { + super(Categories.Misc, "VehicleOneHit", "Destroy boats and minecarts with one hit"); + } + + + @EventHandler + public void onPacketSend(PacketEvent.Send event){ + if(event.packet instanceof PlayerInteractEntityC2SPacket && !ignorePIEPacket){ + ignorePIEPacket = true; + assert mc.crosshairTarget != null && !event.isCancelled(); + Entity entity = ((EntityHitResult) mc.crosshairTarget).getEntity(); + if(entity instanceof BoatEntity || entity instanceof MinecartEntity){ + for (int i = 0; i < amount.get(); i++) mc.player.networkHandler.sendPacket(event.packet); + }; + ignorePIEPacket = false; + } + } +} From d5b0040c65d300c17428112a0e97f93506e231ed Mon Sep 17 00:00:00 2001 From: "Paddyk45@iMac" Date: Fri, 31 Mar 2023 15:21:06 +0200 Subject: [PATCH 2/8] Remove brackets --- .../meteorclient/systems/modules/misc/VehicleOneHit.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java index 2940312c95..8264bebb6d 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java @@ -36,9 +36,7 @@ public void onPacketSend(PacketEvent.Send event){ ignorePIEPacket = true; assert mc.crosshairTarget != null && !event.isCancelled(); Entity entity = ((EntityHitResult) mc.crosshairTarget).getEntity(); - if(entity instanceof BoatEntity || entity instanceof MinecartEntity){ - for (int i = 0; i < amount.get(); i++) mc.player.networkHandler.sendPacket(event.packet); - }; + if(entity instanceof BoatEntity || entity instanceof MinecartEntity) for (int i = 0; i < amount.get(); i++) mc.player.networkHandler.sendPacket(event.packet); ignorePIEPacket = false; } } From 29da29d167738670f4e4f5c64b6f032c79ad3afa Mon Sep 17 00:00:00 2001 From: "Paddyk45@iMac" Date: Fri, 31 Mar 2023 15:26:50 +0200 Subject: [PATCH 3/8] Add License header and remove one unused import --- .../meteorclient/systems/modules/misc/VehicleOneHit.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java index 8264bebb6d..94cd7d5370 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java @@ -1,7 +1,11 @@ +/* + * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client). + * Copyright (c) Meteor Development. + */ + package meteordevelopment.meteorclient.systems.modules.misc; import meteordevelopment.meteorclient.events.packets.PacketEvent; -import meteordevelopment.meteorclient.settings.EnumSetting; import meteordevelopment.meteorclient.settings.IntSetting; import meteordevelopment.meteorclient.settings.Setting; import meteordevelopment.meteorclient.settings.SettingGroup; From fcc0948fce325bc023f8d150f96d05b373128b6f Mon Sep 17 00:00:00 2001 From: Patrick <73178245+Pxddyk45@users.noreply.github.com> Date: Fri, 31 Mar 2023 16:11:32 +0200 Subject: [PATCH 4/8] Update VehicleOneHit.java Fix name --- .../meteorclient/systems/modules/misc/VehicleOneHit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java index 94cd7d5370..8089ffed7f 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java @@ -30,7 +30,7 @@ public class VehicleOneHit extends Module { .build() ); public VehicleOneHit() { - super(Categories.Misc, "VehicleOneHit", "Destroy boats and minecarts with one hit"); + super(Categories.Misc, "vehicle-one-hit", "Destroy boats and minecarts with one hit"); } From 4d3442cd16bb6c62544cd305cccba5abd6577814 Mon Sep 17 00:00:00 2001 From: arlomcwalter Date: Fri, 31 Mar 2023 15:47:45 +0100 Subject: [PATCH 5/8] fix bad code and move to player category --- .../{misc => player}/VehicleOneHit.java | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) rename src/main/java/meteordevelopment/meteorclient/systems/modules/{misc => player}/VehicleOneHit.java (55%) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/VehicleOneHit.java similarity index 55% rename from src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java rename to src/main/java/meteordevelopment/meteorclient/systems/modules/player/VehicleOneHit.java index 8089ffed7f..f742dabc40 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/VehicleOneHit.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/VehicleOneHit.java @@ -3,7 +3,7 @@ * Copyright (c) Meteor Development. */ -package meteordevelopment.meteorclient.systems.modules.misc; +package meteordevelopment.meteorclient.systems.modules.player; import meteordevelopment.meteorclient.events.packets.PacketEvent; import meteordevelopment.meteorclient.settings.IntSetting; @@ -12,36 +12,41 @@ import meteordevelopment.meteorclient.systems.modules.Categories; import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.orbit.EventHandler; -import net.minecraft.entity.Entity; +import net.minecraft.entity.vehicle.AbstractMinecartEntity; import net.minecraft.entity.vehicle.BoatEntity; -import net.minecraft.entity.vehicle.MinecartEntity; import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; import net.minecraft.util.hit.EntityHitResult; public class VehicleOneHit extends Module { - boolean ignorePIEPacket = false; private final SettingGroup sgGeneral = settings.getDefaultGroup(); + private final Setting amount = sgGeneral.add(new IntSetting.Builder() .name("amount") - .description("The amount of packets to send") - .defaultValue(15) + .description("The number of packets to send.") + .defaultValue(16) .range(1, 100) .sliderRange(1, 20) .build() ); + + private boolean ignorePackets; + public VehicleOneHit() { - super(Categories.Misc, "vehicle-one-hit", "Destroy boats and minecarts with one hit"); + super(Categories.Player, "vehicle-one-hit", "Destroy vehicles with one hit."); } - @EventHandler - public void onPacketSend(PacketEvent.Send event){ - if(event.packet instanceof PlayerInteractEntityC2SPacket && !ignorePIEPacket){ - ignorePIEPacket = true; - assert mc.crosshairTarget != null && !event.isCancelled(); - Entity entity = ((EntityHitResult) mc.crosshairTarget).getEntity(); - if(entity instanceof BoatEntity || entity instanceof MinecartEntity) for (int i = 0; i < amount.get(); i++) mc.player.networkHandler.sendPacket(event.packet); - ignorePIEPacket = false; + private void onPacketSend(PacketEvent.Send event) { + if (ignorePackets + || !(event.packet instanceof PlayerInteractEntityC2SPacket) + || !(mc.crosshairTarget instanceof EntityHitResult ehr) + || (!(ehr.getEntity() instanceof AbstractMinecartEntity) && !(ehr.getEntity() instanceof BoatEntity)) + ) return; + + ignorePackets = true; + for (int i = 0; i < amount.get() - 1; i++) { + mc.player.networkHandler.sendPacket(event.packet); } + ignorePackets = false; } } From c311b7f70221acb36819343cf21359e9890432b1 Mon Sep 17 00:00:00 2001 From: arlomcwalter Date: Fri, 31 Mar 2023 15:48:35 +0100 Subject: [PATCH 6/8] move modules.add call --- .../meteordevelopment/meteorclient/systems/modules/Modules.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java index ce7197c7f7..ace5ea3209 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java @@ -439,6 +439,7 @@ private void initPlayer() { add(new Reach()); add(new Rotation()); add(new SpeedMine()); + add(new VehicleOneHit()); } private void initMovement() { @@ -566,7 +567,6 @@ private void initMisc() { add(new Spam()); add(new ServerSpoof()); add(new InventoryTweaks()); - add(new VehicleOneHit()); } public static class ModuleRegistry extends SimpleRegistry { From 9ea6662afca5f74802b48b22befdb69cee66bed5 Mon Sep 17 00:00:00 2001 From: Patrick <73178245+Pxddyk45@users.noreply.github.com> Date: Sat, 1 Apr 2023 11:47:03 +0200 Subject: [PATCH 7/8] Update BookEditScreenMixin.java Fix width --- .../meteorclient/mixin/BookEditScreenMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java index c3f0d0ef66..330b0f21df 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java @@ -109,7 +109,7 @@ private void onInit(CallbackInfo info) { } }) .position(4, 4 + 20 + 2) - .size(4, 4 + 20 + 2) + .size(120, 4 + 20 + 2) .build() ); } From e075cfb61fdc6ac072ba01276a895719ffc18867 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 1 Apr 2023 11:57:00 +0200 Subject: [PATCH 8/8] Revert "Update BookEditScreenMixin.java" This reverts commit 9ea6662afca5f74802b48b22befdb69cee66bed5. --- .../meteorclient/mixin/BookEditScreenMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java index 330b0f21df..c3f0d0ef66 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java @@ -109,7 +109,7 @@ private void onInit(CallbackInfo info) { } }) .position(4, 4 + 20 + 2) - .size(120, 4 + 20 + 2) + .size(4, 4 + 20 + 2) .build() ); }