Package com.comphenix.protocol.wrappers.WrappedServerPing

Examples of com.comphenix.protocol.wrappers.WrappedServerPing.CompressedImage


    BukkitInitialization.initializePackage();
  }
 
  @Test
  public void test() throws IOException {
    CompressedImage tux = CompressedImage.fromPng(Resources.getResource("tux.png").openStream());
    byte[] original = tux.getDataCopy();
   
    WrappedServerPing serverPing = new WrappedServerPing();
    serverPing.setMotD("Hello, this is a test.");
    serverPing.setPlayersOnline(5);
    serverPing.setPlayersMaximum(10);
    serverPing.setVersionName("Minecraft 123");
    serverPing.setVersionProtocol(4);
    serverPing.setFavicon(tux);

    assertEquals(5, serverPing.getPlayersOnline());
    assertEquals(10, serverPing.getPlayersMaximum());
    assertEquals("Minecraft 123", serverPing.getVersionName());
    assertEquals(4, serverPing.getVersionProtocol());
   
    assertArrayEquals(original, serverPing.getFavicon().getData());
   
    CompressedImage copy = CompressedImage.fromBase64Png(Base64Coder.encodeLines(tux.getData()));
    assertArrayEquals(copy.getData(), serverPing.getFavicon().getData());
  }
View Full Code Here

TOP

Related Classes of com.comphenix.protocol.wrappers.WrappedServerPing.CompressedImage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.