2010-12-21 15:32:27 +00:00
|
|
|
|
|
|
|
package org.bukkit;
|
|
|
|
|
2011-01-15 21:20:59 +00:00
|
|
|
import org.bukkit.entity.Player;
|
2011-01-07 10:00:00 +00:00
|
|
|
import java.util.List;
|
2011-01-16 16:30:34 +01:00
|
|
|
|
2010-12-24 16:41:51 +00:00
|
|
|
import org.bukkit.plugin.PluginManager;
|
2011-02-02 23:51:52 +00:00
|
|
|
import org.bukkit.scheduler.BukkitScheduler;
|
2010-12-24 16:41:51 +00:00
|
|
|
|
2010-12-21 15:32:27 +00:00
|
|
|
/**
|
|
|
|
* Represents a server implementation
|
|
|
|
*/
|
|
|
|
public interface Server {
|
|
|
|
/**
|
|
|
|
* Gets the name of this server implementation
|
|
|
|
*
|
|
|
|
* @return name of this server implementation
|
|
|
|
*/
|
|
|
|
public String getName();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the version string of this server implementation.
|
|
|
|
*
|
|
|
|
* @return version of this server implementation
|
|
|
|
*/
|
|
|
|
public String getVersion();
|
2010-12-22 15:21:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of all currently logged in players
|
|
|
|
*
|
|
|
|
* @return An array of Players that are currently online
|
|
|
|
*/
|
|
|
|
public Player[] getOnlinePlayers();
|
2011-02-02 00:02:08 +01:00
|
|
|
|
2011-02-06 13:40:31 +01:00
|
|
|
/**
|
|
|
|
* Get the maximum amount of players which can login to this server
|
|
|
|
*
|
|
|
|
* @return The amount of players this server allows
|
|
|
|
*/
|
|
|
|
public int getMaxPlayers();
|
|
|
|
|
2011-01-15 13:40:07 -08:00
|
|
|
/**
|
|
|
|
* Broadcast a message to all players.
|
2011-02-02 00:02:08 +01:00
|
|
|
*
|
2011-01-15 13:40:07 -08:00
|
|
|
* @param message the message
|
|
|
|
* @return the number of players
|
|
|
|
*/
|
|
|
|
public int broadcastMessage(String message);
|
2010-12-24 16:41:51 +00:00
|
|
|
|
2011-01-03 00:20:09 +00:00
|
|
|
/**
|
|
|
|
* Gets a player object by the given username
|
|
|
|
*
|
|
|
|
* This method may not return objects for offline players
|
|
|
|
*
|
|
|
|
* @param name Name to look up
|
|
|
|
* @return Player if it was found, otherwise null
|
|
|
|
*/
|
|
|
|
public Player getPlayer(String name);
|
|
|
|
|
2011-01-07 10:00:00 +00:00
|
|
|
/**
|
|
|
|
* Attempts to match any players with the given name, and returns a list
|
|
|
|
* of all possibly matches
|
|
|
|
*
|
|
|
|
* This list is not sorted in any particular order. If an exact match is found,
|
|
|
|
* the returned list will only contain a single result.
|
|
|
|
*
|
|
|
|
* @param name Name to match
|
|
|
|
* @return List of all possible players
|
|
|
|
*/
|
|
|
|
public List<Player> matchPlayer(String name);
|
|
|
|
|
2010-12-24 16:41:51 +00:00
|
|
|
/**
|
|
|
|
* Gets the PluginManager for interfacing with plugins
|
|
|
|
*
|
|
|
|
* @return PluginManager for this Server instance
|
|
|
|
*/
|
|
|
|
public PluginManager getPluginManager();
|
2010-12-27 02:11:52 +00:00
|
|
|
|
2011-02-02 23:51:52 +00:00
|
|
|
/**
|
|
|
|
* Gets the Scheduler for managing scheduled events
|
|
|
|
*
|
|
|
|
* @return Scheduler for this Server instance
|
|
|
|
*/
|
|
|
|
public BukkitScheduler getScheduler();
|
|
|
|
|
2010-12-27 02:11:52 +00:00
|
|
|
/**
|
|
|
|
* Gets a list of all worlds on this server
|
|
|
|
*
|
|
|
|
* @return An array of worlds
|
|
|
|
*/
|
|
|
|
public World[] getWorlds();
|
2011-01-04 16:23:01 +08:00
|
|
|
|
2011-01-20 03:53:27 +00:00
|
|
|
/**
|
|
|
|
* Reloads the server, refreshing settings and plugin information
|
|
|
|
*/
|
|
|
|
public void reload();
|
2010-12-21 15:32:27 +00:00
|
|
|
}
|