mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-30 14:13:47 +01:00
Allow setting tab list size per listener see #173
This commit is contained in:
parent
efcf4c6a59
commit
5c1d7e1c5b
@ -24,6 +24,10 @@ public class ListenerInfo
|
||||
* Max amount of slots displayed on the ping page.
|
||||
*/
|
||||
private final int maxPlayers;
|
||||
/**
|
||||
* Number of players to be shown on the tab list.
|
||||
*/
|
||||
private final int tabListSize;
|
||||
/**
|
||||
* Name of the server which users will be taken to by default.
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||
import net.md_5.bungee.api.event.ServerConnectEvent;
|
||||
import net.md_5.bungee.packet.*;
|
||||
|
||||
public class UserConnection extends GenericConnection implements ProxiedPlayer
|
||||
public final class UserConnection extends GenericConnection implements ProxiedPlayer
|
||||
{
|
||||
|
||||
public final Packet2Handshake handshake;
|
||||
@ -119,7 +119,10 @@ public class UserConnection extends GenericConnection implements ProxiedPlayer
|
||||
// Once again, first connection
|
||||
clientEntityId = newServer.loginPacket.entityId;
|
||||
serverEntityId = newServer.loginPacket.entityId;
|
||||
stream.write( newServer.loginPacket );
|
||||
// Set tab list size
|
||||
Packet1Login s = newServer.loginPacket;
|
||||
Packet1Login login = new Packet1Login( s.entityId, s.levelType, s.gameMode, (byte) s.dimension, s.difficulty, s.unused, (byte) pendingConnection.getListener().getTabListSize() );
|
||||
stream.write( login );
|
||||
stream.write( BungeeCord.getInstance().registerChannels() );
|
||||
|
||||
upBridge = new UpstreamBridge();
|
||||
|
@ -181,9 +181,10 @@ public class YamlConfig implements ConfigurationAdapter
|
||||
String defaultServer = get( "default_server", "lobby", val );
|
||||
boolean forceDefault = get( "force_default_server", false, val );
|
||||
String host = get( "host", "0.0.0.0:25577", val );
|
||||
int tabListSize = get( "tab_size", 60, val );
|
||||
InetSocketAddress address = Util.getAddr( host );
|
||||
Map<String, String> forced = get( "forced_hosts", forcedDef, val );
|
||||
ListenerInfo info = new ListenerInfo( address, motd, maxPlayers, defaultServer, forceDefault, forced );
|
||||
ListenerInfo info = new ListenerInfo( address, motd, maxPlayers, tabListSize, defaultServer, forceDefault, forced );
|
||||
ret.add( info );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user