Solved CachedServerIcon

Discussion in 'Plugin Development' started by BajanAmerican, Nov 30, 2013.

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

    BajanAmerican

    So, as you all may know the Bukkit 1.7.2 version Snapshot came out yesterday! As I was exploring it I found a really cool new feature that comes with Minecraft 1.7.2! When you scroll down your server list, there can now be pictures on the left hand side of the server right next to the server name! Now, on the ServerListPingEvent, there is a new method called "setServerIcon". This paticular method takes an argument called a "CachedServerIcon". I know this refers to the picture on the side of the server name, but what actually is a "CachedServerIcon", and how is it utilized? Is it a local .jpg file or is it something other? If anyone could explain this to me, that would be great! Thanks! :)
     
  2. Offline

    Squid_Boss

    Well, I don't know if this helps, but I found that the server icons are called from the folder your server is in (where the server.properties, whitelist, etc files are held), so maybe the "CachedServerIcon" refers to getting the "server-icon.png" from a specific folder?
     
  3. Offline

    xTrollxDudex

    BajanAmerican
    Notice how CachedServerIcon is empty... I think it's just an implementation to generalize the image used for the server icon, as you can get it using loadServerIcon(BufferedImage)
     
  4. Offline

    BajanAmerican

    Squid_Boss xTrollxDudex
    I found out how to utilize the method! You have to load the image and grab the file.
    Code:
    event.setServerIcon(Bukkit.loadServerIcon(new File("server.png")));
    Thanks for your help guys! :D

    *NOTE: The image must be a 64x64 pixel image*
     
  5. Offline

    Squid_Boss

    No problem, and yeah I know about the pixel size! :p
     
  6. Offline

    alexlyn1

    You can use randoms to make it have different icons! Not sure if it will update or if you have to reopen minecraft but still awesome!
     
Thread Status:
Not open for further replies.

Share This Page