-
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.
修复FlightA的激流误判、受伤误判、跳跃提升误判。 迁移反作弊相关指令到/trac。 已知误判:(FlightA)鞘翅。
- Loading branch information
Showing
8 changed files
with
114 additions
and
17 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
36 changes: 36 additions & 0 deletions
36
src/main/java/top/infsky/timerecorder/anticheat/checks/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package top.infsky.timerecorder.anticheat.checks; | ||
|
||
import net.minecraft.network.protocol.Packet; | ||
import net.minecraft.network.protocol.game.ServerGamePacketListener; | ||
import net.minecraft.network.protocol.game.ServerboundKeepAlivePacket; | ||
import org.jetbrains.annotations.NotNull; | ||
import top.infsky.timerecorder.anticheat.Check; | ||
import top.infsky.timerecorder.data.PlayerData; | ||
|
||
import java.util.Queue; | ||
import java.util.concurrent.LinkedBlockingQueue; | ||
|
||
public class BlinkA extends Check { | ||
public Queue<ServerboundKeepAlivePacket> keepAlivePackets = new LinkedBlockingQueue<>(10); | ||
|
||
public BlinkA(@NotNull PlayerData playerData) { | ||
super("BlinkA", playerData); | ||
} | ||
|
||
@Override | ||
public void _onPacketReceive(Packet<ServerGamePacketListener> packet) { | ||
if (packet instanceof ServerboundKeepAlivePacket) { | ||
try { | ||
keepAlivePackets.add((ServerboundKeepAlivePacket) packet); | ||
} catch (IllegalStateException ignored) { | ||
keepAlivePackets.poll(); | ||
keepAlivePackets.add((ServerboundKeepAlivePacket) packet); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void _onTick() { | ||
|
||
} | ||
} |
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/timerecorder/command/AlertCommand.java → ...order/anticheat/command/AlertCommand.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
27 changes: 27 additions & 0 deletions
27
src/main/java/top/infsky/timerecorder/anticheat/command/HelpCommand.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,27 @@ | ||
package top.infsky.timerecorder.anticheat.command; | ||
|
||
import com.mojang.brigadier.context.CommandContext; | ||
import net.minecraft.commands.CommandSourceStack; | ||
import net.minecraft.network.chat.Component; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class HelpCommand { | ||
private static final String opHelpMsg = """ | ||
§r§b§lTimeRecorder Anti-Cheat§r | ||
§r/trac help §f- §7显示此帮助信息§r | ||
§r/trac alert §f- §7显示警报信息§r | ||
"""; | ||
|
||
private static final String memberHelpMsg = """ | ||
§r§b§lTimeRecorder Anti-Cheat§r | ||
§r/tr help §f- §7显示此帮助信息§r | ||
"""; | ||
|
||
public static int execute(@NotNull CommandContext<CommandSourceStack> context) { | ||
context.getSource().sendSystemMessage(Component.literal( | ||
context.getSource().hasPermission(2) ? opHelpMsg : memberHelpMsg | ||
)); | ||
|
||
return 1; | ||
} | ||
} |
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