Advertisement
Guest User

sdf

a guest
Jun 20th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. package me.devkevin.anticheat.check.impl.autoclicker;
  2.  
  3. import me.devkevin.anticheat.Siri;
  4. import me.devkevin.anticheat.event.player.PlayerAlertEvent;
  5. import net.minecraft.server.v1_8_R3.PacketPlayInBlockDig;
  6. import net.minecraft.server.v1_8_R3.PacketPlayInArmAnimation;
  7. import net.minecraft.server.v1_8_R3.Packet;
  8. import org.bukkit.entity.Player;
  9. import me.devkevin.anticheat.data.PlayerData;
  10. import me.devkevin.anticheat.check.checks.PacketCheck;
  11.  
  12. public class AutoClickerJ extends PacketCheck
  13. {
  14. private int stage;
  15.  
  16. public AutoClickerJ(final Siri plugin, final PlayerData playerData) {
  17. super(plugin, playerData, "Auto-Clicker (Check 10)");
  18. }
  19.  
  20. @Override
  21. public void handleCheck(final Player player, final Packet packet) {
  22. if (this.stage == 0) {
  23. if (packet instanceof PacketPlayInArmAnimation) {
  24. ++this.stage;
  25. }
  26. }
  27. else if (packet instanceof PacketPlayInBlockDig) {
  28. if (this.playerData.getFakeBlocks().contains(((PacketPlayInBlockDig)packet).a())) {
  29. return;
  30. }
  31. double vl = this.getVl();
  32. final PacketPlayInBlockDig.EnumPlayerDigType digType = ((PacketPlayInBlockDig)packet).c();
  33. if (digType == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) {
  34. if (this.stage == 1) {
  35. ++this.stage;
  36. }
  37. else {
  38. this.stage = 0;
  39. }
  40. }
  41. else if (digType == PacketPlayInBlockDig.EnumPlayerDigType.START_DESTROY_BLOCK) {
  42. if (this.stage == 2) {
  43. 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) {
  44. this.randomBan(player, 250.0);
  45. }
  46. }
  47. else {
  48. this.stage = 0;
  49. vl -= 0.25;
  50. }
  51. }
  52. else {
  53. this.stage = 0;
  54. }
  55. this.setVl(vl);
  56. }
  57. else {
  58. this.stage = 0;
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement