Skip to content

Commit 3cfa8ae

Browse files
committed
Release 2.9.2
- 新模块 AutoCatch 自动骑乘 - 仅限PAS模式 - 自动骑到设定的玩家身上 - 修复静默瞄准系统的一个bug - 改进AntiBot
1 parent 5a0c508 commit 3cfa8ae

27 files changed

+256
-60
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ minecraft_version=1.20.1
77
loader_version=0.14.23
88

99
# Mod Properties
10-
mod_version = 2.9.1
10+
mod_version = 2.9.2
1111
maven_group = top.infsky
1212
archives_base_name = CheatDetector
1313

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package top.infsky.cheatdetector.commands;
2+
3+
import com.mojang.brigadier.context.CommandContext;
4+
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
5+
import net.minecraft.ChatFormatting;
6+
import net.minecraft.world.entity.player.Player;
7+
import org.jetbrains.annotations.NotNull;
8+
import top.infsky.cheatdetector.CheatDetector;
9+
import top.infsky.cheatdetector.config.Advanced3Config;
10+
import top.infsky.cheatdetector.utils.LogUtils;
11+
import top.infsky.cheatdetector.utils.TRPlayer;
12+
13+
public class CatchCommand {
14+
public static int execute(@NotNull CommandContext<FabricClientCommandSource> context) {
15+
String name;
16+
17+
try {
18+
name = context.getArgument("name", String.class);
19+
} catch (IllegalArgumentException e) {
20+
if (TRPlayer.CLIENT.crosshairPickEntity instanceof Player target) {
21+
name = target.getName().getString();
22+
} else {
23+
name = Advanced3Config.autoCatchName;
24+
}
25+
}
26+
27+
if (CheatDetector.CONFIG_HANDLER.configManager.setValue("autoCatchName", name)) {
28+
LogUtils.custom(ChatFormatting.GREEN + "已设置: " + ChatFormatting.WHITE + name);
29+
return 1;
30+
} else {
31+
return -1;
32+
}
33+
}
34+
}

src/main/java/top/infsky/cheatdetector/commands/CommandEvent.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public static void register(@NotNull CommandDispatcher<FabricClientCommandSource
3838
.then(argument("part", IntegerArgumentType.integer(1))
3939
.executes(WriterCommand::execute))
4040
)
41+
.then(literal("catch")
42+
.executes(CatchCommand::execute)
43+
.then(argument("name", StringArgumentType.string())
44+
.executes(CatchCommand::execute))
45+
)
4146
);
4247
}
4348
}

src/main/java/top/infsky/cheatdetector/config/Advanced3Config.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public class Advanced3Config {
241241
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.DangerMode.class)
242242
public static boolean airStuckAntiKick = false;
243243

244-
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.PASMode.class)
244+
@Config(category = ConfigCategory.ADVANCED3)
245245
public static String clientSpoofBrand = "vanilla";
246246

247247
@Numeric(minValue = 0, maxValue = 5)
@@ -292,6 +292,24 @@ public class Advanced3Config {
292292
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.DangerMode.class)
293293
public static boolean slowMotionFastStop = false;
294294

295+
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.PASMode.class)
296+
public static String autoCatchName = "";
297+
@Numeric(minValue = 0, maxValue = 100)
298+
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.PASMode.class)
299+
public static double autoCatchDistance = 6;
300+
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.PASMode.class)
301+
public static boolean autoCatchFast = false;
302+
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.PASMode.class)
303+
public static boolean autoCatchAlways = false;
304+
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.PASMode.class)
305+
public static boolean autoCatchAsPossible = false;
306+
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.PASMode.class)
307+
public static double autoCatchAsPossibleTeleportDistance = 10;
308+
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.PASMode.class)
309+
public static boolean autoCatchRotate = false;
310+
@Config(category = ConfigCategory.ADVANCED3, predicate = ConfigPredicate.PASMode.class)
311+
public static boolean autoCatchSilentRotate = false;
312+
295313
public static NotebotUtils.NotebotMode getNoteBotMode() {
296314
if (noteBotMode.equals("AnyInstrument")) {
297315
return NotebotUtils.NotebotMode.AnyInstrument;

src/main/java/top/infsky/cheatdetector/config/ModuleConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,8 @@ public class ModuleConfig {
9595
@Hotkey
9696
@Config(category = ConfigCategory.MODULES)
9797
public static boolean sprintEnabled = false;
98+
99+
@Hotkey
100+
@Config(category = ConfigCategory.MODULES, predicate = ConfigPredicate.PASMode.class)
101+
public static boolean autoCatchEnabled = false;
98102
}

src/main/java/top/infsky/cheatdetector/impl/modules/common/Debug.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
package top.infsky.cheatdetector.impl.modules.common;
22

3+
import io.netty.channel.ChannelHandlerContext;
34
import lombok.Getter;
45
import net.minecraft.network.Connection;
5-
import net.minecraft.network.PacketSendListener;
66
import net.minecraft.network.protocol.Packet;
7-
import net.minecraft.network.protocol.game.ServerGamePacketListener;
8-
import net.minecraft.network.protocol.game.ServerboundEditBookPacket;
7+
import net.minecraft.network.protocol.game.ClientGamePacketListener;
8+
import net.minecraft.network.protocol.game.ClientboundEntityEventPacket;
9+
import net.minecraft.network.protocol.game.ClientboundGameEventPacket;
910
import org.jetbrains.annotations.NotNull;
1011
import org.jetbrains.annotations.Nullable;
1112
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
1213
import top.infsky.cheatdetector.config.ModuleConfig;
1314
import top.infsky.cheatdetector.impl.Module;
15+
import top.infsky.cheatdetector.impl.utils.world.LevelUtils;
1416
import top.infsky.cheatdetector.utils.TRSelf;
1517

18+
import java.util.Objects;
19+
1620
public class Debug extends Module {
1721
@Getter
1822
@Nullable
@@ -24,11 +28,14 @@ public Debug(@NotNull TRSelf player) {
2428
}
2529

2630
@Override
27-
public boolean _onPacketSend(@NotNull Packet<ServerGamePacketListener> basePacket, Connection connection, PacketSendListener listener, CallbackInfo ci) {
31+
public boolean _onPacketReceive(@NotNull Packet<ClientGamePacketListener> basePacket, Connection connection, ChannelHandlerContext channelHandlerContext, CallbackInfo ci) {
2832
if (isDisabled()) return false;
2933

30-
if (basePacket instanceof ServerboundEditBookPacket packet) {
31-
customMsg("slot:%s page:%s title:%s".formatted(packet.getSlot(), packet.getPages(), packet.getTitle()));
34+
if (basePacket instanceof ClientboundEntityEventPacket packet) {
35+
customMsg("EntityEvent: entity:%s eventId:%s".formatted(Objects.requireNonNull(packet.getEntity(LevelUtils.getClientLevel())).getName().getString(), packet.getEventId()));
36+
}
37+
if (basePacket instanceof ClientboundGameEventPacket packet) {
38+
customMsg("GameEvent: event:%s param:%s".formatted(Objects.requireNonNull(packet.getEvent()), packet.getParam()));
3239
}
3340
return false;
3441
}

src/main/java/top/infsky/cheatdetector/impl/modules/common/FlagDetector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.jetbrains.annotations.Nullable;
99
import top.infsky.cheatdetector.CheatDetector;
1010
import top.infsky.cheatdetector.impl.Module;
11-
import top.infsky.cheatdetector.impl.modules.pas.Fly;
11+
import top.infsky.cheatdetector.impl.modules.danger.Fly;
1212
import top.infsky.cheatdetector.utils.TRSelf;
1313
import top.infsky.cheatdetector.config.Advanced3Config;
1414
import top.infsky.cheatdetector.config.ModuleConfig;

src/main/java/top/infsky/cheatdetector/impl/modules/common/Rotation.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ public void onFinallyPacketSend(ConnectionAccessor connection, Packet<?> basePac
7474
stoppedSprint = true;
7575
lastStopSprintTime = player.upTime;
7676
}
77-
} else if (stoppedSprint) {
78-
player.fabricPlayer.connection.send(new ServerboundPlayerCommandPacket(player.fabricPlayer, ServerboundPlayerCommandPacket.Action.START_SPRINTING));
77+
} else {
78+
if (stoppedSprint)
79+
player.fabricPlayer.connection.send(new ServerboundPlayerCommandPacket(player.fabricPlayer, ServerboundPlayerCommandPacket.Action.START_SPRINTING));
80+
stoppedSprint = false;
7981
}
8082

8183
if (basePacket instanceof Pos) {

src/main/java/top/infsky/cheatdetector/impl/modules/common/AimAssist.java renamed to src/main/java/top/infsky/cheatdetector/impl/modules/danger/AimAssist.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package top.infsky.cheatdetector.impl.modules.common;
1+
package top.infsky.cheatdetector.impl.modules.danger;
22

33
import net.minecraft.world.entity.Entity;
44
import net.minecraft.world.entity.LivingEntity;

src/main/java/top/infsky/cheatdetector/impl/modules/common/AirStuck.java renamed to src/main/java/top/infsky/cheatdetector/impl/modules/danger/AirStuck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package top.infsky.cheatdetector.impl.modules.common;
1+
package top.infsky.cheatdetector.impl.modules.danger;
22

33
import lombok.Getter;
44
import net.minecraft.client.multiplayer.ClientLevel;

0 commit comments

Comments
 (0)