Ping on a Spigot Server?

Discussion in 'Plugin Development' started by CandyCranium, Apr 28, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    CandyCranium

    I currently have a code for my ping plugin, but it doesn't seem to work on Spigot servers. I haven't tested on CraftBukkit servers, but I just know for sure that when I try it on a Spigot server, it says internal error.

    Here's the code:
    Code:java
    1.  
    2. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    3. if (!(sender instanceof Player)) {
    4. sender.sendMessage(ChatColor.RED + "The console cannot perform this command!");
    5. return true;
    6. }
    7. if(cmd.getName().equalsIgnoreCase("ping")) {
    8. Player p = (Player) sender;
    9. Integer ping = Integer.valueOf(getPing(p));
    10. p.sendMessage(Main.pre + ChatColor.GOLD + "Your current ping: " + ChatColor.DARK_GRAY + "[" + ChatColor.DARK_AQUA + ping + "ms" + ChatColor.DARK_GRAY + "]");
    11. }
    12. return false;
    13. }
    14.  
    15. public int getPing(Player p) {
    16. CraftPlayer pingc = (CraftPlayer) p;
    17. EntityPlayer pinge = pingc.getHandle();
    18. return pinge.ping;
    19. }
    20.  
     
  2. Offline

    coasterman10

    inb4 lock, the people here HATE when you use anything other than craftbukkit because apparently an API should only have one valid implementation.

    Any stacktraces?
     
  3. Offline

    raGan.

    *staff
     
  4. Offline

    AKS JEFFREY

  5. Offline

    adam753

    nubebuster (and CandyCranium)
    This forum is for CraftBukkit, not unofficial builds of Bukkit. You don't contact apple to tell them your windows phone is broken.
     
  6. Offline

    CandyCranium

  7. Offline

    BillyGalbreath

    Actually, we would help him if the problem wasn't directly caused by using spigot. However, this issue (from the information given) is spawned from the direct use of spigot.

    Solution: Dont use spigot. (Or go to spigot forums and ask there)
     
  8. Offline

    Garris0n

    Go ask on the forums where you got the server jar. And, just a tip, provide the stack trace.
     
    BillyGalbreath likes this.
  9. Offline

    Iroh

    Locked.
    If you need support for craftbukkit feel free to post here, as we do not distribute spigot we do not support it. Make a post on the spigot forums, as it appears you are using their software.
     
    Garris0n and BillyGalbreath like this.
Thread Status:
Not open for further replies.

Share This Page