-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 新 实验性检查 - 如果启用,模组会使用实验性检查。 - 请注意,在很长的一段时间内,这些实验性检查均不可靠,使用前请了解。 - 新检查 ReachA - 仅实验性检查 - 在默认情况下,mod会硬检查并标记超过3.5格的距离。 - 新模块 Speed - 仅PAS模式 - 让你稍微跑的比别人快一点,同时更灵活。 - 改进 AutoCatch - 改进 Fly, AirStuck - 改进 MotionA检查 - 改进 AntiBot
- Loading branch information
Showing
30 changed files
with
311 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
src/main/java/top/infsky/cheatdetector/config/AntiCheatConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/main/java/top/infsky/cheatdetector/impl/checks/ReachA.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package top.infsky.cheatdetector.impl.checks; | ||
|
||
import net.minecraft.world.entity.LivingEntity; | ||
import org.jetbrains.annotations.NotNull; | ||
import top.infsky.cheatdetector.config.AdvancedConfig; | ||
import top.infsky.cheatdetector.config.AntiCheatConfig; | ||
import top.infsky.cheatdetector.impl.Check; | ||
import top.infsky.cheatdetector.impl.utils.world.LevelUtils; | ||
import top.infsky.cheatdetector.utils.TRPlayer; | ||
|
||
import java.util.NoSuchElementException; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
public class ReachA extends Check { | ||
private boolean lastSwing = false; | ||
public ReachA(@NotNull TRPlayer player) { | ||
super("ReachA", player); | ||
} | ||
|
||
@Override | ||
public void _onTick() { | ||
boolean currentSwing = player.fabricPlayer.swinging; | ||
|
||
if (currentSwing && !lastSwing) { // 第1个挥手tick | ||
onSwing(); | ||
} | ||
lastSwing = currentSwing; | ||
} | ||
|
||
private void onSwing() { | ||
if (isDisabled()) return; | ||
|
||
player.timeTask.schedule(() -> { | ||
try { | ||
LivingEntity possibleTarget = LevelUtils.getEntities().stream() | ||
.filter(entity -> !entity.is(player.fabricPlayer)) | ||
.filter(entity -> entity.hurtTime >= 10 - AdvancedConfig.reachACheckDelay) | ||
.min((e1, e2) -> (int) ((e1.distanceTo(player.fabricPlayer) - e2.distanceTo(player.fabricPlayer)) * 100)) | ||
.orElseThrow(); | ||
double distance = possibleTarget.distanceTo(player.fabricPlayer); | ||
if (distance < 6 && distance > AdvancedConfig.reachADefaultReach) { // 满足标记条件 | ||
flag("distance: %.2f".formatted(distance)); | ||
} | ||
} catch (NoSuchElementException ignored) {} | ||
}, AdvancedConfig.reachACheckDelay * 50L, TimeUnit.MILLISECONDS); | ||
|
||
} | ||
|
||
@Override | ||
public int getAlertBuffer() { | ||
return AdvancedConfig.reachAAlertBuffer; | ||
} | ||
|
||
@Override | ||
public boolean isDisabled() { | ||
return !AdvancedConfig.reachACheck || !AntiCheatConfig.experimentalCheck; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.