mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 18:17:38 +01:00
BungeeCord can into server icon
This commit is contained in:
parent
07d9a56567
commit
37dc600fe0
@ -35,4 +35,5 @@ public class ServerPing
|
|||||||
private int online;
|
private int online;
|
||||||
}
|
}
|
||||||
private String description;
|
private String description;
|
||||||
|
private String favicon;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package net.md_5.bungee;
|
package net.md_5.bungee;
|
||||||
|
|
||||||
|
import com.google.common.io.BaseEncoding;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
|
import com.google.common.io.Files;
|
||||||
import net.md_5.bungee.log.BungeeLogger;
|
import net.md_5.bungee.log.BungeeLogger;
|
||||||
import net.md_5.bungee.reconnect.YamlReconnectHandler;
|
import net.md_5.bungee.reconnect.YamlReconnectHandler;
|
||||||
import net.md_5.bungee.scheduler.BungeeScheduler;
|
import net.md_5.bungee.scheduler.BungeeScheduler;
|
||||||
@ -122,6 +124,7 @@ public class BungeeCord extends ProxyServer
|
|||||||
public final Gson gson = new Gson();
|
public final Gson gson = new Gson();
|
||||||
@Getter
|
@Getter
|
||||||
private ConnectionThrottle connectionThrottle;
|
private ConnectionThrottle connectionThrottle;
|
||||||
|
public String favicon;
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -187,6 +190,13 @@ public class BungeeCord extends ProxyServer
|
|||||||
}
|
}
|
||||||
isRunning = true;
|
isRunning = true;
|
||||||
|
|
||||||
|
File fav = new File( "server-icon.png" );
|
||||||
|
if ( fav.exists() )
|
||||||
|
{
|
||||||
|
|
||||||
|
favicon = "data:image/png;base64," + BaseEncoding.base64().encode( Files.toByteArray( fav ) );
|
||||||
|
}
|
||||||
|
|
||||||
pluginManager.loadAndEnablePlugins();
|
pluginManager.loadAndEnablePlugins();
|
||||||
|
|
||||||
connectionThrottle = new ConnectionThrottle( config.getThrottle() );
|
connectionThrottle = new ConnectionThrottle( config.getThrottle() );
|
||||||
|
@ -166,7 +166,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
pingBack.done( new ServerPing(
|
pingBack.done( new ServerPing(
|
||||||
new ServerPing.Protocol( bungee.getGameVersion(), bungee.getProtocolVersion() ),
|
new ServerPing.Protocol( bungee.getGameVersion(), bungee.getProtocolVersion() ),
|
||||||
new ServerPing.Players( listener.getMaxPlayers(), bungee.getOnlineCount() ),
|
new ServerPing.Players( listener.getMaxPlayers(), bungee.getOnlineCount() ),
|
||||||
motd ),
|
motd, BungeeCord.getInstance().favicon ),
|
||||||
null );
|
null );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user