+ * This ignores underscores and capitalization + * + * @param name The name + * @return The painting + */ + public static Art getByName(String name) { + Validate.notNull(name, "Name cannot be null"); + + return BY_NAME.get(name.toLowerCase().replaceAll("_", "")); + } + + static { + for (Art art : values()) { + BY_ID.put(art.id, art); + BY_NAME.put(art.toString().toLowerCase().replaceAll("_", ""), art); + } + } +} diff --git a/vspigot-api/src/main/java/org/bukkit/BanEntry.java b/vspigot-api/src/main/java/org/bukkit/BanEntry.java new file mode 100644 index 0000000..986120e --- /dev/null +++ b/vspigot-api/src/main/java/org/bukkit/BanEntry.java @@ -0,0 +1,127 @@ +package org.bukkit; + +import java.util.Date; + +/** + * A single entry from a ban list. This may represent either a player ban or + * an IP ban. + *
+ * Ban entries include the following properties: + *
Property | + *Description | + *
---|---|
Target Name / IP Address | + *The target name or IP address | + *
Creation Date | + *The creation date of the ban | + *
Source | + *The source of the ban, such as a player, console, plugin, etc | + *
Expiration Date | + *The expiration date of the ban | + *
Reason | + *The reason for the ban | + *
+ * Unsaved information is not automatically written to the implementation's + * ban list, instead, the {@link #save()} method must be called to write the + * changes to the ban list. If this ban entry has expired (such as from an + * unban) and is no longer found in the list, the {@link #save()} call will + * re-add it to the list, therefore banning the victim specified. + *
+ * Likewise, changes to the associated {@link BanList} or other entries may or + * may not be reflected in this entry. + */ +public interface BanEntry { + + /** + * Gets the target involved. This may be in the form of an IP or a player + * name. + * + * @return the target name or IP address + */ + public String getTarget(); + + /** + * Gets the date this ban entry was created. + * + * @return the creation date + */ + public Date getCreated(); + + /** + * Sets the date this ban entry was created. + * + * @param created the new created date, cannot be null + * @see #save() saving changes + */ + public void setCreated(Date created); + + /** + * Gets the source of this ban. + *
+ * Note: A source is considered any String, although this is generally a + * player name. + * + * @return the source of the ban + */ + public String getSource(); + + /** + * Sets the source of this ban. + *
+ * Note: A source is considered any String, although this is generally a + * player name. + * + * @param source the new source where null values become empty strings + * @see #save() saving changes + */ + public void setSource(String source); + + /** + * Gets the date this ban expires on, or null for no defined end date. + * + * @return the expiration date + */ + public Date getExpiration(); + + /** + * Sets the date this ban expires on. Null values are considered + * "infinite" bans. + * + * @param expiration the new expiration date, or null to indicate an + * eternity + * @see #save() saving changes + */ + public void setExpiration(Date expiration); + + /** + * Gets the reason for this ban. + * + * @return the ban reason, or null if not set + */ + public String getReason(); + + /** + * Sets the reason for this ban. Reasons must not be null. + * + * @param reason the new reason, null values assume the implementation + * default + * @see #save() saving changes + */ + public void setReason(String reason); + + /** + * Saves the ban entry, overwriting any previous data in the ban list. + *
+ * Saving the ban entry of an unbanned player will cause the player to be
+ * banned once again.
+ */
+ public void save();
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/BanList.java b/vspigot-api/src/main/java/org/bukkit/BanList.java
new file mode 100644
index 0000000..c21b858
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/BanList.java
@@ -0,0 +1,72 @@
+package org.bukkit;
+
+import java.util.Date;
+import java.util.Set;
+
+/**
+ * A ban list, containing bans of some {@link Type}.
+ */
+public interface BanList {
+
+ /**
+ * Represents a ban-type that a {@link BanList} may track.
+ */
+ public enum Type {
+ /**
+ * Banned player names
+ */
+ NAME,
+ /**
+ * Banned player IP addresses
+ */
+ IP,
+ ;
+ }
+
+ /**
+ * Gets a {@link BanEntry} by target.
+ *
+ * @param target entry parameter to search for
+ * @return the corresponding entry, or null if none found
+ */
+ public BanEntry getBanEntry(String target);
+
+ /**
+ * Adds a ban to the this list. If a previous ban exists, this will
+ * update the previous entry.
+ *
+ * @param target the target of the ban
+ * @param reason reason for the ban, null indicates implementation default
+ * @param expires date for the ban's expiration (unban), or null to imply
+ * forever
+ * @param source source of the ban, null indicates implementation default
+ * @return the entry for the newly created ban, or the entry for the
+ * (updated) previous ban
+ */
+ public BanEntry addBan(String target, String reason, Date expires, String source);
+
+ /**
+ * Gets a set containing every {@link BanEntry} in this list.
+ *
+ * @return an immutable set containing every entry tracked by this list
+ */
+ public Set
+ * It is safe to have this call World.setTypeId, but it may be slower than
+ * World.setRawTypeId.
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @param typeId New block ID
+ * @return true if the block was set successfully
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public boolean setRawTypeId(int x, int y, int z, int typeId);
+
+ /**
+ * Set a block type and data at the specified coordinates without doing
+ * all world updates and notifications.
+ *
+ * It is safe to have this call World.setTypeId, but it may be slower than
+ * World.setRawTypeId.
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @param typeId New block ID
+ * @param data Block data
+ * @return true if the block was set successfully
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data);
+
+ /**
+ * Set a block type at the specified coordinates.
+ *
+ * This method cannot call World.setRawTypeId, a full update is needed.
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @param typeId New block ID
+ * @return true if the block was set successfully
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public boolean setTypeId(int x, int y, int z, int typeId);
+
+ /**
+ * Set a block type and data at the specified coordinates.
+ *
+ * This method cannot call World.setRawTypeId, a full update is needed.
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @param typeId New block ID
+ * @param data Block data
+ * @return true if the block was set successfully
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public boolean setTypeIdAndData(int x, int y, int z, int typeId, int data);
+
+ /**
+ * Get the block type at the location.
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @return The block ID
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public int getTypeId(int x, int y, int z);
+
+ /**
+ * Gets the height of the world.
+ *
+ * @return Height of the world
+ */
+ public int getHeight();
+
+ /**
+ * Checks if the specified block is empty (air) or not.
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @return True if the block is considered empty.
+ */
+ public boolean isEmpty(int x, int y, int z);
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/Bukkit.java b/vspigot-api/src/main/java/org/bukkit/Bukkit.java
new file mode 100644
index 0000000..5336f37
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +1,806 @@
+package org.bukkit;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.logging.Logger;
+
+import org.bukkit.Warning.WarningState;
+import org.bukkit.command.CommandException;
+import org.bukkit.command.CommandSender;
+import org.bukkit.command.ConsoleCommandSender;
+import org.bukkit.command.PluginCommand;
+import org.bukkit.entity.Player;
+import org.bukkit.event.inventory.InventoryType;
+import org.bukkit.help.HelpMap;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.inventory.Inventory;
+import org.bukkit.inventory.InventoryHolder;
+import org.bukkit.inventory.ItemFactory;
+import org.bukkit.inventory.Recipe;
+import org.bukkit.map.MapView;
+import org.bukkit.plugin.PluginManager;
+import org.bukkit.plugin.ServicesManager;
+import org.bukkit.plugin.messaging.Messenger;
+import org.bukkit.scheduler.BukkitScheduler;
+import org.bukkit.scoreboard.ScoreboardManager;
+import org.bukkit.util.CachedServerIcon;
+
+import com.avaje.ebean.config.ServerConfig;
+
+/**
+ * Represents the Bukkit core, for version and Server singleton handling
+ */
+public final class Bukkit {
+ private static Server server;
+
+ /**
+ * Static class cannot be initialized.
+ */
+ private Bukkit() {}
+
+ /**
+ * Gets the current {@link Server} singleton
+ *
+ * @return Server instance being ran
+ */
+ public static Server getServer() {
+ return server;
+ }
+
+ /**
+ * Attempts to set the {@link Server} singleton.
+ *
+ * This cannot be done if the Server is already set.
+ *
+ * @param server Server instance
+ */
+ public static void setServer(Server server) {
+ if (Bukkit.server != null) {
+ throw new UnsupportedOperationException("Cannot redefine singleton Server");
+ }
+
+ Bukkit.server = server;
+ server.getLogger().info("This server is running " + getName() + " version " + getVersion() + " (Implementing API version " + getBukkitVersion() + ")");
+ }
+
+ /**
+ * @see Server#getName()
+ */
+ public static String getName() {
+ return server.getName();
+ }
+
+ /**
+ * @see Server#getVersion()
+ */
+ public static String getVersion() {
+ return server.getVersion();
+ }
+
+ /**
+ * @see Server#getBukkitVersion()
+ */
+ public static String getBukkitVersion() {
+ return server.getBukkitVersion();
+ }
+
+ /**
+ * This method exists for legacy reasons to provide backwards
+ * compatibility. It will not exist at runtime and should not be used
+ * under any circumstances.
+ *
+ * @Deprecated
+ * @see Server#_INVALID_getOnlinePlayers()
+ */
+ @Deprecated
+ public static Player[] _INVALID_getOnlinePlayers() {
+ return server._INVALID_getOnlinePlayers();
+ }
+
+ /**
+ * @see Server#getOnlinePlayers()
+ */
+ public static Collection extends Player> getOnlinePlayers() {
+ return server.getOnlinePlayers();
+ }
+
+ /**
+ * @see Server#getMaxPlayers()
+ */
+ public static int getMaxPlayers() {
+ return server.getMaxPlayers();
+ }
+
+ /**
+ * @see Server#getPort()
+ */
+ public static int getPort() {
+ return server.getPort();
+ }
+
+ /**
+ * @see Server#getViewDistance()
+ */
+ public static int getViewDistance() {
+ return server.getViewDistance();
+ }
+
+ /**
+ * @see Server#getIp()
+ */
+ public static String getIp() {
+ return server.getIp();
+ }
+
+ /**
+ * @see Server#getServerName()
+ */
+ public static String getServerName() {
+ return server.getServerName();
+ }
+
+ /**
+ * @see Server#getServerGroup()
+ */
+ public static String getServerGroup() {
+ return server.getServerGroup();
+ }
+
+ /**
+ * @see Server#getServerId()
+ */
+ public static String getServerId() {
+ return server.getServerId();
+ }
+
+ /**
+ * @see Server#getWorldType()
+ */
+ public static String getWorldType() {
+ return server.getWorldType();
+ }
+
+ /**
+ * @see Server#getGenerateStructures()
+ */
+ public static boolean getGenerateStructures() {
+ return server.getGenerateStructures();
+ }
+
+ /**
+ * @see Server#getAllowNether()
+ */
+ public static boolean getAllowNether() {
+ return server.getAllowNether();
+ }
+
+ /**
+ * @see Server#hasWhitelist()
+ */
+ public static boolean hasWhitelist() {
+ return server.hasWhitelist();
+ }
+
+ /**
+ * @see Server#broadcastMessage(String message)
+ */
+ public static int broadcastMessage(String message) {
+ return server.broadcastMessage(message);
+ }
+
+ /**
+ * @see Server#broadcastTranslate(String message)
+ */
+ public static int broadcastTranslate(String message) {
+ return server.broadcastMessage(ChatColor.translate(message));
+ }
+
+ /**
+ * @see Server#getUpdateFolder()
+ */
+ public static String getUpdateFolder() {
+ return server.getUpdateFolder();
+ }
+
+ /**
+ * @see Server#getPlayer(String name)
+ */
+ public static Player getPlayer(String name) {
+ return server.getPlayer(name);
+ }
+
+ /**
+ * @see Server#matchPlayer(String name)
+ */
+ public static List
+ * Purpose is to allow clean, efficient copy of a chunk data to be made, and
+ * then handed off for processing in another thread (e.g. map rendering)
+ */
+public interface ChunkSnapshot {
+
+ /**
+ * Gets the X-coordinate of this chunk
+ *
+ * @return X-coordinate
+ */
+ int getX();
+
+ /**
+ * Gets the Z-coordinate of this chunk
+ *
+ * @return Z-coordinate
+ */
+ int getZ();
+
+ /**
+ * Gets name of the world containing this chunk
+ *
+ * @return Parent World Name
+ */
+ String getWorldName();
+
+ /**
+ * Get block type for block at corresponding coordinate in the chunk
+ *
+ * @param x 0-15
+ * @param y 0-127
+ * @param z 0-15
+ * @return 0-255
+ * @deprecated Magic value
+ */
+ @Deprecated
+ int getBlockTypeId(int x, int y, int z);
+
+ /**
+ * Get block data for block at corresponding coordinate in the chunk
+ *
+ * @param x 0-15
+ * @param y 0-127
+ * @param z 0-15
+ * @return 0-15
+ * @deprecated Magic value
+ */
+ @Deprecated
+ int getBlockData(int x, int y, int z);
+
+ /**
+ * Get sky light level for block at corresponding coordinate in the chunk
+ *
+ * @param x 0-15
+ * @param y 0-127
+ * @param z 0-15
+ * @return 0-15
+ */
+ int getBlockSkyLight(int x, int y, int z);
+
+ /**
+ * Get light level emitted by block at corresponding coordinate in the
+ * chunk
+ *
+ * @param x 0-15
+ * @param y 0-127
+ * @param z 0-15
+ * @return 0-15
+ */
+ int getBlockEmittedLight(int x, int y, int z);
+
+ /**
+ * Gets the highest non-air coordinate at the given coordinates
+ *
+ * @param x X-coordinate of the blocks
+ * @param z Z-coordinate of the blocks
+ * @return Y-coordinate of the highest non-air block
+ */
+ int getHighestBlockYAt(int x, int z);
+
+ /**
+ * Get biome at given coordinates
+ *
+ * @param x X-coordinate
+ * @param z Z-coordinate
+ * @return Biome at given coordinate
+ */
+ Biome getBiome(int x, int z);
+
+ /**
+ * Get raw biome temperature (0.0-1.0) at given coordinate
+ *
+ * @param x X-coordinate
+ * @param z Z-coordinate
+ * @return temperature at given coordinate
+ */
+ double getRawBiomeTemperature(int x, int z);
+
+ /**
+ * Get raw biome rainfall (0.0-1.0) at given coordinate
+ *
+ * @param x X-coordinate
+ * @param z Z-coordinate
+ * @return rainfall at given coordinate
+ */
+ double getRawBiomeRainfall(int x, int z);
+
+ /**
+ * Get world full time when chunk snapshot was captured
+ *
+ * @return time in ticks
+ */
+ long getCaptureFullTime();
+
+ /**
+ * Test if section is empty
+ *
+ * @param sy - section Y coordinate (block Y / 16)
+ * @return true if empty, false if not
+ */
+ boolean isSectionEmpty(int sy);
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/CoalType.java b/vspigot-api/src/main/java/org/bukkit/CoalType.java
new file mode 100644
index 0000000..4fcccd2
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/CoalType.java
@@ -0,0 +1,50 @@
+package org.bukkit;
+
+import java.util.Map;
+
+import com.google.common.collect.Maps;
+
+/**
+ * Represents the two types of coal
+ */
+public enum CoalType {
+ COAL(0x0),
+ CHARCOAL(0x1);
+
+ private final byte data;
+ private final static Map
+ * This will cause client-glitches!
+ */
+ DEATH(3),
+
+ /**
+ * The smoke when taming a wolf fails.
+ *
+ * Without client-mods this will be ignored if the entity is not a wolf.
+ */
+ WOLF_SMOKE(6),
+
+ /**
+ * The hearts when taming a wolf succeeds.
+ *
+ * Without client-mods this will be ignored if the entity is not a wolf.
+ */
+ WOLF_HEARTS(7),
+
+ /**
+ * When a wolf shakes (after being wet).
+ *
+ * Without client-mods this will be ignored if the entity is not a wolf.
+ */
+ WOLF_SHAKE(8),
+
+ /**
+ * When a sheep eats a LONG_GRASS block.
+ */
+ SHEEP_EAT(10),
+
+ /**
+ * When an Iron Golem gives a rose.
+ *
+ * This will not play an effect if the entity is not an iron golem.
+ */
+ IRON_GOLEM_ROSE(11),
+
+ /**
+ * Hearts from a villager.
+ *
+ * This will not play an effect if the entity is not a villager.
+ */
+ VILLAGER_HEART(12),
+
+ /**
+ * When a villager is angry.
+ *
+ * This will not play an effect if the entity is not a villager.
+ */
+ VILLAGER_ANGRY(13),
+
+ /**
+ * Happy particles from a villager.
+ *
+ * This will not play an effect if the entity is not a villager.
+ */
+ VILLAGER_HAPPY(14),
+
+ /**
+ * Magic particles from a witch.
+ *
+ * This will not play an effect if the entity is not a witch.
+ */
+ WITCH_MAGIC(15),
+
+ /**
+ * When a zombie transforms into a villager by shaking violently.
+ *
+ * This will not play an effect if the entity is not a zombie.
+ */
+ ZOMBIE_TRANSFORM(16),
+
+ /**
+ * When a firework explodes.
+ *
+ * This will not play an effect if the entity is not a firework.
+ */
+ FIREWORK_EXPLODE(17);
+
+ private final byte data;
+ private final static Map
+ * To successfully build, you must have specified at least one color.
+ *
+ * @return The representative firework effect
+ */
+ public FireworkEffect build() {
+ return new FireworkEffect(
+ flicker,
+ trail,
+ colors.build(),
+ fadeColors == null ? ImmutableList.
+ * This is a normal lookup, names must be the precise name they are given
+ * in the enum.
+ *
+ * @param name Name of the material to get
+ * @return Material if found, or null
+ */
+ public static Material getMaterial(final String name) {
+ return BY_NAME.get(name);
+ }
+
+ /**
+ * Attempts to match the Material with the given name.
+ *
+ * This is a match lookup; names will be converted to uppercase, then
+ * stripped of special characters in an attempt to format it like the
+ * enum.
+ *
+ * Using this for match by ID is deprecated.
+ *
+ * @param name Name of the material to get
+ * @return Material if found, or null
+ */
+ public static Material matchMaterial(final String name) {
+ Validate.notNull(name, "Name cannot be null");
+
+ Material result = null;
+
+ try {
+ result = getMaterial(Integer.parseInt(name));
+ } catch (NumberFormatException ex) {}
+
+ if (result == null) {
+ String filtered = name.toUpperCase();
+
+ filtered = filtered.replaceAll("\\s+", "_").replaceAll("\\W", "");
+ result = BY_NAME.get(filtered);
+ }
+
+ return result;
+ }
+
+ static {
+ for (Material material : values()) {
+ if (byId.length > material.id) {
+ byId[material.id] = material;
+ } else {
+ byId = Java15Compat.Arrays_copyOfRange(byId, 0, material.id + 2);
+ byId[material.id] = material;
+ }
+ BY_NAME.put(material.name(), material);
+ }
+ }
+
+ /**
+ * @return True if this material represents a playable music disk.
+ */
+ public boolean isRecord() {
+ return id >= GOLD_RECORD.id && id <= RECORD_12.id;
+ }
+
+ /**
+ * Check if the material is a block and solid (cannot be passed through by
+ * a player)
+ *
+ * @return True if this material is a block and solid
+ */
+ public boolean isSolid() {
+ if (!isBlock() || id == 0) {
+ return false;
+ }
+ switch (this) {
+ case STONE:
+ case GRASS:
+ case DIRT:
+ case COBBLESTONE:
+ case WOOD:
+ case BEDROCK:
+ case SAND:
+ case GRAVEL:
+ case GOLD_ORE:
+ case IRON_ORE:
+ case COAL_ORE:
+ case LOG:
+ case LEAVES:
+ case SPONGE:
+ case GLASS:
+ case LAPIS_ORE:
+ case LAPIS_BLOCK:
+ case DISPENSER:
+ case SANDSTONE:
+ case NOTE_BLOCK:
+ case BED_BLOCK:
+ case PISTON_STICKY_BASE:
+ case PISTON_BASE:
+ case PISTON_EXTENSION:
+ case WOOL:
+ case PISTON_MOVING_PIECE:
+ case GOLD_BLOCK:
+ case IRON_BLOCK:
+ case DOUBLE_STEP:
+ case STEP:
+ case BRICK:
+ case TNT:
+ case BOOKSHELF:
+ case MOSSY_COBBLESTONE:
+ case OBSIDIAN:
+ case MOB_SPAWNER:
+ case WOOD_STAIRS:
+ case CHEST:
+ case DIAMOND_ORE:
+ case DIAMOND_BLOCK:
+ case WORKBENCH:
+ case SOIL:
+ case FURNACE:
+ case BURNING_FURNACE:
+ case SIGN_POST:
+ case WOODEN_DOOR:
+ case COBBLESTONE_STAIRS:
+ case WALL_SIGN:
+ case STONE_PLATE:
+ case IRON_DOOR_BLOCK:
+ case WOOD_PLATE:
+ case REDSTONE_ORE:
+ case GLOWING_REDSTONE_ORE:
+ case ICE:
+ case SNOW_BLOCK:
+ case CACTUS:
+ case CLAY:
+ case JUKEBOX:
+ case FENCE:
+ case PUMPKIN:
+ case NETHERRACK:
+ case SOUL_SAND:
+ case GLOWSTONE:
+ case JACK_O_LANTERN:
+ case CAKE_BLOCK:
+ case LOCKED_CHEST:
+ case STAINED_GLASS:
+ case TRAP_DOOR:
+ case MONSTER_EGGS:
+ case SMOOTH_BRICK:
+ case HUGE_MUSHROOM_1:
+ case HUGE_MUSHROOM_2:
+ case IRON_FENCE:
+ case THIN_GLASS:
+ case MELON_BLOCK:
+ case FENCE_GATE:
+ case BRICK_STAIRS:
+ case SMOOTH_STAIRS:
+ case MYCEL:
+ case NETHER_BRICK:
+ case NETHER_FENCE:
+ case NETHER_BRICK_STAIRS:
+ case ENCHANTMENT_TABLE:
+ case BREWING_STAND:
+ case CAULDRON:
+ case ENDER_PORTAL_FRAME:
+ case ENDER_STONE:
+ case DRAGON_EGG:
+ case REDSTONE_LAMP_OFF:
+ case REDSTONE_LAMP_ON:
+ case WOOD_DOUBLE_STEP:
+ case WOOD_STEP:
+ case SANDSTONE_STAIRS:
+ case EMERALD_ORE:
+ case ENDER_CHEST:
+ case EMERALD_BLOCK:
+ case SPRUCE_WOOD_STAIRS:
+ case BIRCH_WOOD_STAIRS:
+ case JUNGLE_WOOD_STAIRS:
+ case COMMAND:
+ case BEACON:
+ case COBBLE_WALL:
+ case ANVIL:
+ case TRAPPED_CHEST:
+ case GOLD_PLATE:
+ case IRON_PLATE:
+ case DAYLIGHT_DETECTOR:
+ case REDSTONE_BLOCK:
+ case QUARTZ_ORE:
+ case HOPPER:
+ case QUARTZ_BLOCK:
+ case QUARTZ_STAIRS:
+ case DROPPER:
+ case STAINED_CLAY:
+ case HAY_BLOCK:
+ case HARD_CLAY:
+ case COAL_BLOCK:
+ case STAINED_GLASS_PANE:
+ case LEAVES_2:
+ case LOG_2:
+ case ACACIA_STAIRS:
+ case DARK_OAK_STAIRS:
+ case PACKED_ICE:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Check if the material is a block and does not block any light
+ *
+ * @return True if this material is a block and does not block any light
+ */
+ public boolean isTransparent() {
+ if (!isBlock()) {
+ return false;
+ }
+ switch (this) {
+ case AIR:
+ case SAPLING:
+ case POWERED_RAIL:
+ case DETECTOR_RAIL:
+ case LONG_GRASS:
+ case DEAD_BUSH:
+ case YELLOW_FLOWER:
+ case RED_ROSE:
+ case BROWN_MUSHROOM:
+ case RED_MUSHROOM:
+ case TORCH:
+ case FIRE:
+ case REDSTONE_WIRE:
+ case CROPS:
+ case LADDER:
+ case RAILS:
+ case LEVER:
+ case REDSTONE_TORCH_OFF:
+ case REDSTONE_TORCH_ON:
+ case STONE_BUTTON:
+ case SNOW:
+ case SUGAR_CANE_BLOCK:
+ case PORTAL:
+ case DIODE_BLOCK_OFF:
+ case DIODE_BLOCK_ON:
+ case PUMPKIN_STEM:
+ case MELON_STEM:
+ case VINE:
+ case WATER_LILY:
+ case NETHER_WARTS:
+ case ENDER_PORTAL:
+ case COCOA:
+ case TRIPWIRE_HOOK:
+ case TRIPWIRE:
+ case FLOWER_POT:
+ case CARROT:
+ case POTATO:
+ case WOOD_BUTTON:
+ case SKULL:
+ case REDSTONE_COMPARATOR_OFF:
+ case REDSTONE_COMPARATOR_ON:
+ case ACTIVATOR_RAIL:
+ case CARPET:
+ case DOUBLE_PLANT:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Check if the material is a block and can catch fire
+ *
+ * @return True if this material is a block and can catch fire
+ */
+ public boolean isFlammable() {
+ if (!isBlock()) {
+ return false;
+ }
+ switch (this) {
+ case WOOD:
+ case LOG:
+ case LEAVES:
+ case NOTE_BLOCK:
+ case BED_BLOCK:
+ case LONG_GRASS:
+ case DEAD_BUSH:
+ case WOOL:
+ case TNT:
+ case BOOKSHELF:
+ case WOOD_STAIRS:
+ case CHEST:
+ case WORKBENCH:
+ case SIGN_POST:
+ case WOODEN_DOOR:
+ case WALL_SIGN:
+ case WOOD_PLATE:
+ case JUKEBOX:
+ case FENCE:
+ case TRAP_DOOR:
+ case HUGE_MUSHROOM_1:
+ case HUGE_MUSHROOM_2:
+ case VINE:
+ case FENCE_GATE:
+ case WOOD_DOUBLE_STEP:
+ case WOOD_STEP:
+ case SPRUCE_WOOD_STAIRS:
+ case BIRCH_WOOD_STAIRS:
+ case JUNGLE_WOOD_STAIRS:
+ case TRAPPED_CHEST:
+ case DAYLIGHT_DETECTOR:
+ case CARPET:
+ case LEAVES_2:
+ case LOG_2:
+ case ACACIA_STAIRS:
+ case DARK_OAK_STAIRS:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Check if the material is a block and can burn away
+ *
+ * @return True if this material is a block and can burn away
+ */
+ public boolean isBurnable() {
+ if (!isBlock()) {
+ return false;
+ }
+ switch (this) {
+ case WOOD:
+ case LOG:
+ case LEAVES:
+ case LONG_GRASS:
+ case WOOL:
+ case YELLOW_FLOWER:
+ case RED_ROSE:
+ case TNT:
+ case BOOKSHELF:
+ case WOOD_STAIRS:
+ case FENCE:
+ case VINE:
+ case WOOD_DOUBLE_STEP:
+ case WOOD_STEP:
+ case SPRUCE_WOOD_STAIRS:
+ case BIRCH_WOOD_STAIRS:
+ case JUNGLE_WOOD_STAIRS:
+ case HAY_BLOCK:
+ case COAL_BLOCK:
+ case LEAVES_2:
+ case LOG_2:
+ case CARPET:
+ case DOUBLE_PLANT:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Check if the material is a block and completely blocks vision
+ *
+ * @return True if this material is a block and completely blocks vision
+ */
+ public boolean isOccluding() {
+ if (!isBlock()) {
+ return false;
+ }
+ switch (this) {
+ case STONE:
+ case GRASS:
+ case DIRT:
+ case COBBLESTONE:
+ case WOOD:
+ case BEDROCK:
+ case SAND:
+ case GRAVEL:
+ case GOLD_ORE:
+ case IRON_ORE:
+ case COAL_ORE:
+ case LOG:
+ case SPONGE:
+ case LAPIS_ORE:
+ case LAPIS_BLOCK:
+ case DISPENSER:
+ case SANDSTONE:
+ case NOTE_BLOCK:
+ case WOOL:
+ case GOLD_BLOCK:
+ case IRON_BLOCK:
+ case DOUBLE_STEP:
+ case BRICK:
+ case BOOKSHELF:
+ case MOSSY_COBBLESTONE:
+ case OBSIDIAN:
+ case MOB_SPAWNER:
+ case DIAMOND_ORE:
+ case DIAMOND_BLOCK:
+ case WORKBENCH:
+ case FURNACE:
+ case BURNING_FURNACE:
+ case REDSTONE_ORE:
+ case GLOWING_REDSTONE_ORE:
+ case SNOW_BLOCK:
+ case CLAY:
+ case JUKEBOX:
+ case PUMPKIN:
+ case NETHERRACK:
+ case SOUL_SAND:
+ case JACK_O_LANTERN:
+ case MONSTER_EGGS:
+ case SMOOTH_BRICK:
+ case HUGE_MUSHROOM_1:
+ case HUGE_MUSHROOM_2:
+ case MELON_BLOCK:
+ case MYCEL:
+ case NETHER_BRICK:
+ case ENDER_PORTAL_FRAME:
+ case ENDER_STONE:
+ case REDSTONE_LAMP_OFF:
+ case REDSTONE_LAMP_ON:
+ case WOOD_DOUBLE_STEP:
+ case EMERALD_ORE:
+ case EMERALD_BLOCK:
+ case COMMAND:
+ case QUARTZ_ORE:
+ case QUARTZ_BLOCK:
+ case DROPPER:
+ case STAINED_CLAY:
+ case HAY_BLOCK:
+ case HARD_CLAY:
+ case COAL_BLOCK:
+ case LOG_2:
+ case PACKED_ICE:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * @return True if this material is affected by gravity.
+ */
+ public boolean hasGravity() {
+ if (!isBlock()) {
+ return false;
+ }
+ switch (this) {
+ case SAND:
+ case GRAVEL:
+ case ANVIL:
+ return true;
+ default:
+ return false;
+ }
+ }
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/NetherWartsState.java b/vspigot-api/src/main/java/org/bukkit/NetherWartsState.java
new file mode 100644
index 0000000..f43209c
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/NetherWartsState.java
@@ -0,0 +1,21 @@
+package org.bukkit;
+
+public enum NetherWartsState {
+
+ /**
+ * State when first seeded
+ */
+ SEEDED,
+ /**
+ * First growth stage
+ */
+ STAGE_ONE,
+ /**
+ * Second growth stage
+ */
+ STAGE_TWO,
+ /**
+ * Ready to harvest
+ */
+ RIPE;
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/Note.java b/vspigot-api/src/main/java/org/bukkit/Note.java
new file mode 100644
index 0000000..417936f
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/Note.java
@@ -0,0 +1,276 @@
+package org.bukkit;
+
+import java.util.Map;
+
+import org.apache.commons.lang.Validate;
+
+import com.google.common.collect.Maps;
+
+/**
+ * A note class to store a specific note.
+ */
+public class Note {
+
+ /**
+ * An enum holding tones.
+ */
+ public enum Tone {
+ G(0x1, true),
+ A(0x3, true),
+ B(0x5, false),
+ C(0x6, true),
+ D(0x8, true),
+ E(0xA, false),
+ F(0xB, true);
+
+ private final boolean sharpable;
+ private final byte id;
+
+ private static final Map
+ * Names are no longer unique past a single game session. For persistent storage
+ * it is recommended that you use {@link #getUniqueId()} instead.
+ *
+ * @return Player name or null if we have not seen a name for this player yet
+ */
+ public String getName();
+
+ /**
+ * Returns the UUID of this player
+ *
+ * @return Player UUID
+ */
+ public UUID getUniqueId();
+
+ /**
+ * Checks if this player is banned or not
+ *
+ * @return true if banned, otherwise false
+ */
+ public boolean isBanned();
+
+ /**
+ * Bans or unbans this player
+ *
+ * @param banned true if banned
+ * @deprecated Use {@link org.bukkit.BanList#addBan(String, String, Date,
+ * String)} or {@link org.bukkit.BanList#pardon(String)} to enhance
+ * functionality
+ */
+ @Deprecated
+ public void setBanned(boolean banned);
+
+ /**
+ * Checks if this player is whitelisted or not
+ *
+ * @return true if whitelisted
+ */
+ public boolean isWhitelisted();
+
+ /**
+ * Sets if this player is whitelisted or not
+ *
+ * @param value true if whitelisted
+ */
+ public void setWhitelisted(boolean value);
+
+ /**
+ * Gets a {@link Player} object that this represents, if there is one
+ *
+ * If the player is online, this will return that player. Otherwise,
+ * it will return null.
+ *
+ * @return Online player
+ */
+ public Player getPlayer();
+
+ /**
+ * Gets the first date and time that this player was witnessed on this
+ * server.
+ *
+ * If the player has never played before, this will return 0. Otherwise,
+ * it will be the amount of milliseconds since midnight, January 1, 1970
+ * UTC.
+ *
+ * @return Date of first log-in for this player, or 0
+ */
+ public long getFirstPlayed();
+
+ /**
+ * Gets the last date and time that this player was witnessed on this
+ * server.
+ *
+ * If the player has never played before, this will return 0. Otherwise,
+ * it will be the amount of milliseconds since midnight, January 1, 1970
+ * UTC.
+ *
+ * @return Date of last log-in for this player, or 0
+ */
+ public long getLastPlayed();
+
+ /**
+ * Checks if this player has played on this server before.
+ *
+ * @return True if the player has played before, otherwise false
+ */
+ public boolean hasPlayedBefore();
+
+ /**
+ * Gets the Location where the player will spawn at their bed, null if
+ * they have not slept in one or their current bed spawn is invalid.
+ *
+ * @return Bed Spawn Location if bed exists, otherwise null.
+ */
+ public Location getBedSpawnLocation();
+
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/PortalType.java b/vspigot-api/src/main/java/org/bukkit/PortalType.java
new file mode 100644
index 0000000..427cfbb
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/PortalType.java
@@ -0,0 +1,22 @@
+package org.bukkit;
+
+/**
+ * Represents various types of portals that can be made in a world.
+ */
+public enum PortalType {
+
+ /**
+ * This is a Nether portal, made of obsidian.
+ */
+ NETHER,
+
+ /**
+ * This is an Ender portal.
+ */
+ ENDER,
+
+ /**
+ * This is a custom Plugin portal.
+ */
+ CUSTOM;
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/Rotation.java b/vspigot-api/src/main/java/org/bukkit/Rotation.java
new file mode 100644
index 0000000..dfdb0e5
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/Rotation.java
@@ -0,0 +1,47 @@
+package org.bukkit;
+
+/**
+ * An enum to specify a rotation based orientation, like that on a clock.
+ *
+ * It represents how something is viewed, as opposed to cardinal directions.
+ */
+public enum Rotation {
+
+ /**
+ * No rotation
+ */
+ NONE,
+ /**
+ * Rotated clockwise by 90 degrees
+ */
+ CLOCKWISE,
+ /**
+ * Flipped upside-down, a 180 degree rotation
+ */
+ FLIPPED,
+ /**
+ * Rotated counter-clockwise by 90 degrees
+ */
+ COUNTER_CLOCKWISE,
+ ;
+
+ private static final Rotation [] rotations = values();
+
+ /**
+ * Rotate clockwise by 90 degrees.
+ *
+ * @return the relative rotation
+ */
+ public Rotation rotateClockwise() {
+ return rotations[(this.ordinal() + 1) & 0x3];
+ }
+
+ /**
+ * Rotate counter-clockwise by 90 degrees.
+ *
+ * @return the relative rotation
+ */
+ public Rotation rotateCounterClockwise() {
+ return rotations[(this.ordinal() - 1) & 0x3];
+ }
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/SandstoneType.java b/vspigot-api/src/main/java/org/bukkit/SandstoneType.java
new file mode 100644
index 0000000..a9ac16e
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/SandstoneType.java
@@ -0,0 +1,51 @@
+package org.bukkit;
+
+import java.util.Map;
+
+import com.google.common.collect.Maps;
+
+/**
+ * Represents the three different types of Sandstone
+ */
+public enum SandstoneType {
+ CRACKED(0x0),
+ GLYPHED(0x1),
+ SMOOTH(0x2);
+
+ private final byte data;
+ private final static Map
+ * 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.
+ *
+ * For use in {@link #broadcast(java.lang.String, java.lang.String)}.
+ */
+ public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user";
+
+ /**
+ * 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();
+
+ /**
+ * Gets the Bukkit version that this server is running.
+ *
+ * @return version of Bukkit
+ */
+ public String getBukkitVersion();
+
+ /**
+ * Gets an array copy of all currently logged in players.
+ *
+ * This method exists for legacy reasons to provide backwards
+ * compatibility. It will not exist at runtime and should not be used
+ * under any circumstances.
+ *
+ * @Deprecated superseded by {@link #getOnlinePlayers()}
+ * @return an array of Players that are currently online
+ */
+ @Deprecated
+ public Player[] _INVALID_getOnlinePlayers();
+
+ /**
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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();
+
+ /**
+ * Get the maximum amount of players which can login to this server.
+ *
+ * @return the amount of players this server allows
+ */
+ public int getMaxPlayers();
+
+ /**
+ * Get the game port that the server runs on.
+ *
+ * @return the port number of this server
+ */
+ public int getPort();
+
+ /**
+ * Get the view distance from this server.
+ *
+ * @return the view distance from this server.
+ */
+ public int getViewDistance();
+
+ /**
+ * 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();
+
+ /**
+ * Get the server group of this server.
+ *
+ * @return the server group of this server
+ */
+ public String getServerGroup();
+
+ /**
+ * 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();
+
+ /**
+ * Get world type (level-type setting) for default world.
+ *
+ * @return the value of level-type (e.g. DEFAULT, FLAT, DEFAULT_1_1)
+ */
+ public String getWorldType();
+
+ /**
+ * Get generate-structures setting.
+ *
+ * @return true if structure generation is enabled, false otherwise
+ */
+ public boolean getGenerateStructures();
+
+ /**
+ * Gets whether this server allows the End or not.
+ *
+ * @return whether this server allows the End or not
+ */
+ public boolean getAllowEnd();
+
+ /**
+ * 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();
+
+ /**
+ * Sets if the server is whitelisted.
+ *
+ * @param value true for whitelist on, false for off
+ */
+ public void setWhitelist(boolean value);
+
+ /**
+ * Gets a list of whitelisted players.
+ *
+ * @return a set containing all whitelisted players
+ */
+ public Set
+ * This is the same as calling {@link #broadcast(java.lang.String,
+ * java.lang.String)} to {@link #BROADCAST_CHANNEL_USERS}
+ *
+ * @param message the message
+ * @return the number of players
+ */
+ public int broadcastMessage(String message);
+
+ /**
+ * Broadcast a message to all players. With chatcolor translate
+ *
+ * This is the same as calling {@link #broadcast(java.lang.String,
+ * java.lang.String)} to {@link #BROADCAST_CHANNEL_USERS}
+ *
+ * @param message the message
+ * @return the number of players
+ */
+ public int broadcastTranslate(String message);
+
+ /**
+ * Gets the name of the update folder. The update folder is used to safely
+ * update plugins at the right moment on a plugin load.
+ *
+ * The update folder name is relative to the plugins folder.
+ *
+ * @return the name of the update folder
+ */
+ public String getUpdateFolder();
+
+ /**
+ * Gets the update folder. The update folder is used to safely update
+ * plugins at the right moment on a plugin load.
+ *
+ * @return the update folder
+ */
+ public File getUpdateFolderFile();
+
+ /**
+ * Gets the value of the connection throttle setting.
+ *
+ * @return the value of the connection throttle setting
+ */
+ public long getConnectionThrottle();
+
+ /**
+ * Gets default ticks per animal spawns value.
+ *
+ * Example Usage:
+ *
+ * Note: If set to 0, animal spawning will be disabled. We
+ * recommend using spawn-animals to control this instead.
+ *
+ * Minecraft default: 400.
+ *
+ * @return the default ticks per animal spawns value
+ */
+ public int getTicksPerAnimalSpawns();
+
+ /**
+ * Gets the default ticks per monster spawns value.
+ *
+ * Example Usage:
+ *
+ * Note: If set to 0, monsters spawning will be disabled. We
+ * recommend using spawn-monsters to control this instead.
+ *
+ * Minecraft default: 1.
+ *
+ * @return the default ticks per monsters spawn value
+ */
+ public int getTicksPerMonsterSpawns();
+
+ /**
+ * Gets a player object by the given username.
+ *
+ * This method may not return objects for offline players.
+ *
+ * @param name the name to look up
+ * @return a player if one was found, null otherwise
+ */
+ public Player getPlayer(String name);
+
+ /**
+ * Gets the player with the exact given name, case insensitive.
+ *
+ * @param name Exact name of the player to retrieve
+ * @return a player object if one was found, null otherwise
+ */
+ public Player getPlayerExact(String name);
+
+ /**
+ * 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 the (partial) name to match
+ * @return list of all possible players
+ */
+ public List
+ * If the world is already loaded, it will just return the equivalent of
+ * getWorld(creator.name()).
+ *
+ * @param creator the options to use when creating the world
+ * @return newly created or loaded world
+ */
+ public World createWorld(WorldCreator creator);
+
+ /**
+ * 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 true if successful, false otherwise
+ */
+ 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 true if successful, false otherwise
+ */
+ public boolean unloadWorld(World world, boolean save);
+
+ /**
+ * Gets the world with the given name.
+ *
+ * @param name the name of the world to retrieve
+ * @return a world with the given name, or null if none exists
+ */
+ public World getWorld(String name);
+
+ /**
+ * Gets the world from the given Unique ID.
+ *
+ * @param uid a unique-id of the world to retrieve
+ * @return a world with the given Unique ID, or null if none exists
+ */
+ public World getWorld(UUID uid);
+
+ /**
+ * Gets the map from the given item ID.
+ *
+ * @param id the id of the map to get
+ * @return a map view if it exists, or null otherwise
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public MapView getMap(short id);
+
+ /**
+ * Create a new map with an automatically assigned ID.
+ *
+ * @param world the world the map will belong to
+ * @return a newly created map view
+ */
+ public MapView createMap(World world);
+
+ /**
+ * Reloads the server, refreshing settings and plugin information.
+ */
+ public void reload();
+
+ /**
+ * Returns the primary logger associated with this server instance.
+ *
+ * @return Logger associated with this server
+ */
+ public Logger getLogger();
+
+ /**
+ * Gets a {@link PluginCommand} with the given name or alias.
+ *
+ * @param name the name of the command to retrieve
+ * @return a plugin command if found, null otherwise
+ */
+ public PluginCommand getPluginCommand(String name);
+
+ /**
+ * Writes loaded players to disk.
+ */
+ public void savePlayers();
+
+ /**
+ * Dispatches a command on this server, and executes it if found.
+ *
+ * @param sender the apparent sender of the command
+ * @param commandLine the command + arguments. Example:
+ * This method may involve a blocking web request to get the UUID for the
+ * given name.
+ *
+ * This will return an object even if the player does not exist. To this
+ * method, all players will exist.
+ *
+ * @deprecated Persistent storage of users should be by UUID as names are no longer
+ * unique past a single session.
+ * @param name the name the player to retrieve
+ * @return an offline player
+ * @see #getOfflinePlayer(java.util.UUID)
+ */
+ @Deprecated
+ public OfflinePlayer getOfflinePlayer(String name);
+
+ /**
+ * Gets the player by the given UUID, regardless if they are offline or
+ * online.
+ *
+ * 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);
+
+ /**
+ * Gets a set containing all current IPs that are banned.
+ *
+ * @return a set containing banned IP addresses
+ */
+ public Set
+ * Bans by name are no longer supported and this method will return
+ * null when trying to request them. The replacement is bans by UUID.
+ *
+ * @param type the type of list to fetch, cannot be null
+ * @return a ban list of the specified type
+ */
+ public BanList getBanList(BanList.Type type);
+
+ /**
+ * Gets a set containing all player operators.
+ *
+ * @return a set containing player operators
+ */
+ public Set
+ * Note: 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 does not
+ * preclude the same assumption.
+ *
+ * @return true if the current thread matches the expected primary thread,
+ * false otherwise
+ */
+ boolean isPrimaryThread();
+
+ /**
+ * Gets the message that is displayed on the server list.
+ *
+ * @return the servers MOTD
+ */
+ String getMotd();
+
+ /**
+ * Gets the default message that is displayed when the server is stopped.
+ *
+ * @return the shutdown message
+ */
+ String getShutdownMessage();
+
+ /**
+ * Gets the current warning state for the server.
+ *
+ * @return the configured warning state
+ */
+ public WarningState getWarningState();
+
+ /**
+ * Gets the instance of the item factory (for {@link ItemMeta}).
+ *
+ * @return the item factory
+ * @see ItemFactory
+ */
+ ItemFactory getItemFactory();
+
+ /**
+ * Gets the instance of the scoreboard manager.
+ *
+ * This will only exist after the first world has loaded.
+ *
+ * @return the scoreboard manager or null if no worlds are loaded.
+ */
+ ScoreboardManager getScoreboardManager();
+
+ /**
+ * 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();
+
+ /**
+ * Loads an image from a file, and returns a cached image for the specific
+ * server-icon.
+ *
+ * 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
+ * @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(File file) throws IllegalArgumentException, Exception;
+
+ /**
+ * Creates a cached server-icon for the specific image.
+ *
+ * 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;
+
+ /**
+ * Set the idle kick timeout. Any players idle for the specified amount of
+ * time will be automatically kicked.
+ *
+ * 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();
+
+ // Guardian start
+
+ /**
+ * @return Whether Guardian is enabled or not.
+ */
+ public boolean isGuardianEnabled();
+
+ /**
+ * Set whether Guardian is enabled or not.
+ *
+ * @param enabled - The new state to set to
+ */
+ public void setGuardianEnabled(boolean enabled);
+
+ /**
+ * @return Whether Guardian should do checks in the server's
+ * current conditions or not.
+ */
+ public boolean shouldGuardianAct();
+ // Guardian end
+
+ // MineHQ start
+ /**
+ * Gets a player object by the given disguised name.
+ *
+ * This method may not return objects for disguises not in use.
+ *
+ * @param name the disguised name to look up
+ * @return a player if one was found, null otherwise
+ */
+ public Player getPlayerByDisguise(String name);
+
+ /**
+ * Gets the player with the exact given disguise name, case insensitive
+ *
+ * This method may not return objects for disguises not in use.
+ *
+ * @param name the exact disguised name of a player
+ * @return a player if one was found, null otherwise
+ */
+ public Player getPlayerExactByDisguise(String name);
+ // MineHQ end
+
+ /**
+ * @see UnsafeValues
+ */
+ @Deprecated
+ UnsafeValues getUnsafe();
+
+ public class Spigot
+ {
+
+ public org.bukkit.configuration.file.YamlConfiguration getConfig()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ /**
+ * Sends the component to the player
+ *
+ * @param component the components to send
+ */
+ public void broadcast(net.md_5.bungee.api.chat.BaseComponent component)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ /**
+ * Sends an array of components as a single message to the
+ * player
+ *
+ * @param components the components to send
+ */
+ public void broadcast(net.md_5.bungee.api.chat.BaseComponent ...components)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ // PaperSpigot start - Add getTPS method
+ public double[] getTPS()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+ // PaperSpigot end
+ }
+
+ Spigot spigot();
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/SkullType.java b/vspigot-api/src/main/java/org/bukkit/SkullType.java
new file mode 100644
index 0000000..abd07c2
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/SkullType.java
@@ -0,0 +1,12 @@
+package org.bukkit;
+
+/**
+ * Represents the different types of skulls.
+ */
+public enum SkullType {
+ SKELETON,
+ WITHER,
+ ZOMBIE,
+ PLAYER,
+ CREEPER;
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/Sound.java b/vspigot-api/src/main/java/org/bukkit/Sound.java
new file mode 100644
index 0000000..0913530
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/Sound.java
@@ -0,0 +1,211 @@
+package org.bukkit;
+
+/**
+ * An Enum of Sounds the server is able to send to players.
+ *
+ * WARNING: At any time, sounds may be added/removed from this Enum or even
+ * MineCraft itself! There is no guarantee the sounds will play. There is no
+ * guarantee values will not be removed from this Enum. As such, you should
+ * not depend on the ordinal values of this class.
+ */
+public enum Sound {
+ AMBIENCE_CAVE,
+ AMBIENCE_RAIN,
+ AMBIENCE_THUNDER,
+ ANVIL_BREAK,
+ ANVIL_LAND,
+ ANVIL_USE,
+ ARROW_HIT,
+ BURP,
+ CHEST_CLOSE,
+ CHEST_OPEN,
+ CLICK,
+ DOOR_CLOSE,
+ DOOR_OPEN,
+ DRINK,
+ EAT,
+ EXPLODE,
+ FALL_BIG,
+ FALL_SMALL,
+ FIRE,
+ FIRE_IGNITE,
+ FIZZ,
+ FUSE,
+ GLASS,
+ HURT_FLESH,
+ ITEM_BREAK,
+ ITEM_PICKUP,
+ LAVA,
+ LAVA_POP,
+ LEVEL_UP,
+ MINECART_BASE,
+ MINECART_INSIDE,
+ NOTE_BASS,
+ NOTE_PIANO,
+ NOTE_BASS_DRUM,
+ NOTE_STICKS,
+ NOTE_BASS_GUITAR,
+ NOTE_SNARE_DRUM,
+ NOTE_PLING,
+ ORB_PICKUP,
+ PISTON_EXTEND,
+ PISTON_RETRACT,
+ PORTAL,
+ PORTAL_TRAVEL,
+ PORTAL_TRIGGER,
+ SHOOT_ARROW,
+ SPLASH,
+ SPLASH2,
+ STEP_GRASS,
+ STEP_GRAVEL,
+ STEP_LADDER,
+ STEP_SAND,
+ STEP_SNOW,
+ STEP_STONE,
+ STEP_WOOD,
+ STEP_WOOL,
+ SWIM,
+ WATER,
+ WOOD_CLICK,
+ // Mob sounds
+ BAT_DEATH,
+ BAT_HURT,
+ BAT_IDLE,
+ BAT_LOOP,
+ BAT_TAKEOFF,
+ BLAZE_BREATH,
+ BLAZE_DEATH,
+ BLAZE_HIT,
+ CAT_HISS,
+ CAT_HIT,
+ CAT_MEOW,
+ CAT_PURR,
+ CAT_PURREOW,
+ CHICKEN_IDLE,
+ CHICKEN_HURT,
+ CHICKEN_EGG_POP,
+ CHICKEN_WALK,
+ COW_IDLE,
+ COW_HURT,
+ COW_WALK,
+ CREEPER_HISS,
+ CREEPER_DEATH,
+ ENDERDRAGON_DEATH,
+ ENDERDRAGON_GROWL,
+ ENDERDRAGON_HIT,
+ ENDERDRAGON_WINGS,
+ ENDERMAN_DEATH,
+ ENDERMAN_HIT,
+ ENDERMAN_IDLE,
+ ENDERMAN_TELEPORT,
+ ENDERMAN_SCREAM,
+ ENDERMAN_STARE,
+ GHAST_SCREAM,
+ GHAST_SCREAM2,
+ GHAST_CHARGE,
+ GHAST_DEATH,
+ GHAST_FIREBALL,
+ GHAST_MOAN,
+ IRONGOLEM_DEATH,
+ IRONGOLEM_HIT,
+ IRONGOLEM_THROW,
+ IRONGOLEM_WALK,
+ MAGMACUBE_WALK,
+ MAGMACUBE_WALK2,
+ MAGMACUBE_JUMP,
+ PIG_IDLE,
+ PIG_DEATH,
+ PIG_WALK,
+ SHEEP_IDLE,
+ SHEEP_SHEAR,
+ SHEEP_WALK,
+ SILVERFISH_HIT,
+ SILVERFISH_KILL,
+ SILVERFISH_IDLE,
+ SILVERFISH_WALK,
+ SKELETON_IDLE,
+ SKELETON_DEATH,
+ SKELETON_HURT,
+ SKELETON_WALK,
+ SLIME_ATTACK,
+ SLIME_WALK,
+ SLIME_WALK2,
+ SPIDER_IDLE,
+ SPIDER_DEATH,
+ SPIDER_WALK,
+ WITHER_DEATH,
+ WITHER_HURT,
+ WITHER_IDLE,
+ WITHER_SHOOT,
+ WITHER_SPAWN,
+ WOLF_BARK,
+ WOLF_DEATH,
+ WOLF_GROWL,
+ WOLF_HOWL,
+ WOLF_HURT,
+ WOLF_PANT,
+ WOLF_SHAKE,
+ WOLF_WALK,
+ WOLF_WHINE,
+ ZOMBIE_METAL,
+ ZOMBIE_WOOD,
+ ZOMBIE_WOODBREAK,
+ ZOMBIE_IDLE,
+ ZOMBIE_DEATH,
+ ZOMBIE_HURT,
+ ZOMBIE_INFECT,
+ ZOMBIE_UNFECT,
+ ZOMBIE_REMEDY,
+ ZOMBIE_WALK,
+ ZOMBIE_PIG_IDLE,
+ ZOMBIE_PIG_ANGRY,
+ ZOMBIE_PIG_DEATH,
+ ZOMBIE_PIG_HURT,
+ // Dig Sounds
+ DIG_WOOL,
+ DIG_GRASS,
+ DIG_GRAVEL,
+ DIG_SAND,
+ DIG_SNOW,
+ DIG_STONE,
+ DIG_WOOD,
+ // Fireworks
+ FIREWORK_BLAST,
+ FIREWORK_BLAST2,
+ FIREWORK_LARGE_BLAST,
+ FIREWORK_LARGE_BLAST2,
+ FIREWORK_TWINKLE,
+ FIREWORK_TWINKLE2,
+ FIREWORK_LAUNCH,
+ SUCCESSFUL_HIT,
+ // Horses
+ HORSE_ANGRY,
+ HORSE_ARMOR,
+ HORSE_BREATHE,
+ HORSE_DEATH,
+ HORSE_GALLOP,
+ HORSE_HIT,
+ HORSE_IDLE,
+ HORSE_JUMP,
+ HORSE_LAND,
+ HORSE_SADDLE,
+ HORSE_SOFT,
+ HORSE_WOOD,
+ DONKEY_ANGRY,
+ DONKEY_DEATH,
+ DONKEY_HIT,
+ DONKEY_IDLE,
+ HORSE_SKELETON_DEATH,
+ HORSE_SKELETON_HIT,
+ HORSE_SKELETON_IDLE,
+ HORSE_ZOMBIE_DEATH,
+ HORSE_ZOMBIE_HIT,
+ HORSE_ZOMBIE_IDLE,
+ // Villager
+ VILLAGER_DEATH,
+ VILLAGER_HAGGLE,
+ VILLAGER_HIT,
+ VILLAGER_IDLE,
+ VILLAGER_NO,
+ VILLAGER_YES,
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/Statistic.java b/vspigot-api/src/main/java/org/bukkit/Statistic.java
new file mode 100644
index 0000000..57df72b
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/Statistic.java
@@ -0,0 +1,108 @@
+package org.bukkit;
+
+/**
+ * Represents a countable statistic, which is tracked by the server.
+ */
+public enum Statistic {
+ DAMAGE_DEALT,
+ DAMAGE_TAKEN,
+ DEATHS,
+ MOB_KILLS,
+ PLAYER_KILLS,
+ FISH_CAUGHT,
+ ANIMALS_BRED,
+ TREASURE_FISHED,
+ JUNK_FISHED,
+ LEAVE_GAME,
+ JUMP,
+ DROP,
+ PLAY_ONE_TICK,
+ WALK_ONE_CM,
+ SWIM_ONE_CM,
+ FALL_ONE_CM,
+ CLIMB_ONE_CM,
+ FLY_ONE_CM,
+ DIVE_ONE_CM,
+ MINECART_ONE_CM,
+ BOAT_ONE_CM,
+ PIG_ONE_CM,
+ HORSE_ONE_CM,
+ MINE_BLOCK(Type.BLOCK),
+ USE_ITEM(Type.ITEM),
+ BREAK_ITEM(Type.ITEM),
+ CRAFT_ITEM(Type.ITEM),
+ KILL_ENTITY(Type.ENTITY),
+ ENTITY_KILLED_BY(Type.ENTITY);
+
+ private final Type type;
+
+ private Statistic() {
+ this(Type.UNTYPED);
+ }
+
+ private Statistic(Type type) {
+ this.type = type;
+ }
+
+ /**
+ * Gets the type of this statistic.
+ *
+ * @return the type of this statistic
+ */
+ public Type getType() {
+ return type;
+ }
+
+ /**
+ * Checks if this is a substatistic.
+ *
+ * A substatistic exists en masse for each block, item, or entitytype, depending on
+ * {@link #getType()}.
+ *
+ * This is a redundant method and equivalent to checking
+ *
+ * This is a redundant method and equivalent to checking
+ *
+ * It is used in {@link org.bukkit.event.entity.EntityPortalEvent} and in
+ * {@link org.bukkit.event.player.PlayerPortalEvent} to help developers
+ * reproduce and/or modify Vanilla behaviour.
+ */
+public interface TravelAgent {
+
+ /**
+ * Set the Block radius to search in for available portals.
+ *
+ * @param radius the radius in which to search for a portal from the
+ * location
+ * @return this travel agent
+ */
+ public TravelAgent setSearchRadius(int radius);
+
+ /**
+ * Gets the search radius value for finding an available portal.
+ *
+ * @return the currently set search radius
+ */
+ public int getSearchRadius();
+
+ /**
+ * Sets the maximum radius from the given location to create a portal.
+ *
+ * @param radius the radius in which to create a portal from the location
+ * @return this travel agent
+ */
+ public TravelAgent setCreationRadius(int radius);
+
+ /**
+ * Gets the maximum radius from the given location to create a portal.
+ *
+ * @return the currently set creation radius
+ */
+ public int getCreationRadius();
+
+ /**
+ * Returns whether the TravelAgent will attempt to create a destination
+ * portal or not.
+ *
+ * @return whether the TravelAgent should create a destination portal or
+ * not
+ */
+ public boolean getCanCreatePortal();
+
+ /**
+ * Sets whether the TravelAgent should attempt to create a destination
+ * portal or not.
+ *
+ * @param create Sets whether the TravelAgent should create a destination
+ * portal or not
+ */
+ public void setCanCreatePortal(boolean create);
+
+ /**
+ * Attempt to find a portal near the given location, if a portal is not
+ * found it will attempt to create one.
+ *
+ * @param location the location where the search for a portal should begin
+ * @return the location of a portal which has been found or returns the
+ * location passed to the method if unsuccessful
+ * @see #createPortal(Location)
+ */
+ public Location findOrCreate(Location location);
+
+ /**
+ * Attempt to find a portal near the given location.
+ *
+ * @param location the desired location of the portal
+ * @return the location of the nearest portal to the location
+ */
+ public Location findPortal(Location location);
+
+ /**
+ * Attempt to create a portal near the given location.
+ *
+ * In the case of a Nether portal teleportation, this will attempt to
+ * create a Nether portal.
+ *
+ * In the case of an Ender portal teleportation, this will (re-)create the
+ * obsidian platform and clean blocks above it.
+ *
+ * @param location the desired location of the portal
+ * @return true if a portal was successfully created
+ */
+ public boolean createPortal(Location location);
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/TreeSpecies.java b/vspigot-api/src/main/java/org/bukkit/TreeSpecies.java
new file mode 100644
index 0000000..f29062a
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/TreeSpecies.java
@@ -0,0 +1,74 @@
+package org.bukkit;
+
+import java.util.Map;
+
+import com.google.common.collect.Maps;
+
+/**
+ * Represents the different species of trees regardless of size.
+ */
+public enum TreeSpecies {
+
+ /**
+ * Represents the common tree species.
+ */
+ GENERIC(0x0),
+ /**
+ * Represents the darker barked/leaved tree species.
+ */
+ REDWOOD(0x1),
+ /**
+ * Represents birches.
+ */
+ BIRCH(0x2),
+ /**
+ * Represents jungle trees.
+ */
+ JUNGLE(0x3),
+ /**
+ * Represents acacia trees.
+ */
+ ACACIA(0x4),
+ /**
+ * Represents dark oak trees.
+ */
+ DARK_OAK(0x5),
+ ;
+
+ private final byte data;
+ private final static Map
+ * Their existence and behavior is not guaranteed across future versions. They
+ * may be poorly named, throw exceptions, have misleading parameters, or any
+ * other bad programming practice.
+ *
+ * This interface is unsupported and only for internal use.
+ *
+ * @deprecated Unsupported & internal use only
+ */
+@Deprecated
+public interface UnsafeValues {
+
+ Material getMaterialFromInternalName(String name);
+
+ List
+ * This is solely meant for identifying methods that don't need to be
+ * overridden / handled manually.
+ */
+@Target({ElementType.CONSTRUCTOR, ElementType.METHOD})
+@Retention(RetentionPolicy.SOURCE)
+public @interface Utility {
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/Warning.java b/vspigot-api/src/main/java/org/bukkit/Warning.java
new file mode 100644
index 0000000..6a2a3b0
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/Warning.java
@@ -0,0 +1,109 @@
+package org.bukkit;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.Map;
+
+import com.google.common.collect.ImmutableMap;
+
+/**
+ * This designates the warning state for a specific item.
+ *
+ * When the server settings dictate 'default' warnings, warnings are printed
+ * if the {@link #value()} is true.
+ */
+@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Warning {
+
+ /**
+ * This represents the states that server verbose for warnings may be.
+ */
+ public enum WarningState {
+
+ /**
+ * Indicates all warnings should be printed for deprecated items.
+ */
+ ON,
+ /**
+ * Indicates no warnings should be printed for deprecated items.
+ */
+ OFF,
+ /**
+ * Indicates each warning would default to the configured {@link
+ * Warning} annotation, or always if annotation not found.
+ */
+ DEFAULT;
+
+ private static final Map
+ * If the chunk does not exist, it will be generated.
+ *
+ * This method is analogous to {@link #loadChunk(int, int, boolean)} where
+ * generate is true.
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ */
+ public void loadChunk(int x, int z);
+
+ /**
+ * Loads the {@link Chunk} at the specified coordinates
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @param generate Whether or not to generate a chunk if it doesn't
+ * already exist
+ * @return true if the chunk has loaded successfully, otherwise false
+ */
+ public boolean loadChunk(int x, int z, boolean generate);
+
+ /**
+ * Safely unloads and saves the {@link Chunk} at the specified coordinates
+ *
+ * This method is analogous to {@link #unloadChunk(int, int, boolean,
+ * boolean)} where safe and saveis true
+ *
+ * @param chunk the chunk to unload
+ * @return true if the chunk has unloaded successfully, otherwise false
+ */
+ public boolean unloadChunk(Chunk chunk);
+
+ /**
+ * Safely unloads and saves the {@link Chunk} at the specified coordinates
+ *
+ * This method is analogous to {@link #unloadChunk(int, int, boolean,
+ * boolean)} where safe and saveis true
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @return true if the chunk has unloaded successfully, otherwise false
+ */
+ public boolean unloadChunk(int x, int z);
+
+ /**
+ * Safely unloads and optionally saves the {@link Chunk} at the specified
+ * coordinates
+ *
+ * This method is analogous to {@link #unloadChunk(int, int, boolean,
+ * boolean)} where save is true
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @param save Whether or not to save the chunk
+ * @return true if the chunk has unloaded successfully, otherwise false
+ */
+ public boolean unloadChunk(int x, int z, boolean save);
+
+ /**
+ * Unloads and optionally saves the {@link Chunk} at the specified
+ * coordinates
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @param save Controls whether the chunk is saved
+ * @param safe Controls whether to unload the chunk when players are
+ * nearby
+ * @return true if the chunk has unloaded successfully, otherwise false
+ */
+ public boolean unloadChunk(int x, int z, boolean save, boolean safe);
+
+ /**
+ * Safely queues the {@link Chunk} at the specified coordinates for
+ * unloading
+ *
+ * This method is analogous to {@link #unloadChunkRequest(int, int,
+ * boolean)} where safe is true
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @return true is the queue attempt was successful, otherwise false
+ */
+ public boolean unloadChunkRequest(int x, int z);
+
+ /**
+ * Queues the {@link Chunk} at the specified coordinates for unloading
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @param safe Controls whether to queue the chunk when players are nearby
+ * @return Whether the chunk was actually queued
+ */
+ public boolean unloadChunkRequest(int x, int z, boolean safe);
+
+ /**
+ * Regenerates the {@link Chunk} at the specified coordinates
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @return Whether the chunk was actually regenerated
+ */
+ public boolean regenerateChunk(int x, int z);
+
+ /**
+ * Resends the {@link Chunk} to all clients
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @return Whether the chunk was actually refreshed
+ */
+ public boolean refreshChunk(int x, int z);
+
+ /**
+ * Drops an item at the specified {@link Location}
+ *
+ * @param location Location to drop the item
+ * @param item ItemStack to drop
+ * @return ItemDrop entity created as a result of this method
+ */
+ public Item dropItem(Location location, ItemStack item);
+
+ /**
+ * Drops an item at the specified {@link Location} with a random offset
+ *
+ * @param location Location to drop the item
+ * @param item ItemStack to drop
+ * @return ItemDrop entity created as a result of this method
+ */
+ public Item dropItemNaturally(Location location, ItemStack item);
+
+ /**
+ * Creates an {@link Arrow} entity at the given {@link Location}
+ *
+ * @param location Location to spawn the arrow
+ * @param direction Direction to shoot the arrow in
+ * @param speed Speed of the arrow. A recommend speed is 0.6
+ * @param spread Spread of the arrow. A recommend spread is 12
+ * @return Arrow entity spawned as a result of this method
+ */
+ public Arrow spawnArrow(Location location, Vector direction, float speed, float spread);
+
+ /**
+ * Creates a tree at the given {@link Location}
+ *
+ * @param location Location to spawn the tree
+ * @param type Type of the tree to create
+ * @return true if the tree was created successfully, otherwise false
+ */
+ public boolean generateTree(Location location, TreeType type);
+
+ /**
+ * Creates a tree at the given {@link Location}
+ *
+ * @param loc Location to spawn the tree
+ * @param type Type of the tree to create
+ * @param delegate A class to call for each block changed as a result of
+ * this method
+ * @return true if the tree was created successfully, otherwise false
+ */
+ public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate);
+
+ /**
+ * Creates a entity at the given {@link Location}
+ *
+ * @param loc The location to spawn the entity
+ * @param type The entity to spawn
+ * @return Resulting Entity of this method, or null if it was unsuccessful
+ */
+ public Entity spawnEntity(Location loc, EntityType type);
+
+ /**
+ * Creates a creature at the given {@link Location}
+ *
+ * @param loc The location to spawn the creature
+ * @param type The creature to spawn
+ * @return Resulting LivingEntity of this method, or null if it was
+ * unsuccessful
+ * @deprecated Has issues spawning non LivingEntities. Use {@link
+ * #spawnEntity(Location, EntityType) spawnEntity} instead.
+ */
+ @Deprecated
+ public LivingEntity spawnCreature(Location loc, EntityType type);
+
+ /**
+ * Creates a creature at the given {@link Location}
+ *
+ * @param loc The location to spawn the creature
+ * @param type The creature to spawn
+ * @return Resulting LivingEntity of this method, or null if it was
+ * unsuccessful
+ */
+ @Deprecated
+ public LivingEntity spawnCreature(Location loc, CreatureType type);
+
+ /**
+ * Strikes lightning at the given {@link Location}
+ *
+ * @param loc The location to strike lightning
+ * @return The lightning entity.
+ */
+ public LightningStrike strikeLightning(Location loc);
+
+ /**
+ * Strikes lightning at the given {@link Location} without doing damage
+ *
+ * @param loc The location to strike lightning
+ * @return The lightning entity.
+ */
+ public LightningStrike strikeLightningEffect(Location loc);
+
+ /**
+ * Get a list of all entities in this World
+ *
+ * @return A List of all Entities currently residing in this world
+ */
+ public List
+ * The relative time is analogous to hours * 1000
+ *
+ * @return The current relative time
+ * @see #getFullTime() Returns an absolute time of this world
+ */
+ public long getTime();
+
+ /**
+ * Sets the relative in-game time on the server.
+ *
+ * The relative time is analogous to hours * 1000
+ *
+ * Note that setting the relative time below the current relative time
+ * will actually move the clock forward a day. If you require to rewind
+ * time, please see {@link #setFullTime(long)}
+ *
+ * @param time The new relative time to set the in-game time to (in
+ * hours*1000)
+ * @see #setFullTime(long) Sets the absolute time of this world
+ */
+ public void setTime(long time);
+
+ /**
+ * Gets the full in-game time on this world
+ *
+ * @return The current absolute time
+ * @see #getTime() Returns a relative time of this world
+ */
+ public long getFullTime();
+
+ /**
+ * Sets the in-game time on the server
+ *
+ * Note that this sets the full time of the world, which may cause adverse
+ * effects such as breaking redstone clocks and any scheduled events
+ *
+ * @param time The new absolute time to set this world to
+ * @see #setTime(long) Sets the relative time of this world
+ */
+ public void setFullTime(long time);
+
+ /**
+ * Returns whether the world has an ongoing storm.
+ *
+ * @return Whether there is an ongoing storm
+ */
+ public boolean hasStorm();
+
+ /**
+ * Set whether there is a storm. A duration will be set for the new
+ * current conditions.
+ *
+ * @param hasStorm Whether there is rain and snow
+ */
+ public void setStorm(boolean hasStorm);
+
+ /**
+ * Get the remaining time in ticks of the current conditions.
+ *
+ * @return Time in ticks
+ */
+ public int getWeatherDuration();
+
+ /**
+ * Set the remaining time in ticks of the current conditions.
+ *
+ * @param duration Time in ticks
+ */
+ public void setWeatherDuration(int duration);
+
+ /**
+ * Returns whether there is thunder.
+ *
+ * @return Whether there is thunder
+ */
+ public boolean isThundering();
+
+ /**
+ * Set whether it is thundering.
+ *
+ * @param thundering Whether it is thundering
+ */
+ public void setThundering(boolean thundering);
+
+ /**
+ * Get the thundering duration.
+ *
+ * @return Duration in ticks
+ */
+ public int getThunderDuration();
+
+ /**
+ * Set the thundering duration.
+ *
+ * @param duration Duration in ticks
+ */
+ public void setThunderDuration(int duration);
+
+ /**
+ * Creates explosion at given coordinates with given power
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @param power The power of explosion, where 4F is TNT
+ * @return false if explosion was canceled, otherwise true
+ */
+ public boolean createExplosion(double x, double y, double z, float power);
+
+ /**
+ * Creates explosion at given coordinates with given power and optionally
+ * setting blocks on fire.
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @param power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire
+ * @return false if explosion was canceled, otherwise true
+ */
+ public boolean createExplosion(double x, double y, double z, float power, boolean setFire);
+
+ /**
+ * Creates explosion at given coordinates with given power and optionally
+ * setting blocks on fire or breaking blocks.
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @param power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire
+ * @param breakBlocks Whether or not to have blocks be destroyed
+ * @return false if explosion was canceled, otherwise true
+ */
+ public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks);
+
+ /**
+ * Creates explosion at given coordinates with given power
+ *
+ * @param loc Location to blow up
+ * @param power The power of explosion, where 4F is TNT
+ * @return false if explosion was canceled, otherwise true
+ */
+ public boolean createExplosion(Location loc, float power);
+
+ /**
+ * Creates explosion at given coordinates with given power and optionally
+ * setting blocks on fire.
+ *
+ * @param loc Location to blow up
+ * @param power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire
+ * @return false if explosion was canceled, otherwise true
+ */
+ public boolean createExplosion(Location loc, float power, boolean setFire);
+
+ /**
+ * Gets the {@link Environment} type of this world
+ *
+ * @return This worlds Environment type
+ */
+ public Environment getEnvironment();
+
+ /**
+ * Gets the Seed for this world.
+ *
+ * @return This worlds Seed
+ */
+ public long getSeed();
+
+ /**
+ * Gets the current PVP setting for this world.
+ *
+ * @return True if PVP is enabled
+ */
+ public boolean getPVP();
+
+ /**
+ * Sets the PVP setting for this world.
+ *
+ * @param pvp True/False whether PVP should be Enabled.
+ */
+ public void setPVP(boolean pvp);
+
+ /**
+ * Gets the chunk generator for this world
+ *
+ * @return ChunkGenerator associated with this world
+ */
+ public ChunkGenerator getGenerator();
+
+ /**
+ * Saves world to disk
+ */
+ public void save();
+
+ /**
+ * Gets a list of all applied {@link BlockPopulator}s for this World
+ *
+ * @return List containing any or none BlockPopulators
+ */
+ public List
+ * The Material must be a block type, check with {@link Material#isBlock()
+ * material.isBlock()}. The Material may not be air.
+ *
+ * @param location The {@link Location} to spawn the FallingBlock
+ * @param material The block {@link Material} type
+ * @param data The block data
+ * @return The spawned {@link FallingBlock} instance
+ * @throws IllegalArgumentException if {@link Location} or {@link
+ * Material} are null or {@link Material} is not a block
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public FallingBlock spawnFallingBlock(Location location, Material material, byte data) throws IllegalArgumentException;
+
+ /**
+ * Spawn a {@link FallingBlock} entity at the given {@link Location} of
+ * the specified blockId (converted to {@link Material})
+ *
+ * @param location The {@link Location} to spawn the FallingBlock
+ * @param blockId The id of the intended material
+ * @param blockData The block data
+ * @return The spawned FallingBlock instance
+ * @throws IllegalArgumentException if location is null, or blockId is
+ * invalid
+ * @see #spawnFallingBlock(org.bukkit.Location, org.bukkit.Material, byte)
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public FallingBlock spawnFallingBlock(Location location, int blockId, byte blockData) throws IllegalArgumentException;
+
+ /**
+ * Plays an effect to all players within a default radius around a given
+ * location.
+ *
+ * @param location the {@link Location} around which players must be to
+ * hear the sound
+ * @param effect the {@link Effect}
+ * @param data a data bit needed for some effects
+ */
+ public void playEffect(Location location, Effect effect, int data);
+
+ /**
+ * Plays an effect to all players within a given radius around a location.
+ *
+ * @param location the {@link Location} around which players must be to
+ * hear the effect
+ * @param effect the {@link Effect}
+ * @param data a data bit needed for some effects
+ * @param radius the radius around the location
+ */
+ public void playEffect(Location location, Effect effect, int data, int radius);
+
+ /**
+ * Plays an effect to all players within a default radius around a given
+ * location.
+ *
+ * @param location the {@link Location} around which players must be to
+ * hear the sound
+ * @param effect the {@link Effect}
+ * @param data a data bit needed for some effects
+ */
+ public
+ * It is safe to run this method when the block does not exist, it will
+ * not create the block.
+ *
+ * @param x X coordinate of the block
+ * @param z Z coordinate of the block
+ * @return Temperature of the requested block
+ */
+ public double getTemperature(int x, int z);
+
+ /**
+ * Gets the humidity for the given block coordinates.
+ *
+ * It is safe to run this method when the block does not exist, it will
+ * not create the block.
+ *
+ * @param x X coordinate of the block
+ * @param z Z coordinate of the block
+ * @return Humidity of the requested block
+ */
+ public double getHumidity(int x, int z);
+
+ /**
+ * Gets the maximum height of this world.
+ *
+ * If the max height is 100, there are only blocks from y=0 to y=99.
+ *
+ * @return Maximum height of the world
+ */
+ public int getMaxHeight();
+
+ /**
+ * Gets the sea level for this world.
+ *
+ * This is often half of {@link #getMaxHeight()}
+ *
+ * @return Sea level
+ */
+ public int getSeaLevel();
+
+ /**
+ * Gets whether the world's spawn area should be kept loaded into memory
+ * or not.
+ *
+ * @return true if the world's spawn area will be kept loaded into memory.
+ */
+ public boolean getKeepSpawnInMemory();
+
+ /**
+ * Sets whether the world's spawn area should be kept loaded into memory
+ * or not.
+ *
+ * @param keepLoaded if true then the world's spawn area will be kept
+ * loaded into memory.
+ */
+ public void setKeepSpawnInMemory(boolean keepLoaded);
+
+ /**
+ * Gets whether or not the world will automatically save
+ *
+ * @return true if the world will automatically save, otherwise false
+ */
+ public boolean isAutoSave();
+
+ /**
+ * Sets whether or not the world will automatically save
+ *
+ * @param value true if the world should automatically save, otherwise
+ * false
+ */
+ public void setAutoSave(boolean value);
+
+ /**
+ * Sets the Difficulty of the world.
+ *
+ * @param difficulty the new difficulty you want to set the world to
+ */
+ public void setDifficulty(Difficulty difficulty);
+
+ /**
+ * Gets the Difficulty of the world.
+ *
+ * @return The difficulty of the world.
+ */
+ public Difficulty getDifficulty();
+
+ /**
+ * Gets the folder of this world on disk.
+ *
+ * @return The folder of this world.
+ */
+ public File getWorldFolder();
+
+ /**
+ * Gets the type of this world.
+ *
+ * @return Type of this world.
+ */
+ public WorldType getWorldType();
+
+ /**
+ * Gets whether or not structures are being generated.
+ *
+ * @return True if structures are being generated.
+ */
+ public boolean canGenerateStructures();
+
+ /**
+ * Gets the world's ticks per animal spawns value
+ *
+ * This value determines how many ticks there are between attempts to
+ * spawn animals.
+ *
+ * Example Usage:
+ *
+ * Note:
+ * If set to 0, animal spawning will be disabled for this world. We
+ * recommend using {@link #setSpawnFlags(boolean, boolean)} to control
+ * this instead.
+ *
+ * Minecraft default: 400.
+ *
+ * @return The world's ticks per animal spawns value
+ */
+ public long getTicksPerAnimalSpawns();
+
+ /**
+ * Sets the world's ticks per animal spawns value
+ *
+ * This value determines how many ticks there are between attempts to
+ * spawn animals.
+ *
+ * Example Usage:
+ *
+ * Note:
+ * If set to 0, animal spawning will be disabled for this world. We
+ * recommend using {@link #setSpawnFlags(boolean, boolean)} to control
+ * this instead.
+ *
+ * Minecraft default: 400.
+ *
+ * @param ticksPerAnimalSpawns the ticks per animal spawns value you want
+ * to set the world to
+ */
+ public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns);
+
+ /**
+ * Gets the world's ticks per monster spawns value
+ *
+ * This value determines how many ticks there are between attempts to
+ * spawn monsters.
+ *
+ * Example Usage:
+ *
+ * Note:
+ * If set to 0, monsters spawning will be disabled for this world. We
+ * recommend using {@link #setSpawnFlags(boolean, boolean)} to control
+ * this instead.
+ *
+ * Minecraft default: 1.
+ *
+ * @return The world's ticks per monster spawns value
+ */
+ public long getTicksPerMonsterSpawns();
+
+ /**
+ * Sets the world's ticks per monster spawns value
+ *
+ * This value determines how many ticks there are between attempts to
+ * spawn monsters.
+ *
+ * Example Usage:
+ *
+ * Note:
+ * If set to 0, monsters spawning will be disabled for this world. We
+ * recommend using {@link #setSpawnFlags(boolean, boolean)} to control
+ * this instead.
+ *
+ * Minecraft default: 1.
+ *
+ * @param ticksPerMonsterSpawns the ticks per monster spawns value you
+ * want to set the world to
+ */
+ public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns);
+
+ /**
+ * Gets limit for number of monsters that can spawn in a chunk in this
+ * world
+ *
+ * @return The monster spawn limit
+ */
+ int getMonsterSpawnLimit();
+
+ /**
+ * Sets the limit for number of monsters that can spawn in a chunk in this
+ * world
+ *
+ * Note: If set to a negative number the world will use the
+ * server-wide spawn limit instead.
+ */
+ void setMonsterSpawnLimit(int limit);
+
+ /**
+ * Gets the limit for number of animals that can spawn in a chunk in this
+ * world
+ *
+ * @return The animal spawn limit
+ */
+ int getAnimalSpawnLimit();
+
+ /**
+ * Sets the limit for number of animals that can spawn in a chunk in this
+ * world
+ *
+ * Note: If set to a negative number the world will use the
+ * server-wide spawn limit instead.
+ */
+ void setAnimalSpawnLimit(int limit);
+
+ /**
+ * Gets the limit for number of water animals that can spawn in a chunk in
+ * this world
+ *
+ * @return The water animal spawn limit
+ */
+ int getWaterAnimalSpawnLimit();
+
+ /**
+ * Sets the limit for number of water animals that can spawn in a chunk in
+ * this world
+ *
+ * Note: If set to a negative number the world will use the
+ * server-wide spawn limit instead.
+ */
+ void setWaterAnimalSpawnLimit(int limit);
+
+ /**
+ * Gets the limit for number of ambient mobs that can spawn in a chunk in
+ * this world
+ *
+ * @return The ambient spawn limit
+ */
+ int getAmbientSpawnLimit();
+
+ /**
+ * Sets the limit for number of ambient mobs that can spawn in a chunk in
+ * this world
+ *
+ * Note: If set to a negative number the world will use the
+ * server-wide spawn limit instead.
+ */
+ void setAmbientSpawnLimit(int limit);
+
+ /**
+ * Play a Sound at the provided Location in the World
+ *
+ * This function will fail silently if Location or Sound are null.
+ *
+ * @param location The location to play the sound
+ * @param sound The sound to play
+ * @param volume The volume of the sound
+ * @param pitch The pitch of the sound
+ */
+ void playSound(Location location, Sound sound, float volume, float pitch);
+
+ /**
+ * Get existing rules
+ *
+ * @return An array of rules
+ */
+ public String[] getGameRules();
+
+ /**
+ * Gets the current state of the specified rule
+ *
+ * Will return null if rule passed is null
+ *
+ * @param rule Rule to look up value of
+ * @return String value of rule
+ */
+ public String getGameRuleValue(String rule);
+
+ /**
+ * Set the specified gamerule to specified value.
+ *
+ * The rule may attempt to validate the value passed, will return true if
+ * value was set.
+ *
+ * If rule is null, the function will return false.
+ *
+ * @param rule Rule to set
+ * @param value Value to set rule to
+ * @return True if rule was set
+ */
+ public boolean setGameRuleValue(String rule, String value);
+
+ /**
+ * Checks if string is a valid game rule
+ *
+ * @param rule Rule to check
+ * @return True if rule exists
+ */
+ public boolean isGameRule(String rule);
+
+ // Spigot start
+ public class Spigot
+ {
+
+ /**
+ * Plays an effect to all players within a default radius around a given
+ * location.
+ *
+ * @param location the {@link Location} around which players must be to
+ * see the effect
+ * @param effect the {@link Effect}
+ * @throws IllegalArgumentException if the location or effect is null.
+ * It also throws when the effect requires a material or a material data
+ */
+ public void playEffect(Location location, Effect effect)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ /**
+ * Plays an effect to all players within a default radius around a given
+ * location. The effect will use the provided material (and material
+ * data if required). The particle's position on the client will be the
+ * given location, adjusted on each axis by a normal distribution with
+ * mean 0 and standard deviation given in the offset parameters, each
+ * particle has independently calculated offsets. The effect will have
+ * the given speed and particle count if the effect is a particle. Some
+ * effect will create multiple particles.
+ *
+ * @param location the {@link Location} around which players must be to
+ * see the effect
+ * @param effect effect the {@link Effect}
+ * @param id the item/block/data id for the effect
+ * @param data the data value of the block/item for the effect
+ * @param offsetX the amount to be randomly offset by in the X axis
+ * @param offsetY the amount to be randomly offset by in the Y axis
+ * @param offsetZ the amount to be randomly offset by in the Z axis
+ * @param speed the speed of the particles
+ * @param particleCount the number of particles
+ * @param radius the radius around the location
+ */
+ public void playEffect(Location location, Effect effect, int id, int data, float offsetX, float offsetY, float offsetZ, float speed, int particleCount, int radius)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ /**
+ * Strikes lightning at the given {@link Location} and possibly without sound
+ *
+ * @param loc The location to strike lightning
+ * @param isSilent Whether this strike makes no sound
+ * @return The lightning entity.
+ */
+ public LightningStrike strikeLightning(Location loc, boolean isSilent)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ /**
+ * Strikes lightning at the given {@link Location} without doing damage and possibly without sound
+ *
+ * @param loc The location to strike lightning
+ * @param isSilent Whether this strike makes no sound
+ * @return The lightning entity.
+ */
+ public LightningStrike strikeLightningEffect(Location loc, boolean isSilent)
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+ }
+
+ Spigot spigot();
+ // Spigot end
+
+ /**
+ * Represents various map environment types that a world may be
+ */
+ public enum Environment {
+
+ /**
+ * Represents the "normal"/"surface world" map
+ */
+ NORMAL(0),
+ /**
+ * Represents a nether based map ("hell")
+ */
+ NETHER(-1),
+ /**
+ * Represents the "end" map
+ */
+ THE_END(1);
+
+ private final int id;
+ private static final Map
+ * This may be null, in which case the "natural" generator for this
+ * environment will be used.
+ *
+ * @return Chunk generator
+ */
+ public ChunkGenerator generator() {
+ return generator;
+ }
+
+ /**
+ * Sets the generator that will be used to create or load the world.
+ *
+ * This may be null, in which case the "natural" generator for this
+ * environment will be used.
+ *
+ * @param generator Chunk generator
+ * @return This object, for chaining
+ */
+ public WorldCreator generator(ChunkGenerator generator) {
+ this.generator = generator;
+
+ return this;
+ }
+
+ /**
+ * Sets the generator that will be used to create or load the world.
+ *
+ * This may be null, in which case the "natural" generator for this
+ * environment will be used.
+ *
+ * If the generator cannot be found for the given name, the natural
+ * environment generator will be used instead and a warning will be
+ * printed to the console.
+ *
+ * @param generator Name of the generator to use, in "plugin:id" notation
+ * @return This object, for chaining
+ */
+ public WorldCreator generator(String generator) {
+ this.generator = getGeneratorForName(name, generator, Bukkit.getConsoleSender());
+
+ return this;
+ }
+
+ /**
+ * Sets the generator that will be used to create or load the world.
+ *
+ * This may be null, in which case the "natural" generator for this
+ * environment will be used.
+ *
+ * If the generator cannot be found for the given name, the natural
+ * environment generator will be used instead and a warning will be
+ * printed to the specified output
+ *
+ * @param generator Name of the generator to use, in "plugin:id" notation
+ * @param output {@link CommandSender} that will receive any error
+ * messages
+ * @return This object, for chaining
+ */
+ public WorldCreator generator(String generator, CommandSender output) {
+ this.generator = getGeneratorForName(name, generator, output);
+
+ return this;
+ }
+
+ /**
+ * Sets whether or not worlds created or loaded with this creator will
+ * have structures.
+ *
+ * @param generate Whether to generate structures
+ * @return This object, for chaining
+ */
+ public WorldCreator generateStructures(boolean generate) {
+ this.generateStructures = generate;
+
+ return this;
+ }
+
+ /**
+ * Gets whether or not structures will be generated in the world.
+ *
+ * @return True if structures will be generated
+ */
+ public boolean generateStructures() {
+ return generateStructures;
+ }
+
+ /**
+ * Creates a world with the specified options.
+ *
+ * If the world already exists, it will be loaded from disk and some
+ * options may be ignored.
+ *
+ * @return Newly created or loaded world
+ */
+ public World createWorld() {
+ return Bukkit.createWorld(this);
+ }
+
+ /**
+ * Creates a new {@link WorldCreator} for the given world name
+ *
+ * @param name Name of the world to load or create
+ * @return Resulting WorldCreator
+ */
+ public static WorldCreator name(String name) {
+ return new WorldCreator(name);
+ }
+
+ /**
+ * Attempts to get the {@link ChunkGenerator} with the given name.
+ *
+ * If the generator is not found, null will be returned and a message will
+ * be printed to the specified {@link CommandSender} explaining why.
+ *
+ * The name must be in the "plugin:id" notation, or optionally just
+ * "plugin", where "plugin" is the safe-name of a plugin and "id" is an
+ * optional unique identifier for the generator you wish to request from
+ * the plugin.
+ *
+ * @param world Name of the world this will be used for
+ * @param name Name of the generator to retrieve
+ * @param output Where to output if errors are present
+ * @return Resulting generator, or null
+ */
+ public static ChunkGenerator getGeneratorForName(String world, String name, CommandSender output) {
+ ChunkGenerator result = null;
+
+ if (world == null) {
+ throw new IllegalArgumentException("World name must be specified");
+ }
+
+ if (output == null) {
+ output = Bukkit.getConsoleSender();
+ }
+
+ if (name != null) {
+ String[] split = name.split(":", 2);
+ String id = (split.length > 1) ? split[1] : null;
+ Plugin plugin = Bukkit.getPluginManager().getPlugin(split[0]);
+
+ if (plugin == null) {
+ output.sendMessage("Could not set generator for world '" + world + "': Plugin '" + split[0] + "' does not exist");
+ } else if (!plugin.isEnabled()) {
+ output.sendMessage("Could not set generator for world '" + world + "': Plugin '" + plugin.getDescription().getFullName() + "' is not enabled");
+ } else {
+ result = plugin.getDefaultWorldGenerator(world, id);
+ }
+ }
+
+ return result;
+ }
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/WorldType.java b/vspigot-api/src/main/java/org/bukkit/WorldType.java
new file mode 100644
index 0000000..201852d
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/WorldType.java
@@ -0,0 +1,47 @@
+package org.bukkit;
+
+import com.google.common.collect.Maps;
+import java.util.Map;
+
+/**
+ * Represents various types of worlds that may exist
+ */
+public enum WorldType {
+ NORMAL("DEFAULT"),
+ FLAT("FLAT"),
+ VERSION_1_1("DEFAULT_1_1"),
+ LARGE_BIOMES("LARGEBIOMES"),
+ AMPLIFIED("AMPLIFIED");
+
+ private final static Map
+ * This method is equal to getRelative(face, 1)
+ *
+ * @param face Face of this block to return
+ * @return Block at the given face
+ * @see #getRelative(BlockFace, int)
+ */
+ Block getRelative(BlockFace face);
+
+ /**
+ * Gets the block at the given distance of the given face
+ *
+ * For example, the following method places water at 100,102,100; two
+ * blocks above 100,100,100.
+ *
+ *
+ * Any light given from other sources (such as blocks like torches) will
+ * be ignored.
+ *
+ * @return Sky light level
+ */
+ byte getLightFromSky();
+
+ /**
+ * Get the amount of light at this block from nearby blocks.
+ *
+ * Any light given from other sources (such as the sun) will be ignored.
+ *
+ * @return Block light level
+ */
+ byte getLightFromBlocks();
+
+ /**
+ * Gets the world which contains this Block
+ *
+ * @return World containing this block
+ */
+ World getWorld();
+
+ /**
+ * Gets the x-coordinate of this block
+ *
+ * @return x-coordinate
+ */
+ int getX();
+
+ /**
+ * Gets the y-coordinate of this block
+ *
+ * @return y-coordinate
+ */
+ int getY();
+
+ /**
+ * Gets the z-coordinate of this block
+ *
+ * @return z-coordinate
+ */
+ int getZ();
+
+ /**
+ * Gets the Location of the block
+ *
+ * @return Location of block
+ */
+ Location getLocation();
+
+ /**
+ * Stores the location of the block in the provided Location object.
+ *
+ * If the provided Location is null this method does nothing and returns
+ * null.
+ *
+ * @return The Location object provided or null
+ */
+ Location getLocation(Location loc);
+
+ /**
+ * Gets the chunk which contains this block
+ *
+ * @return Containing Chunk
+ */
+ Chunk getChunk();
+
+ /**
+ * Sets the metadata for this block
+ *
+ * @param data New block specific metadata
+ * @deprecated Magic value
+ */
+ @Deprecated
+ void setData(byte data);
+
+ /**
+ * Sets the metadata for this block
+ *
+ * @param data New block specific metadata
+ * @param applyPhysics False to cancel physics from the changed block.
+ * @deprecated Magic value
+ */
+ @Deprecated
+ void setData(byte data, boolean applyPhysics);
+
+ /**
+ * Sets the type of this block
+ *
+ * @param type Material to change this block to
+ */
+ void setType(Material type);
+
+ /**
+ * Sets the type-id of this block
+ *
+ * @param type Type-Id to change this block to
+ * @return whether the block was changed
+ * @deprecated Magic value
+ */
+ @Deprecated
+ boolean setTypeId(int type);
+
+ /**
+ * Sets the type-id of this block
+ *
+ * @param type Type-Id to change this block to
+ * @param applyPhysics False to cancel physics on the changed block.
+ * @return whether the block was changed
+ * @deprecated Magic value
+ */
+ @Deprecated
+ boolean setTypeId(int type, boolean applyPhysics);
+
+ /**
+ * Sets the type-id of this block
+ *
+ * @param type Type-Id to change this block to
+ * @param data The data value to change this block to
+ * @param applyPhysics False to cancel physics on the changed block
+ * @return whether the block was changed
+ * @deprecated Magic value
+ */
+ @Deprecated
+ boolean setTypeIdAndData(int type, byte data, boolean applyPhysics);
+
+ /**
+ * Gets the face relation of this block compared to the given block
+ *
+ * For example:
+ *
+ * The returned object will never be updated, and you are not guaranteed
+ * that (for example) a sign is still a sign after you capture its state.
+ *
+ * @return BlockState with the current state of this block.
+ */
+ BlockState getState();
+
+ /**
+ * Returns the biome that this block resides in
+ *
+ * @return Biome type containing this block
+ */
+ Biome getBiome();
+
+ /**
+ * Sets the biome that this block resides in
+ *
+ * @param bio new Biome type for this block
+ */
+ void setBiome(Biome bio);
+
+ /**
+ * Returns true if the block is being powered by Redstone.
+ *
+ * @return True if the block is powered.
+ */
+ boolean isBlockPowered();
+
+ /**
+ * Returns true if the block is being indirectly powered by Redstone.
+ *
+ * @return True if the block is indirectly powered.
+ */
+ boolean isBlockIndirectlyPowered();
+
+ /**
+ * Returns true if the block face is being powered by Redstone.
+ *
+ * @param face The block face
+ * @return True if the block face is powered.
+ */
+ boolean isBlockFacePowered(BlockFace face);
+
+ /**
+ * Returns true if the block face is being indirectly powered by Redstone.
+ *
+ * @param face The block face
+ * @return True if the block face is indirectly powered.
+ */
+ boolean isBlockFaceIndirectlyPowered(BlockFace face);
+
+ /**
+ * Returns the redstone power being provided to this block face
+ *
+ * @param face the face of the block to query or BlockFace.SELF for the
+ * block itself
+ * @return The power level.
+ */
+ int getBlockPower(BlockFace face);
+
+ /**
+ * Returns the redstone power being provided to this block
+ *
+ * @return The power level.
+ */
+ int getBlockPower();
+
+ /**
+ * Checks if this block is empty.
+ *
+ * A block is considered empty when {@link #getType()} returns {@link
+ * Material#AIR}.
+ *
+ * @return true if this block is empty
+ */
+ boolean isEmpty();
+
+ /**
+ * Checks if this block is liquid.
+ *
+ * A block is considered liquid when {@link #getType()} returns {@link
+ * Material#WATER}, {@link Material#STATIONARY_WATER}, {@link
+ * Material#LAVA} or {@link Material#STATIONARY_LAVA}.
+ *
+ * @return true if this block is liquid
+ */
+ boolean isLiquid();
+
+ /**
+ * Gets the temperature of the biome of this block
+ *
+ * @return Temperature of this block
+ */
+ double getTemperature();
+
+ /**
+ * Gets the humidity of the biome of this block
+ *
+ * @return Humidity of this block
+ */
+ double getHumidity();
+
+ /**
+ * Returns the reaction of the block when moved by a piston
+ *
+ * @return reaction
+ */
+ PistonMoveReaction getPistonMoveReaction();
+
+ /**
+ * Breaks the block and spawns items as if a player had digged it
+ *
+ * @return true if the block was destroyed
+ */
+ boolean breakNaturally();
+
+ /**
+ * Breaks the block and spawns items as if a player had digged it with a
+ * specific tool
+ *
+ * @param tool The tool or item in hand used for digging
+ * @return true if the block was destroyed
+ */
+ boolean breakNaturally(ItemStack tool);
+
+ /**
+ * Returns a list of items which would drop by destroying this block
+ *
+ * @return a list of dropped items for this type of block
+ */
+ Collection
+ * Unlike Block, which only one object can exist per coordinate, BlockState
+ * can exist multiple times for any given Block. Note that another plugin may
+ * change the state of the block and you will not know, or they may change the
+ * block to another type entirely, causing your BlockState to become invalid.
+ */
+public interface BlockState extends Metadatable {
+
+ /**
+ * Gets the block represented by this BlockState
+ *
+ * @return Block that this BlockState represents
+ */
+ Block getBlock();
+
+ /**
+ * Gets the metadata for this block
+ *
+ * @return block specific metadata
+ */
+ MaterialData getData();
+
+ /**
+ * Gets the type of this block
+ *
+ * @return block type
+ */
+ Material getType();
+
+ /**
+ * Gets the type-id of this block
+ *
+ * @return block type-id
+ * @deprecated Magic value
+ */
+ @Deprecated
+ int getTypeId();
+
+ /**
+ * Gets the light level between 0-15
+ *
+ * @return light level
+ */
+ byte getLightLevel();
+
+ /**
+ * Gets the world which contains this Block
+ *
+ * @return World containing this block
+ */
+ World getWorld();
+
+ /**
+ * Gets the x-coordinate of this block
+ *
+ * @return x-coordinate
+ */
+ int getX();
+
+ /**
+ * Gets the y-coordinate of this block
+ *
+ * @return y-coordinate
+ */
+ int getY();
+
+ /**
+ * Gets the z-coordinate of this block
+ *
+ * @return z-coordinate
+ */
+ int getZ();
+
+ /**
+ * Gets the location of this block
+ *
+ * @return location
+ */
+ Location getLocation();
+
+ /**
+ * Stores the location of this block in the provided Location object.
+ *
+ * If the provided Location is null this method does nothing and returns
+ * null.
+ *
+ * @return The Location object provided or null
+ */
+ Location getLocation(Location loc);
+
+ /**
+ * Gets the chunk which contains this block
+ *
+ * @return Containing Chunk
+ */
+ Chunk getChunk();
+
+ /**
+ * Sets the metadata for this block
+ *
+ * @param data New block specific metadata
+ */
+ void setData(MaterialData data);
+
+ /**
+ * Sets the type of this block
+ *
+ * @param type Material to change this block to
+ */
+ void setType(Material type);
+
+ /**
+ * Sets the type-id of this block
+ *
+ * @param type Type-Id to change this block to
+ * @return Whether it worked?
+ * @deprecated Magic value
+ */
+ @Deprecated
+ boolean setTypeId(int type);
+
+ /**
+ * Attempts to update the block represented by this state, setting it to
+ * the new values as defined by this state.
+ *
+ * This has the same effect as calling update(false). That is to say,
+ * this will not modify the state of a block if it is no longer the same
+ * type as it was when this state was taken. It will return false in this
+ * eventuality.
+ *
+ * @return true if the update was successful, otherwise false
+ * @see #update(boolean)
+ */
+ boolean update();
+
+ /**
+ * Attempts to update the block represented by this state, setting it to
+ * the new values as defined by this state.
+ *
+ * This has the same effect as calling update(force, true). That is to
+ * say, this will trigger a physics update to surrounding blocks.
+ *
+ * @param force true to forcefully set the state
+ * @return true if the update was successful, otherwise false
+ */
+ boolean update(boolean force);
+
+ /**
+ * Attempts to update the block represented by this state, setting it to
+ * the new values as defined by this state.
+ *
+ * Unless force is true, this will not modify the state of a block if it
+ * is no longer the same type as it was when this state was taken. It will
+ * return false in this eventuality.
+ *
+ * If force is true, it will set the type of the block to match the new
+ * state, set the state data and then return true.
+ *
+ * If applyPhysics is true, it will trigger a physics update on
+ * surrounding blocks which could cause them to update or disappear.
+ *
+ * @param force true to forcefully set the state
+ * @param applyPhysics false to cancel updating physics on surrounding
+ * blocks
+ * @return true if the update was successful, otherwise false
+ */
+ boolean update(boolean force, boolean applyPhysics);
+
+ /**
+ * @return The data as a raw byte.
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public byte getRawData();
+
+ /**
+ * @param data The new data value for the block.
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public void setRawData(byte data);
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/BrewingStand.java b/vspigot-api/src/main/java/org/bukkit/block/BrewingStand.java
new file mode 100644
index 0000000..c66a51c
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/BrewingStand.java
@@ -0,0 +1,25 @@
+package org.bukkit.block;
+
+import org.bukkit.inventory.BrewerInventory;
+
+/**
+ * Represents a brewing stand.
+ */
+public interface BrewingStand extends BlockState, ContainerBlock {
+
+ /**
+ * How much time is left in the brewing cycle
+ *
+ * @return Brew Time
+ */
+ int getBrewingTime();
+
+ /**
+ * Set the time left before brewing completes.
+ *
+ * @param brewTime Brewing time
+ */
+ void setBrewingTime(int brewTime);
+
+ public BrewerInventory getInventory();
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/Chest.java b/vspigot-api/src/main/java/org/bukkit/block/Chest.java
new file mode 100644
index 0000000..125d5e7
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/Chest.java
@@ -0,0 +1,17 @@
+package org.bukkit.block;
+
+import org.bukkit.inventory.Inventory;
+
+/**
+ * Represents a chest.
+ */
+public interface Chest extends BlockState, ContainerBlock {
+
+ /**
+ * Returns the chest's inventory. If this is a double chest, it returns
+ * just the portion of the inventory linked to this half of the chest.
+ *
+ * @return The inventory.
+ */
+ Inventory getBlockInventory();
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/CommandBlock.java b/vspigot-api/src/main/java/org/bukkit/block/CommandBlock.java
new file mode 100644
index 0000000..85d5345
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/CommandBlock.java
@@ -0,0 +1,40 @@
+package org.bukkit.block;
+
+public interface CommandBlock extends BlockState {
+
+ /**
+ * Gets the command that this CommandBlock will run when powered.
+ * This will never return null. If the CommandBlock does not have a
+ * command, an empty String will be returned instead.
+ *
+ * @return Command that this CommandBlock will run when powered.
+ */
+ public String getCommand();
+
+ /**
+ * Sets the command that this CommandBlock will run when powered.
+ * Setting the command to null is the same as setting it to an empty
+ * String.
+ *
+ * @param command Command that this CommandBlock will run when powered.
+ */
+ public void setCommand(String command);
+
+ /**
+ * Gets the name of this CommandBlock. The name is used with commands
+ * that this CommandBlock executes. This name will never be null, and
+ * by default is "@".
+ *
+ * @return Name of this CommandBlock.
+ */
+ public String getName();
+
+ /**
+ * Sets the name of this CommandBlock. The name is used with commands
+ * that this CommandBlock executes. Setting the name to null is the
+ * same as setting it to "@".
+ *
+ * @param name New name for this CommandBlock.
+ */
+ public void setName(String name);
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/ContainerBlock.java b/vspigot-api/src/main/java/org/bukkit/block/ContainerBlock.java
new file mode 100644
index 0000000..c69ac9e
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/ContainerBlock.java
@@ -0,0 +1,11 @@
+package org.bukkit.block;
+
+import org.bukkit.inventory.InventoryHolder;
+
+/**
+ * Indicates a block type that has inventory.
+ *
+ * @deprecated in favour of {@link InventoryHolder}
+ */
+@Deprecated
+public interface ContainerBlock extends InventoryHolder {}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/CreatureSpawner.java b/vspigot-api/src/main/java/org/bukkit/block/CreatureSpawner.java
new file mode 100644
index 0000000..e54d997
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/CreatureSpawner.java
@@ -0,0 +1,88 @@
+package org.bukkit.block;
+
+import org.bukkit.entity.CreatureType;
+import org.bukkit.entity.EntityType;
+
+/**
+ * Represents a creature spawner.
+ */
+public interface CreatureSpawner extends BlockState {
+
+ /**
+ * Get the spawner's creature type.
+ *
+ * @return The creature type.
+ * @deprecated In favour of {@link #getSpawnedType()}.
+ */
+ @Deprecated
+ public CreatureType getCreatureType();
+
+ /**
+ * Get the spawner's creature type.
+ *
+ * @return The creature type.
+ */
+ public EntityType getSpawnedType();
+
+ /**
+ * Set the spawner's creature type.
+ *
+ * @param creatureType The creature type.
+ */
+ public void setSpawnedType(EntityType creatureType);
+
+ /**
+ * Set the spawner creature type.
+ *
+ * @param creatureType The creature type.
+ * @deprecated In favour of {@link #setSpawnedType(EntityType)}.
+ */
+ @Deprecated
+ public void setCreatureType(CreatureType creatureType);
+
+ /**
+ * Get the spawner's creature type.
+ *
+ * @return The creature type's name.
+ * @deprecated Use {@link #getCreatureTypeName()}.
+ */
+ @Deprecated
+ public String getCreatureTypeId();
+
+ /**
+ * Set the spawner mob type.
+ *
+ * @param creatureType The creature type's name.
+ */
+ public void setCreatureTypeByName(String creatureType);
+
+ /**
+ * Get the spawner's creature type.
+ *
+ * @return The creature type's name.
+ */
+ public String getCreatureTypeName();
+
+ /**
+ * Set the spawner mob type.
+ *
+ * @param creatureType The creature type's name.
+ * @deprecated Use {@link #setCreatureTypeByName(String)}.
+ */
+ @Deprecated
+ public void setCreatureTypeId(String creatureType);
+
+ /**
+ * Get the spawner's delay.
+ *
+ * @return The delay.
+ */
+ public int getDelay();
+
+ /**
+ * Set the spawner's delay.
+ *
+ * @param delay The delay.
+ */
+ public void setDelay(int delay);
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/Dispenser.java b/vspigot-api/src/main/java/org/bukkit/block/Dispenser.java
new file mode 100644
index 0000000..bba753e
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/Dispenser.java
@@ -0,0 +1,27 @@
+package org.bukkit.block;
+
+import org.bukkit.projectiles.BlockProjectileSource;
+
+/**
+ * Represents a dispenser.
+ */
+public interface Dispenser extends BlockState, ContainerBlock {
+
+ /**
+ * Gets the BlockProjectileSource object for this dispenser.
+ *
+ * If the block is no longer a dispenser, this will return null.
+ *
+ * @return a BlockProjectileSource if valid, otherwise null
+ */
+ public BlockProjectileSource getBlockProjectileSource();
+
+ /**
+ * Attempts to dispense the contents of this block.
+ *
+ * If the block is no longer a dispenser, this will return false.
+ *
+ * @return true if successful, otherwise false
+ */
+ public boolean dispense();
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/DoubleChest.java b/vspigot-api/src/main/java/org/bukkit/block/DoubleChest.java
new file mode 100644
index 0000000..148099c
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/DoubleChest.java
@@ -0,0 +1,50 @@
+package org.bukkit.block;
+
+import org.bukkit.Location;
+import org.bukkit.World;
+import org.bukkit.inventory.DoubleChestInventory;
+import org.bukkit.inventory.Inventory;
+import org.bukkit.inventory.InventoryHolder;
+
+/**
+ * Represents a double chest.
+ */
+public class DoubleChest implements InventoryHolder {
+ private DoubleChestInventory inventory;
+
+ public DoubleChest(DoubleChestInventory chest) {
+ inventory = chest;
+ }
+
+ public Inventory getInventory() {
+ return inventory;
+ }
+
+ public InventoryHolder getLeftSide() {
+ return inventory.getLeftSide().getHolder();
+ }
+
+ public InventoryHolder getRightSide() {
+ return inventory.getRightSide().getHolder();
+ }
+
+ public Location getLocation() {
+ return new Location(getWorld(), getX(), getY(), getZ());
+ }
+
+ public World getWorld() {
+ return ((Chest)getLeftSide()).getWorld();
+ }
+
+ public double getX() {
+ return 0.5 * (((Chest)getLeftSide()).getX() + ((Chest)getRightSide()).getX());
+ }
+
+ public double getY() {
+ return 0.5 * (((Chest)getLeftSide()).getY() + ((Chest)getRightSide()).getY());
+ }
+
+ public double getZ() {
+ return 0.5 * (((Chest)getLeftSide()).getZ() + ((Chest)getRightSide()).getZ());
+ }
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/Dropper.java b/vspigot-api/src/main/java/org/bukkit/block/Dropper.java
new file mode 100644
index 0000000..21fbedc
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/Dropper.java
@@ -0,0 +1,25 @@
+package org.bukkit.block;
+
+import org.bukkit.inventory.InventoryHolder;
+
+/**
+ * Represents a dropper.
+ */
+public interface Dropper extends BlockState, InventoryHolder {
+ /**
+ * Tries to drop a randomly selected item from the Dropper's inventory,
+ * following the normal behavior of a Dropper.
+ *
+ * Normal behavior of a Dropper is as follows:
+ *
+ * If the block that the Dropper is facing is an InventoryHolder or
+ * ContainerBlock the randomly selected ItemStack is placed within that
+ * Inventory in the first slot that's available, starting with 0 and
+ * counting up. If the inventory is full, nothing happens.
+ *
+ * If the block that the Dropper is facing is not an InventoryHolder or
+ * ContainerBlock, the randomly selected ItemStack is dropped on
+ * the ground in the form of an {@link org.bukkit.entity.Item Item}.
+ */
+ public void drop();
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/Furnace.java b/vspigot-api/src/main/java/org/bukkit/block/Furnace.java
new file mode 100644
index 0000000..94af85e
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/Furnace.java
@@ -0,0 +1,39 @@
+package org.bukkit.block;
+
+import org.bukkit.inventory.FurnaceInventory;
+
+/**
+ * Represents a furnace.
+ */
+public interface Furnace extends BlockState, ContainerBlock {
+
+ /**
+ * Get burn time.
+ *
+ * @return Burn time
+ */
+ public short getBurnTime();
+
+ /**
+ * Set burn time.
+ *
+ * @param burnTime Burn time
+ */
+ public void setBurnTime(short burnTime);
+
+ /**
+ * Get cook time.
+ *
+ * @return Cook time
+ */
+ public short getCookTime();
+
+ /**
+ * Set cook time.
+ *
+ * @param cookTime Cook time
+ */
+ public void setCookTime(short cookTime);
+
+ public FurnaceInventory getInventory();
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/Hopper.java b/vspigot-api/src/main/java/org/bukkit/block/Hopper.java
new file mode 100644
index 0000000..e097157
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/Hopper.java
@@ -0,0 +1,10 @@
+package org.bukkit.block;
+
+import org.bukkit.inventory.InventoryHolder;
+
+/**
+ * Represents a hopper.
+ */
+public interface Hopper extends BlockState, InventoryHolder {
+
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/Jukebox.java b/vspigot-api/src/main/java/org/bukkit/block/Jukebox.java
new file mode 100644
index 0000000..7b45b83
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/Jukebox.java
@@ -0,0 +1,36 @@
+package org.bukkit.block;
+
+import org.bukkit.Material;
+
+/**
+ * Represents a Jukebox
+ */
+public interface Jukebox extends BlockState {
+ /**
+ * Get the record currently playing
+ *
+ * @return The record Material, or AIR if none is playing
+ */
+ public Material getPlaying();
+
+ /**
+ * Set the record currently playing
+ *
+ * @param record The record Material, or null/AIR to stop playing
+ */
+ public void setPlaying(Material record);
+
+ /**
+ * Check if the jukebox is currently playing a record
+ *
+ * @return True if there is a record playing
+ */
+ public boolean isPlaying();
+
+ /**
+ * Stop the jukebox playing and eject the current record
+ *
+ * @return True if a record was ejected; false if there was none playing
+ */
+ public boolean eject();
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/NoteBlock.java b/vspigot-api/src/main/java/org/bukkit/block/NoteBlock.java
new file mode 100644
index 0000000..8380068
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/NoteBlock.java
@@ -0,0 +1,72 @@
+package org.bukkit.block;
+
+import org.bukkit.Instrument;
+import org.bukkit.Note;
+
+/**
+ * Represents a note.
+ */
+public interface NoteBlock extends BlockState {
+
+ /**
+ * Gets the note.
+ *
+ * @return The note.
+ */
+ public Note getNote();
+
+ /**
+ * Gets the note.
+ *
+ * @return The note ID.
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public byte getRawNote();
+
+ /**
+ * Set the note.
+ *
+ * @param note The note.
+ */
+ public void setNote(Note note);
+
+ /**
+ * Set the note.
+ *
+ * @param note The note ID.
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public void setRawNote(byte note);
+
+ /**
+ * Attempts to play the note at block
+ *
+ * If the block is no longer a note block, this will return false
+ *
+ * @return true if successful, otherwise false
+ */
+ public boolean play();
+
+ /**
+ * Plays an arbitrary note with an arbitrary instrument
+ *
+ * @param instrument Instrument ID
+ * @param note Note ID
+ * @return true if successful, otherwise false
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public boolean play(byte instrument, byte note);
+
+ /**
+ * Plays an arbitrary note with an arbitrary instrument
+ *
+ * @param instrument The instrument
+ * @param note The note
+ * @return true if successful, otherwise false
+ * @see Instrument Note
+ */
+ public boolean play(Instrument instrument, Note note);
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/PistonMoveReaction.java b/vspigot-api/src/main/java/org/bukkit/block/PistonMoveReaction.java
new file mode 100644
index 0000000..e5279f7
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/PistonMoveReaction.java
@@ -0,0 +1,51 @@
+package org.bukkit.block;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum PistonMoveReaction {
+
+ /**
+ * Indicates that the block can be pushed or pulled.
+ */
+ MOVE(0),
+ /**
+ * Indicates the block is fragile and will break if pushed on.
+ */
+ BREAK(1),
+ /**
+ * Indicates that the block will resist being pushed or pulled.
+ */
+ BLOCK(2);
+
+ private int id;
+ private static Map
+ * For example, getLine(0) will return the first line of text.
+ *
+ * @param index Line number to get the text from, starting at 0
+ * @throws IndexOutOfBoundsException Thrown when the line does not exist
+ * @return Text on the given line
+ */
+ public String getLine(int index) throws IndexOutOfBoundsException;
+
+ /**
+ * Sets the line of text at the specified index.
+ *
+ * For example, setLine(0, "Line One") will set the first line of text to
+ * "Line One".
+ *
+ * @param index Line number to set the text at, starting from 0
+ * @param line New text to set at the specified index
+ * @throws IndexOutOfBoundsException If the index is out of the range 0..3
+ */
+ public void setLine(int index, String line) throws IndexOutOfBoundsException;
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/block/Skull.java b/vspigot-api/src/main/java/org/bukkit/block/Skull.java
new file mode 100644
index 0000000..4f4896f
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/block/Skull.java
@@ -0,0 +1,62 @@
+package org.bukkit.block;
+
+import org.bukkit.SkullType;
+
+/**
+ * Represents a Skull
+ */
+public interface Skull extends BlockState {
+
+ /**
+ * Checks to see if the skull has an owner
+ *
+ * @return true if the skull has an owner
+ */
+ public boolean hasOwner();
+
+ /**
+ * Gets the owner of the skull, if one exists
+ *
+ * @return the owner of the skull or null if the skull does not have an owner
+ */
+ public String getOwner();
+
+ /**
+ * Sets the owner of the skull
+ *
+ * Involves a potentially blocking web request to acquire the profile data for
+ * the provided name.
+ *
+ * @param name the new owner of the skull
+ * @return true if the owner was successfully set
+ */
+ public boolean setOwner(String name);
+
+ /**
+ * Gets the rotation of the skull in the world
+ *
+ * @return the rotation of the skull
+ */
+ public BlockFace getRotation();
+
+ /**
+ * Sets the rotation of the skull in the world
+ *
+ * @param rotation the rotation of the skull
+ */
+ public void setRotation(BlockFace rotation);
+
+ /**
+ * Gets the type of skull
+ *
+ * @return the type of skull
+ */
+ public SkullType getSkullType();
+
+ /**
+ * Sets the type of skull
+ *
+ * @param skullType the type of skull
+ */
+ public void setSkullType(SkullType skullType);
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/command/BlockCommandSender.java b/vspigot-api/src/main/java/org/bukkit/command/BlockCommandSender.java
new file mode 100644
index 0000000..ce229d2
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/command/BlockCommandSender.java
@@ -0,0 +1,13 @@
+package org.bukkit.command;
+
+import org.bukkit.block.Block;
+
+public interface BlockCommandSender extends CommandSender {
+
+ /**
+ * Returns the block this command sender belongs to
+ *
+ * @return Block for the command sender
+ */
+ public Block getBlock();
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/command/Command.java b/vspigot-api/src/main/java/org/bukkit/command/Command.java
new file mode 100644
index 0000000..796ca24
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/command/Command.java
@@ -0,0 +1,399 @@
+package org.bukkit.command;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.lang.Validate;
+import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
+import org.bukkit.Server;
+import org.bukkit.entity.Player;
+import org.bukkit.entity.minecart.CommandMinecart;
+import org.bukkit.permissions.Permissible;
+import org.bukkit.plugin.PluginDescriptionFile;
+import org.bukkit.util.StringUtil;
+
+import com.google.common.collect.ImmutableList;
+
+/**
+ * Represents a Command, which executes various tasks upon user input
+ */
+public abstract class Command {
+ private final String name;
+ private String nextLabel;
+ private String label;
+ private List
+ * If they do not have permission, they will be informed that they cannot
+ * do this.
+ *
+ * @param target User to test
+ * @return true if they can use it, otherwise false
+ */
+ public boolean testPermission(CommandSender target) {
+ if (testPermissionSilent(target)) {
+ return true;
+ }
+
+ if (permissionMessage == null) {
+ target.sendMessage(ChatColor.RED + "I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.");
+ } else if (permissionMessage.length() != 0) {
+ for (String line : permissionMessage.replace("
+ * No error is sent to the sender.
+ *
+ * @param target User to test
+ * @return true if they can use it, otherwise false
+ */
+ public boolean testPermissionSilent(CommandSender target) {
+ if ((permission == null) || (permission.length() == 0)) {
+ return true;
+ }
+
+ for (String p : permission.split(";")) {
+ if (target.hasPermission(p)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns the current label for this command
+ *
+ * @return Label of this command or null if not registered
+ */
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * Sets the label of this command.
+ *
+ * If the command is currently registered the label change will only take
+ * effect after its been re-registered e.g. after a /reload
+ *
+ * @param name The command's name
+ * @return returns true if the name change happened instantly or false if
+ * it was scheduled for re-registration
+ */
+ public boolean setLabel(String name) {
+ this.nextLabel = name;
+ if (!isRegistered()) {
+ this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot
+ this.label = name;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Registers this command to a CommandMap.
+ * Once called it only allows changes the registered CommandMap
+ *
+ * @param commandMap the CommandMap to register this command to
+ * @return true if the registration was successful (the current registered
+ * CommandMap was the passed CommandMap or null) false otherwise
+ */
+ public boolean register(CommandMap commandMap) {
+ if (allowChangesFrom(commandMap)) {
+ this.commandMap = commandMap;
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Unregisters this command from the passed CommandMap applying any
+ * outstanding changes
+ *
+ * @param commandMap the CommandMap to unregister
+ * @return true if the unregistration was successfull (the current
+ * registered CommandMap was the passed CommandMap or null) false
+ * otherwise
+ */
+ public boolean unregister(CommandMap commandMap) {
+ if (allowChangesFrom(commandMap)) {
+ this.commandMap = null;
+ this.activeAliases = new ArrayList
+ * Caller can use:-
+ *
+ * Caller can use:-
+ *
+ * Caller can use:-
+ *
+ * If no TabCompleter is specified, and the command's executor implements
+ * TabCompleter, then the executor will be used for tab completion.
+ *
+ * @param completer New tab completer
+ */
+ public void setTabCompleter(TabCompleter completer) {
+ this.completer = completer;
+ }
+
+ /**
+ * Gets the {@link TabCompleter} associated with this command.
+ *
+ * @return TabCompleter object linked to this command
+ */
+ public TabCompleter getTabCompleter() {
+ return completer;
+ }
+
+ /**
+ * Gets the owner of this PluginCommand
+ *
+ * @return Plugin that owns this command
+ */
+ public Plugin getPlugin() {
+ return owningPlugin;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Delegates to the tab completer if present.
+ *
+ * If it is not present or returns null, will delegate to the current
+ * command executor if it implements {@link TabCompleter}. If a non-null
+ * list has not been found, will default to standard player name
+ * completion in {@link
+ * Command#tabComplete(CommandSender, String, String[])}.
+ *
+ * This method does not consider permissions.
+ *
+ * @throws CommandException if the completer or executor throw an
+ * exception during the process of tab-completing.
+ * @throws IllegalArgumentException if sender, alias, or args is null
+ */
+ @Override
+ public java.util.List
+ *
+ * Increasing yaw values are the equivalent of turning to your
+ * right-facing, increasing the scale of the next respective axis, and
+ * decreasing the scale of the previous axis.
+ *
+ * @param yaw new rotation's yaw
+ */
+ public void setYaw(float yaw) {
+ this.yaw = yaw;
+ }
+
+ /**
+ * Gets the yaw of this location, measured in degrees.
+ *
+ *
+ * Increasing yaw values are the equivalent of turning to your
+ * right-facing, increasing the scale of the next respective axis, and
+ * decreasing the scale of the previous axis.
+ *
+ * @return the rotation's yaw
+ */
+ public float getYaw() {
+ return yaw;
+ }
+
+ /**
+ * Sets the pitch of this location, measured in degrees.
+ *
+ *
+ * Increasing pitch values the equivalent of looking down.
+ *
+ * @param pitch new incline's pitch
+ */
+ public void setPitch(float pitch) {
+ this.pitch = pitch;
+ }
+
+ /**
+ * Gets the pitch of this location, measured in degrees.
+ *
+ *
+ * Increasing pitch values the equivalent of looking down.
+ *
+ * @return the incline's pitch
+ */
+ public float getPitch() {
+ return pitch;
+ }
+
+ /**
+ * Gets a unit-vector pointing in the direction that this Location is
+ * facing.
+ *
+ * @return a vector pointing the direction of this location's {@link
+ * #getPitch() pitch} and {@link #getYaw() yaw}
+ */
+ public Vector getDirection() {
+ Vector vector = new Vector();
+
+ double rotX = this.getYaw();
+ double rotY = this.getPitch();
+
+ vector.setY(-Math.sin(Math.toRadians(rotY)));
+
+ double xz = Math.cos(Math.toRadians(rotY));
+
+ vector.setX(-xz * Math.sin(Math.toRadians(rotX)));
+ vector.setZ(xz * Math.cos(Math.toRadians(rotX)));
+
+ return vector;
+ }
+
+ /**
+ * Sets the {@link #getYaw() yaw} and {@link #getPitch() pitch} to point
+ * in the direction of the vector.
+ */
+ public Location setDirection(Vector vector) {
+ /*
+ * Sin = Opp / Hyp
+ * Cos = Adj / Hyp
+ * Tan = Opp / Adj
+ *
+ * x = -Opp
+ * z = Adj
+ */
+ final double _2PI = 2 * Math.PI;
+ final double x = vector.getX();
+ final double z = vector.getZ();
+
+ if (x == 0 && z == 0) {
+ pitch = vector.getY() > 0 ? -90 : 90;
+ return this;
+ }
+
+ double theta = Math.atan2(-x, z);
+ yaw = (float) Math.toDegrees((theta + _2PI) % _2PI);
+
+ double x2 = NumberConversions.square(x);
+ double z2 = NumberConversions.square(z);
+ double xz = Math.sqrt(x2 + z2);
+ pitch = (float) Math.toDegrees(Math.atan(-vector.getY() / xz));
+
+ return this;
+ }
+
+ /**
+ * Adds the location by another.
+ *
+ * @see Vector
+ * @param vec The other location
+ * @return the same location
+ * @throws IllegalArgumentException for differing worlds
+ */
+ public Location add(Location vec) {
+ if (vec == null || vec.getWorld() != getWorld()) {
+ throw new IllegalArgumentException("Cannot add Locations of differing worlds");
+ }
+
+ x += vec.x;
+ y += vec.y;
+ z += vec.z;
+ return this;
+ }
+
+ /**
+ * Adds the location by a vector.
+ *
+ * @see Vector
+ * @param vec Vector to use
+ * @return the same location
+ */
+ public Location add(Vector vec) {
+ this.x += vec.getX();
+ this.y += vec.getY();
+ this.z += vec.getZ();
+ return this;
+ }
+
+ /**
+ * Adds the location by another. Not world-aware.
+ *
+ * @see Vector
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @return the same location
+ */
+ public Location add(double x, double y, double z) {
+ this.x += x;
+ this.y += y;
+ this.z += z;
+ return this;
+ }
+
+ /**
+ * Subtracts the location by another.
+ *
+ * @see Vector
+ * @param vec The other location
+ * @return the same location
+ * @throws IllegalArgumentException for differing worlds
+ */
+ public Location subtract(Location vec) {
+ if (vec == null || vec.getWorld() != getWorld()) {
+ throw new IllegalArgumentException("Cannot add Locations of differing worlds");
+ }
+
+ x -= vec.x;
+ y -= vec.y;
+ z -= vec.z;
+ return this;
+ }
+
+ /**
+ * Subtracts the location by a vector.
+ *
+ * @see Vector
+ * @param vec The vector to use
+ * @return the same location
+ */
+ public Location subtract(Vector vec) {
+ this.x -= vec.getX();
+ this.y -= vec.getY();
+ this.z -= vec.getZ();
+ return this;
+ }
+
+ /**
+ * Subtracts the location by another. Not world-aware and
+ * orientation independent.
+ *
+ * @see Vector
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @return the same location
+ */
+ public Location subtract(double x, double y, double z) {
+ this.x -= x;
+ this.y -= y;
+ this.z -= z;
+ return this;
+ }
+
+ /**
+ * Gets the magnitude of the location, defined as sqrt(x^2+y^2+z^2). The
+ * value of this method is not cached and uses a costly square-root
+ * function, so do not repeatedly call this method to get the location's
+ * magnitude. NaN will be returned if the inner result of the sqrt()
+ * function overflows, which will be caused if the length is too long. Not
+ * world-aware and orientation independent.
+ *
+ * @see Vector
+ * @return the magnitude
+ */
+ public double length() {
+ return Math.sqrt(NumberConversions.square(x) + NumberConversions.square(y) + NumberConversions.square(z));
+ }
+
+ /**
+ * Gets the magnitude of the location squared. Not world-aware and
+ * orientation independent.
+ *
+ * @see Vector
+ * @return the magnitude
+ */
+ public double lengthSquared() {
+ return NumberConversions.square(x) + NumberConversions.square(y) + NumberConversions.square(z);
+ }
+
+ /**
+ * Get the distance between this location and another. The value of this
+ * method is not cached and uses a costly square-root function, so do not
+ * repeatedly call this method to get the location's magnitude. NaN will
+ * be returned if the inner result of the sqrt() function overflows, which
+ * will be caused if the distance is too long.
+ *
+ * @see Vector
+ * @param o The other location
+ * @return the distance
+ * @throws IllegalArgumentException for differing worlds
+ */
+ public double distance(Location o) {
+ return Math.sqrt(distanceSquared(o));
+ }
+
+ /**
+ * Get the squared distance between this location and another.
+ *
+ * @see Vector
+ * @param o The other location
+ * @return the distance
+ * @throws IllegalArgumentException for differing worlds
+ */
+ public double distanceSquared(Location o) {
+ if (o == null) {
+ throw new IllegalArgumentException("Cannot measure distance to a null location");
+ } else if (o.getWorld() == null || getWorld() == null) {
+ throw new IllegalArgumentException("Cannot measure distance to a null world");
+ } else if (o.getWorld() != getWorld()) {
+ throw new IllegalArgumentException("Cannot measure distance between " + getWorld().getName() + " and " + o.getWorld().getName());
+ }
+
+ return NumberConversions.square(x - o.x) + NumberConversions.square(y - o.y) + NumberConversions.square(z - o.z);
+ }
+
+ /**
+ * Performs scalar multiplication, multiplying all components with a
+ * scalar. Not world-aware.
+ *
+ * @param m The factor
+ * @see Vector
+ * @return the same location
+ */
+ public Location multiply(double m) {
+ x *= m;
+ y *= m;
+ z *= m;
+ return this;
+ }
+
+ /**
+ * Zero this location's components. Not world-aware.
+ *
+ * @see Vector
+ * @return the same location
+ */
+ public Location zero() {
+ x = 0;
+ y = 0;
+ z = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final Location other = (Location) obj;
+
+ if (this.world != other.world && (this.world == null || !this.world.equals(other.world))) {
+ return false;
+ }
+ if (Double.doubleToLongBits(this.x) != Double.doubleToLongBits(other.x)) {
+ return false;
+ }
+ if (Double.doubleToLongBits(this.y) != Double.doubleToLongBits(other.y)) {
+ return false;
+ }
+ if (Double.doubleToLongBits(this.z) != Double.doubleToLongBits(other.z)) {
+ return false;
+ }
+ if (Float.floatToIntBits(this.pitch) != Float.floatToIntBits(other.pitch)) {
+ return false;
+ }
+ if (Float.floatToIntBits(this.yaw) != Float.floatToIntBits(other.yaw)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 3;
+
+ hash = 19 * hash + (this.world != null ? this.world.hashCode() : 0);
+ hash = 19 * hash + (int) (Double.doubleToLongBits(this.x) ^ (Double.doubleToLongBits(this.x) >>> 32));
+ hash = 19 * hash + (int) (Double.doubleToLongBits(this.y) ^ (Double.doubleToLongBits(this.y) >>> 32));
+ hash = 19 * hash + (int) (Double.doubleToLongBits(this.z) ^ (Double.doubleToLongBits(this.z) >>> 32));
+ hash = 19 * hash + Float.floatToIntBits(this.pitch);
+ hash = 19 * hash + Float.floatToIntBits(this.yaw);
+ return hash;
+ }
+
+ @Override
+ public String toString() {
+ return "Location{" + "world=" + world + ",x=" + x + ",y=" + y + ",z=" + z + ",pitch=" + pitch + ",yaw=" + yaw + '}';
+ }
+
+ /**
+ * Constructs a new {@link Vector} based on this Location
+ *
+ * @return New Vector containing the coordinates represented by this
+ * Location
+ */
+ public Vector toVector() {
+ return new Vector(x, y, z);
+ }
+
+ @Override
+ public Location clone() {
+ try {
+ return (Location) super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new Error(e);
+ }
+ }
+
+ /**
+ * Safely converts a double (location coordinate) to an int (block
+ * coordinate)
+ *
+ * @param loc Precise coordinate
+ * @return Block coordinate
+ */
+ public static int locToBlock(double loc) {
+ return NumberConversions.floor(loc);
+ }
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/Material.java b/vspigot-api/src/main/java/org/bukkit/Material.java
new file mode 100644
index 0000000..c45c180
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/Material.java
@@ -0,0 +1,1034 @@
+package org.bukkit;
+
+import java.lang.reflect.Constructor;
+import java.util.Map;
+
+import org.apache.commons.lang.Validate;
+import org.bukkit.map.MapView;
+import org.bukkit.material.Bed;
+import org.bukkit.material.Button;
+import org.bukkit.material.Cake;
+import org.bukkit.material.Cauldron;
+import org.bukkit.material.Chest;
+import org.bukkit.material.Coal;
+import org.bukkit.material.CocoaPlant;
+import org.bukkit.material.Command;
+import org.bukkit.material.Crops;
+import org.bukkit.material.DetectorRail;
+import org.bukkit.material.Diode;
+import org.bukkit.material.Dispenser;
+import org.bukkit.material.Door;
+import org.bukkit.material.Dye;
+import org.bukkit.material.EnderChest;
+import org.bukkit.material.FlowerPot;
+import org.bukkit.material.Furnace;
+import org.bukkit.material.Gate;
+import org.bukkit.material.Ladder;
+import org.bukkit.material.Lever;
+import org.bukkit.material.LongGrass;
+import org.bukkit.material.MaterialData;
+import org.bukkit.material.MonsterEggs;
+import org.bukkit.material.Mushroom;
+import org.bukkit.material.NetherWarts;
+import org.bukkit.material.PistonBaseMaterial;
+import org.bukkit.material.PistonExtensionMaterial;
+import org.bukkit.material.PoweredRail;
+import org.bukkit.material.PressurePlate;
+import org.bukkit.material.Pumpkin;
+import org.bukkit.material.Rails;
+import org.bukkit.material.RedstoneTorch;
+import org.bukkit.material.RedstoneWire;
+import org.bukkit.material.Sandstone;
+import org.bukkit.material.Sign;
+import org.bukkit.material.Skull;
+import org.bukkit.material.SmoothBrick;
+import org.bukkit.material.SpawnEgg;
+import org.bukkit.material.Stairs;
+import org.bukkit.material.Step;
+import org.bukkit.material.Torch;
+import org.bukkit.material.TrapDoor;
+import org.bukkit.material.Tree;
+import org.bukkit.material.Tripwire;
+import org.bukkit.material.TripwireHook;
+import org.bukkit.material.Vine;
+import org.bukkit.material.WoodenStep;
+import org.bukkit.material.Wool;
+import org.bukkit.potion.Potion;
+import org.bukkit.util.Java15Compat;
+
+import com.google.common.collect.Maps;
+
+/**
+ * An enum of all material IDs accepted by the official server and client
+ */
+public enum Material {
+ AIR(0, 0),
+ STONE(1),
+ GRASS(2),
+ DIRT(3),
+ COBBLESTONE(4),
+ WOOD(5, Tree.class),
+ SAPLING(6, Tree.class),
+ BEDROCK(7),
+ WATER(8, MaterialData.class),
+ STATIONARY_WATER(9, MaterialData.class),
+ LAVA(10, MaterialData.class),
+ STATIONARY_LAVA(11, MaterialData.class),
+ SAND(12),
+ GRAVEL(13),
+ GOLD_ORE(14),
+ IRON_ORE(15),
+ COAL_ORE(16),
+ LOG(17, Tree.class),
+ LEAVES(18, Tree.class),
+ SPONGE(19),
+ GLASS(20),
+ LAPIS_ORE(21),
+ LAPIS_BLOCK(22),
+ DISPENSER(23, Dispenser.class),
+ SANDSTONE(24, Sandstone.class),
+ NOTE_BLOCK(25),
+ BED_BLOCK(26, Bed.class),
+ POWERED_RAIL(27, PoweredRail.class),
+ DETECTOR_RAIL(28, DetectorRail.class),
+ PISTON_STICKY_BASE(29, PistonBaseMaterial.class),
+ WEB(30),
+ LONG_GRASS(31, LongGrass.class),
+ DEAD_BUSH(32),
+ PISTON_BASE(33, PistonBaseMaterial.class),
+ PISTON_EXTENSION(34, PistonExtensionMaterial.class),
+ WOOL(35, Wool.class),
+ PISTON_MOVING_PIECE(36),
+ YELLOW_FLOWER(37),
+ RED_ROSE(38),
+ BROWN_MUSHROOM(39),
+ RED_MUSHROOM(40),
+ GOLD_BLOCK(41),
+ IRON_BLOCK(42),
+ DOUBLE_STEP(43, Step.class),
+ STEP(44, Step.class),
+ BRICK(45),
+ TNT(46),
+ BOOKSHELF(47),
+ MOSSY_COBBLESTONE(48),
+ OBSIDIAN(49),
+ TORCH(50, Torch.class),
+ FIRE(51),
+ MOB_SPAWNER(52),
+ WOOD_STAIRS(53, Stairs.class),
+ CHEST(54, Chest.class),
+ REDSTONE_WIRE(55, RedstoneWire.class),
+ DIAMOND_ORE(56),
+ DIAMOND_BLOCK(57),
+ WORKBENCH(58),
+ CROPS(59, Crops.class),
+ SOIL(60, MaterialData.class),
+ FURNACE(61, Furnace.class),
+ BURNING_FURNACE(62, Furnace.class),
+ SIGN_POST(63, 64, Sign.class),
+ WOODEN_DOOR(64, Door.class),
+ LADDER(65, Ladder.class),
+ RAILS(66, Rails.class),
+ COBBLESTONE_STAIRS(67, Stairs.class),
+ WALL_SIGN(68, 64, Sign.class),
+ LEVER(69, Lever.class),
+ STONE_PLATE(70, PressurePlate.class),
+ IRON_DOOR_BLOCK(71, Door.class),
+ WOOD_PLATE(72, PressurePlate.class),
+ REDSTONE_ORE(73),
+ GLOWING_REDSTONE_ORE(74),
+ REDSTONE_TORCH_OFF(75, RedstoneTorch.class),
+ REDSTONE_TORCH_ON(76, RedstoneTorch.class),
+ STONE_BUTTON(77, Button.class),
+ SNOW(78),
+ ICE(79),
+ SNOW_BLOCK(80),
+ CACTUS(81, MaterialData.class),
+ CLAY(82),
+ SUGAR_CANE_BLOCK(83, MaterialData.class),
+ JUKEBOX(84),
+ FENCE(85),
+ PUMPKIN(86, Pumpkin.class),
+ NETHERRACK(87),
+ SOUL_SAND(88),
+ GLOWSTONE(89),
+ PORTAL(90),
+ JACK_O_LANTERN(91, Pumpkin.class),
+ CAKE_BLOCK(92, 64, Cake.class),
+ DIODE_BLOCK_OFF(93, Diode.class),
+ DIODE_BLOCK_ON(94, Diode.class),
+ @Deprecated
+ LOCKED_CHEST(95),
+ STAINED_GLASS(95),
+ TRAP_DOOR(96, TrapDoor.class),
+ MONSTER_EGGS(97, MonsterEggs.class),
+ SMOOTH_BRICK(98, SmoothBrick.class),
+ HUGE_MUSHROOM_1(99, Mushroom.class),
+ HUGE_MUSHROOM_2(100, Mushroom.class),
+ IRON_FENCE(101),
+ THIN_GLASS(102),
+ MELON_BLOCK(103),
+ PUMPKIN_STEM(104, MaterialData.class),
+ MELON_STEM(105, MaterialData.class),
+ VINE(106, Vine.class),
+ FENCE_GATE(107, Gate.class),
+ BRICK_STAIRS(108, Stairs.class),
+ SMOOTH_STAIRS(109, Stairs.class),
+ MYCEL(110),
+ WATER_LILY(111),
+ NETHER_BRICK(112),
+ NETHER_FENCE(113),
+ NETHER_BRICK_STAIRS(114, Stairs.class),
+ NETHER_WARTS(115, NetherWarts.class),
+ ENCHANTMENT_TABLE(116),
+ BREWING_STAND(117, MaterialData.class),
+ CAULDRON(118, Cauldron.class),
+ ENDER_PORTAL(119),
+ ENDER_PORTAL_FRAME(120),
+ ENDER_STONE(121),
+ DRAGON_EGG(122),
+ REDSTONE_LAMP_OFF(123),
+ REDSTONE_LAMP_ON(124),
+ WOOD_DOUBLE_STEP(125, WoodenStep.class),
+ WOOD_STEP(126, WoodenStep.class),
+ COCOA(127, CocoaPlant.class),
+ SANDSTONE_STAIRS(128, Stairs.class),
+ EMERALD_ORE(129),
+ ENDER_CHEST(130, EnderChest.class),
+ TRIPWIRE_HOOK(131, TripwireHook.class),
+ TRIPWIRE(132, Tripwire.class),
+ EMERALD_BLOCK(133),
+ SPRUCE_WOOD_STAIRS(134, Stairs.class),
+ BIRCH_WOOD_STAIRS(135, Stairs.class),
+ JUNGLE_WOOD_STAIRS(136, Stairs.class),
+ COMMAND(137, Command.class),
+ BEACON(138),
+ COBBLE_WALL(139),
+ FLOWER_POT(140, FlowerPot.class),
+ CARROT(141),
+ POTATO(142),
+ WOOD_BUTTON(143, Button.class),
+ SKULL(144, Skull.class),
+ ANVIL(145),
+ TRAPPED_CHEST(146),
+ GOLD_PLATE(147),
+ IRON_PLATE(148),
+ REDSTONE_COMPARATOR_OFF(149),
+ REDSTONE_COMPARATOR_ON(150),
+ DAYLIGHT_DETECTOR(151),
+ REDSTONE_BLOCK(152),
+ QUARTZ_ORE(153),
+ HOPPER(154),
+ QUARTZ_BLOCK(155),
+ QUARTZ_STAIRS(156, Stairs.class),
+ ACTIVATOR_RAIL(157, PoweredRail.class),
+ DROPPER(158, Dispenser.class),
+ STAINED_CLAY(159),
+ STAINED_GLASS_PANE(160),
+ LEAVES_2(161),
+ LOG_2(162),
+ ACACIA_STAIRS(163, Stairs.class),
+ DARK_OAK_STAIRS(164, Stairs.class),
+ HAY_BLOCK(170),
+ CARPET(171),
+ HARD_CLAY(172),
+ COAL_BLOCK(173),
+ PACKED_ICE(174),
+ DOUBLE_PLANT(175),
+ // ----- Item Separator -----
+ IRON_SPADE(256, 1, 250),
+ IRON_PICKAXE(257, 1, 250),
+ IRON_AXE(258, 1, 250),
+ FLINT_AND_STEEL(259, 1, 64),
+ APPLE(260),
+ BOW(261, 1, 384),
+ ARROW(262),
+ COAL(263, Coal.class),
+ DIAMOND(264),
+ IRON_INGOT(265),
+ GOLD_INGOT(266),
+ IRON_SWORD(267, 1, 250),
+ WOOD_SWORD(268, 1, 59),
+ WOOD_SPADE(269, 1, 59),
+ WOOD_PICKAXE(270, 1, 59),
+ WOOD_AXE(271, 1, 59),
+ STONE_SWORD(272, 1, 131),
+ STONE_SPADE(273, 1, 131),
+ STONE_PICKAXE(274, 1, 131),
+ STONE_AXE(275, 1, 131),
+ DIAMOND_SWORD(276, 1, 1561),
+ DIAMOND_SPADE(277, 1, 1561),
+ DIAMOND_PICKAXE(278, 1, 1561),
+ DIAMOND_AXE(279, 1, 1561),
+ STICK(280),
+ BOWL(281),
+ MUSHROOM_SOUP(282, 1),
+ GOLD_SWORD(283, 1, 32),
+ GOLD_SPADE(284, 1, 32),
+ GOLD_PICKAXE(285, 1, 32),
+ GOLD_AXE(286, 1, 32),
+ STRING(287),
+ FEATHER(288),
+ SULPHUR(289),
+ WOOD_HOE(290, 1, 59),
+ STONE_HOE(291, 1, 131),
+ IRON_HOE(292, 1, 250),
+ DIAMOND_HOE(293, 1, 1561),
+ GOLD_HOE(294, 1, 32),
+ SEEDS(295),
+ WHEAT(296),
+ BREAD(297),
+ LEATHER_HELMET(298, 1, 55),
+ LEATHER_CHESTPLATE(299, 1, 80),
+ LEATHER_LEGGINGS(300, 1, 75),
+ LEATHER_BOOTS(301, 1, 65),
+ CHAINMAIL_HELMET(302, 1, 165),
+ CHAINMAIL_CHESTPLATE(303, 1, 240),
+ CHAINMAIL_LEGGINGS(304, 1, 225),
+ CHAINMAIL_BOOTS(305, 1, 195),
+ IRON_HELMET(306, 1, 165),
+ IRON_CHESTPLATE(307, 1, 240),
+ IRON_LEGGINGS(308, 1, 225),
+ IRON_BOOTS(309, 1, 195),
+ DIAMOND_HELMET(310, 1, 363),
+ DIAMOND_CHESTPLATE(311, 1, 528),
+ DIAMOND_LEGGINGS(312, 1, 495),
+ DIAMOND_BOOTS(313, 1, 429),
+ GOLD_HELMET(314, 1, 77),
+ GOLD_CHESTPLATE(315, 1, 112),
+ GOLD_LEGGINGS(316, 1, 105),
+ GOLD_BOOTS(317, 1, 91),
+ FLINT(318),
+ PORK(319),
+ GRILLED_PORK(320),
+ PAINTING(321),
+ GOLDEN_APPLE(322),
+ SIGN(323, 16),
+ WOOD_DOOR(324, 1),
+ BUCKET(325, 16),
+ WATER_BUCKET(326, 1),
+ LAVA_BUCKET(327, 1),
+ MINECART(328, 1),
+ SADDLE(329, 1),
+ IRON_DOOR(330, 1),
+ REDSTONE(331),
+ SNOW_BALL(332, 16),
+ BOAT(333, 1),
+ LEATHER(334),
+ MILK_BUCKET(335, 1),
+ CLAY_BRICK(336),
+ CLAY_BALL(337),
+ SUGAR_CANE(338),
+ PAPER(339),
+ BOOK(340),
+ SLIME_BALL(341),
+ STORAGE_MINECART(342, 1),
+ POWERED_MINECART(343, 1),
+ EGG(344, 16),
+ COMPASS(345),
+ FISHING_ROD(346, 1, 64),
+ WATCH(347),
+ GLOWSTONE_DUST(348),
+ RAW_FISH(349),
+ COOKED_FISH(350),
+ INK_SACK(351, Dye.class),
+ BONE(352),
+ SUGAR(353),
+ CAKE(354, 1),
+ BED(355, 1),
+ DIODE(356),
+ COOKIE(357),
+ /**
+ * @see MapView
+ */
+ MAP(358, MaterialData.class),
+ SHEARS(359, 1, 238),
+ MELON(360),
+ PUMPKIN_SEEDS(361),
+ MELON_SEEDS(362),
+ RAW_BEEF(363),
+ COOKED_BEEF(364),
+ RAW_CHICKEN(365),
+ COOKED_CHICKEN(366),
+ ROTTEN_FLESH(367),
+ ENDER_PEARL(368, 16),
+ BLAZE_ROD(369),
+ GHAST_TEAR(370),
+ GOLD_NUGGET(371),
+ NETHER_STALK(372),
+ /**
+ * @see Potion
+ */
+ POTION(373, 1, MaterialData.class),
+ GLASS_BOTTLE(374),
+ SPIDER_EYE(375),
+ FERMENTED_SPIDER_EYE(376),
+ BLAZE_POWDER(377),
+ MAGMA_CREAM(378),
+ BREWING_STAND_ITEM(379),
+ CAULDRON_ITEM(380),
+ EYE_OF_ENDER(381),
+ SPECKLED_MELON(382),
+ MONSTER_EGG(383, 64, SpawnEgg.class),
+ EXP_BOTTLE(384, 64),
+ FIREBALL(385, 64),
+ BOOK_AND_QUILL(386, 1),
+ WRITTEN_BOOK(387, 16),
+ EMERALD(388, 64),
+ ITEM_FRAME(389),
+ FLOWER_POT_ITEM(390),
+ CARROT_ITEM(391),
+ POTATO_ITEM(392),
+ BAKED_POTATO(393),
+ POISONOUS_POTATO(394),
+ EMPTY_MAP(395),
+ GOLDEN_CARROT(396),
+ SKULL_ITEM(397),
+ CARROT_STICK(398, 1, 25),
+ NETHER_STAR(399),
+ PUMPKIN_PIE(400),
+ FIREWORK(401),
+ FIREWORK_CHARGE(402),
+ ENCHANTED_BOOK(403, 1),
+ REDSTONE_COMPARATOR(404),
+ NETHER_BRICK_ITEM(405),
+ QUARTZ(406),
+ EXPLOSIVE_MINECART(407, 1),
+ HOPPER_MINECART(408, 1),
+ IRON_BARDING(417, 1),
+ GOLD_BARDING(418, 1),
+ DIAMOND_BARDING(419, 1),
+ LEASH(420),
+ NAME_TAG(421),
+ COMMAND_MINECART(422, 1),
+ GOLD_RECORD(2256, 1),
+ GREEN_RECORD(2257, 1),
+ RECORD_3(2258, 1),
+ RECORD_4(2259, 1),
+ RECORD_5(2260, 1),
+ RECORD_6(2261, 1),
+ RECORD_7(2262, 1),
+ RECORD_8(2263, 1),
+ RECORD_9(2264, 1),
+ RECORD_10(2265, 1),
+ RECORD_11(2266, 1),
+ RECORD_12(2267, 1),
+ ;
+
+ private final int id;
+ private final Constructor extends MaterialData> ctor;
+ private static Material[] byId = new Material[383];
+ private final static Map
+ *
+ *
+ *
+ * test abc
+ * 123
+ * @return returns false if no target is found
+ * @throws CommandException thrown when the executor for the given command
+ * fails with an unhandled exception
+ */
+ public boolean dispatchCommand(CommandSender sender, String commandLine) throws CommandException;
+
+ /**
+ * Populates a given {@link ServerConfig} with values attributes to this
+ * server.
+ *
+ * @param config the server config to populate
+ */
+ public void configureDbConfig(ServerConfig config);
+
+ /**
+ * Adds a recipe to the crafting manager.
+ *
+ * @param recipe the recipe to add
+ * @return true if the recipe was added, false if it wasn't for some
+ * reason
+ */
+ public boolean addRecipe(Recipe recipe);
+
+ /**
+ * 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 to match against recipe results
+ * @return a list of recipes with the given result
+ */
+ public List
+ *
+ *
+ * @return true if exact location locations are used for spawning, false
+ * for vanilla collision detection or otherwise
+ */
+ public boolean useExactLoginLocation();
+
+ /**
+ * Shutdowns the server, stopping everything.
+ */
+ public void shutdown();
+
+ /**
+ * Broadcasts the specified message to every user with the given
+ * permission name.
+ *
+ * @param message message to broadcast
+ * @param permission the required permission {@link Permissible
+ * permissibles} must have to receive the broadcast
+ * @return number of message recipients
+ */
+ public int broadcast(String message, String permission);
+
+ /**
+ * Gets the player by the given name, regardless if they are offline or
+ * online.
+ *
+ * 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);
+
+ /**
+ * Creates an empty inventory of type {@link InventoryType#CHEST} with the
+ * specified size.
+ *
+ * @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
+ */
+ Inventory createInventory(InventoryHolder owner, int size) throws IllegalArgumentException;
+
+ /**
+ * Creates an empty inventory of type {@link InventoryType#CHEST} with the
+ * specified size and title.
+ *
+ * @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
+ */
+ Inventory createInventory(InventoryHolder owner, int size, String title) throws IllegalArgumentException;
+
+ /**
+ * Gets user-specified limit for number of monsters that can spawn in a
+ * chunk.
+ *
+ * @return the monster spawn limit
+ */
+ int getMonsterSpawnLimit();
+
+ /**
+ * Gets user-specified limit for number of animals that can spawn in a
+ * chunk.
+ *
+ * @return the animal spawn limit
+ */
+ int getAnimalSpawnLimit();
+
+ /**
+ * Gets user-specified limit for number of water animals that can spawn in
+ * a chunk.
+ *
+ * @return the water animal spawn limit
+ */
+ int getWaterAnimalSpawnLimit();
+
+ /**
+ * Gets user-specified limit for number of ambient mobs that can spawn in
+ * a chunk.
+ *
+ * @return the ambient spawn limit
+ */
+ int getAmbientSpawnLimit();
+
+ /**
+ * Checks the current thread against the expected primary thread for the
+ * server.
+ * getType() != Type.UNTYPED
+ *
+ * @return true if this is a substatistic
+ */
+ public boolean isSubstatistic() {
+ return type != Type.UNTYPED;
+ }
+
+ /**
+ * Checks if this is a substatistic dealing with blocks.
+ * getType() == Type.BLOCK
+ *
+ * @return true if this deals with blocks
+ */
+ public boolean isBlock() {
+ return type == Type.BLOCK;
+ }
+
+ /**
+ * The type of statistic.
+ *
+ */
+ public enum Type {
+ /**
+ * Statistics of this type do not require a qualifier.
+ */
+ UNTYPED,
+
+ /**
+ * Statistics of this type require an Item Material qualifier.
+ */
+ ITEM,
+
+ /**
+ * Statistics of this type require a Block Material qualifier.
+ */
+ BLOCK,
+
+ /**
+ * Statistics of this type require an EntityType qualifier.
+ */
+ ENTITY;
+ }
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/TravelAgent.java b/vspigot-api/src/main/java/org/bukkit/TravelAgent.java
new file mode 100644
index 0000000..2dfeffa
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/TravelAgent.java
@@ -0,0 +1,94 @@
+package org.bukkit;
+
+/**
+ * The Travel Agent handles the creation and the research of Nether and End
+ * portals when Entities try to use one.
+ *
+ *
+ */
+ public boolean printFor(Warning warning) {
+ if (this == DEFAULT) {
+ return warning == null || warning.value();
+ }
+ return this == ON;
+ }
+
+ /**
+ * This method returns the corresponding warning state for the given
+ * string value.
+ *
+ * @param value The string value to check
+ * @return {@link #DEFAULT} if not found, or the respective
+ * WarningState
+ */
+ public static WarningState value(final String value) {
+ if (value == null) {
+ return DEFAULT;
+ }
+ WarningState state = values.get(value.toLowerCase());
+ if (state == null) {
+ return DEFAULT;
+ }
+ return state;
+ }
+ }
+
+ /**
+ * This sets if the deprecation warnings when registering events gets
+ * printed when the setting is in the default state.
+ *
+ * @return false normally, or true to encourage warning printout
+ */
+ boolean value() default false;
+
+ /**
+ * This can provide detailed information on why the event is deprecated.
+ *
+ * @return The reason an event is deprecated
+ */
+ String reason() default "";
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/WeatherType.java b/vspigot-api/src/main/java/org/bukkit/WeatherType.java
new file mode 100644
index 0000000..36b993f
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/WeatherType.java
@@ -0,0 +1,17 @@
+package org.bukkit;
+
+/**
+ * An enum of all current weather types
+ */
+public enum WeatherType {
+
+ /**
+ * Raining or snowing depending on biome.
+ */
+ DOWNFALL,
+ /**
+ * Clear weather, clouds but no rain.
+ */
+ CLEAR,
+ ;
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/World.java b/vspigot-api/src/main/java/org/bukkit/World.java
new file mode 100644
index 0000000..7c94319
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/World.java
@@ -0,0 +1,1309 @@
+package org.bukkit;
+
+import java.io.File;
+import org.bukkit.generator.ChunkGenerator;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.bukkit.block.Biome;
+import org.bukkit.block.Block;
+import org.bukkit.entity.*;
+import org.bukkit.generator.BlockPopulator;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.metadata.Metadatable;
+import org.bukkit.plugin.messaging.PluginMessageRecipient;
+import org.bukkit.util.Vector;
+
+/**
+ * Represents a world, which may contain entities, chunks and blocks
+ */
+public interface World extends PluginMessageRecipient, Metadatable {
+
+ /**
+ * Gets the {@link Block} at the given coordinates
+ *
+ * @param x X-coordinate of the block
+ * @param y Y-coordinate of the block
+ * @param z Z-coordinate of the block
+ * @return Block at the given coordinates
+ * @see #getBlockTypeIdAt(int, int, int) Returns the current type ID of
+ * the block
+ */
+ public Block getBlockAt(int x, int y, int z);
+
+ /**
+ * Gets the {@link Block} at the given {@link Location}
+ *
+ * @param location Location of the block
+ * @return Block at the given location
+ * @see #getBlockTypeIdAt(org.bukkit.Location) Returns the current type ID
+ * of the block
+ */
+ public Block getBlockAt(Location location);
+
+ /**
+ * Gets the block type ID at the given coordinates
+ *
+ * @param x X-coordinate of the block
+ * @param y Y-coordinate of the block
+ * @param z Z-coordinate of the block
+ * @return Type ID of the block at the given coordinates
+ * @see #getBlockAt(int, int, int) Returns a live Block object at the
+ * given location
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public int getBlockTypeIdAt(int x, int y, int z);
+
+ /**
+ * Gets the block type ID at the given {@link Location}
+ *
+ * @param location Location of the block
+ * @return Type ID of the block at the given location
+ * @see #getBlockAt(org.bukkit.Location) Returns a live Block object at
+ * the given location
+ * @deprecated Magic value
+ */
+ @Deprecated
+ public int getBlockTypeIdAt(Location location);
+
+ /**
+ * Gets the highest non-air coordinate at the given coordinates
+ *
+ * @param x X-coordinate of the blocks
+ * @param z Z-coordinate of the blocks
+ * @return Y-coordinate of the highest non-air block
+ */
+ public int getHighestBlockYAt(int x, int z);
+
+ /**
+ * Gets the highest non-air coordinate at the given {@link Location}
+ *
+ * @param location Location of the blocks
+ * @return Y-coordinate of the highest non-air block
+ */
+ public int getHighestBlockYAt(Location location);
+
+ /**
+ * Gets the highest non-empty block at the given coordinates
+ *
+ * @param x X-coordinate of the block
+ * @param z Z-coordinate of the block
+ * @return Highest non-empty block
+ */
+ public Block getHighestBlockAt(int x, int z);
+
+ /**
+ * Gets the highest non-empty block at the given coordinates
+ *
+ * @param location Coordinates to get the highest block
+ * @return Highest non-empty block
+ */
+ public Block getHighestBlockAt(Location location);
+
+ /**
+ * Gets the {@link Chunk} at the given coordinates
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @return Chunk at the given coordinates
+ */
+ public Chunk getChunkAt(int x, int z);
+
+ /**
+ * Gets the {@link Chunk} at the given {@link Location}
+ *
+ * @param location Location of the chunk
+ * @return Chunk at the given location
+ */
+ public Chunk getChunkAt(Location location);
+
+ /**
+ * Gets the {@link Chunk} that contains the given {@link Block}
+ *
+ * @param block Block to get the containing chunk from
+ * @return The chunk that contains the given block
+ */
+ public Chunk getChunkAt(Block block);
+
+ // PaperSpigot start - Async chunk load API
+ public static interface ChunkLoadCallback {
+ public void onLoad(Chunk chunk);
+ }
+ public void getChunkAtAsync(int x, int z, ChunkLoadCallback cb);
+ public void getChunkAtAsync(Location location, ChunkLoadCallback cb);
+ public void getChunkAtAsync(Block block, ChunkLoadCallback cb);
+ // PaperSpigot end
+
+ /**
+ * Checks if the specified {@link Chunk} is loaded
+ *
+ * @param chunk The chunk to check
+ * @return true if the chunk is loaded, otherwise false
+ */
+ public boolean isChunkLoaded(Chunk chunk);
+
+ /**
+ * Gets an array of all loaded {@link Chunk}s
+ *
+ * @return Chunk[] containing all loaded chunks
+ */
+ public Chunk[] getLoadedChunks();
+
+ /**
+ * Loads the specified {@link Chunk}
+ *
+ * @param chunk The chunk to load
+ */
+ public void loadChunk(Chunk chunk);
+
+ /**
+ * Checks if the {@link Chunk} at the specified coordinates is loaded
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @return true if the chunk is loaded, otherwise false
+ */
+ public boolean isChunkLoaded(int x, int z);
+
+ /**
+ * Checks if the {@link Chunk} at the specified coordinates is loaded and
+ * in use by one or more players
+ *
+ * @param x X-coordinate of the chunk
+ * @param z Z-coordinate of the chunk
+ * @return true if the chunk is loaded and in use by one or more players,
+ * otherwise false
+ */
+ public boolean isChunkInUse(int x, int z);
+
+ /**
+ * Loads the {@link Chunk} at the specified coordinates
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * Block block = world.getBlockAt(100, 100, 100);
+ * Block shower = block.getRelative(BlockFace.UP, 2);
+ * shower.setType(Material.WATER);
+ *
+ *
+ * @param face Face of this block to return
+ * @param distance Distance to get the block at
+ * @return Block at the given face
+ */
+ Block getRelative(BlockFace face, int distance);
+
+ /**
+ * Gets the type of this block
+ *
+ * @return block type
+ */
+ Material getType();
+
+ /**
+ * Gets the type-id of this block
+ *
+ * @return block type-id
+ * @deprecated Magic value
+ */
+ @Deprecated
+ int getTypeId();
+
+ /**
+ * Gets the light level between 0-15
+ *
+ * @return light level
+ */
+ byte getLightLevel();
+
+ /**
+ * Get the amount of light at this block from the sky.
+ *
+ * Block current = world.getBlockAt(100, 100, 100);
+ * Block target = world.getBlockAt(100, 101, 100);
+ *
+ * current.getFace(target) == BlockFace.Up;
+ *
+ *
+ * If the given block is not connected to this block, null may be returned
+ *
+ * @param block Block to compare against this block
+ * @return BlockFace of this block which has the requested block, or null
+ */
+ BlockFace getFace(Block block);
+
+ /**
+ * Captures the current state of this block. You may then cast that state
+ * into any accepted type, such as Furnace or Sign.
+ * aliases
' node) is equivalent to this method.
+ *
+ * @param aliases aliases to register to this command
+ * @return this command object, for chaining
+ */
+ public Command setAliases(Listdescription
' node) is equivalent to this method.
+ *
+ * @param description new command description
+ * @return this command object, for chaining
+ */
+ public Command setDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Sets the message sent when a permission check fails
+ *
+ * @param permissionMessage new permission message, null to indicate
+ * default message, or an empty string to indicate no message
+ * @return this command object, for chaining
+ */
+ public Command setPermissionMessage(String permissionMessage) {
+ this.permissionMessage = permissionMessage;
+ return this;
+ }
+
+ /**
+ * Sets the example usage of this command
+ *
+ * @param usage new example usage
+ * @return this command object, for chaining
+ */
+ public Command setUsage(String usage) {
+ this.usageMessage = usage;
+ return this;
+ }
+
+ public static void broadcastCommandMessage(CommandSender source, String message) {
+ broadcastCommandMessage(source, message, true);
+ }
+
+ public static void broadcastCommandMessage(CommandSender source, String message, boolean sendToSource) {
+ String result = source.getName() + ": " + message;
+
+ if (source instanceof BlockCommandSender) {
+ BlockCommandSender blockCommandSender = (BlockCommandSender) source;
+
+ if (blockCommandSender.getBlock().getWorld().getGameRuleValue("commandBlockOutput").equalsIgnoreCase("false")) {
+ Bukkit.getConsoleSender().sendMessage(result);
+ return;
+ }
+ } else if (source instanceof CommandMinecart) {
+ CommandMinecart commandMinecart = (CommandMinecart) source;
+
+ if (commandMinecart.getWorld().getGameRuleValue("commandBlockOutput").equalsIgnoreCase("false")) {
+ Bukkit.getConsoleSender().sendMessage(result);
+ return;
+ }
+ }
+
+ SetCommandException
without detail
+ * message.
+ */
+ public CommandException() {}
+
+ /**
+ * Constructs an instance of CommandException
with the
+ * specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public CommandException(String msg) {
+ super(msg);
+ }
+
+ public CommandException(String msg, Throwable cause) {
+ super(msg, cause);
+ }
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/command/CommandExecutor.java b/vspigot-api/src/main/java/org/bukkit/command/CommandExecutor.java
new file mode 100644
index 0000000..c75586f
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/command/CommandExecutor.java
@@ -0,0 +1,18 @@
+package org.bukkit.command;
+
+/**
+ * Represents a class which contains a single method for executing commands
+ */
+public interface CommandExecutor {
+
+ /**
+ * Executes the given command, returning its success
+ *
+ * @param sender Source of the command
+ * @param command Command which was executed
+ * @param label Alias of the command which was used
+ * @param args Passed command arguments
+ * @return true if a valid command, otherwise false
+ */
+ public boolean onCommand(CommandSender sender, Command command, String label, String[] args);
+}
diff --git a/vspigot-api/src/main/java/org/bukkit/command/CommandMap.java b/vspigot-api/src/main/java/org/bukkit/command/CommandMap.java
new file mode 100644
index 0000000..e7e20d8
--- /dev/null
+++ b/vspigot-api/src/main/java/org/bukkit/command/CommandMap.java
@@ -0,0 +1,109 @@
+package org.bukkit.command;
+
+import java.util.List;
+
+public interface CommandMap {
+
+ /**
+ * Registers all the commands belonging to a certain plugin.
+ *
+ *
+ *
+ * @param fallbackPrefix a prefix which is prepended to each command with
+ * a ':' one or more times to make the command unique
+ * @param commands a list of commands to register
+ */
+ public void registerAll(String fallbackPrefix, List
+ *
+ *
+ * @param label the label of the command, without the '/'-prefix.
+ * @param fallbackPrefix a prefix which is prepended to the command with a
+ * ':' one or more times to make the command unique
+ * @param command the command to register
+ * @return true if command was registered with the passed in label, false
+ * otherwise, which indicates the fallbackPrefix was used one or more
+ * times
+ */
+ public boolean register(String label, String fallbackPrefix, Command command);
+
+ /**
+ * Registers a command. Returns true on success; false if name is already
+ * taken and fallback had to be used.
+ *
+ *
+ *
+ * @param fallbackPrefix a prefix which is prepended to the command with a
+ * ':' one or more times to make the command unique
+ * @param command the command to register, from which label is determined
+ * from the command name
+ * @return true if command was registered with the passed in label, false
+ * otherwise, which indicates the fallbackPrefix was used one or more
+ * times
+ */
+ public boolean register(String fallbackPrefix, Command command);
+
+ /**
+ * Looks for the requested command and executes it if found.
+ *
+ * @param sender The command's sender
+ * @param cmdLine command + arguments. Example: "/test abc 123"
+ * @return returns false if no target is found, true otherwise.
+ * @throws CommandException Thrown when the executor for the given command
+ * fails with an unhandled exception
+ */
+ public boolean dispatch(CommandSender sender, String cmdLine) throws CommandException;
+
+ /**
+ * Clears all registered commands.
+ */
+ public void clearCommands();
+
+ /**
+ * Gets the command registered to the specified name
+ *
+ * @param name Name of the command to retrieve
+ * @return Command with the specified name or null if a command with that
+ * label doesn't exist
+ */
+ public Command getCommand(String name);
+
+
+ /**
+ * Looks for the requested command and executes an appropriate
+ * tab-completer if found. This method will also tab-complete partial
+ * commands.
+ *
+ * @param sender The command's sender.
+ * @param cmdLine The entire command string to tab-complete, excluding
+ * initial slash.
+ * @return a list of possible tab-completions. This list may be immutable.
+ * Will be null if no matching command of which sender has permission.
+ * @throws CommandException Thrown when the tab-completer for the given
+ * command fails with an unhandled exception
+ * @throws IllegalArgumentException if either sender or cmdLine are null
+ */
+ public List