2010-12-21 15:32:27 +00:00
|
|
|
package org.bukkit;
|
|
|
|
|
2012-01-30 21:32:48 +01:00
|
|
|
import java.io.File;
|
2011-07-23 23:18:58 -04:00
|
|
|
import java.util.Iterator;
|
2011-01-07 10:00:00 +00:00
|
|
|
import java.util.List;
|
2011-06-17 04:07:17 +01:00
|
|
|
import java.util.Map;
|
2011-09-03 01:59:08 +01:00
|
|
|
import java.util.Set;
|
2011-07-13 00:15:47 -04:00
|
|
|
import java.util.UUID;
|
2011-02-20 02:24:47 +00:00
|
|
|
import java.util.logging.Logger;
|
2011-09-25 02:56:40 +01:00
|
|
|
|
|
|
|
import org.bukkit.command.CommandException;
|
2011-03-12 17:57:22 +00:00
|
|
|
import org.bukkit.command.CommandSender;
|
2011-09-24 23:11:01 +01:00
|
|
|
import org.bukkit.command.ConsoleCommandSender;
|
2012-01-30 21:32:48 +01:00
|
|
|
import org.bukkit.command.PluginCommand;
|
|
|
|
import org.bukkit.entity.Player;
|
2012-02-29 13:32:33 -05:00
|
|
|
import org.bukkit.event.inventory.InventoryType;
|
2012-03-01 00:07:05 -05:00
|
|
|
import org.bukkit.help.HelpMap;
|
2012-02-29 13:32:33 -05:00
|
|
|
import org.bukkit.inventory.Inventory;
|
|
|
|
import org.bukkit.inventory.InventoryHolder;
|
2011-07-23 23:18:58 -04:00
|
|
|
import org.bukkit.inventory.ItemStack;
|
2012-01-30 21:32:48 +01:00
|
|
|
import org.bukkit.inventory.Recipe;
|
2011-08-12 21:59:10 -04:00
|
|
|
import org.bukkit.map.MapView;
|
2010-12-24 16:41:51 +00:00
|
|
|
import org.bukkit.plugin.PluginManager;
|
2011-05-02 11:31:00 -07:00
|
|
|
import org.bukkit.plugin.ServicesManager;
|
2012-01-13 08:51:10 +00:00
|
|
|
import org.bukkit.plugin.messaging.Messenger;
|
|
|
|
import org.bukkit.plugin.messaging.PluginMessageRecipient;
|
2011-02-02 23:51:52 +00:00
|
|
|
import org.bukkit.scheduler.BukkitScheduler;
|
2010-12-24 16:41:51 +00:00
|
|
|
|
2012-01-30 21:32:48 +01:00
|
|
|
import com.avaje.ebean.config.ServerConfig;
|
|
|
|
|
2010-12-21 15:32:27 +00:00
|
|
|
/**
|
|
|
|
* Represents a server implementation
|
|
|
|
*/
|
2012-01-13 08:51:10 +00:00
|
|
|
public interface Server extends PluginMessageRecipient {
|
2011-09-02 22:21:26 +01:00
|
|
|
/**
|
|
|
|
* Used for all administrative messages, such as an operator using a command.
|
2012-01-15 14:37:30 +01:00
|
|
|
* <p />
|
2011-09-02 22:21:26 +01:00
|
|
|
* For use in {@link #broadcast(java.lang.String, java.lang.String)}
|
|
|
|
*/
|
|
|
|
public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for all announcement messages, such as informing users that a player has joined.
|
2012-01-15 14:37:30 +01:00
|
|
|
* <p />
|
2011-09-02 22:21:26 +01:00
|
|
|
* For use in {@link #broadcast(java.lang.String, java.lang.String)}
|
|
|
|
*/
|
|
|
|
public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user";
|
2011-05-14 23:22:54 +02:00
|
|
|
|
2010-12-21 15:32:27 +00:00
|
|
|
/**
|
|
|
|
* 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();
|
2011-12-25 16:02:30 +01:00
|
|
|
|
2011-10-31 04:01:56 +00:00
|
|
|
/**
|
|
|
|
* Gets the Bukkit version that this server is running.
|
2011-12-25 16:02:30 +01:00
|
|
|
*
|
2011-10-31 04:01:56 +00:00
|
|
|
* @return Version of Bukkit
|
|
|
|
*/
|
|
|
|
public String getBukkitVersion();
|
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-03-12 17:57:22 +00:00
|
|
|
/**
|
|
|
|
* Get the game port that the server runs on
|
|
|
|
*
|
2011-08-07 20:24:43 -04:00
|
|
|
* @return The port number of this server
|
2011-03-12 17:57:22 +00:00
|
|
|
*/
|
|
|
|
public int getPort();
|
|
|
|
|
2011-08-15 14:26:42 -04:00
|
|
|
/**
|
|
|
|
* Get the view distance from this server.
|
|
|
|
*
|
|
|
|
* @return The view distance from this server.
|
|
|
|
*/
|
|
|
|
public int getViewDistance();
|
|
|
|
|
2011-03-12 17:57:22 +00:00
|
|
|
/**
|
|
|
|
* Get the IP that this server is bound to or empty string if not specified
|
|
|
|
*
|
|
|
|
* @return The IP string that this server is bound to, otherwise empty string
|
|
|
|
*/
|
|
|
|
public String getIp();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the name of this server
|
|
|
|
*
|
|
|
|
* @return The name of this server
|
|
|
|
*/
|
|
|
|
public String getServerName();
|
|
|
|
|
2011-03-26 01:39:10 -07:00
|
|
|
/**
|
|
|
|
* Get an ID of this server. The ID is a simple generally alphanumeric
|
|
|
|
* ID that can be used for uniquely identifying this server.
|
|
|
|
*
|
|
|
|
* @return The ID of this server
|
|
|
|
*/
|
|
|
|
public String getServerId();
|
2011-12-25 16:02:30 +01:00
|
|
|
|
2011-12-09 18:50:49 +01:00
|
|
|
/**
|
|
|
|
* Gets whether this server allows the End or not.
|
|
|
|
*
|
|
|
|
* @return Whether this server allows the End or not.
|
|
|
|
*/
|
|
|
|
public boolean getAllowEnd();
|
2011-03-26 01:39:10 -07:00
|
|
|
|
2011-08-07 20:24:43 -04:00
|
|
|
/**
|
|
|
|
* Gets whether this server allows the Nether or not.
|
|
|
|
*
|
|
|
|
* @return Whether this server allows the Nether or not.
|
|
|
|
*/
|
|
|
|
public boolean getAllowNether();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets whether this server has a whitelist or not.
|
|
|
|
*
|
|
|
|
* @return Whether this server has a whitelist or not.
|
|
|
|
*/
|
|
|
|
public boolean hasWhitelist();
|
|
|
|
|
2011-09-03 04:37:23 +01:00
|
|
|
/**
|
|
|
|
* Sets the whitelist on or off
|
|
|
|
*
|
|
|
|
* @param value true if whitelist is on, otherwise false
|
|
|
|
*/
|
|
|
|
public void setWhitelist(boolean value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of whitelisted players
|
|
|
|
*
|
|
|
|
* @return Set containing all whitelisted players
|
|
|
|
*/
|
|
|
|
public Set<OfflinePlayer> getWhitelistedPlayers();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reloads the whitelist from disk
|
|
|
|
*/
|
|
|
|
public void reloadWhitelist();
|
|
|
|
|
2011-01-15 13:40:07 -08:00
|
|
|
/**
|
|
|
|
* Broadcast a message to all players.
|
2012-01-15 14:37:30 +01:00
|
|
|
* <p />
|
2011-09-02 22:21:26 +01:00
|
|
|
* This is the same as calling {@link #broadcast(java.lang.String, java.lang.String)} to {@link #BROADCAST_CHANNEL_USERS}
|
|
|
|
*
|
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-05-05 16:52:50 -04:00
|
|
|
/**
|
|
|
|
* Gets the name of the update folder. The update folder is used to safely update
|
|
|
|
* plugins at the right moment on a plugin load.
|
2012-01-15 14:37:30 +01:00
|
|
|
* <p />
|
2011-08-14 05:34:15 +01:00
|
|
|
* The update folder name is relative to the plugins folder.
|
|
|
|
*
|
2011-05-05 16:52:50 -04:00
|
|
|
* @return The name of the update folder
|
|
|
|
*/
|
|
|
|
public String getUpdateFolder();
|
|
|
|
|
2011-08-14 05:34:15 +01:00
|
|
|
/**
|
|
|
|
* Gets the update folder. The update folder is used to safely update
|
|
|
|
* plugins at the right moment on a plugin load.
|
|
|
|
*
|
|
|
|
* @return The name of the update folder
|
|
|
|
*/
|
|
|
|
public File getUpdateFolderFile();
|
|
|
|
|
2012-02-10 10:23:21 -05:00
|
|
|
/**
|
|
|
|
* Gets default ticks per animal spawns value
|
|
|
|
* <p />
|
|
|
|
* <b>Example Usage:</b>
|
|
|
|
* <ul>
|
|
|
|
* <li>A value of 1 will mean the server will attempt to spawn monsters every tick.
|
|
|
|
* <li>A value of 400 will mean the server will attempt to spawn monsters every 400th tick.
|
|
|
|
* <li>A value below 0 will be reset back to Minecraft's default.
|
|
|
|
* </ul>
|
|
|
|
* <p />
|
|
|
|
* <b>Note:</b>
|
|
|
|
* If set to 0, animal spawning will be disabled. We recommend using spawn-animals to control this instead.
|
|
|
|
* <p />
|
|
|
|
* Minecraft default: 400.
|
|
|
|
*
|
|
|
|
* @return The default ticks per animal spawns value
|
|
|
|
*/
|
|
|
|
public int getTicksPerAnimalSpawns();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the default ticks per monster spawns value
|
|
|
|
* <p />
|
|
|
|
* <b>Example Usage:</b>
|
|
|
|
* <ul>
|
|
|
|
* <li>A value of 1 will mean the server will attempt to spawn monsters every tick.
|
|
|
|
* <li>A value of 400 will mean the server will attempt to spawn monsters every 400th tick.
|
|
|
|
* <li>A value below 0 will be reset back to Minecraft's default.
|
|
|
|
* </ul>
|
|
|
|
* <p />
|
|
|
|
* <b>Note:</b>
|
|
|
|
* If set to 0, monsters spawning will be disabled. We recommend using spawn-monsters to control this instead.
|
|
|
|
* <p />
|
|
|
|
* Minecraft default: 1.
|
|
|
|
*
|
|
|
|
* @return The default ticks per monsters spawn value
|
|
|
|
*/
|
|
|
|
public int getTicksPerMonsterSpawns();
|
|
|
|
|
2011-01-03 00:20:09 +00:00
|
|
|
/**
|
|
|
|
* Gets a player object by the given username
|
2012-01-15 14:37:30 +01:00
|
|
|
* <p />
|
2011-01-03 00:20:09 +00:00
|
|
|
* 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-09-03 04:37:23 +01:00
|
|
|
/**
|
|
|
|
* Gets the player with the exact given name, case insensitive
|
|
|
|
*
|
|
|
|
* @param name Exact name of the player to retrieve
|
|
|
|
* @return Player object or null if not found
|
|
|
|
*/
|
|
|
|
public Player getPlayerExact(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
|
2012-01-15 14:37:30 +01:00
|
|
|
* <p />
|
2011-01-07 10:00:00 +00:00
|
|
|
* 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();
|
|
|
|
|
2011-05-02 11:31:00 -07:00
|
|
|
/**
|
|
|
|
* Gets a services manager
|
|
|
|
*
|
|
|
|
* @return Services manager
|
|
|
|
*/
|
|
|
|
public ServicesManager getServicesManager();
|
|
|
|
|
2010-12-27 02:11:52 +00:00
|
|
|
/**
|
|
|
|
* Gets a list of all worlds on this server
|
|
|
|
*
|
2011-02-05 19:24:35 +00:00
|
|
|
* @return A list of worlds
|
2010-12-27 02:11:52 +00:00
|
|
|
*/
|
2011-02-05 19:24:35 +00:00
|
|
|
public List<World> getWorlds();
|
2011-02-06 20:47:39 +00:00
|
|
|
|
2011-09-25 01:04:43 +01:00
|
|
|
/**
|
|
|
|
* Creates or loads a world with the given name using the specified options.
|
|
|
|
* <p>
|
|
|
|
* If the world is already loaded, it will just return the equivalent of
|
|
|
|
* getWorld(creator.name()).
|
|
|
|
*
|
2012-02-26 10:35:17 -05:00
|
|
|
* @param creator The options to use when creating the world.
|
2011-09-25 01:04:43 +01:00
|
|
|
* @return Newly created or loaded world
|
|
|
|
*/
|
|
|
|
public World createWorld(WorldCreator creator);
|
|
|
|
|
2011-12-25 16:02:30 +01:00
|
|
|
/**
|
2011-06-04 06:46:21 +01:00
|
|
|
* Unloads a world with the given name.
|
|
|
|
*
|
|
|
|
* @param name Name of the world to unload
|
|
|
|
* @param save Whether to save the chunks before unloading.
|
|
|
|
* @return Whether the action was Successful
|
|
|
|
*/
|
|
|
|
public boolean unloadWorld(String name, boolean save);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unloads the given world.
|
|
|
|
*
|
|
|
|
* @param world The world to unload
|
|
|
|
* @param save Whether to save the chunks before unloading.
|
|
|
|
* @return Whether the action was Successful
|
|
|
|
*/
|
|
|
|
public boolean unloadWorld(World world, boolean save);
|
|
|
|
|
2011-02-08 11:58:28 +00:00
|
|
|
/**
|
|
|
|
* Gets the world with the given name
|
|
|
|
*
|
|
|
|
* @param name Name of the world to retrieve
|
|
|
|
* @return World with the given name, or null if none exists
|
|
|
|
*/
|
|
|
|
public World getWorld(String name);
|
|
|
|
|
2011-07-05 04:49:03 +01:00
|
|
|
/**
|
|
|
|
* Gets the world from the given Unique ID
|
|
|
|
*
|
|
|
|
* @param uid Unique ID of the world to retrieve.
|
|
|
|
* @return World with the given Unique ID, or null if none exists.
|
|
|
|
*/
|
2011-07-13 00:15:47 -04:00
|
|
|
public World getWorld(UUID uid);
|
2011-10-03 01:25:39 -04:00
|
|
|
|
2011-08-12 21:59:10 -04:00
|
|
|
/**
|
|
|
|
* Gets the map from the given item ID.
|
2011-10-03 01:25:39 -04:00
|
|
|
*
|
2011-08-12 21:59:10 -04:00
|
|
|
* @param id ID of the map to get.
|
|
|
|
* @return The MapView if it exists, or null otherwise.
|
|
|
|
*/
|
|
|
|
public MapView getMap(short id);
|
2011-10-03 01:25:39 -04:00
|
|
|
|
2011-08-12 21:59:10 -04:00
|
|
|
/**
|
|
|
|
* Create a new map with an automatically assigned ID.
|
2011-10-03 01:25:39 -04:00
|
|
|
*
|
2011-08-12 21:59:10 -04:00
|
|
|
* @param world The world the map will belong to.
|
|
|
|
* @return The MapView just created.
|
|
|
|
*/
|
|
|
|
public MapView createMap(World world);
|
2011-07-05 04:49:03 +01:00
|
|
|
|
2011-01-20 03:53:27 +00:00
|
|
|
/**
|
|
|
|
* Reloads the server, refreshing settings and plugin information
|
|
|
|
*/
|
|
|
|
public void reload();
|
2011-02-20 02:24:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the primary logger associated with this server instance
|
|
|
|
*
|
|
|
|
* @return Logger associated with this server
|
|
|
|
*/
|
|
|
|
public Logger getLogger();
|
2011-02-28 00:57:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a {@link PluginCommand} with the given name or alias
|
|
|
|
*
|
|
|
|
* @param name Name of the command to retrieve
|
|
|
|
* @return PluginCommand if found, otherwise null
|
|
|
|
*/
|
|
|
|
public PluginCommand getPluginCommand(String name);
|
2011-02-25 21:32:25 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes loaded players to disk
|
|
|
|
*/
|
|
|
|
public void savePlayers();
|
2011-03-12 17:57:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches a command on the server, and executes it if found.
|
|
|
|
*
|
2011-09-25 02:56:40 +01:00
|
|
|
* @param sender The apparent sender of the command
|
|
|
|
* @param commandLine command + arguments. Example: "test abc 123"
|
|
|
|
* @return returns false if no target is found.
|
2011-03-12 17:57:22 +00:00
|
|
|
* @throws CommandException Thrown when the executor for the given command fails with an unhandled exception
|
|
|
|
*/
|
2011-09-25 02:56:40 +01:00
|
|
|
public boolean dispatchCommand(CommandSender sender, String commandLine) throws CommandException;
|
2011-04-01 16:04:43 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Populates a given {@link ServerConfig} with values attributes to this server
|
|
|
|
*
|
|
|
|
* @param config ServerConfig to populate
|
|
|
|
*/
|
|
|
|
public void configureDbConfig(ServerConfig config);
|
2011-04-16 11:34:31 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a recipe to the crafting manager.
|
2011-12-25 16:02:30 +01:00
|
|
|
*
|
2011-04-16 11:34:31 -04:00
|
|
|
* @param recipe The recipe to add.
|
2011-07-23 23:18:58 -04:00
|
|
|
* @return True if the recipe was added, false if it wasn't for some reason.
|
2011-04-16 11:34:31 -04:00
|
|
|
*/
|
|
|
|
public boolean addRecipe(Recipe recipe);
|
2011-06-17 04:07:17 +01:00
|
|
|
|
2011-07-23 23:18:58 -04:00
|
|
|
/**
|
|
|
|
* Get a list of all recipes for a given item. The stack size is ignored in comparisons.
|
|
|
|
* If the durability is -1, it will match any data value.
|
|
|
|
*
|
|
|
|
* @param result The item whose recipes you want
|
|
|
|
* @return The list of recipes
|
|
|
|
*/
|
|
|
|
public List<Recipe> getRecipesFor(ItemStack result);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get an iterator through the list of crafting recipes.
|
|
|
|
*
|
|
|
|
* @return The iterator.
|
|
|
|
*/
|
|
|
|
public Iterator<Recipe> recipeIterator();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the list of crafting recipes.
|
|
|
|
*/
|
|
|
|
public void clearRecipes();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Resets the list of crafting recipes to the default.
|
|
|
|
*/
|
|
|
|
public void resetRecipes();
|
|
|
|
|
2011-06-17 04:07:17 +01:00
|
|
|
/**
|
|
|
|
* Gets a list of command aliases defined in the server properties.
|
|
|
|
*
|
|
|
|
* @return Map of aliases to command names
|
|
|
|
*/
|
2011-06-22 19:07:07 +01:00
|
|
|
public Map<String, String[]> getCommandAliases();
|
2011-06-17 04:49:21 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the radius, in blocks, around each worlds spawn point to protect
|
|
|
|
*
|
|
|
|
* @return Spawn radius, or 0 if none
|
|
|
|
*/
|
|
|
|
public int getSpawnRadius();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the radius, in blocks, around each worlds spawn point to protect
|
|
|
|
*
|
|
|
|
* @param value New spawn radius, or 0 if none
|
|
|
|
*/
|
|
|
|
public void setSpawnRadius(int value);
|
2011-06-19 06:13:28 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets whether the Server is in online mode or not.
|
|
|
|
*
|
|
|
|
* @return Whether the server is in online mode.
|
|
|
|
*/
|
|
|
|
public boolean getOnlineMode();
|
2011-08-07 20:24:43 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets whether this server allows flying or not.
|
|
|
|
*
|
|
|
|
* @return Whether this server allows flying or not.
|
|
|
|
*/
|
|
|
|
public boolean getAllowFlight();
|
2011-09-02 20:18:10 +01:00
|
|
|
|
2012-01-29 06:33:50 -05:00
|
|
|
/**
|
2012-01-29 13:10:51 -05:00
|
|
|
* Gets whether to use vanilla (false) or exact behaviour (true).
|
2012-01-29 06:33:50 -05:00
|
|
|
*
|
|
|
|
* Vanilla behaviour: check for collisions and move the player if needed.
|
|
|
|
* Exact behaviour: spawn players exactly where they should be.
|
|
|
|
*
|
|
|
|
* @return Whether to use vanilla (false) or exact behaviour (true).
|
|
|
|
*/
|
|
|
|
public boolean useExactLoginLocation();
|
|
|
|
|
2011-09-02 20:18:10 +01:00
|
|
|
/**
|
|
|
|
* Shutdowns the server, stopping everything.
|
|
|
|
*/
|
|
|
|
public void shutdown();
|
2011-09-02 22:21:26 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Broadcasts the specified message to every user with the given permission
|
|
|
|
*
|
|
|
|
* @param message Message to broadcast
|
|
|
|
* @param permission Permission the users must have to receive the broadcast
|
|
|
|
* @return Amount of users who received the message
|
|
|
|
*/
|
|
|
|
public int broadcast(String message, String permission);
|
2011-09-03 00:41:22 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the player by the given name, regardless if they are offline or online.
|
2012-01-15 14:37:30 +01:00
|
|
|
* <p />
|
2011-09-03 00:41:22 +01:00
|
|
|
* This will return an object even if the player does not exist. To this method, all players will exist.
|
|
|
|
*
|
|
|
|
* @param name Name of the player to retrieve
|
|
|
|
* @return OfflinePlayer object
|
|
|
|
*/
|
|
|
|
public OfflinePlayer getOfflinePlayer(String name);
|
2011-09-03 01:59:08 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a set containing all current IPs that are banned
|
|
|
|
*
|
|
|
|
* @return Set containing banned IP addresses
|
|
|
|
*/
|
|
|
|
public Set<String> getIPBans();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Bans the specified address from the server
|
|
|
|
*
|
|
|
|
* @param address IP address to ban
|
|
|
|
*/
|
|
|
|
public void banIP(String address);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unbans the specified address from the server
|
|
|
|
*
|
|
|
|
* @param address IP address to unban
|
|
|
|
*/
|
|
|
|
public void unbanIP(String address);
|
2011-09-03 02:13:37 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a set containing all banned players
|
|
|
|
*
|
|
|
|
* @return Set containing banned players
|
|
|
|
*/
|
|
|
|
public Set<OfflinePlayer> getBannedPlayers();
|
2011-09-09 01:15:37 +01:00
|
|
|
|
2011-09-25 03:27:44 +01:00
|
|
|
/**
|
|
|
|
* Gets a set containing all player operators
|
|
|
|
*
|
|
|
|
* @return Set containing player operators
|
|
|
|
*/
|
|
|
|
public Set<OfflinePlayer> getOperators();
|
|
|
|
|
2011-09-09 01:15:37 +01:00
|
|
|
/**
|
|
|
|
* Gets the default {@link GameMode} for new players
|
|
|
|
*
|
|
|
|
* @return Default game mode
|
|
|
|
*/
|
|
|
|
public GameMode getDefaultGameMode();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the default {@link GameMode} for new players
|
|
|
|
*
|
|
|
|
* @param mode New game mode
|
|
|
|
*/
|
|
|
|
public void setDefaultGameMode(GameMode mode);
|
2011-09-24 23:11:01 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the {@link ConsoleCommandSender} that may be used as an input source
|
|
|
|
* for this server.
|
|
|
|
*
|
|
|
|
* @return The Console CommandSender
|
|
|
|
*/
|
|
|
|
public ConsoleCommandSender getConsoleSender();
|
2011-11-25 03:46:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the folder that contains all of the various {@link World}s.
|
|
|
|
*
|
|
|
|
* @return World container folder
|
|
|
|
*/
|
|
|
|
public File getWorldContainer();
|
2011-12-04 17:56:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets every player that has ever played on this server.
|
|
|
|
*
|
|
|
|
* @return Array containing all players
|
|
|
|
*/
|
|
|
|
public OfflinePlayer[] getOfflinePlayers();
|
2012-01-13 08:51:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the {@link Messenger} responsible for this server.
|
|
|
|
*
|
|
|
|
* @return Messenger responsible for this server.
|
|
|
|
*/
|
|
|
|
public Messenger getMessenger();
|
2012-02-29 13:32:33 -05:00
|
|
|
|
2012-03-01 00:07:05 -05:00
|
|
|
/**
|
|
|
|
* Gets the {@link HelpMap} providing help topics for this server.
|
|
|
|
*
|
|
|
|
* @return The server's HelpMap.
|
|
|
|
*/
|
|
|
|
public HelpMap getHelpMap();
|
|
|
|
|
2012-02-29 13:32:33 -05:00
|
|
|
/**
|
|
|
|
* Creates an empty inventory of the specified type. If the type is {@link InventoryType#CHEST},
|
|
|
|
* the new inventory has a size of 27; otherwise the new inventory has the normal size for
|
|
|
|
* its type.
|
|
|
|
* @param owner The holder of the inventory; can be null if there's no holder.
|
|
|
|
* @param type The type of inventory to create.
|
|
|
|
* @return The new inventory.
|
|
|
|
*/
|
|
|
|
Inventory createInventory(InventoryHolder owner, InventoryType type);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an empty inventory of type {@link InventoryType#CHEST} with the specified size.
|
|
|
|
* @param owner The holder of the inventory; can be null if there's no holder.
|
|
|
|
* @param size The size of inventory to create; must be a multiple of 9.
|
|
|
|
* @return The new inventory.
|
|
|
|
* @throws IllegalArgumentException If the size is not a multiple of 9.
|
|
|
|
*/
|
|
|
|
Inventory createInventory(InventoryHolder owner, int size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an empty inventory of type {@link InventoryType#CHEST} with the specified size and title.
|
|
|
|
* @param owner The holder of the inventory; can be null if there's no holder.
|
|
|
|
* @param size The size of inventory to create; must be a multiple of 9.
|
|
|
|
* @param title The title of the inventory, to be displayed when it is viewed.
|
|
|
|
* @return The new inventory.
|
|
|
|
* @throws IllegalArgumentException If the size is not a multiple of 9.
|
|
|
|
*/
|
|
|
|
Inventory createInventory(InventoryHolder owner, int size, String title);
|
2012-03-01 00:07:05 -05:00
|
|
|
}
|