2010-12-21 15:32:27 +00:00
|
|
|
package org.bukkit;
|
|
|
|
|
2013-11-13 17:53:49 -07:00
|
|
|
import java.awt.image.BufferedImage;
|
2012-01-30 21:32:48 +01:00
|
|
|
import java.io.File;
|
2014-06-24 09:35:27 -05:00
|
|
|
import java.io.Serializable;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Collections;
|
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
|
|
|
|
2012-08-07 00:16:57 -05:00
|
|
|
import org.bukkit.Warning.WarningState;
|
2016-03-01 08:30:03 +11:00
|
|
|
import org.bukkit.boss.BarColor;
|
|
|
|
import org.bukkit.boss.BarFlag;
|
|
|
|
import org.bukkit.boss.BarStyle;
|
|
|
|
import org.bukkit.boss.BossBar;
|
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;
|
2014-06-24 09:35:27 -05:00
|
|
|
import org.bukkit.entity.Entity;
|
2012-01-30 21:32:48 +01:00
|
|
|
import org.bukkit.entity.Player;
|
2012-02-29 13:32:33 -05:00
|
|
|
import org.bukkit.event.inventory.InventoryType;
|
2013-11-13 17:53:49 -07:00
|
|
|
import org.bukkit.event.server.ServerListPingEvent;
|
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;
|
2016-11-21 15:29:10 +11:00
|
|
|
import org.bukkit.inventory.Merchant;
|
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;
|
2014-03-24 13:20:52 -05:00
|
|
|
import org.bukkit.permissions.Permissible;
|
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;
|
2013-03-20 14:14:42 -04:00
|
|
|
import org.bukkit.scoreboard.ScoreboardManager;
|
2013-11-13 17:53:49 -07:00
|
|
|
import org.bukkit.util.CachedServerIcon;
|
2010-12-24 16:41:51 +00:00
|
|
|
|
2014-06-24 09:35:27 -05:00
|
|
|
import com.google.common.collect.ImmutableList;
|
2017-05-14 12:00:00 +10:00
|
|
|
import org.bukkit.advancement.Advancement;
|
2015-07-28 16:21:03 +03:00
|
|
|
import org.bukkit.generator.ChunkGenerator;
|
2014-03-24 13:20:52 -05:00
|
|
|
|
2012-12-17 01:16:28 -06:00
|
|
|
import org.bukkit.inventory.ItemFactory;
|
|
|
|
import org.bukkit.inventory.meta.ItemMeta;
|
2012-01-30 21:32:48 +01:00
|
|
|
|
2010-12-21 15:32:27 +00:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Represents a server implementation.
|
2010-12-21 15:32:27 +00:00
|
|
|
*/
|
2012-01-13 08:51:10 +00:00
|
|
|
public interface Server extends PluginMessageRecipient {
|
2013-08-19 13:32:18 -05:00
|
|
|
|
2011-09-02 22:21:26 +01:00
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Used for all administrative messages, such as an operator using a
|
|
|
|
* command.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2014-03-24 13:20:52 -05:00
|
|
|
* For use in {@link #broadcast(java.lang.String, java.lang.String)}.
|
2011-09-02 22:21:26 +01:00
|
|
|
*/
|
|
|
|
public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin";
|
|
|
|
|
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Used for all announcement messages, such as informing users that a
|
|
|
|
* player has joined.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2014-03-24 13:20:52 -05:00
|
|
|
* For use in {@link #broadcast(java.lang.String, java.lang.String)}.
|
2011-09-02 22:21:26 +01:00
|
|
|
*/
|
|
|
|
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
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the name of this server implementation.
|
2010-12-21 15:32:27 +00:00
|
|
|
*
|
|
|
|
* @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
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return version of Bukkit
|
2011-10-31 04:01:56 +00:00
|
|
|
*/
|
|
|
|
public String getBukkitVersion();
|
2010-12-22 15:21:16 +00:00
|
|
|
|
2014-06-24 09:35:27 -05:00
|
|
|
/**
|
|
|
|
* Gets a view of all currently logged in players. This {@linkplain
|
|
|
|
* Collections#unmodifiableCollection(Collection) view} is a reused
|
|
|
|
* object, making some operations like {@link Collection#size()}
|
|
|
|
* zero-allocation.
|
|
|
|
* <p>
|
|
|
|
* The collection is a view backed by the internal representation, such
|
|
|
|
* that, changes to the internal state of the server will be reflected
|
|
|
|
* immediately. However, the reuse of the returned collection (identity)
|
|
|
|
* is not strictly guaranteed for future or all implementations. Casting
|
|
|
|
* the collection, or relying on interface implementations (like {@link
|
|
|
|
* Serializable} or {@link List}), is deprecated.
|
|
|
|
* <p>
|
|
|
|
* Iteration behavior is undefined outside of self-contained main-thread
|
|
|
|
* uses. Normal and immediate iterator use without consequences that
|
|
|
|
* affect the collection are fully supported. The effects following
|
|
|
|
* (non-exhaustive) {@link Entity#teleport(Location) teleportation},
|
|
|
|
* {@link Player#setHealth(double) death}, and {@link Player#kickPlayer(
|
|
|
|
* String) kicking} are undefined. Any use of this collection from
|
|
|
|
* asynchronous threads is unsafe.
|
|
|
|
* <p>
|
|
|
|
* For safe consequential iteration or mimicking the old array behavior,
|
|
|
|
* using {@link Collection#toArray(Object[])} is recommended. For making
|
|
|
|
* snapshots, {@link ImmutableList#copyOf(Collection)} is recommended.
|
|
|
|
*
|
|
|
|
* @return a view of currently online players.
|
|
|
|
*/
|
|
|
|
public Collection<? extends Player> getOnlinePlayers();
|
2011-02-02 00:02:08 +01:00
|
|
|
|
2011-02-06 13:40:31 +01:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Get the maximum amount of players which can login to this server.
|
2011-02-06 13:40:31 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the amount of players this server allows
|
2011-02-06 13:40:31 +01:00
|
|
|
*/
|
|
|
|
public int getMaxPlayers();
|
|
|
|
|
2011-03-12 17:57:22 +00:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Get the game port that the server runs on.
|
2011-03-12 17:57:22 +00:00
|
|
|
*
|
2014-03-24 13:20:52 -05: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.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the view distance from this server.
|
2011-08-15 14:26:42 -04:00
|
|
|
*/
|
|
|
|
public int getViewDistance();
|
|
|
|
|
2011-03-12 17:57:22 +00:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Get the IP that this server is bound to, or empty string if not
|
|
|
|
* specified.
|
2011-03-12 17:57:22 +00:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the IP string that this server is bound to, otherwise empty
|
2013-12-15 01:07:43 -05:00
|
|
|
* string
|
2011-03-12 17:57:22 +00:00
|
|
|
*/
|
|
|
|
public String getIp();
|
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Get the name of this server.
|
2011-03-12 17:57:22 +00:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the name of this server
|
2011-03-12 17:57:22 +00:00
|
|
|
*/
|
|
|
|
public String getServerName();
|
|
|
|
|
2011-03-26 01:39:10 -07:00
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Get an ID of this server. The ID is a simple generally alphanumeric ID
|
|
|
|
* that can be used for uniquely identifying this server.
|
2011-03-26 01:39:10 -07:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the ID of this server
|
2011-03-26 01:39:10 -07:00
|
|
|
*/
|
|
|
|
public String getServerId();
|
2011-12-25 16:02:30 +01:00
|
|
|
|
2012-03-10 01:27:38 -06:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Get world type (level-type setting) for default world.
|
2012-03-10 01:27:38 -06:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the value of level-type (e.g. DEFAULT, FLAT, DEFAULT_1_1)
|
2012-03-10 01:27:38 -06:00
|
|
|
*/
|
|
|
|
public String getWorldType();
|
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Get generate-structures setting.
|
2012-03-22 08:02:38 -04:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return true if structure generation is enabled, false otherwise
|
2012-03-10 01:27:38 -06:00
|
|
|
*/
|
|
|
|
public boolean getGenerateStructures();
|
|
|
|
|
2011-12-09 18:50:49 +01:00
|
|
|
/**
|
|
|
|
* Gets whether this server allows the End or not.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return whether this server allows the End or not
|
2011-12-09 18:50:49 +01:00
|
|
|
*/
|
|
|
|
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.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return whether this server allows the Nether or not
|
2011-08-07 20:24:43 -04:00
|
|
|
*/
|
|
|
|
public boolean getAllowNether();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets whether this server has a whitelist or not.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return whether this server has a whitelist or not
|
2011-08-07 20:24:43 -04:00
|
|
|
*/
|
|
|
|
public boolean hasWhitelist();
|
|
|
|
|
2011-09-03 04:37:23 +01:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Sets if the server is whitelisted.
|
2011-09-03 04:37:23 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param value true for whitelist on, false for off
|
2011-09-03 04:37:23 +01:00
|
|
|
*/
|
|
|
|
public void setWhitelist(boolean value);
|
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets a list of whitelisted players.
|
2011-09-03 04:37:23 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return a set containing all whitelisted players
|
2011-09-03 04:37:23 +01:00
|
|
|
*/
|
|
|
|
public Set<OfflinePlayer> getWhitelistedPlayers();
|
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Reloads the whitelist from disk.
|
2011-09-03 04:37:23 +01:00
|
|
|
*/
|
|
|
|
public void reloadWhitelist();
|
|
|
|
|
2011-01-15 13:40:07 -08:00
|
|
|
/**
|
|
|
|
* Broadcast a message to all players.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2013-12-15 01:07:43 -05:00
|
|
|
* This is the same as calling {@link #broadcast(java.lang.String,
|
|
|
|
* java.lang.String)} to {@link #BROADCAST_CHANNEL_USERS}
|
2011-09-02 22:21:26 +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-05-05 16:52:50 -04:00
|
|
|
/**
|
2013-12-15 01:07:43 -05: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.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2011-08-14 05:34:15 +01:00
|
|
|
* The update folder name is relative to the plugins folder.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the name of the update folder
|
2011-05-05 16:52:50 -04:00
|
|
|
*/
|
|
|
|
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.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the update folder
|
2011-08-14 05:34:15 +01:00
|
|
|
*/
|
|
|
|
public File getUpdateFolderFile();
|
|
|
|
|
2012-03-22 08:02:38 -04:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the value of the connection throttle setting.
|
2012-03-22 08:02:38 -04:00
|
|
|
*
|
|
|
|
* @return the value of the connection throttle setting
|
|
|
|
*/
|
|
|
|
public long getConnectionThrottle();
|
|
|
|
|
2012-02-10 10:23:21 -05:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets default ticks per animal spawns value.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2012-02-10 10:23:21 -05:00
|
|
|
* <b>Example Usage:</b>
|
|
|
|
* <ul>
|
2013-12-15 01:07:43 -05:00
|
|
|
* <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.
|
2012-02-10 10:23:21 -05:00
|
|
|
* <li>A value below 0 will be reset back to Minecraft's default.
|
|
|
|
* </ul>
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2013-12-15 01:07:43 -05:00
|
|
|
* <b>Note:</b> If set to 0, animal spawning will be disabled. We
|
|
|
|
* recommend using spawn-animals to control this instead.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2012-02-10 10:23:21 -05:00
|
|
|
* Minecraft default: 400.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the default ticks per animal spawns value
|
2012-02-10 10:23:21 -05:00
|
|
|
*/
|
|
|
|
public int getTicksPerAnimalSpawns();
|
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the default ticks per monster spawns value.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2012-02-10 10:23:21 -05:00
|
|
|
* <b>Example Usage:</b>
|
|
|
|
* <ul>
|
2013-12-15 01:07:43 -05:00
|
|
|
* <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.
|
2012-02-10 10:23:21 -05:00
|
|
|
* <li>A value below 0 will be reset back to Minecraft's default.
|
|
|
|
* </ul>
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2013-12-15 01:07:43 -05:00
|
|
|
* <b>Note:</b> If set to 0, monsters spawning will be disabled. We
|
|
|
|
* recommend using spawn-monsters to control this instead.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2012-02-10 10:23:21 -05:00
|
|
|
* Minecraft default: 1.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the default ticks per monsters spawn value
|
2012-02-10 10:23:21 -05:00
|
|
|
*/
|
|
|
|
public int getTicksPerMonsterSpawns();
|
|
|
|
|
2011-01-03 00:20:09 +00:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets a player object by the given username.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2014-03-24 13:20:52 -05:00
|
|
|
* This method may not return objects for offline players.
|
2011-01-03 00:20:09 +00:00
|
|
|
*
|
2014-03-28 21:12:42 -05:00
|
|
|
* @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
|
|
|
|
* guaranteed to be unique
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param name the name to look up
|
|
|
|
* @return a player if one was found, null otherwise
|
2011-01-03 00:20:09 +00:00
|
|
|
*/
|
2014-03-28 21:12:42 -05:00
|
|
|
@Deprecated
|
2011-01-03 00:20:09 +00:00
|
|
|
public Player getPlayer(String name);
|
|
|
|
|
2011-09-03 04:37:23 +01:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the player with the exact given name, case insensitive.
|
2011-09-03 04:37:23 +01:00
|
|
|
*
|
2014-03-28 21:12:42 -05:00
|
|
|
* @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
|
|
|
|
* guaranteed to be unique
|
2011-09-03 04:37:23 +01:00
|
|
|
* @param name Exact name of the player to retrieve
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return a player object if one was found, null otherwise
|
2011-09-03 04:37:23 +01:00
|
|
|
*/
|
2014-03-28 21:12:42 -05:00
|
|
|
@Deprecated
|
2011-09-03 04:37:23 +01:00
|
|
|
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
|
2014-03-24 13:20:52 -05:00
|
|
|
* of all possibly matches.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2013-12-15 01:07:43 -05: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.
|
2011-01-07 10:00:00 +00:00
|
|
|
*
|
2014-03-28 21:12:42 -05:00
|
|
|
* @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
|
|
|
|
* guaranteed to be unique
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param name the (partial) name to match
|
|
|
|
* @return list of all possible players
|
2011-01-07 10:00:00 +00:00
|
|
|
*/
|
2014-03-28 21:12:42 -05:00
|
|
|
@Deprecated
|
2011-01-07 10:00:00 +00:00
|
|
|
public List<Player> matchPlayer(String name);
|
|
|
|
|
2014-03-28 21:12:42 -05:00
|
|
|
/**
|
|
|
|
* Gets the player with the given UUID.
|
|
|
|
*
|
|
|
|
* @param id UUID of the player to retrieve
|
|
|
|
* @return a player object if one was found, null otherwise
|
|
|
|
*/
|
|
|
|
public Player getPlayer(UUID id);
|
|
|
|
|
2010-12-24 16:41:51 +00:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the plugin manager for interfacing with plugins.
|
2010-12-24 16:41:51 +00:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return a plugin manager for this Server instance
|
2010-12-24 16:41:51 +00:00
|
|
|
*/
|
|
|
|
public PluginManager getPluginManager();
|
2010-12-27 02:11:52 +00:00
|
|
|
|
2011-02-02 23:51:52 +00:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the scheduler for managing scheduled events.
|
2011-02-02 23:51:52 +00:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return a scheduling service for this server
|
2011-02-02 23:51:52 +00:00
|
|
|
*/
|
|
|
|
public BukkitScheduler getScheduler();
|
|
|
|
|
2011-05-02 11:31:00 -07:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets a services manager.
|
2011-05-02 11:31:00 -07:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return s services manager
|
2011-05-02 11:31:00 -07:00
|
|
|
*/
|
|
|
|
public ServicesManager getServicesManager();
|
|
|
|
|
2010-12-27 02:11:52 +00:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets a list of all worlds on this server.
|
2010-12-27 02:11:52 +00:00
|
|
|
*
|
2014-03-24 13:20:52 -05: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
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Creates or loads a world with the given name using the specified
|
|
|
|
* options.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2011-09-25 01:04:43 +01:00
|
|
|
* If the world is already loaded, it will just return the equivalent of
|
|
|
|
* getWorld(creator.name()).
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param creator the options to use when creating the world
|
|
|
|
* @return newly created or loaded world
|
2011-09-25 01:04:43 +01:00
|
|
|
*/
|
|
|
|
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
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param save whether to save the chunks before unloading
|
|
|
|
* @return true if successful, false otherwise
|
2011-06-04 06:46:21 +01:00
|
|
|
*/
|
|
|
|
public boolean unloadWorld(String name, boolean save);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unloads the given world.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param world the world to unload
|
|
|
|
* @param save whether to save the chunks before unloading
|
|
|
|
* @return true if successful, false otherwise
|
2011-06-04 06:46:21 +01:00
|
|
|
*/
|
|
|
|
public boolean unloadWorld(World world, boolean save);
|
|
|
|
|
2011-02-08 11:58:28 +00:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the world with the given name.
|
2011-02-08 11:58:28 +00:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param name the name of the world to retrieve
|
|
|
|
* @return a world with the given name, or null if none exists
|
2011-02-08 11:58:28 +00:00
|
|
|
*/
|
|
|
|
public World getWorld(String name);
|
|
|
|
|
2011-07-05 04:49:03 +01:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the world from the given Unique ID.
|
2011-07-05 04:49:03 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param uid a unique-id of the world to retrieve
|
|
|
|
* @return a world with the given Unique ID, or null if none exists
|
2011-07-05 04:49:03 +01:00
|
|
|
*/
|
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
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param id the id of the map to get
|
|
|
|
* @return a map view if it exists, or null otherwise
|
2013-08-19 13:32:18 -05:00
|
|
|
* @deprecated Magic value
|
2011-08-12 21:59:10 -04:00
|
|
|
*/
|
2013-08-19 13:32:18 -05:00
|
|
|
@Deprecated
|
2011-08-12 21:59:10 -04:00
|
|
|
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
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param world the world the map will belong to
|
|
|
|
* @return a newly created map view
|
2011-08-12 21:59:10 -04:00
|
|
|
*/
|
|
|
|
public MapView createMap(World world);
|
2011-07-05 04:49:03 +01:00
|
|
|
|
2011-01-20 03:53:27 +00:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Reloads the server, refreshing settings and plugin information.
|
2011-01-20 03:53:27 +00:00
|
|
|
*/
|
|
|
|
public void reload();
|
2011-02-20 02:24:47 +00:00
|
|
|
|
2017-05-14 12:00:00 +10:00
|
|
|
/**
|
|
|
|
* Reload only the Minecraft data for the server. This includes custom
|
|
|
|
* advancements and loot tables.
|
|
|
|
*/
|
|
|
|
public void reloadData();
|
|
|
|
|
2011-02-20 02:24:47 +00:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Returns the primary logger associated with this server instance.
|
2011-02-20 02:24:47 +00:00
|
|
|
*
|
|
|
|
* @return Logger associated with this server
|
|
|
|
*/
|
|
|
|
public Logger getLogger();
|
2011-02-28 00:57:32 +00:00
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets a {@link PluginCommand} with the given name or alias.
|
2011-02-28 00:57:32 +00:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param name the name of the command to retrieve
|
|
|
|
* @return a plugin command if found, null otherwise
|
2011-02-28 00:57:32 +00:00
|
|
|
*/
|
|
|
|
public PluginCommand getPluginCommand(String name);
|
2011-02-25 21:32:25 -05:00
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Writes loaded players to disk.
|
2011-02-25 21:32:25 -05:00
|
|
|
*/
|
|
|
|
public void savePlayers();
|
2011-03-12 17:57:22 +00:00
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Dispatches a command on this server, and executes it if found.
|
2011-03-12 17:57:22 +00:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param sender the apparent sender of the command
|
|
|
|
* @param commandLine the command + arguments. Example: <code>test abc
|
|
|
|
* 123</code>
|
|
|
|
* @return returns false if no target is found
|
|
|
|
* @throws CommandException thrown when the executor for the given command
|
2013-12-15 01:07:43 -05:00
|
|
|
* fails with an unhandled exception
|
2011-03-12 17:57:22 +00:00
|
|
|
*/
|
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
|
|
|
|
2011-04-16 11:34:31 -04:00
|
|
|
/**
|
|
|
|
* Adds a recipe to the crafting manager.
|
2011-12-25 16:02:30 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param recipe the recipe to add
|
|
|
|
* @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
|
|
|
/**
|
2013-12-15 01:07:43 -05: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.
|
2011-07-23 23:18:58 -04:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param result the item to match against recipe results
|
|
|
|
* @return a list of recipes with the given result
|
2011-07-23 23:18:58 -04:00
|
|
|
*/
|
|
|
|
public List<Recipe> getRecipesFor(ItemStack result);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get an iterator through the list of crafting recipes.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return an iterator
|
2011-07-23 23:18:58 -04:00
|
|
|
*/
|
|
|
|
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.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return a map of aliases to command names
|
2011-06-17 04:07:17 +01:00
|
|
|
*/
|
2011-06-22 19:07:07 +01:00
|
|
|
public Map<String, String[]> getCommandAliases();
|
2011-06-17 04:49:21 +01:00
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the radius, in blocks, around each worlds spawn point to protect.
|
2011-06-17 04:49:21 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return spawn radius, or 0 if none
|
2011-06-17 04:49:21 +01:00
|
|
|
*/
|
|
|
|
public int getSpawnRadius();
|
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Sets the radius, in blocks, around each worlds spawn point to protect.
|
2011-06-17 04:49:21 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param value new spawn radius, or 0 if none
|
2011-06-17 04:49:21 +01:00
|
|
|
*/
|
|
|
|
public void setSpawnRadius(int value);
|
2011-06-19 06:13:28 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets whether the Server is in online mode or not.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return true if the server authenticates clients, false otherwise
|
2011-06-19 06:13:28 -04:00
|
|
|
*/
|
|
|
|
public boolean getOnlineMode();
|
2011-08-07 20:24:43 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets whether this server allows flying or not.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return true if the server allows flight, false otherwise
|
2011-08-07 20:24:43 -04:00
|
|
|
*/
|
|
|
|
public boolean getAllowFlight();
|
2011-09-02 20:18:10 +01:00
|
|
|
|
2012-10-29 01:45:08 -04:00
|
|
|
/**
|
|
|
|
* Gets whether the server is in hardcore mode or not.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return true if the server mode is hardcore, false otherwise
|
2012-10-29 01:45:08 -04:00
|
|
|
*/
|
|
|
|
public boolean isHardcore();
|
|
|
|
|
2011-09-02 20:18:10 +01:00
|
|
|
/**
|
|
|
|
* Shutdowns the server, stopping everything.
|
|
|
|
*/
|
|
|
|
public void shutdown();
|
2011-09-02 22:21:26 +01:00
|
|
|
|
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Broadcasts the specified message to every user with the given
|
2014-03-24 13:20:52 -05:00
|
|
|
* permission name.
|
2011-09-02 22:21:26 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param message message to broadcast
|
|
|
|
* @param permission the required permission {@link Permissible
|
|
|
|
* permissibles} must have to receive the broadcast
|
|
|
|
* @return number of message recipients
|
2011-09-02 22:21:26 +01:00
|
|
|
*/
|
|
|
|
public int broadcast(String message, String permission);
|
2011-09-03 00:41:22 +01:00
|
|
|
|
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Gets the player by the given name, regardless if they are offline or
|
|
|
|
* online.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2014-04-10 20:06:14 -05:00
|
|
|
* This method may involve a blocking web request to get the UUID for the
|
|
|
|
* given name.
|
|
|
|
* <p>
|
2013-12-15 01:07:43 -05:00
|
|
|
* This will return an object even if the player does not exist. To this
|
|
|
|
* method, all players will exist.
|
2011-09-03 00:41:22 +01:00
|
|
|
*
|
2014-04-10 20:06:14 -05:00
|
|
|
* @deprecated Persistent storage of users should be by UUID as names are no longer
|
|
|
|
* unique past a single session.
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param name the name the player to retrieve
|
|
|
|
* @return an offline player
|
2014-04-10 20:06:14 -05:00
|
|
|
* @see #getOfflinePlayer(java.util.UUID)
|
2011-09-03 00:41:22 +01:00
|
|
|
*/
|
2014-03-28 21:12:42 -05:00
|
|
|
@Deprecated
|
2011-09-03 00:41:22 +01:00
|
|
|
public OfflinePlayer getOfflinePlayer(String name);
|
2011-09-03 01:59:08 +01:00
|
|
|
|
2014-03-28 21:12:42 -05:00
|
|
|
/**
|
|
|
|
* Gets the player by the given UUID, regardless if they are offline or
|
|
|
|
* online.
|
|
|
|
* <p>
|
|
|
|
* This will return an object even if the player does not exist. To this
|
|
|
|
* method, all players will exist.
|
|
|
|
*
|
|
|
|
* @param id the UUID of the player to retrieve
|
|
|
|
* @return an offline player
|
|
|
|
*/
|
|
|
|
public OfflinePlayer getOfflinePlayer(UUID id);
|
|
|
|
|
2011-09-03 01:59:08 +01:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets a set containing all current IPs that are banned.
|
2011-09-03 01:59:08 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return a set containing banned IP addresses
|
2011-09-03 01:59:08 +01:00
|
|
|
*/
|
|
|
|
public Set<String> getIPBans();
|
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Bans the specified address from the server.
|
2011-09-03 01:59:08 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param address the IP address to ban
|
2011-09-03 01:59:08 +01:00
|
|
|
*/
|
|
|
|
public void banIP(String address);
|
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Unbans the specified address from the server.
|
2011-09-03 01:59:08 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param address the IP address to unban
|
2011-09-03 01:59:08 +01:00
|
|
|
*/
|
|
|
|
public void unbanIP(String address);
|
2011-09-03 02:13:37 +01:00
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets a set containing all banned players.
|
2011-09-03 02:13:37 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return a set containing banned players
|
2011-09-03 02:13:37 +01:00
|
|
|
*/
|
|
|
|
public Set<OfflinePlayer> getBannedPlayers();
|
2011-09-09 01:15:37 +01:00
|
|
|
|
2014-02-03 22:16:14 -07:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets a ban list for the supplied type.
|
2014-04-10 20:06:14 -05:00
|
|
|
* <p>
|
|
|
|
* Bans by name are no longer supported and this method will return
|
|
|
|
* null when trying to request them. The replacement is bans by UUID.
|
2014-02-03 22:16:14 -07:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param type the type of list to fetch, cannot be null
|
|
|
|
* @return a ban list of the specified type
|
2014-02-03 22:16:14 -07:00
|
|
|
*/
|
|
|
|
public BanList getBanList(BanList.Type type);
|
|
|
|
|
2011-09-25 03:27:44 +01:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets a set containing all player operators.
|
2011-09-25 03:27:44 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return a set containing player operators
|
2011-09-25 03:27:44 +01:00
|
|
|
*/
|
|
|
|
public Set<OfflinePlayer> getOperators();
|
|
|
|
|
2011-09-09 01:15:37 +01:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the default {@link GameMode} for new players.
|
2011-09-09 01:15:37 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the default game mode
|
2011-09-09 01:15:37 +01:00
|
|
|
*/
|
|
|
|
public GameMode getDefaultGameMode();
|
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Sets the default {@link GameMode} for new players.
|
2011-09-09 01:15:37 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param mode the new game mode
|
2011-09-09 01:15:37 +01:00
|
|
|
*/
|
|
|
|
public void setDefaultGameMode(GameMode mode);
|
2011-09-24 23:11:01 +01:00
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets a {@link ConsoleCommandSender} that may be used as an input source
|
|
|
|
* for this server.
|
2011-09-24 23:11:01 +01:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return a console command sender
|
2011-09-24 23:11:01 +01:00
|
|
|
*/
|
|
|
|
public ConsoleCommandSender getConsoleSender();
|
2011-11-25 03:46:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the folder that contains all of the various {@link World}s.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return folder that contains all worlds
|
2011-11-25 03:46:47 +00:00
|
|
|
*/
|
|
|
|
public File getWorldContainer();
|
2011-12-04 17:56:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets every player that has ever played on this server.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return an array containing all previous players
|
2011-12-04 17:56:41 +00:00
|
|
|
*/
|
|
|
|
public OfflinePlayer[] getOfflinePlayers();
|
2012-01-13 08:51:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the {@link Messenger} responsible for this server.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return messenger responsible for this server
|
2012-01-13 08:51:10 +00:00
|
|
|
*/
|
|
|
|
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.
|
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return a help map for this server
|
2012-03-01 00:07:05 -05:00
|
|
|
*/
|
|
|
|
public HelpMap getHelpMap();
|
|
|
|
|
2012-02-29 13:32:33 -05:00
|
|
|
/**
|
2013-12-15 01:07:43 -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.
|
2013-08-03 21:46:30 -04:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param owner the holder of the inventory, or null to indicate no holder
|
|
|
|
* @param type the type of inventory to create
|
|
|
|
* @return a new inventory
|
2012-02-29 13:32:33 -05:00
|
|
|
*/
|
|
|
|
Inventory createInventory(InventoryHolder owner, InventoryType type);
|
|
|
|
|
2013-04-11 14:13:11 -05:00
|
|
|
/**
|
|
|
|
* Creates an empty inventory with the specified type and title. If the type
|
|
|
|
* is {@link InventoryType#CHEST}, the new inventory has a size of 27;
|
2014-11-30 21:09:01 +00:00
|
|
|
* otherwise the new inventory has the normal size for its type.<br>
|
2013-04-11 14:13:11 -05:00
|
|
|
* It should be noted that some inventory types do not support titles and
|
|
|
|
* may not render with said titles on the Minecraft client.
|
|
|
|
*
|
|
|
|
* @param owner The holder of the inventory; can be null if there's no holder.
|
|
|
|
* @param type The type of inventory to create.
|
|
|
|
* @param title The title of the inventory, to be displayed when it is viewed.
|
|
|
|
* @return The new inventory.
|
|
|
|
*/
|
|
|
|
Inventory createInventory(InventoryHolder owner, InventoryType type, String title);
|
|
|
|
|
2012-02-29 13:32:33 -05:00
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Creates an empty inventory of type {@link InventoryType#CHEST} with the
|
|
|
|
* specified size.
|
2013-08-03 21:46:30 -04:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param owner the holder of the inventory, or null to indicate no holder
|
|
|
|
* @param size a multiple of 9 as the size of inventory to create
|
|
|
|
* @return a new inventory
|
|
|
|
* @throws IllegalArgumentException if the size is not a multiple of 9
|
2012-02-29 13:32:33 -05:00
|
|
|
*/
|
2014-03-24 13:20:52 -05:00
|
|
|
Inventory createInventory(InventoryHolder owner, int size) throws IllegalArgumentException;
|
2012-02-29 13:32:33 -05:00
|
|
|
|
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Creates an empty inventory of type {@link InventoryType#CHEST} with the
|
|
|
|
* specified size and title.
|
2013-08-03 21:46:30 -04:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @param owner the holder of the inventory, or null to indicate no holder
|
|
|
|
* @param size a multiple of 9 as the size of inventory to create
|
|
|
|
* @param title the title of the inventory, displayed when inventory is
|
|
|
|
* viewed
|
|
|
|
* @return a new inventory
|
|
|
|
* @throws IllegalArgumentException if the size is not a multiple of 9
|
2012-02-29 13:32:33 -05:00
|
|
|
*/
|
2014-03-24 13:20:52 -05:00
|
|
|
Inventory createInventory(InventoryHolder owner, int size, String title) throws IllegalArgumentException;
|
2012-04-23 19:25:11 -05:00
|
|
|
|
2016-11-21 15:29:10 +11:00
|
|
|
/**
|
|
|
|
* Creates an empty merchant.
|
|
|
|
*
|
|
|
|
* @param title the title of the corresponding merchant inventory, displayed
|
|
|
|
* when the merchant inventory is viewed
|
|
|
|
* @return a new merchant
|
|
|
|
*/
|
|
|
|
Merchant createMerchant(String title);
|
|
|
|
|
2012-04-23 19:25:11 -05:00
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Gets user-specified limit for number of monsters that can spawn in a
|
2014-03-24 13:20:52 -05:00
|
|
|
* chunk.
|
2013-08-03 21:46:30 -04:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the monster spawn limit
|
2012-04-23 19:25:11 -05:00
|
|
|
*/
|
|
|
|
int getMonsterSpawnLimit();
|
|
|
|
|
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Gets user-specified limit for number of animals that can spawn in a
|
2014-03-24 13:20:52 -05:00
|
|
|
* chunk.
|
2013-08-03 21:46:30 -04:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the animal spawn limit
|
2012-04-23 19:25:11 -05:00
|
|
|
*/
|
|
|
|
int getAnimalSpawnLimit();
|
|
|
|
|
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Gets user-specified limit for number of water animals that can spawn in
|
2014-03-24 13:20:52 -05:00
|
|
|
* a chunk.
|
2013-08-03 21:46:30 -04:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the water animal spawn limit
|
2012-04-23 19:25:11 -05:00
|
|
|
*/
|
|
|
|
int getWaterAnimalSpawnLimit();
|
2012-06-13 21:28:13 -05:00
|
|
|
|
2012-10-31 11:18:06 -05:00
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Gets user-specified limit for number of ambient mobs that can spawn in
|
2014-03-24 13:20:52 -05:00
|
|
|
* a chunk.
|
2013-08-03 21:46:30 -04:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the ambient spawn limit
|
2012-10-31 11:18:06 -05:00
|
|
|
*/
|
|
|
|
int getAmbientSpawnLimit();
|
|
|
|
|
2012-06-13 21:28:13 -05:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Checks the current thread against the expected primary thread for the
|
|
|
|
* server.
|
|
|
|
* <p>
|
|
|
|
* <b>Note:</b> this method should not be used to indicate the current
|
|
|
|
* synchronized state of the runtime. A current thread matching the main
|
|
|
|
* thread indicates that it is synchronized, but a mismatch <b>does not
|
|
|
|
* preclude</b> the same assumption.
|
|
|
|
*
|
|
|
|
* @return true if the current thread matches the expected primary thread,
|
|
|
|
* false otherwise
|
2012-06-13 21:28:13 -05:00
|
|
|
*/
|
|
|
|
boolean isPrimaryThread();
|
2012-07-03 17:39:12 -05:00
|
|
|
|
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the message that is displayed on the server list.
|
2012-07-03 17:39:12 -05:00
|
|
|
*
|
2013-01-22 15:09:24 -06:00
|
|
|
* @return the servers MOTD
|
2012-07-03 17:39:12 -05:00
|
|
|
*/
|
|
|
|
String getMotd();
|
2012-08-07 00:16:57 -05:00
|
|
|
|
2012-12-05 05:55:26 -06:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the default message that is displayed when the server is stopped.
|
2012-12-05 05:55:26 -06:00
|
|
|
*
|
|
|
|
* @return the shutdown message
|
|
|
|
*/
|
|
|
|
String getShutdownMessage();
|
|
|
|
|
2012-08-07 00:16:57 -05:00
|
|
|
/**
|
2014-03-24 13:20:52 -05:00
|
|
|
* Gets the current warning state for the server.
|
2012-08-07 00:16:57 -05:00
|
|
|
*
|
2014-03-24 13:20:52 -05:00
|
|
|
* @return the configured warning state
|
2012-08-07 00:16:57 -05:00
|
|
|
*/
|
|
|
|
public WarningState getWarningState();
|
2012-12-17 01:16:28 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the instance of the item factory (for {@link ItemMeta}).
|
|
|
|
*
|
|
|
|
* @return the item factory
|
|
|
|
* @see ItemFactory
|
|
|
|
*/
|
|
|
|
ItemFactory getItemFactory();
|
2013-03-20 14:14:42 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the instance of the scoreboard manager.
|
|
|
|
* <p>
|
|
|
|
* This will only exist after the first world has loaded.
|
|
|
|
*
|
|
|
|
* @return the scoreboard manager or null if no worlds are loaded.
|
|
|
|
*/
|
|
|
|
ScoreboardManager getScoreboardManager();
|
2013-11-13 17:53:49 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets an instance of the server's default server-icon.
|
|
|
|
*
|
|
|
|
* @return the default server-icon; null values may be used by the
|
|
|
|
* implementation to indicate no defined icon, but this behavior is
|
|
|
|
* not guaranteed
|
|
|
|
*/
|
|
|
|
CachedServerIcon getServerIcon();
|
|
|
|
|
|
|
|
/**
|
2013-12-15 01:07:43 -05:00
|
|
|
* Loads an image from a file, and returns a cached image for the specific
|
|
|
|
* server-icon.
|
2013-11-13 17:53:49 -07:00
|
|
|
* <p>
|
|
|
|
* Size and type are implementation defined. An incompatible file is
|
|
|
|
* guaranteed to throw an implementation-defined {@link Exception}.
|
|
|
|
*
|
|
|
|
* @param file the file to load the from
|
|
|
|
* @throws IllegalArgumentException if image is null
|
2013-12-15 01:07:43 -05:00
|
|
|
* @throws Exception if the image does not meet current server server-icon
|
|
|
|
* specifications
|
2013-11-13 17:53:49 -07:00
|
|
|
* @return a cached server-icon that can be used for a {@link
|
|
|
|
* ServerListPingEvent#setServerIcon(CachedServerIcon)}
|
|
|
|
*/
|
|
|
|
CachedServerIcon loadServerIcon(File file) throws IllegalArgumentException, Exception;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a cached server-icon for the specific image.
|
|
|
|
* <p>
|
|
|
|
* Size and type are implementation defined. An incompatible file is
|
|
|
|
* guaranteed to throw an implementation-defined {@link Exception}.
|
|
|
|
*
|
|
|
|
* @param image the image to use
|
|
|
|
* @throws IllegalArgumentException if image is null
|
|
|
|
* @throws Exception if the image does not meet current server
|
|
|
|
* server-icon specifications
|
|
|
|
* @return a cached server-icon that can be used for a {@link
|
|
|
|
* ServerListPingEvent#setServerIcon(CachedServerIcon)}
|
|
|
|
*/
|
|
|
|
CachedServerIcon loadServerIcon(BufferedImage image) throws IllegalArgumentException, Exception;
|
2014-01-07 01:31:35 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the idle kick timeout. Any players idle for the specified amount of
|
|
|
|
* time will be automatically kicked.
|
|
|
|
* <p>
|
|
|
|
* A value of 0 will disable the idle kick timeout.
|
|
|
|
*
|
|
|
|
* @param threshold the idle timeout in minutes
|
|
|
|
*/
|
|
|
|
public void setIdleTimeout(int threshold);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the idle kick timeout.
|
|
|
|
*
|
|
|
|
* @return the idle timeout in minutes
|
|
|
|
*/
|
|
|
|
public int getIdleTimeout();
|
2014-01-14 21:32:03 -06:00
|
|
|
|
2015-07-28 16:21:03 +03:00
|
|
|
/**
|
|
|
|
* Create a ChunkData for use in a generator.
|
|
|
|
*
|
|
|
|
* See {@link ChunkGenerator#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}
|
|
|
|
*
|
|
|
|
* @param world the world to create the ChunkData for
|
|
|
|
* @return a new ChunkData for the world
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public ChunkGenerator.ChunkData createChunkData(World world);
|
|
|
|
|
2016-03-01 08:30:03 +11:00
|
|
|
/**
|
|
|
|
* Creates a boss bar instance to display to players. The progress
|
|
|
|
* defaults to 1.0
|
|
|
|
*
|
|
|
|
* @param title the title of the boss bar
|
|
|
|
* @param color the color of the boss bar
|
|
|
|
* @param style the style of the boss bar
|
|
|
|
* @param flags an optional list of flags to set on the boss bar
|
|
|
|
* @return the created boss bar
|
|
|
|
*/
|
2017-08-06 09:08:05 +10:00
|
|
|
BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag... flags);
|
2016-03-01 08:30:03 +11:00
|
|
|
|
2017-01-03 22:40:31 -06:00
|
|
|
/**
|
|
|
|
* Gets an entity on the server by its UUID
|
|
|
|
*
|
|
|
|
* @param uuid the UUID of the entity
|
|
|
|
* @return the entity with the given UUID, or null if it isn't found
|
|
|
|
*/
|
|
|
|
Entity getEntity(UUID uuid);
|
|
|
|
|
2017-05-14 12:00:00 +10:00
|
|
|
/**
|
|
|
|
* Get the advancement specified by this key.
|
|
|
|
*
|
|
|
|
* @param key unique advancement key
|
|
|
|
* @return advancement or null if not exists
|
|
|
|
*/
|
|
|
|
Advancement getAdvancement(NamespacedKey key);
|
|
|
|
|
2017-05-15 08:25:11 +10:00
|
|
|
/**
|
|
|
|
* Get an iterator through all advancements. Advancements cannot be removed
|
|
|
|
* from this iterator,
|
|
|
|
*
|
|
|
|
* @return an advancement iterator
|
|
|
|
*/
|
|
|
|
Iterator<Advancement> advancementIterator();
|
|
|
|
|
2014-01-14 21:32:03 -06:00
|
|
|
/**
|
|
|
|
* @see UnsafeValues
|
2014-11-30 21:09:01 +00:00
|
|
|
* @return the unsafe values instance
|
2014-01-14 21:32:03 -06:00
|
|
|
*/
|
|
|
|
@Deprecated
|
|
|
|
UnsafeValues getUnsafe();
|
2012-10-31 11:18:06 -05:00
|
|
|
}
|