funkemunky

Untitled

Mar 24th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. package pro.clyde.lancer.check.impl.aimassist;
  2.  
  3. import lombok.val;
  4. import org.bukkit.entity.Player;
  5. import pro.clyde.lancer.LancerPlugin;
  6. import pro.clyde.lancer.data.PlayerData;
  7. import pro.clyde.lancer.util.math.MathUtil;
  8. import pro.clyde.lancer.check.checks.RotationCheck;
  9. import pro.clyde.lancer.update.impl.RotationUpdate;
  10.  
  11. public class AimAssistD extends RotationCheck {
  12. private float suspiciousYaw;
  13.  
  14. public AimAssistD(LancerPlugin plugin, PlayerData playerData) {
  15. super(plugin, playerData, "Aim Assist§7[§cD§7]");
  16. }
  17.  
  18. @Override
  19. public void run(Player player, RotationUpdate update) {
  20. if (System.currentTimeMillis() - this.playerData.getActionManager().getLastAttack() > 10000L) {
  21. return;
  22. }
  23.  
  24. val yawChange = MathUtil.getDistanceBetweenAngles(update.getTo().getYaw(), update.getFrom().getYaw());
  25. if (yawChange > 1.0f && Math.round(yawChange * 10.0f) * 0.1f == yawChange && Math.round(yawChange) != yawChange && yawChange % 1.5f != 0.0f) {
  26. if (yawChange == this.suspiciousYaw && this.onViolation(player, "failed " + name)) {
  27. //this.ban(player, name, 20);
  28. }
  29. this.suspiciousYaw = Math.round(yawChange * 10.0f) * 0.1f;
  30. } else {
  31. this.suspiciousYaw = 0.0f;
  32. }
  33.  
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment