Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync update #10

Merged
merged 18 commits into from
May 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -23,28 +23,32 @@

## 反作弊
反作弊 旨在不被发现的情况下揭示其他玩家的作弊行为。
- **Flight** 飞行检查
- **Fly** 飞行检查
- **HighJump** 高跳检查
- **Blink** 闪现检查
- **NoSlow** 无减速检查
- **Speed** 速度检查
- **Motion** 惯性检查
- **GameMode** 游戏模式检查
- **Velocity** 反击退检查
- **GroundSpoof** 假地面检查

## 修复
修复 旨在避免被生电服务器反作弊错误标记。
- 针对Themis反作弊
- tweakeroo右键连点器修复
- 右键连点器修复
- 针对GrimAC反作弊
- 无效偏航角修复
- 针对Vulcan反作弊
- BadPacket (Type 1)
- BadPacket (Type 2)
- OmniSprint Disabler (适用于Old Vulcan)
- ServerFreeze 服务器冻结修复
- 在服务器冻结时提醒你,并主动避免反作弊误判

## 模块
模块 旨在在生存中提供一些消解无趣的办法。
- **AntiVanish** 反隐身
- 揪出使用vanish插件隐身的人
- 找出使用vanish插件隐身的人
- **FlagDetector** 标记检测器
- 基于拉回帮助你确认自己是否被服务器反作弊标记。
- **Spin** 自旋
@@ -57,9 +61,9 @@
## 可调选项
CheatDetector Mod使用**Mod Menu**和**Cloth Config API**实现配置页面。<sup>[Release 1.1.5.1](https://github.com/Nova-Committee/CheatDetector/releases/tag/1.1.5.1)及以前<sup>

从[Release 2.0.0](https://github.com/Nova-Committee/CheatDetector/releases/tag/1.1.5.1)开始,Mod使用**Mod Menu**和**Cloth Config API**实现配置页面。
从[Release 2.0.0](https://github.com/Nova-Committee/CheatDetector/releases/tag/1.1.5.1)开始,Mod使用**Magiclib**实现配置页面。

Mod包含150+项自定义选项,对于不同服务器,你可能需要根据延迟、丢包等情况修改配置。
Mod包含200+项自定义选项,对于不同服务器,你可能需要根据延迟、丢包等情况修改配置。

默认设置为<80ms的服务器设计。

13 changes: 13 additions & 0 deletions bookUtils/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from pyperclip import copy, paste

inputStr = ""
while True:
cur = input()
if cur == "done": break
inputStr += cur + "\n"

result = ""
for s in (i for i in inputStr.split("\n") if i != ""):
result += s + "\n"

copy(result)
19 changes: 1 addition & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id "com.replaymod.preprocess" version "SNAPSHOT"
id 'maven-publish'
}

preprocess {
def mc1182 = createNode("1.18.2", 1_18_02, "yarn")
def mc1192 = createNode("1.19.2", 1_19_02, "yarn")
def mc1193 = createNode("1.19.3", 1_19_03, "yarn")
def mc1194 = createNode("1.19.4", 1_19_04, "yarn")
def mc1201 = createNode("1.20.1", 1_20_01, "yarn")
def mc1204 = createNode("1.20.4", 1_20_04, "yarn")

mc1182.link(mc1192, null)
mc1192.link(mc1193, null)
mc1193.link(mc1194, null)
mc1194.link(mc1201, null)
mc1201.link(mc1204, null)
}

apply(plugin: "com.replaymod.preprocess")

version = project.mod_version
group = project.maven_group

@@ -68,6 +50,7 @@ dependencies {
modImplementation("top.hendrixshen.magiclib:magiclib-${project.minecraft_version.replace(".", "_")}:${project.magiclib_version}") {
exclude(group: "carpet", module: "fabric-carpet")
}
modImplementation("maven.modrinth:replaymod:${project.minecraft_version}-${project.replaymod_version}")

// modApi "com.terraformersmc:modmenu:${project.modmenu_version}"

5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -7,13 +7,12 @@ minecraft_version=1.20.1
loader_version=0.14.23

# Mod Properties
mod_version = 2.6.0
mod_version = 2.9.4
maven_group = top.infsky
archives_base_name = CheatDetector

# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.91.0+1.20.1
modmenu_version=7.2.2
cloth_config_version=11.1.118
magiclib_version=0.7.398
replaymod_version=2.6.15
31 changes: 31 additions & 0 deletions qodana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#-------------------------------------------------------------------------------#
# Qodana analysis is configured by qodana.yaml file #
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
#-------------------------------------------------------------------------------#
version: "1.0"

#Specify inspection profile for code analysis
profile:
name: qodana.starter

#Enable inspections
#include:
# - name: <SomeEnabledInspectionId>

#Disable inspections
#exclude:
# - name: <SomeDisabledInspectionId>
# paths:
# - <path/where/not/run/inspection>

projectJDK: 17 #(Applied in CI/CD pipeline)

#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
#bootstrap: sh ./prepare-qodana.sh

#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
#plugins:
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)

#Specify Qodana linter for analysis (Applied in CI/CD pipeline)
linter: jetbrains/qodana-jvm-community:latest
11 changes: 11 additions & 0 deletions src/main/java/top/infsky/cheatdetector/CheatDetector.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package top.infsky.cheatdetector;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
@@ -11,6 +12,7 @@
import org.jetbrains.annotations.NotNull;
import top.hendrixshen.magiclib.malilib.impl.ConfigHandler;
import top.hendrixshen.magiclib.malilib.impl.ConfigManager;
import top.infsky.cheatdetector.commands.CommandEvent;
import top.infsky.cheatdetector.utils.TRSelf;
import top.infsky.cheatdetector.impl.modules.ClickGUI;
import top.infsky.cheatdetector.config.ModuleConfig;
@@ -34,6 +36,15 @@ public void onInitializeClient() {
CONFIG_HANDLER = new ConfigHandler(MOD_ID, configManager, 1);
ConfigHandler.register(CONFIG_HANDLER);

CheatDetector.CONFIG_HANDLER.configManager.getOptionByName("aaaPASModeEnabled").orElseThrow().setValueChangeCallback(configOption -> ClickGUI.update());
CheatDetector.CONFIG_HANDLER.configManager.getOptionByName("aaaDangerModeEnabled").orElseThrow().setValueChangeCallback(configOption -> ClickGUI.update());
CheatDetector.CONFIG_HANDLER.configManager.getOptionByName("fakelagMode").orElseThrow().setValueChangeCallback(configOption -> ClickGUI.update());
CheatDetector.CONFIG_HANDLER.configManager.getOptionByName("aimAssistInteract").orElseThrow().setValueChangeCallback(configOption -> ClickGUI.update());

// command
ClientCommandRegistrationCallback.EVENT.register(CommandEvent::register);

// mod cycle
ClientLifecycleEvents.CLIENT_STARTED.register(this::onClientStarted);
ClientLifecycleEvents.CLIENT_STOPPING.register(this::onClientStopping);
ClientPlayConnectionEvents.JOIN.register(this::onJoinWorld);
34 changes: 34 additions & 0 deletions src/main/java/top/infsky/cheatdetector/commands/CatchCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package top.infsky.cheatdetector.commands;

import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.ChatFormatting;
import net.minecraft.world.entity.player.Player;
import org.jetbrains.annotations.NotNull;
import top.infsky.cheatdetector.CheatDetector;
import top.infsky.cheatdetector.config.Advanced3Config;
import top.infsky.cheatdetector.utils.LogUtils;
import top.infsky.cheatdetector.utils.TRPlayer;

public class CatchCommand {
public static int execute(@NotNull CommandContext<FabricClientCommandSource> context) {
String name;

try {
name = context.getArgument("name", String.class);
} catch (IllegalArgumentException e) {
if (TRPlayer.CLIENT.crosshairPickEntity instanceof Player target) {
name = target.getName().getString();
} else {
name = Advanced3Config.autoCatchName;
}
}

if (CheatDetector.CONFIG_HANDLER.configManager.setValue("autoCatchName", name)) {
LogUtils.custom(ChatFormatting.GREEN + "已设置: " + ChatFormatting.WHITE + name);
return 1;
} else {
return -1;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package top.infsky.cheatdetector.commands;

import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.ChatFormatting;
import org.jetbrains.annotations.NotNull;
import top.infsky.cheatdetector.CheatDetector;
import top.infsky.cheatdetector.utils.LogUtils;

public class ClientSpoofCommand {
public static int execute(@NotNull CommandContext<FabricClientCommandSource> context) {
String brand = context.getArgument("brand", String.class);
if (CheatDetector.CONFIG_HANDLER.configManager.setValue("clientSpoofBrand", brand)) {
LogUtils.custom(ChatFormatting.GREEN + "已设置: " + ChatFormatting.WHITE + brand);
return 1;
} else {
return -1;
}
}
}
48 changes: 48 additions & 0 deletions src/main/java/top/infsky/cheatdetector/commands/CommandEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package top.infsky.cheatdetector.commands;

import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.commands.CommandBuildContext;
import org.jetbrains.annotations.NotNull;

import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.*;

public class CommandEvent {
public static void register(@NotNull CommandDispatcher<FabricClientCommandSource> dispatcher, CommandBuildContext ignoredContext) {
dispatcher.register(literal("ctr")
.executes(HelpCommand::execute)
.then(literal("help")
.executes(HelpCommand::execute))
.then(literal("t")
.then(argument("moduleName", StringArgumentType.string())
.executes(ToggleCommand::execute)
)
)
.then(literal("toggle")
.then(argument("moduleName", StringArgumentType.string())
.executes(ToggleCommand::execute)
)
)
.then(literal("notebot")
.then(argument("path", StringArgumentType.string())
.executes(NoteBotCommand::execute)
)
)
.then(literal("clientspoof")
.then(argument("brand", StringArgumentType.string())
.executes(ClientSpoofCommand::execute))
)
.then(literal("writer")
.then(argument("part", IntegerArgumentType.integer(1))
.executes(WriterCommand::execute))
)
.then(literal("catch")
.executes(CatchCommand::execute)
.then(argument("name", StringArgumentType.string())
.executes(CatchCommand::execute))
)
);
}
}
22 changes: 22 additions & 0 deletions src/main/java/top/infsky/cheatdetector/commands/HelpCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package top.infsky.cheatdetector.commands;

import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.NotNull;

public class HelpCommand {
private static final String helpMsg = """
§r§b§lCheatDetector 帮助信息§r
§r/ctr (help) §f- §7显示此帮助信息§r
§r/ctr t(toggle) <moduleName> §f- §7启用/禁用某个模块§r
§r/ctr notebot <path> §f- §7修改音符机器人.nbs文件路径§r
§r/ctr clientspoof <brand> §f- §7设置客户端伪装名§r
§r/ctr writer <part> §f- §7写一本书。§r
""";

public static int execute(@NotNull CommandContext<FabricClientCommandSource> context) {
context.getSource().sendFeedback(Component.literal(helpMsg));
return 1;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package top.infsky.cheatdetector.commands;

import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.ChatFormatting;
import org.jetbrains.annotations.NotNull;
import top.infsky.cheatdetector.CheatDetector;
import top.infsky.cheatdetector.utils.LogUtils;

public class NoteBotCommand {
public static int execute(@NotNull CommandContext<FabricClientCommandSource> context) {
String path = context.getArgument("path", String.class);
if (CheatDetector.CONFIG_HANDLER.configManager.setValue("noteBotFilePath", path)) {
LogUtils.custom(ChatFormatting.GREEN + "已设置: " + ChatFormatting.WHITE + path);
return 1;
} else {
return -1;
}
}
}
42 changes: 42 additions & 0 deletions src/main/java/top/infsky/cheatdetector/commands/ToggleCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package top.infsky.cheatdetector.commands;

import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.ChatFormatting;
import org.jetbrains.annotations.NotNull;
import top.infsky.cheatdetector.CheatDetector;
import top.infsky.cheatdetector.impl.Check;
import top.infsky.cheatdetector.impl.Module;
import top.infsky.cheatdetector.utils.LogUtils;
import top.infsky.cheatdetector.utils.TRSelf;

public class ToggleCommand {
public static int execute(@NotNull CommandContext<FabricClientCommandSource> context) {
try {
String moduleName = getModule(context.getArgument("moduleName", String.class)).checkName;
String settingName = moduleName.substring(0, 1).toLowerCase() + moduleName.substring(1) + "Enabled";
boolean baseValue = CheatDetector.CONFIG_HANDLER.configManager.getConfig(boolean.class, settingName)
.orElseThrow(() -> new IllegalArgumentException("不正确的设置名: " + settingName));

CheatDetector.CONFIG_HANDLER.configManager.setValue(settingName,
!baseValue);
LogUtils.custom((baseValue ? ChatFormatting.RED + "已禁用" : ChatFormatting.GREEN + "已启用") + ChatFormatting.WHITE + " " + moduleName);
return 1;
} catch (IllegalArgumentException e) {
LogUtils.custom(ChatFormatting.DARK_RED + e.getMessage());
return -1;
}
}

private static @NotNull Module getModule(String input) throws IllegalArgumentException {
for (Check check : TRSelf.getInstance().manager.getChecks().values()) {
if (check instanceof Module module) {
String moduleName = module.checkName;
if (!moduleName.equalsIgnoreCase(input)) continue;

return module;
}
}
throw new IllegalArgumentException("不正确的模块茗: " + input);
}
}
18 changes: 18 additions & 0 deletions src/main/java/top/infsky/cheatdetector/commands/WriterCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package top.infsky.cheatdetector.commands;

import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import org.jetbrains.annotations.NotNull;
import top.infsky.cheatdetector.CheatDetector;

public class WriterCommand {
public static int execute(@NotNull CommandContext<FabricClientCommandSource> context) {
int part = context.getArgument("part", Integer.class);
if (CheatDetector.CONFIG_HANDLER.configManager.setValue("writerPart", part)) {
CheatDetector.CONFIG_HANDLER.configManager.setValue("writerEnabled", true);
return 1;
} else {
return -1;
}
}
}
Loading