server logo
This commit is contained in:
6
pom.xml
6
pom.xml
@@ -51,6 +51,12 @@
|
||||
<artifactId>guava</artifactId>
|
||||
<version>24.1-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Netty -->
|
||||
<dependency>
|
||||
|
||||
@@ -5,12 +5,19 @@
|
||||
package mc.core.netty.packets;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import mc.core.NetStream;
|
||||
import mc.core.NotSupportException;
|
||||
import mc.core.Packet;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Base64;
|
||||
|
||||
import static mc.core.netty.Utils.*;
|
||||
|
||||
@Slf4j
|
||||
public class HandshakeResponsePacket implements Packet {
|
||||
private static final int id = 0;
|
||||
private static String json;
|
||||
@@ -33,6 +40,16 @@ public class HandshakeResponsePacket implements Packet {
|
||||
rootObj.add("players", playersObj);
|
||||
rootObj.add("description", descriptionObj);
|
||||
|
||||
try {
|
||||
rootObj.addProperty("favicon",
|
||||
"data:image/png;base64," +
|
||||
new String(Base64.getEncoder().encode(
|
||||
IOUtils.resourceToByteArray("/icon.png")))
|
||||
);
|
||||
} catch (IOException e) {
|
||||
log.warn("error read icon server", e);
|
||||
}
|
||||
|
||||
json = rootObj.toString();
|
||||
|
||||
size = lengthVarInt(id)
|
||||
|
||||
BIN
src/main/resources/icon.png
Normal file
BIN
src/main/resources/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Reference in New Issue
Block a user