Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.devkevin.anticheat.check.impl.autoclicker;
- import me.devkevin.anticheat.Siri;
- import me.devkevin.anticheat.event.player.PlayerAlertEvent;
- import net.minecraft.server.v1_8_R3.PacketPlayInBlockDig;
- import net.minecraft.server.v1_8_R3.PacketPlayInArmAnimation;
- import net.minecraft.server.v1_8_R3.Packet;
- import org.bukkit.entity.Player;
- import me.devkevin.anticheat.data.PlayerData;
- import me.devkevin.anticheat.check.checks.PacketCheck;
- public class AutoClickerJ extends PacketCheck
- {
- private int stage;
- public AutoClickerJ(final Siri plugin, final PlayerData playerData) {
- super(plugin, playerData, "Auto-Clicker (Check 10)");
- }
- @Override
- public void handleCheck(final Player player, final Packet packet) {
- if (this.stage == 0) {
- if (packet instanceof PacketPlayInArmAnimation) {
- ++this.stage;
- }
- }
- else if (packet instanceof PacketPlayInBlockDig) {
- if (this.playerData.getFakeBlocks().contains(((PacketPlayInBlockDig)packet).a())) {
- return;
- }
- double vl = this.getVl();
- final PacketPlayInBlockDig.EnumPlayerDigType digType = ((PacketPlayInBlockDig)packet).c();
- if (digType == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) {
- if (this.stage == 1) {
- ++this.stage;
- }
- else {
- this.stage = 0;
- }
- }
- else if (digType == PacketPlayInBlockDig.EnumPlayerDigType.START_DESTROY_BLOCK) {
- if (this.stage == 2) {
- if ((vl += 1.4) >= 15.0 && this.alert(PlayerAlertEvent.AlertType.RELEASE, player, String.format("VL %.2f.", vl), true) && !this.playerData.isBanning() && !this.playerData.isRandomBan() && vl >= 50.0) {
- this.randomBan(player, 250.0);
- }
- }
- else {
- this.stage = 0;
- vl -= 0.25;
- }
- }
- else {
- this.stage = 0;
- }
- this.setVl(vl);
- }
- else {
- this.stage = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement