Add support for Minecraft 1.8.x

This commit allows BungeeCord to support Minecraft clients both of versions 1.7.x and of 1.8.x. There should be no breakages to any other support, however following their deprecation and uselessness within 1.8, the Tab list APIs have been removed.

Please report any issues to GitHub and be sure to mention client, server and BungeeCord versions.

When used with an appropriate server jar (such as multi protocol Spigot), this will allow clients of many versions to concurrently be connected to the same set of servers.
This commit is contained in:
Thinkofdeath
2014-08-31 09:24:38 +10:00
parent e99bbff22e
commit 26521cf2ff
38 changed files with 857 additions and 533 deletions

View File

@@ -15,7 +15,6 @@ import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.api.scheduler.TaskScheduler;
import net.md_5.bungee.api.tab.CustomTabList;
public abstract class ProxyServer
{
@@ -260,14 +259,6 @@ public abstract class ProxyServer
*/
public abstract void broadcast(BaseComponent message);
/**
* Gets a new instance of this proxies custom tab list.
*
* @param player the player to generate this list in the context of
* @return a new {@link CustomTabList} instance
*/
public abstract CustomTabList customTabList(ProxiedPlayer player);
/**
* Gets the commands which are disabled and will not be run on this proxy.
*

View File

@@ -3,7 +3,6 @@ package net.md_5.bungee.api.config;
import java.net.InetSocketAddress;
import java.util.Map;
import lombok.Data;
import net.md_5.bungee.api.tab.TabListHandler;
/**
* Class representing the configuration of a server listener. Used for allowing
@@ -49,12 +48,9 @@ public class ListenerInfo
*/
private final Map<String, String> forcedHosts;
/**
* Class used to build tab lists for this player.
*
* @deprecated Future Minecraft versions render this API useless
* The type of tab list to use
*/
@Deprecated
private final Class<? extends TabListHandler> tabList;
private final String tabListType;
/**
* Whether to set the local address when connecting to servers.
*/

View File

@@ -4,7 +4,6 @@ import java.util.Locale;
import net.md_5.bungee.api.Callback;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.tab.TabListHandler;
import java.util.UUID;
/**
@@ -86,25 +85,6 @@ public interface ProxiedPlayer extends Connection, CommandSender
*/
void chat(String message);
/**
* Sets the new tab list for the user. At this stage it is not advisable to
* change after the user has logged in!
*
* @param list the new list
* @deprecated Future Minecraft versions render this API useless
*/
@Deprecated
void setTabList(TabListHandler list);
/**
* Get the current tab list.
*
* @return the tab list in use by this user
* @deprecated Future Minecraft versions render this API useless
*/
@Deprecated
TabListHandler getTabList();
/**
* Get the server which this player will be sent to next time the log in.
*

View File

@@ -1,63 +0,0 @@
package net.md_5.bungee.api.tab;
/**
* Represents a custom tab list, which may have slots manipulated.
*
* @deprecated Future Minecraft versions render this API useless
*/
@Deprecated
public interface CustomTabList extends TabListHandler
{
/**
* Blank out this tab list and update immediately.
*/
void clear();
/**
* Gets the columns in this list.
*
* @return the width of this list
*/
int getColumns();
/**
* Gets the rows in this list.
*
* @return the height of this list
*/
int getRows();
/**
* Get the total size of this list.
*
* @return {@link #getRows()} * {@link #getColumns()}
*/
int getSize();
/**
* Set the text in the specified slot and update immediately.
*
* @param row the row to set
* @param column the column to set
* @param text the text to set
* @return the padded text
*/
String setSlot(int row, int column, String text);
/**
* Set the text in the specified slot.
*
* @param row the row to set
* @param column the column to set
* @param text the text to set
* @param update whether or not to invoke {@link #update()} upon completion
* @return the padded text
*/
String setSlot(int row, int column, String text, boolean update);
/**
* Flush all queued changes to the user.
*/
void update();
}

View File

@@ -1,43 +0,0 @@
package net.md_5.bungee.api.tab;
import lombok.Getter;
import lombok.NoArgsConstructor;
import net.md_5.bungee.api.connection.ProxiedPlayer;
/**
* @deprecated Future Minecraft versions render this API useless
*/
@Deprecated
@NoArgsConstructor
public abstract class TabListAdapter implements TabListHandler
{
@Getter
private ProxiedPlayer player;
@Override
public void init(ProxiedPlayer player)
{
this.player = player;
}
@Override
public void onConnect()
{
}
@Override
public void onDisconnect()
{
}
@Override
public void onServerChange()
{
}
@Override
public void onPingChange(int ping)
{
}
}

View File

@@ -1,53 +0,0 @@
package net.md_5.bungee.api.tab;
import net.md_5.bungee.api.connection.ProxiedPlayer;
/**
* @deprecated Future Minecraft versions render this API useless
*/
@Deprecated
public interface TabListHandler
{
/**
* Called so that this class may set member fields to keep track of its
* internal state. You should not do any packet sending or manipulation of
* the passed player, other than storing it.
*
* @param player the player to be associated with this list
*/
void init(ProxiedPlayer player);
/**
* Called when this player first connects to the proxy.
*/
void onConnect();
/**
* Called when a player first connects to the proxy.
*/
void onServerChange();
/**
* Called when a players ping changes. The new ping will have not updated in
* the player instance until this method returns.
*
* @param ping the player's new ping.
*/
void onPingChange(int ping);
/**
* Called when a player disconnects.
*/
void onDisconnect();
/**
* Called when a list update packet is sent from server to client.
*
* @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
*/
boolean onListUpdate(String name, boolean online, int ping);
}