Need a quick bit of help.

Discussion in 'Spigot Plugin Development' started by SpaceBob, May 15, 2016.

  1. Hey,

    I am creating an Anti-Cheat plugin and this is my notification class. On line 17, I don't want to specify anything, but it wants me to put something after it? Anyway to get around? Cheers.
    Code (Text):
    package utils;

    import net.minecraft.server.v1_7_R4.EntityPlayer;
    import org.bukkit.Bukkit;
    import org.bukkit.Server;
    import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.scheduler.BukkitScheduler;

    public class Notify
    {
      private static int tps = 0;
     
      public static void broadcastModo(Player p, CheatType cheat)
      {
          for (Player player : )
        {
          Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Bukkit.getPluginManager().getPlugin("DAC"), new Runnable()
          {
            long sec;
            long currentSec;
            int ticks;
            int delay;
           
            public void run()
            {
              this.sec = (System.currentTimeMillis() / 1000L);
              if (this.currentSec == this.sec)
              {
                this.ticks += 1;  
              }
              else
              {
                this.currentSec = this.sec;
                Notify.tps = Notify.tps == 0 ? this.ticks : (Notify.tps + this.ticks) / 2;
                this.ticks = 0;
              }
            }
          }, 0L, 1L);
          int ping = ((CraftPlayer)p1).getHandle().ping;
          if (player.hasPermission("DAC.message")) {
            player.sendMessage("§4[DAC - DETECTION] §e§l " + p1.getName() + " §4failed§e§el " + cheat.getName() + " §c§o(Their Ping:" + ping + ")");
          }
        }
      }
    }
     
     
  2. Are you trying to go through all the online players?
    Code (Text):
    for (Player player : Bukkit.getOnlinePlayers()) {
            //do something
    }