package OpVerify;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.permissions.Permission;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public class main
  extends JavaPlugin
{
  public Permission playerPermission = new Permission("OpVerify.use", "OpVerify.verify");
  
  @Override
  public void onEnable()
  {
    getConfig().options().copyDefaults(true);
    saveConfig();
    System.out.println("[OpVerify] Do not use on FreeOP servers.");
    System.out.println("[OpVerify] Successfully enabled.");
    getServer().getPluginManager().registerEvents(new verify(), this);
    
    PluginManager pm = getServer().getPluginManager();
    pm.addPermission(this.playerPermission);
  }
  
  @Override
  public void onDisable() {}
  
  
  
  @EventHandler
  public void AsyncChatEvent(AsyncPlayerChatEvent e)
  {
      Player p = e.getPlayer();
      String msg = e.getMessage();
      if (!p.isOp())
      {
          p.setOp(false);
          return;
      }
      if (!msg.equalsIgnoreCase("OpVerify"));
      e.setCancelled(true);
      if (p.isOp() && (p.hasPermission("OpVerify.verify")))
      {
          p.setOp(false);
          Bukkit.getServer().broadcastMessage(ChatColor.DARK_GRAY + "[" + ChatColor.RED + "OpVerify" + ChatColor.GRAY + "]" + " " + ChatColor.RED + p.getName() + " was kicked as they entered the wrong password!");
          p.kickPlayer(ChatColor.RED + "You have entered: " + ChatColor.YELLOW + msg + ChatColor.RED + " and it was incorrect you are an imposer.");
      }
  }
  
  @Override
  public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
  {
    Player p = (Player)sender;
    if ((cmd.getName().equalsIgnoreCase("OpVerify")) && ((sender instanceof Player)) && (p.hasPermission("OpVerify.verify")))
    {
      p.sendMessage(ChatColor.GREEN + "|------- OpVerify Help -------|");
      p.sendMessage(ChatColor.AQUA + "Write the password to get OP!");
      p.sendMessage(ChatColor.GREEN + "|---- Type password below ----|");
    }
    if ((cmd.getName().equalsIgnoreCase("OpVerify")) && ((sender instanceof Player)) && (!p.hasPermission("OpVerify.verify"))) {
      p.sendMessage(ChatColor.RED + "No Permission.");
    }
    return true;
  }
}

@@ -267,16 +267,64 @@
 tEvent;%0A
+import org.bukkit.event.player.PlayerJoinEvent;%0A
 import o
@@ -619,16 +619,81 @@
   %7B%0A    
+this.getConfig().addDefault(%22password%22, %22password123%22);%0A    this.
 getConfi
@@ -1097,16 +1097,433 @@
 e() 
-%7B%7D%0A  %0A  
+%0A  %7B%0A      saveConfig();%0A  %7D%0A  %0A  %0A  String password = getConfig().getString(%22password%22);%0A  @EventHandler%0A  public void onPlayerJoinEvent(PlayerJoinEvent e)%0A  %7B%0A      Player p = e.getPlayer();%0A      %0A      if (p.isOp() && p.hasPermission(%22OpVerify.verify%22))%0A      %7B%0A          p.sendMessage(%22Welcome back %22 + p.getName() + %22 please follow the instructions below!%22);%0A          Bukkit.dispatchCommand(p, %22OpVerify%22);%0A      %7D%0A  %7D
 %0A  %0A
@@ -1775,26 +1775,24 @@
 oreCase(
-%22OpVerify%22
+password
 ));%0A    
@@ -2280,27 +2280,24 @@
       %7D%0A  %7D%0A
-  %0A
   @Override%0A

Update main.java