package cloud.swiftnode.kspam.abstraction.checker;

import cloud.swiftnode.kspam.abstraction.Info;
import cloud.swiftnode.kspam.abstraction.SpamChecker;

/**
 * Created by Junhyeong Lim on 2017-01-11.
 */
public class LocalChecker extends SpamChecker {
    public LocalChecker(Info info) {
        super(info);
    }

    @Override
    public Result spamCheck() throws Exception {
        String ip = lastInfo = info.getIp();
        if (ip.contains("192.168.") || ip.contains("127.0.")
                || (info.getPlayer() != null && info.getPlayer().isOp())) {
            return Result.FORCE_PASS;
        }
        return Result.PASS;
    }
}

@@ -145,16 +145,49 @@
 Checker;
+%0Aimport org.bukkit.entity.Player;
 %0A%0A/**%0A *
@@ -452,16 +452,58 @@
 etIp();%0A
+        Player player = info.getPlayer();%0A
         
@@ -578,25 +578,14 @@
  %7C%7C 
-(info.getP
+p
 layer
-()
  != 
@@ -596,31 +596,50 @@
  && 
-info.getP
+(p
 layer
-()
 .isOp()
+ %7C%7C player.hasPlayedBefore()
 )) %7B

Fix LocalChecker