-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 新检查 BoatFlyA - 新检查 FlyC - 改进AntiBot模块 - 添加InTabList选项
- Loading branch information
Showing
28 changed files
with
193 additions
and
30 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
2 changes: 1 addition & 1 deletion
2
...cheatdetector/impl/checks/AutoBlockA.java → ...tector/impl/checks/combat/AutoBlockA.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
2 changes: 1 addition & 1 deletion
2
...eatdetector/impl/checks/AutoClickerA.java → ...ctor/impl/checks/combat/AutoClickerA.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
2 changes: 1 addition & 1 deletion
2
...ky/cheatdetector/impl/checks/HitBoxA.java → ...tdetector/impl/checks/combat/HitBoxA.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
2 changes: 1 addition & 1 deletion
2
...sky/cheatdetector/impl/checks/ReachA.java → ...atdetector/impl/checks/combat/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
2 changes: 1 addition & 1 deletion
2
.../cheatdetector/impl/checks/VelocityA.java → ...etector/impl/checks/combat/VelocityA.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
2 changes: 1 addition & 1 deletion
2
.../cheatdetector/impl/checks/GameModeA.java → ...ector/impl/checks/exploits/GameModeA.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
2 changes: 1 addition & 1 deletion
2
...sky/cheatdetector/impl/checks/BlinkA.java → ...detector/impl/checks/movement/BlinkA.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
54 changes: 54 additions & 0 deletions
54
src/main/java/top/infsky/cheatdetector/impl/checks/movement/BoatFlyA.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,54 @@ | ||
package top.infsky.cheatdetector.impl.checks.movement; | ||
|
||
import net.minecraft.world.entity.vehicle.Boat; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.block.BubbleColumnBlock; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.jetbrains.annotations.NotNull; | ||
import top.infsky.cheatdetector.config.AdvancedConfig; | ||
import top.infsky.cheatdetector.impl.Check; | ||
import top.infsky.cheatdetector.utils.TRPlayer; | ||
|
||
import java.util.List; | ||
import java.util.function.Predicate; | ||
|
||
|
||
public class BoatFlyA extends Check { | ||
public static final List<Block> IGNORE_BLOCKS = List.of(Blocks.WATER, Blocks.PISTON, Blocks.PISTON_HEAD, Blocks.MOVING_PISTON, Blocks.STICKY_PISTON); | ||
public BoatFlyA(@NotNull TRPlayer player) { | ||
super("BoatFlyA", player); | ||
} | ||
|
||
@Override | ||
public void _onTick() { | ||
if (player.fabricPlayer.getVehicle() instanceof Boat boat) { | ||
if (boat.onGround()) return; | ||
if (boat.isInWater()) { | ||
if (blockCheck(boat, blockState -> blockState.is(Blocks.BUBBLE_COLUMN) && !blockState.getValue(BubbleColumnBlock.DRAG_DOWN))) | ||
return; | ||
} else { | ||
if (IGNORE_BLOCKS.stream().anyMatch(block -> blockCheck(boat, blockState -> blockState.is(block)))) | ||
return; | ||
} | ||
|
||
if (player.currentVehicleMotion.y() >= 0) { | ||
flag("Invalid boat Y-motion: %s inWater=%s onGround=%s".formatted(player.currentVehicleMotion.y(), boat.isInWater(), boat.onGround())); | ||
} | ||
} | ||
} | ||
|
||
private static boolean blockCheck(@NotNull Boat boat, @NotNull Predicate<BlockState> predicate) { | ||
return predicate.test(boat.getFeetBlockState()) || predicate.test(boat.getBlockStateOn()); | ||
} | ||
|
||
@Override | ||
public int getAlertBuffer() { | ||
return AdvancedConfig.boatFlyAAlertBuffer; | ||
} | ||
|
||
@Override | ||
public boolean isDisabled() { | ||
return !AdvancedConfig.boatFlyACheck; | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...nfsky/cheatdetector/impl/checks/FlyB.java → ...atdetector/impl/checks/movement/FlyB.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
47 changes: 47 additions & 0 deletions
47
src/main/java/top/infsky/cheatdetector/impl/checks/movement/FlyC.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,47 @@ | ||
package top.infsky.cheatdetector.impl.checks.movement; | ||
|
||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
import org.jetbrains.annotations.NotNull; | ||
import top.infsky.cheatdetector.config.AdvancedConfig; | ||
import top.infsky.cheatdetector.impl.Check; | ||
import top.infsky.cheatdetector.utils.TRPlayer; | ||
|
||
import java.util.List; | ||
|
||
public class FlyC extends Check { | ||
public static final List<Block> IGNORED_BLOCKS = List.of(Blocks.COBWEB, Blocks.WATER, Blocks.LAVA, Blocks.POWDER_SNOW); | ||
public FlyC(@NotNull TRPlayer player) { | ||
super("FlyC", player); | ||
} | ||
|
||
@Override | ||
public void _onTick() { | ||
if (player.fabricPlayer.isPassenger() | ||
|| player.currentOnGround || player.fabricPlayer.isFallFlying() | ||
|| IGNORED_BLOCKS.stream().anyMatch(block -> player.fabricPlayer.getFeetBlockState().is(block))) return; | ||
|
||
int repeatFromTick = 0; | ||
for (int i = 0; i < player.motionHistory.size(); i++) { | ||
if (Math.abs(player.motionHistory.get(i).y() - player.currentMotion.y()) >= AdvancedConfig.flyCMinDiffYMotion) { | ||
return; | ||
} | ||
|
||
repeatFromTick++; | ||
} | ||
|
||
if (repeatFromTick >= AdvancedConfig.flyCMinRepeatTicks) { | ||
flag("Repeat Y-motion from %s ticks.".formatted(repeatFromTick)); | ||
} | ||
} | ||
|
||
@Override | ||
public int getAlertBuffer() { | ||
return AdvancedConfig.flyCAlertBuffer; | ||
} | ||
|
||
@Override | ||
public boolean isDisabled() { | ||
return !AdvancedConfig.flyCCheck; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...eatdetector/impl/checks/GroundSpoofA.java → ...or/impl/checks/movement/GroundSpoofA.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
2 changes: 1 addition & 1 deletion
2
...eatdetector/impl/checks/GroundSpoofB.java → ...or/impl/checks/movement/GroundSpoofB.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
2 changes: 1 addition & 1 deletion
2
.../cheatdetector/impl/checks/HighJumpA.java → ...ector/impl/checks/movement/HighJumpA.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
2 changes: 1 addition & 1 deletion
2
...ky/cheatdetector/impl/checks/MotionA.java → ...etector/impl/checks/movement/MotionA.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
2 changes: 1 addition & 1 deletion
2
...ky/cheatdetector/impl/checks/NoSlowA.java → ...etector/impl/checks/movement/NoSlowA.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
2 changes: 1 addition & 1 deletion
2
...sky/cheatdetector/impl/checks/SpeedA.java → ...detector/impl/checks/movement/SpeedA.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
2 changes: 1 addition & 1 deletion
2
...sky/cheatdetector/impl/checks/SpeedB.java → ...detector/impl/checks/movement/SpeedB.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
2 changes: 1 addition & 1 deletion
2
...sky/cheatdetector/impl/checks/SpeedC.java → ...detector/impl/checks/movement/SpeedC.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
Oops, something went wrong.