Add a tab list handler to allow plugins to customize the tab list.

This commit is contained in:
md_5 2013-01-12 11:26:26 +11:00
parent 14e196e952
commit 4cef0b2395
11 changed files with 61 additions and 9 deletions

View File

@ -1,5 +1,6 @@
package net.md_5.bungee.api;
import net.md_5.bungee.api.connection.Connection;
import net.md_5.bungee.api.plugin.PluginManager;
import com.google.common.base.Preconditions;
import java.util.Collection;

View File

@ -0,0 +1,47 @@
package net.md_5.bungee.api;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public interface TabListHandler
{
/**
* Called when a player first connects to the proxy.
*
* @param player the connecting player
*/
public void onConnect(ProxiedPlayer player);
/**
* Called when a player changes their connected server.
*
* @param player the player who changed servers
*/
public void onServerChange(ProxiedPlayer player);
/**
* Called when a players ping changes.
*
* @param player the player who's ping changed
* @param ping the player's new ping.
*/
public void onPingChange(ProxiedPlayer player, int ping);
/**
* Called when a player disconnects.
*
* @param player the disconnected player
*/
public void onDisconnect(ProxiedPlayer player);
/**
* Called when a list update packet is sent from server to client.
*
* @param player receiving this packet
* @param name the player which this packet is relevant to
* @param online whether the subject player is online
* @param ping ping of the subject player
* @return whether to send the packet to the client
*/
public boolean onListUpdate(ProxiedPlayer player, String name, boolean online, int ping);
}

View File

@ -1,4 +1,4 @@
package net.md_5.bungee.api;
package net.md_5.bungee.api.connection;
/**
* Represents a player physically connected to the world hosted on this server.

View File

@ -1,4 +1,4 @@
package net.md_5.bungee.api;
package net.md_5.bungee.api.connection;
import java.net.InetSocketAddress;

View File

@ -1,4 +1,4 @@
package net.md_5.bungee.api;
package net.md_5.bungee.api.connection;
/**
* Represents a user attempting to log into the proxy.

View File

@ -1,4 +1,6 @@
package net.md_5.bungee.api;
package net.md_5.bungee.api.connection;
import net.md_5.bungee.api.CommandSender;
/**
* Represents a player who's connection is being connected to somewhere else,

View File

@ -1,7 +1,9 @@
package net.md_5.bungee.api;
package net.md_5.bungee.api.connection;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.md_5.bungee.api.Callback;
import net.md_5.bungee.api.ServerPing;
/**
* Represents a destination which this proxy might connect to.

View File

@ -3,7 +3,7 @@ package net.md_5.bungee.api.event;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import net.md_5.bungee.api.Connection;
import net.md_5.bungee.api.connection.Connection;
import net.md_5.bungee.api.plugin.Cancellable;
/**

View File

@ -1,7 +1,7 @@
package net.md_5.bungee.api.event;
import lombok.Data;
import net.md_5.bungee.api.PendingConnection;
import net.md_5.bungee.api.connection.PendingConnection;
import net.md_5.bungee.api.plugin.Cancellable;
/**

View File

@ -3,7 +3,7 @@ package net.md_5.bungee.api.event;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import net.md_5.bungee.api.Connection;
import net.md_5.bungee.api.connection.Connection;
import net.md_5.bungee.api.plugin.Cancellable;
/**

View File

@ -2,7 +2,7 @@ package net.md_5.bungee.api.event;
import lombok.AllArgsConstructor;
import lombok.Data;
import net.md_5.bungee.api.Connection;
import net.md_5.bungee.api.connection.Connection;
/**
* An event which occurs in the communication between two nodes. It is not