From 9073db6c0a666da1392ef2db8ebbb57e3a38b3e4 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 1 Apr 2014 06:57:14 +1100 Subject: [PATCH] Deprecate Some Stuff These classes / methods / fields have been deprecated as their functionality may be broken or changed some time in the future by Mojang. Deprecating them now raises awareness and gives time for developers to evaluate the impact the use of these items may have on their code and rectify it accordingly. Happy April Fools' from Australia! diff --git a/src/main/java/org/bukkit/Achievement.java b/src/main/java/org/bukkit/Achievement.java index 928b6d5..296ce51 100644 --- a/src/main/java/org/bukkit/Achievement.java +++ b/src/main/java/org/bukkit/Achievement.java @@ -3,6 +3,7 @@ package org.bukkit; /** * Represents an achievement, which may be given to players. */ +@Deprecated public enum Achievement { OPEN_INVENTORY, MINE_WOOD (OPEN_INVENTORY), @@ -39,12 +40,15 @@ public enum Achievement { DIAMONDS_TO_YOU (GET_DIAMONDS), ; + @Deprecated private final Achievement parent; + @Deprecated private Achievement() { parent = null; } + @Deprecated private Achievement(Achievement parent) { this.parent = parent; } @@ -54,6 +58,7 @@ public enum Achievement { * * @return whether the achievement has a parent achievement */ + @Deprecated public boolean hasParent() { return parent != null; } @@ -63,6 +68,7 @@ public enum Achievement { * * @return the parent achievement or null */ + @Deprecated public Achievement getParent() { return parent; } diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java index ba66f16..2014bfc 100644 --- a/src/main/java/org/bukkit/Art.java +++ b/src/main/java/org/bukkit/Art.java @@ -9,6 +9,7 @@ import com.google.common.collect.Maps; /** * Represents the art on a painting */ +@Deprecated public enum Art { KEBAB(0, 1, 1), AZTEC(1, 1, 1), @@ -37,10 +38,14 @@ public enum Art { SKELETON(24, 4, 3), DONKEYKONG(25, 4, 3); + @Deprecated private int id, width, height; + @Deprecated private static final HashMap BY_NAME = Maps.newHashMap(); + @Deprecated private static final HashMap BY_ID = Maps.newHashMap(); + @Deprecated private Art(int id, int width, int height) { this.id = id; this.width = width; @@ -52,6 +57,7 @@ public enum Art { * * @return The width of the painting, in blocks */ + @Deprecated public int getBlockWidth() { return width; } @@ -61,6 +67,7 @@ public enum Art { * * @return The height of the painting, in blocks */ + @Deprecated public int getBlockHeight() { return height; } @@ -96,6 +103,7 @@ public enum Art { * @param name The name * @return The painting */ + @Deprecated public static Art getByName(String name) { Validate.notNull(name, "Name cannot be null"); diff --git a/src/main/java/org/bukkit/BanEntry.java b/src/main/java/org/bukkit/BanEntry.java index 986120e..1db50ac 100644 --- a/src/main/java/org/bukkit/BanEntry.java +++ b/src/main/java/org/bukkit/BanEntry.java @@ -38,6 +38,7 @@ import java.util.Date; * Likewise, changes to the associated {@link BanList} or other entries may or * may not be reflected in this entry. */ +@Deprecated public interface BanEntry { /** @@ -46,6 +47,7 @@ public interface BanEntry { * * @return the target name or IP address */ + @Deprecated public String getTarget(); /** @@ -53,6 +55,7 @@ public interface BanEntry { * * @return the creation date */ + @Deprecated public Date getCreated(); /** @@ -61,6 +64,7 @@ public interface BanEntry { * @param created the new created date, cannot be null * @see #save() saving changes */ + @Deprecated public void setCreated(Date created); /** @@ -71,6 +75,7 @@ public interface BanEntry { * * @return the source of the ban */ + @Deprecated public String getSource(); /** @@ -82,6 +87,7 @@ public interface BanEntry { * @param source the new source where null values become empty strings * @see #save() saving changes */ + @Deprecated public void setSource(String source); /** @@ -89,6 +95,7 @@ public interface BanEntry { * * @return the expiration date */ + @Deprecated public Date getExpiration(); /** @@ -99,6 +106,7 @@ public interface BanEntry { * eternity * @see #save() saving changes */ + @Deprecated public void setExpiration(Date expiration); /** @@ -106,6 +114,7 @@ public interface BanEntry { * * @return the ban reason, or null if not set */ + @Deprecated public String getReason(); /** @@ -115,6 +124,7 @@ public interface BanEntry { * default * @see #save() saving changes */ + @Deprecated public void setReason(String reason); /** @@ -123,5 +133,6 @@ public interface BanEntry { * Saving the ban entry of an unbanned player will cause the player to be * banned once again. */ + @Deprecated public void save(); } diff --git a/src/main/java/org/bukkit/BanList.java b/src/main/java/org/bukkit/BanList.java index c21b858..c6e2dc9 100644 --- a/src/main/java/org/bukkit/BanList.java +++ b/src/main/java/org/bukkit/BanList.java @@ -6,11 +6,13 @@ import java.util.Set; /** * A ban list, containing bans of some {@link Type}. */ +@Deprecated public interface BanList { /** * Represents a ban-type that a {@link BanList} may track. */ + @Deprecated public enum Type { /** * Banned player names @@ -29,6 +31,7 @@ public interface BanList { * @param target entry parameter to search for * @return the corresponding entry, or null if none found */ + @Deprecated public BanEntry getBanEntry(String target); /** @@ -43,6 +46,7 @@ public interface BanList { * @return the entry for the newly created ban, or the entry for the * (updated) previous ban */ + @Deprecated public BanEntry addBan(String target, String reason, Date expires, String source); /** @@ -50,6 +54,7 @@ public interface BanList { * * @return an immutable set containing every entry tracked by this list */ + @Deprecated public Set getBanEntries(); /** @@ -60,6 +65,7 @@ public interface BanList { * @return true if a {@link BanEntry} exists for the name, indicating an * active ban status, false otherwise */ + @Deprecated public boolean isBanned(String target); /** @@ -68,5 +74,6 @@ public interface BanList { * * @param target the target to remove from this list */ + @Deprecated public void pardon(String target); } diff --git a/src/main/java/org/bukkit/BlockChangeDelegate.java b/src/main/java/org/bukkit/BlockChangeDelegate.java index e6b9f0e..4154b3f 100644 --- a/src/main/java/org/bukkit/BlockChangeDelegate.java +++ b/src/main/java/org/bukkit/BlockChangeDelegate.java @@ -5,6 +5,7 @@ package org.bukkit; * between generation algorithms in the server implementation and utilizing * code. */ +@Deprecated public interface BlockChangeDelegate { /** @@ -90,6 +91,7 @@ public interface BlockChangeDelegate { * * @return Height of the world */ + @Deprecated public int getHeight(); /** @@ -100,5 +102,6 @@ public interface BlockChangeDelegate { * @param z Z coordinate * @return True if the block is considered empty. */ + @Deprecated public boolean isEmpty(int x, int y, int z); } diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index 7d8736e..169f364 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -34,12 +34,15 @@ import org.bukkit.inventory.ItemFactory; /** * Represents the Bukkit core, for version and Server singleton handling */ +@Deprecated public final class Bukkit { + @Deprecated private static Server server; /** * Static class cannot be initialized. */ + @Deprecated private Bukkit() {} /** @@ -47,6 +50,7 @@ public final class Bukkit { * * @return Server instance being ran */ + @Deprecated public static Server getServer() { return server; } @@ -58,6 +62,7 @@ public final class Bukkit { * * @param server Server instance */ + @Deprecated public static void setServer(Server server) { if (Bukkit.server != null) { throw new UnsupportedOperationException("Cannot redefine singleton Server"); @@ -70,6 +75,7 @@ public final class Bukkit { /** * @see Server#getName() */ + @Deprecated public static String getName() { return server.getName(); } @@ -77,6 +83,7 @@ public final class Bukkit { /** * @see Server#getVersion() */ + @Deprecated public static String getVersion() { return server.getVersion(); } @@ -84,6 +91,7 @@ public final class Bukkit { /** * @see Server#getBukkitVersion() */ + @Deprecated public static String getBukkitVersion() { return server.getBukkitVersion(); } @@ -91,6 +99,7 @@ public final class Bukkit { /** * @see Server#getOnlinePlayers() */ + @Deprecated public static Player[] getOnlinePlayers() { return server.getOnlinePlayers(); } @@ -98,6 +107,7 @@ public final class Bukkit { /** * @see Server#getMaxPlayers() */ + @Deprecated public static int getMaxPlayers() { return server.getMaxPlayers(); } @@ -105,6 +115,7 @@ public final class Bukkit { /** * @see Server#getPort() */ + @Deprecated public static int getPort() { return server.getPort(); } @@ -112,6 +123,7 @@ public final class Bukkit { /** * @see Server#getViewDistance() */ + @Deprecated public static int getViewDistance() { return server.getViewDistance(); } @@ -119,6 +131,7 @@ public final class Bukkit { /** * @see Server#getIp() */ + @Deprecated public static String getIp() { return server.getIp(); } @@ -126,6 +139,7 @@ public final class Bukkit { /** * @see Server#getServerName() */ + @Deprecated public static String getServerName() { return server.getServerName(); } @@ -133,6 +147,7 @@ public final class Bukkit { /** * @see Server#getServerId() */ + @Deprecated public static String getServerId() { return server.getServerId(); } @@ -140,6 +155,7 @@ public final class Bukkit { /** * @see Server#getWorldType() */ + @Deprecated public static String getWorldType() { return server.getWorldType(); } @@ -147,6 +163,7 @@ public final class Bukkit { /** * @see Server#getGenerateStructures() */ + @Deprecated public static boolean getGenerateStructures() { return server.getGenerateStructures(); } @@ -154,6 +171,7 @@ public final class Bukkit { /** * @see Server#getAllowNether() */ + @Deprecated public static boolean getAllowNether() { return server.getAllowNether(); } @@ -161,6 +179,7 @@ public final class Bukkit { /** * @see Server#hasWhitelist() */ + @Deprecated public static boolean hasWhitelist() { return server.hasWhitelist(); } @@ -168,6 +187,7 @@ public final class Bukkit { /** * @see Server#broadcastMessage(String message) */ + @Deprecated public static int broadcastMessage(String message) { return server.broadcastMessage(message); } @@ -175,6 +195,7 @@ public final class Bukkit { /** * @see Server#getUpdateFolder() */ + @Deprecated public static String getUpdateFolder() { return server.getUpdateFolder(); } @@ -182,6 +203,7 @@ public final class Bukkit { /** * @see Server#getPlayer(String name) */ + @Deprecated public static Player getPlayer(String name) { return server.getPlayer(name); } @@ -189,6 +211,7 @@ public final class Bukkit { /** * @see Server#matchPlayer(String name) */ + @Deprecated public static List matchPlayer(String name) { return server.matchPlayer(name); } @@ -196,6 +219,7 @@ public final class Bukkit { /** * @see Server#getPlayer(java.util.UUID) */ + @Deprecated public static Player getPlayer(UUID id) { return server.getPlayer(id); } @@ -203,6 +227,7 @@ public final class Bukkit { /** * @see Server#getPluginManager() */ + @Deprecated public static PluginManager getPluginManager() { return server.getPluginManager(); } @@ -210,6 +235,7 @@ public final class Bukkit { /** * @see Server#getScheduler() */ + @Deprecated public static BukkitScheduler getScheduler() { return server.getScheduler(); } @@ -217,6 +243,7 @@ public final class Bukkit { /** * @see Server#getServicesManager() */ + @Deprecated public static ServicesManager getServicesManager() { return server.getServicesManager(); } @@ -224,6 +251,7 @@ public final class Bukkit { /** * @see Server#getWorlds() */ + @Deprecated public static List getWorlds() { return server.getWorlds(); } @@ -231,6 +259,7 @@ public final class Bukkit { /** * @see Server#createWorld(WorldCreator options) */ + @Deprecated public static World createWorld(WorldCreator options) { return server.createWorld(options); } @@ -238,6 +267,7 @@ public final class Bukkit { /** * @see Server#unloadWorld(String name, boolean save) */ + @Deprecated public static boolean unloadWorld(String name, boolean save) { return server.unloadWorld(name, save); } @@ -245,6 +275,7 @@ public final class Bukkit { /** * @see Server#unloadWorld(World world, boolean save) */ + @Deprecated public static boolean unloadWorld(World world, boolean save) { return server.unloadWorld(world, save); } @@ -252,6 +283,7 @@ public final class Bukkit { /** * @see Server#getWorld(String name) */ + @Deprecated public static World getWorld(String name) { return server.getWorld(name); } @@ -259,6 +291,7 @@ public final class Bukkit { /** * @see Server#getWorld(UUID uid) */ + @Deprecated public static World getWorld(UUID uid) { return server.getWorld(uid); } @@ -275,6 +308,7 @@ public final class Bukkit { /** * @see Server#createMap(World world) */ + @Deprecated public static MapView createMap(World world) { return server.createMap(world); } @@ -282,6 +316,7 @@ public final class Bukkit { /** * @see Server#reload() */ + @Deprecated public static void reload() { server.reload(); } @@ -289,6 +324,7 @@ public final class Bukkit { /** * @see Server#getLogger() */ + @Deprecated public static Logger getLogger() { return server.getLogger(); } @@ -296,6 +332,7 @@ public final class Bukkit { /** * @see Server#getPluginCommand(String name) */ + @Deprecated public static PluginCommand getPluginCommand(String name) { return server.getPluginCommand(name); } @@ -303,6 +340,7 @@ public final class Bukkit { /** * @see Server#savePlayers() */ + @Deprecated public static void savePlayers() { server.savePlayers(); } @@ -310,6 +348,7 @@ public final class Bukkit { /** * @see Server#dispatchCommand(CommandSender sender, String commandLine) */ + @Deprecated public static boolean dispatchCommand(CommandSender sender, String commandLine) { return server.dispatchCommand(sender, commandLine); } @@ -317,6 +356,7 @@ public final class Bukkit { /** * @see Server#configureDbConfig(ServerConfig config) */ + @Deprecated public static void configureDbConfig(ServerConfig config) { server.configureDbConfig(config); } @@ -324,6 +364,7 @@ public final class Bukkit { /** * @see Server#addRecipe(Recipe recipe) */ + @Deprecated public static boolean addRecipe(Recipe recipe) { return server.addRecipe(recipe); } @@ -331,6 +372,7 @@ public final class Bukkit { /** * @see Server#getRecipesFor(ItemStack result) */ + @Deprecated public static List getRecipesFor(ItemStack result) { return server.getRecipesFor(result); } @@ -338,6 +380,7 @@ public final class Bukkit { /** * @see Server#recipeIterator() */ + @Deprecated public static Iterator recipeIterator() { return server.recipeIterator(); } @@ -345,6 +388,7 @@ public final class Bukkit { /** * @see Server#clearRecipes() */ + @Deprecated public static void clearRecipes() { server.clearRecipes(); } @@ -352,6 +396,7 @@ public final class Bukkit { /** * @see Server#resetRecipes() */ + @Deprecated public static void resetRecipes() { server.resetRecipes(); } @@ -359,6 +404,7 @@ public final class Bukkit { /** * @see Server#getCommandAliases() */ + @Deprecated public static Map getCommandAliases() { return server.getCommandAliases(); } @@ -366,6 +412,7 @@ public final class Bukkit { /** * @see Server#getSpawnRadius() */ + @Deprecated public static int getSpawnRadius() { return server.getSpawnRadius(); } @@ -373,6 +420,7 @@ public final class Bukkit { /** * @see Server#setSpawnRadius(int value) */ + @Deprecated public static void setSpawnRadius(int value) { server.setSpawnRadius(value); } @@ -380,6 +428,7 @@ public final class Bukkit { /** * @see Server#getOnlineMode() */ + @Deprecated public static boolean getOnlineMode() { return server.getOnlineMode(); } @@ -387,6 +436,7 @@ public final class Bukkit { /** * @see Server#getAllowFlight() */ + @Deprecated public static boolean getAllowFlight() { return server.getAllowFlight(); } @@ -394,6 +444,7 @@ public final class Bukkit { /** * @see Server#isHardcore() */ + @Deprecated public static boolean isHardcore() { return server.isHardcore(); } @@ -401,6 +452,7 @@ public final class Bukkit { /** * @see Server#shutdown() */ + @Deprecated public static void shutdown() { server.shutdown(); } @@ -408,6 +460,7 @@ public final class Bukkit { /** * @see Server#broadcast(String message, String permission) */ + @Deprecated public static int broadcast(String message, String permission) { return server.broadcast(message, permission); } @@ -423,6 +476,7 @@ public final class Bukkit { /** * @see Server#getOfflinePlayer(java.util.UUID) */ + @Deprecated public static OfflinePlayer getOfflinePlayer(UUID id) { return server.getOfflinePlayer(id); } @@ -438,6 +492,7 @@ public final class Bukkit { /** * @see Server#getIPBans() */ + @Deprecated public static Set getIPBans() { return server.getIPBans(); } @@ -445,6 +500,7 @@ public final class Bukkit { /** * @see Server#banIP(String address) */ + @Deprecated public static void banIP(String address) { server.banIP(address); } @@ -452,6 +508,7 @@ public final class Bukkit { /** * @see Server#unbanIP(String address) */ + @Deprecated public static void unbanIP(String address) { server.unbanIP(address); } @@ -459,6 +516,7 @@ public final class Bukkit { /** * @see Server#getBannedPlayers() */ + @Deprecated public static Set getBannedPlayers() { return server.getBannedPlayers(); } @@ -466,6 +524,7 @@ public final class Bukkit { /** * @see Server#getBanList(BanList.Type) */ + @Deprecated public static BanList getBanList(BanList.Type type){ return server.getBanList(type); } @@ -473,6 +532,7 @@ public final class Bukkit { /** * @see Server#setWhitelist(boolean value) */ + @Deprecated public static void setWhitelist(boolean value) { server.setWhitelist(value); } @@ -480,6 +540,7 @@ public final class Bukkit { /** * @see Server#getWhitelistedPlayers() */ + @Deprecated public static Set getWhitelistedPlayers() { return server.getWhitelistedPlayers(); } @@ -487,6 +548,7 @@ public final class Bukkit { /** * @see Server#reloadWhitelist() */ + @Deprecated public static void reloadWhitelist() { server.reloadWhitelist(); } @@ -494,6 +556,7 @@ public final class Bukkit { /** * @see Server#getConsoleSender() */ + @Deprecated public static ConsoleCommandSender getConsoleSender() { return server.getConsoleSender(); } @@ -501,6 +564,7 @@ public final class Bukkit { /** * @see Server#getOperators() */ + @Deprecated public static Set getOperators() { return server.getOperators(); } @@ -508,6 +572,7 @@ public final class Bukkit { /** * @see Server#getWorldContainer() */ + @Deprecated public static File getWorldContainer() { return server.getWorldContainer(); } @@ -515,6 +580,7 @@ public final class Bukkit { /** * @see Server#getMessenger() */ + @Deprecated public static Messenger getMessenger() { return server.getMessenger(); } @@ -522,6 +588,7 @@ public final class Bukkit { /** * @see Server#getAllowEnd() */ + @Deprecated public static boolean getAllowEnd() { return server.getAllowEnd(); } @@ -529,6 +596,7 @@ public final class Bukkit { /** * @see Server#getUpdateFolderFile() */ + @Deprecated public static File getUpdateFolderFile() { return server.getUpdateFolderFile(); } @@ -536,6 +604,7 @@ public final class Bukkit { /** * @see Server#getConnectionThrottle() */ + @Deprecated public static long getConnectionThrottle() { return server.getConnectionThrottle(); } @@ -543,6 +612,7 @@ public final class Bukkit { /** * @see Server#getTicksPerAnimalSpawns() */ + @Deprecated public static int getTicksPerAnimalSpawns() { return server.getTicksPerAnimalSpawns(); } @@ -550,6 +620,7 @@ public final class Bukkit { /** * @see Server#getTicksPerMonsterSpawns() */ + @Deprecated public static int getTicksPerMonsterSpawns() { return server.getTicksPerMonsterSpawns(); } @@ -557,6 +628,7 @@ public final class Bukkit { /** * @see Server#useExactLoginLocation() */ + @Deprecated public static boolean useExactLoginLocation() { return server.useExactLoginLocation(); } @@ -564,6 +636,7 @@ public final class Bukkit { /** * @see Server#getDefaultGameMode() */ + @Deprecated public static GameMode getDefaultGameMode() { return server.getDefaultGameMode(); } @@ -571,6 +644,7 @@ public final class Bukkit { /** * @see Server#setDefaultGameMode(GameMode mode) */ + @Deprecated public static void setDefaultGameMode(GameMode mode) { server.setDefaultGameMode(mode); } @@ -578,6 +652,7 @@ public final class Bukkit { /** * @see Server#getOfflinePlayers() */ + @Deprecated public static OfflinePlayer[] getOfflinePlayers() { return server.getOfflinePlayers(); } @@ -585,6 +660,7 @@ public final class Bukkit { /** * @see Server#createInventory(InventoryHolder owner, InventoryType type) */ + @Deprecated public static Inventory createInventory(InventoryHolder owner, InventoryType type) { return server.createInventory(owner, type); } @@ -592,6 +668,7 @@ public final class Bukkit { /** * @see Server#createInventory(InventoryHolder owner, int size) */ + @Deprecated public static Inventory createInventory(InventoryHolder owner, int size) { return server.createInventory(owner, size); } @@ -600,6 +677,7 @@ public final class Bukkit { * @see Server#createInventory(InventoryHolder owner, int size, String * title) */ + @Deprecated public static Inventory createInventory(InventoryHolder owner, int size, String title) { return server.createInventory(owner, size, title); } @@ -607,6 +685,7 @@ public final class Bukkit { /** * @see Server#getHelpMap() */ + @Deprecated public static HelpMap getHelpMap() { return server.getHelpMap(); } @@ -614,6 +693,7 @@ public final class Bukkit { /** * @see Server#getMonsterSpawnLimit() */ + @Deprecated public static int getMonsterSpawnLimit() { return server.getMonsterSpawnLimit(); } @@ -621,6 +701,7 @@ public final class Bukkit { /** * @see Server#getAnimalSpawnLimit() */ + @Deprecated public static int getAnimalSpawnLimit() { return server.getAnimalSpawnLimit(); } @@ -628,6 +709,7 @@ public final class Bukkit { /** * @see Server#getWaterAnimalSpawnLimit() */ + @Deprecated public static int getWaterAnimalSpawnLimit() { return server.getWaterAnimalSpawnLimit(); } @@ -635,6 +717,7 @@ public final class Bukkit { /** * @see Server#getAmbientSpawnLimit() */ + @Deprecated public static int getAmbientSpawnLimit() { return server.getAmbientSpawnLimit(); } @@ -642,6 +725,7 @@ public final class Bukkit { /** * @see Server#isPrimaryThread() */ + @Deprecated public static boolean isPrimaryThread() { return server.isPrimaryThread(); } @@ -649,6 +733,7 @@ public final class Bukkit { /** * @see Server#getMotd() */ + @Deprecated public static String getMotd() { return server.getMotd(); } @@ -656,6 +741,7 @@ public final class Bukkit { /** * @see Server#getShutdownMessage() */ + @Deprecated public static String getShutdownMessage() { return server.getShutdownMessage(); } @@ -663,6 +749,7 @@ public final class Bukkit { /** * @see Server#getWarningState() */ + @Deprecated public static WarningState getWarningState() { return server.getWarningState(); } @@ -670,6 +757,7 @@ public final class Bukkit { /** * @see Server#getItemFactory() */ + @Deprecated public static ItemFactory getItemFactory() { return server.getItemFactory(); } @@ -677,6 +765,7 @@ public final class Bukkit { /** * @see Server#getScoreboardManager() */ + @Deprecated public static ScoreboardManager getScoreboardManager() { return server.getScoreboardManager(); } @@ -684,6 +773,7 @@ public final class Bukkit { /** * @see Server#getServerIcon() */ + @Deprecated public static CachedServerIcon getServerIcon() { return server.getServerIcon(); } @@ -691,6 +781,7 @@ public final class Bukkit { /** * @see Server#loadServerIcon(File) */ + @Deprecated public static CachedServerIcon loadServerIcon(File file) throws Exception { return server.loadServerIcon(file); } @@ -698,6 +789,7 @@ public final class Bukkit { /** * @see Server#loadServerIcon(BufferedImage) */ + @Deprecated public static CachedServerIcon loadServerIcon(BufferedImage image) throws Exception { return server.loadServerIcon(image); } @@ -705,6 +797,7 @@ public final class Bukkit { /** * @see Server#setIdleTimeout(int) */ + @Deprecated public static void setIdleTimeout(int threshold) { server.setIdleTimeout(threshold); } @@ -712,6 +805,7 @@ public final class Bukkit { /** * @see Server#getIdleTimeout() */ + @Deprecated public static int getIdleTimeout() { return server.getIdleTimeout(); } diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java index 0bbc9fa..0702c5f 100644 --- a/src/main/java/org/bukkit/ChatColor.java +++ b/src/main/java/org/bukkit/ChatColor.java @@ -10,6 +10,7 @@ import com.google.common.collect.Maps; /** * All supported color values for chat */ +@Deprecated public enum ChatColor { /** * Represents black @@ -104,20 +105,30 @@ public enum ChatColor { * The special character which prefixes all chat colour codes. Use this if * you need to dynamically convert colour codes from your custom format. */ + @Deprecated public static final char COLOR_CHAR = '\u00A7'; + @Deprecated private static final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + String.valueOf(COLOR_CHAR) + "[0-9A-FK-OR]"); + @Deprecated private final int intCode; + @Deprecated private final char code; + @Deprecated private final boolean isFormat; + @Deprecated private final String toString; + @Deprecated private final static Map BY_ID = Maps.newHashMap(); + @Deprecated private final static Map BY_CHAR = Maps.newHashMap(); + @Deprecated private ChatColor(char code, int intCode) { this(code, intCode, false); } + @Deprecated private ChatColor(char code, int intCode, boolean isFormat) { this.code = code; this.intCode = intCode; @@ -130,11 +141,13 @@ public enum ChatColor { * * @return A char value of this color code */ + @Deprecated public char getChar() { return code; } @Override + @Deprecated public String toString() { return toString; } @@ -142,6 +155,7 @@ public enum ChatColor { /** * Checks if this code is a format code as opposed to a color code. */ + @Deprecated public boolean isFormat() { return isFormat; } @@ -149,6 +163,7 @@ public enum ChatColor { /** * Checks if this code is a color code as opposed to a format code. */ + @Deprecated public boolean isColor() { return !isFormat && this != RESET; } @@ -160,6 +175,7 @@ public enum ChatColor { * @return Associative {@link org.bukkit.ChatColor} with the given code, * or null if it doesn't exist */ + @Deprecated public static ChatColor getByChar(char code) { return BY_CHAR.get(code); } @@ -171,6 +187,7 @@ public enum ChatColor { * @return Associative {@link org.bukkit.ChatColor} with the given code, * or null if it doesn't exist */ + @Deprecated public static ChatColor getByChar(String code) { Validate.notNull(code, "Code cannot be null"); Validate.isTrue(code.length() > 0, "Code must have at least one char"); @@ -184,6 +201,7 @@ public enum ChatColor { * @param input String to strip of color * @return A copy of the input string, without any coloring */ + @Deprecated public static String stripColor(final String input) { if (input == null) { return null; @@ -202,6 +220,7 @@ public enum ChatColor { * @param textToTranslate Text containing the alternate color code character. * @return Text containing the ChatColor.COLOR_CODE color code character. */ + @Deprecated public static String translateAlternateColorCodes(char altColorChar, String textToTranslate) { char[] b = textToTranslate.toCharArray(); for (int i = 0; i < b.length - 1; i++) { @@ -219,6 +238,7 @@ public enum ChatColor { * @param input Input string to retrieve the colors from. * @return Any remaining ChatColors to pass onto the next line. */ + @Deprecated public static String getLastColors(String input) { String result = ""; int length = input.length(); diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java index 0510151..42729b3 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java @@ -7,6 +7,7 @@ import org.bukkit.entity.Entity; /** * Represents a chunk of blocks */ +@Deprecated public interface Chunk { /** diff --git a/src/main/java/org/bukkit/ChunkSnapshot.java b/src/main/java/org/bukkit/ChunkSnapshot.java index 83fccc8..cbcf0bf 100644 --- a/src/main/java/org/bukkit/ChunkSnapshot.java +++ b/src/main/java/org/bukkit/ChunkSnapshot.java @@ -8,6 +8,7 @@ import org.bukkit.block.Biome; * 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) */ +@Deprecated public interface ChunkSnapshot { /** diff --git a/src/main/java/org/bukkit/CoalType.java b/src/main/java/org/bukkit/CoalType.java index 4fcccd2..b1b33e3 100644 --- a/src/main/java/org/bukkit/CoalType.java +++ b/src/main/java/org/bukkit/CoalType.java @@ -7,13 +7,17 @@ import com.google.common.collect.Maps; /** * Represents the two types of coal */ +@Deprecated public enum CoalType { COAL(0x0), CHARCOAL(0x1); + @Deprecated private final byte data; + @Deprecated private final static Map BY_DATA = Maps.newHashMap(); + @Deprecated private CoalType(final int data) { this.data = (byte) data; } diff --git a/src/main/java/org/bukkit/Color.java b/src/main/java/org/bukkit/Color.java index 76ff651..41b4375 100644 --- a/src/main/java/org/bukkit/Color.java +++ b/src/main/java/org/bukkit/Color.java @@ -14,96 +14,118 @@ import com.google.common.collect.ImmutableMap; * but subject to change. */ @SerializableAs("Color") +@Deprecated public final class Color implements ConfigurationSerializable { + @Deprecated private static final int BIT_MASK = 0xff; /** * White, or (0xFF,0xFF,0xFF) in (R,G,B) */ + @Deprecated public static final Color WHITE = fromRGB(0xFFFFFF); /** * Silver, or (0xC0,0xC0,0xC0) in (R,G,B) */ + @Deprecated public static final Color SILVER = fromRGB(0xC0C0C0); /** * Gray, or (0x80,0x80,0x80) in (R,G,B) */ + @Deprecated public static final Color GRAY = fromRGB(0x808080); /** * Black, or (0x00,0x00,0x00) in (R,G,B) */ + @Deprecated public static final Color BLACK = fromRGB(0x000000); /** * Red, or (0xFF,0x00,0x00) in (R,G,B) */ + @Deprecated public static final Color RED = fromRGB(0xFF0000); /** * Maroon, or (0x80,0x00,0x00) in (R,G,B) */ + @Deprecated public static final Color MAROON = fromRGB(0x800000); /** * Yellow, or (0xFF,0xFF,0x00) in (R,G,B) */ + @Deprecated public static final Color YELLOW = fromRGB(0xFFFF00); /** * Olive, or (0x80,0x80,0x00) in (R,G,B) */ + @Deprecated public static final Color OLIVE = fromRGB(0x808000); /** * Lime, or (0x00,0xFF,0x00) in (R,G,B) */ + @Deprecated public static final Color LIME = fromRGB(0x00FF00); /** * Green, or (0x00,0x80,0x00) in (R,G,B) */ + @Deprecated public static final Color GREEN = fromRGB(0x008000); /** * Aqua, or (0x00,0xFF,0xFF) in (R,G,B) */ + @Deprecated public static final Color AQUA = fromRGB(0x00FFFF); /** * Teal, or (0x00,0x80,0x80) in (R,G,B) */ + @Deprecated public static final Color TEAL = fromRGB(0x008080); /** * Blue, or (0x00,0x00,0xFF) in (R,G,B) */ + @Deprecated public static final Color BLUE = fromRGB(0x0000FF); /** * Navy, or (0x00,0x00,0x80) in (R,G,B) */ + @Deprecated public static final Color NAVY = fromRGB(0x000080); /** * Fuchsia, or (0xFF,0x00,0xFF) in (R,G,B) */ + @Deprecated public static final Color FUCHSIA = fromRGB(0xFF00FF); /** * Purple, or (0x80,0x00,0x80) in (R,G,B) */ + @Deprecated public static final Color PURPLE = fromRGB(0x800080); /** * Orange, or (0xFF,0xA5,0x00) in (R,G,B) */ + @Deprecated public static final Color ORANGE = fromRGB(0xFFA500); + @Deprecated private final byte red; + @Deprecated private final byte green; + @Deprecated private final byte blue; /** @@ -115,6 +137,7 @@ public final class Color implements ConfigurationSerializable { * @return a new Color object for the red, green, blue * @throws IllegalArgumentException if any value is strictly >255 or <0 */ + @Deprecated public static Color fromRGB(int red, int green, int blue) throws IllegalArgumentException { return new Color(red, green, blue); } @@ -128,6 +151,7 @@ public final class Color implements ConfigurationSerializable { * @return a new Color object for the red, green, blue * @throws IllegalArgumentException if any value is strictly >255 or <0 */ + @Deprecated public static Color fromBGR(int blue, int green, int red) throws IllegalArgumentException { return new Color(red, green, blue); } @@ -141,6 +165,7 @@ public final class Color implements ConfigurationSerializable { * @throws IllegalArgumentException if any data is in the highest order 8 * bits */ + @Deprecated public static Color fromRGB(int rgb) throws IllegalArgumentException { Validate.isTrue((rgb >> 24) == 0, "Extrenuous data in: ", rgb); return fromRGB(rgb >> 16 & BIT_MASK, rgb >> 8 & BIT_MASK, rgb >> 0 & BIT_MASK); @@ -155,11 +180,13 @@ public final class Color implements ConfigurationSerializable { * @throws IllegalArgumentException if any data is in the highest order 8 * bits */ + @Deprecated public static Color fromBGR(int bgr) throws IllegalArgumentException { Validate.isTrue((bgr >> 24) == 0, "Extrenuous data in: ", bgr); return fromBGR(bgr >> 16 & BIT_MASK, bgr >> 8 & BIT_MASK, bgr >> 0 & BIT_MASK); } + @Deprecated private Color(int red, int green, int blue) { Validate.isTrue(red >= 0 && red <= BIT_MASK, "Red is not between 0-255: ", red); Validate.isTrue(green >= 0 && green <= BIT_MASK, "Green is not between 0-255: ", green); @@ -175,6 +202,7 @@ public final class Color implements ConfigurationSerializable { * * @return red component, from 0 to 255 */ + @Deprecated public int getRed() { return BIT_MASK & red; } @@ -185,6 +213,7 @@ public final class Color implements ConfigurationSerializable { * @param red the red component, from 0 to 255 * @return a new color object with the red component */ + @Deprecated public Color setRed(int red) { return fromRGB(red, getGreen(), getBlue()); } @@ -194,6 +223,7 @@ public final class Color implements ConfigurationSerializable { * * @return green component, from 0 to 255 */ + @Deprecated public int getGreen() { return BIT_MASK & green; } @@ -204,6 +234,7 @@ public final class Color implements ConfigurationSerializable { * @param green the red component, from 0 to 255 * @return a new color object with the red component */ + @Deprecated public Color setGreen(int green) { return fromRGB(getRed(), green, getBlue()); } @@ -213,6 +244,7 @@ public final class Color implements ConfigurationSerializable { * * @return blue component, from 0 to 255 */ + @Deprecated public int getBlue() { return BIT_MASK & blue; } @@ -223,6 +255,7 @@ public final class Color implements ConfigurationSerializable { * @param blue the red component, from 0 to 255 * @return a new color object with the red component */ + @Deprecated public Color setBlue(int blue) { return fromRGB(getRed(), getGreen(), blue); } @@ -231,6 +264,7 @@ public final class Color implements ConfigurationSerializable { * * @return An integer representation of this color, as 0xRRGGBB */ + @Deprecated public int asRGB() { return getRed() << 16 | getGreen() << 8 | getBlue() << 0; } @@ -239,6 +273,7 @@ public final class Color implements ConfigurationSerializable { * * @return An integer representation of this color, as 0xBBGGRR */ + @Deprecated public int asBGR() { return getBlue() << 16 | getGreen() << 8 | getRed() << 0; } @@ -251,6 +286,7 @@ public final class Color implements ConfigurationSerializable { * @return A new color with the changed rgb components */ // TODO: Javadoc what this method does, not what it mimics. API != Implementation + @Deprecated public Color mixDyes(DyeColor... colors) { Validate.noNullElements(colors, "Colors cannot be null"); @@ -270,6 +306,7 @@ public final class Color implements ConfigurationSerializable { * @return A new color with the changed rgb components */ // TODO: Javadoc what this method does, not what it mimics. API != Implementation + @Deprecated public Color mixColors(Color... colors) { Validate.noNullElements(colors, "Colors cannot be null"); @@ -296,6 +333,7 @@ public final class Color implements ConfigurationSerializable { } @Override + @Deprecated public boolean equals(Object o) { if (!(o instanceof Color)) { return false; @@ -305,10 +343,12 @@ public final class Color implements ConfigurationSerializable { } @Override + @Deprecated public int hashCode() { return asRGB() ^ Color.class.hashCode(); } + @Deprecated public Map serialize() { return ImmutableMap.of( "RED", getRed(), @@ -318,6 +358,7 @@ public final class Color implements ConfigurationSerializable { } @SuppressWarnings("javadoc") + @Deprecated public static Color deserialize(Map map) { return fromRGB( asInt("RED", map), @@ -326,6 +367,7 @@ public final class Color implements ConfigurationSerializable { ); } + @Deprecated private static int asInt(String string, Map map) { Object value = map.get(string); if (value == null) { @@ -338,6 +380,7 @@ public final class Color implements ConfigurationSerializable { } @Override + @Deprecated public String toString() { return "Color:[rgb0x" + Integer.toHexString(getRed()).toUpperCase() + Integer.toHexString(getGreen()).toUpperCase() + Integer.toHexString(getBlue()).toUpperCase() + "]"; } diff --git a/src/main/java/org/bukkit/CropState.java b/src/main/java/org/bukkit/CropState.java index ef0faf9..7fcc327 100644 --- a/src/main/java/org/bukkit/CropState.java +++ b/src/main/java/org/bukkit/CropState.java @@ -7,6 +7,7 @@ import com.google.common.collect.Maps; /** * Represents the different growth states of crops */ +@Deprecated public enum CropState { /** @@ -42,9 +43,12 @@ public enum CropState { */ RIPE(0x7); + @Deprecated private final byte data; + @Deprecated private final static Map BY_DATA = Maps.newHashMap(); + @Deprecated private CropState(final int data) { this.data = (byte) data; } diff --git a/src/main/java/org/bukkit/Difficulty.java b/src/main/java/org/bukkit/Difficulty.java index a8a5a78..12fdaaf 100644 --- a/src/main/java/org/bukkit/Difficulty.java +++ b/src/main/java/org/bukkit/Difficulty.java @@ -7,6 +7,7 @@ import com.google.common.collect.Maps; /** * Represents the various difficulty levels that are available. */ +@Deprecated public enum Difficulty { /** * Players regain health over time, hostile mobs don't spawn, the hunger @@ -33,9 +34,12 @@ public enum Difficulty { */ HARD(3); + @Deprecated private final int value; + @Deprecated private final static Map BY_ID = Maps.newHashMap(); + @Deprecated private Difficulty(final int value) { this.value = value; } diff --git a/src/main/java/org/bukkit/DyeColor.java b/src/main/java/org/bukkit/DyeColor.java index 214806e..4e57cee 100644 --- a/src/main/java/org/bukkit/DyeColor.java +++ b/src/main/java/org/bukkit/DyeColor.java @@ -7,6 +7,7 @@ import com.google.common.collect.ImmutableMap; /** * All supported color values for dyes and cloth */ +@Deprecated public enum DyeColor { /** @@ -74,15 +75,24 @@ public enum DyeColor { */ BLACK(0xF, 0x0, Color.fromRGB(0x191919), Color.fromRGB(0x1E1B1B)); + @Deprecated private final byte woolData; + @Deprecated private final byte dyeData; + @Deprecated private final Color color; + @Deprecated private final Color firework; + @Deprecated private final static DyeColor[] BY_WOOL_DATA; + @Deprecated private final static DyeColor[] BY_DYE_DATA; + @Deprecated private final static Map BY_COLOR; + @Deprecated private final static Map BY_FIREWORK; + @Deprecated private DyeColor(final int woolData, final int dyeData, Color color, Color firework) { this.woolData = (byte) woolData; this.dyeData = (byte) dyeData; @@ -133,6 +143,7 @@ public enum DyeColor { * * @return The {@link Color} that this dye represents */ + @Deprecated public Color getColor() { return color; } @@ -142,6 +153,7 @@ public enum DyeColor { * * @return The {@link Color} that this dye represents */ + @Deprecated public Color getFireworkColor() { return firework; } @@ -205,6 +217,7 @@ public enum DyeColor { * @return The {@link DyeColor} representing the given value, or null if * it doesn't exist */ + @Deprecated public static DyeColor getByColor(final Color color) { return BY_COLOR.get(color); } @@ -216,6 +229,7 @@ public enum DyeColor { * @return The {@link DyeColor} representing the given value, or null if * it doesn't exist */ + @Deprecated public static DyeColor getByFireworkColor(final Color color) { return BY_FIREWORK.get(color); } diff --git a/src/main/java/org/bukkit/Effect.java b/src/main/java/org/bukkit/Effect.java index 9964203..37fa448 100644 --- a/src/main/java/org/bukkit/Effect.java +++ b/src/main/java/org/bukkit/Effect.java @@ -11,6 +11,7 @@ import org.bukkit.potion.Potion; /** * A list of effects that the server is able to send to players. */ +@Deprecated public enum Effect { /** * An alternate click sound. @@ -221,17 +222,25 @@ public enum Effect { */ TILE_DUST("blockdust", Type.PARTICLE, MaterialData.class); + @Deprecated private final int id; + @Deprecated private final Type type; + @Deprecated private final Class data; + @Deprecated private static final Map BY_ID = Maps.newHashMap(); + @Deprecated private static final Map BY_NAME = Maps.newHashMap(); + @Deprecated private final String particleName; + @Deprecated private Effect(int id, Type type) { this(id,type,null); } + @Deprecated private Effect(int id, Type type, Class data) { this.id = id; this.type = type; @@ -239,6 +248,7 @@ public enum Effect { particleName = null; } + @Deprecated private Effect(String particleName, Type type, Class data) { this.particleName = particleName; this.type = type; @@ -246,6 +256,7 @@ public enum Effect { this.data = data; } + @Deprecated private Effect(String particleName, Type type) { this.particleName = particleName; this.type = type; @@ -269,6 +280,7 @@ public enum Effect { * * @return The effect's name */ + @Deprecated public String getName() { return particleName; } @@ -276,6 +288,7 @@ public enum Effect { /** * @return The type of the effect. */ + @Deprecated public Type getType() { return this.type; } @@ -283,6 +296,7 @@ public enum Effect { /** * @return if this Effect isn't of type PARTICLE it returns the class which represents data for this effect, or null if none */ + @Deprecated public Class getData() { return this.data; } @@ -313,6 +327,7 @@ public enum Effect { * @param name name of the Effect to return * @return Effect with the given name */ + @Deprecated public static Effect getByName(String name) { return BY_NAME.get(name); } @@ -328,5 +343,6 @@ public enum Effect { /** * Represents the type of an effect. */ + @Deprecated public enum Type {SOUND, VISUAL, PARTICLE} } diff --git a/src/main/java/org/bukkit/EntityEffect.java b/src/main/java/org/bukkit/EntityEffect.java index f2481ba..4ec5c85 100644 --- a/src/main/java/org/bukkit/EntityEffect.java +++ b/src/main/java/org/bukkit/EntityEffect.java @@ -7,6 +7,7 @@ import com.google.common.collect.Maps; /** * A list of all Effects that can happen to entities. */ +@Deprecated public enum EntityEffect { /** @@ -47,7 +48,9 @@ public enum EntityEffect { */ SHEEP_EAT(10); + @Deprecated private final byte data; + @Deprecated private final static Map BY_DATA = Maps.newHashMap(); EntityEffect(final int data) { diff --git a/src/main/java/org/bukkit/FireworkEffect.java b/src/main/java/org/bukkit/FireworkEffect.java index 6f2d096..b61d198 100644 --- a/src/main/java/org/bukkit/FireworkEffect.java +++ b/src/main/java/org/bukkit/FireworkEffect.java @@ -14,11 +14,13 @@ import com.google.common.collect.ImmutableMap; * Represents a single firework effect. */ @SerializableAs("Firework") +@Deprecated public final class FireworkEffect implements ConfigurationSerializable { /** * The type or shape of the effect. */ + @Deprecated public enum Type { /** * A small ball effect. @@ -48,6 +50,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * * @return A utility object for building a firework effect */ + @Deprecated public static Builder builder() { return new Builder(); } @@ -57,6 +60,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * * @see FireworkEffect#builder() */ + @Deprecated public static final class Builder { boolean flicker = false; boolean trail = false; @@ -73,6 +77,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * @return This object, for chaining * @throws IllegalArgumentException If type is null */ + @Deprecated public Builder with(Type type) throws IllegalArgumentException { Validate.notNull(type, "Cannot have null type"); this.type = type; @@ -84,6 +89,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * * @return This object, for chaining */ + @Deprecated public Builder withFlicker() { flicker = true; return this; @@ -95,6 +101,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * @param flicker true if it should flicker, false if not * @return This object, for chaining */ + @Deprecated public Builder flicker(boolean flicker) { this.flicker = flicker; return this; @@ -105,6 +112,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * * @return This object, for chaining */ + @Deprecated public Builder withTrail() { trail = true; return this; @@ -116,6 +124,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * @param trail true if it should have a trail, false for no trail * @return This object, for chaining */ + @Deprecated public Builder trail(boolean trail) { this.trail = trail; return this; @@ -128,6 +137,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * @return This object, for chaining * @throws IllegalArgumentException If color is null */ + @Deprecated public Builder withColor(Color color) throws IllegalArgumentException { Validate.notNull(color, "Cannot have null color"); @@ -145,6 +155,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * @throws IllegalArgumentException If any color is null (may be * thrown after changes have occurred) */ + @Deprecated public Builder withColor(Color...colors) throws IllegalArgumentException { Validate.notNull(colors, "Cannot have null colors"); if (colors.length == 0) { @@ -170,6 +181,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * @throws IllegalArgumentException If any color is null (may be * thrown after changes have occurred) */ + @Deprecated public Builder withColor(Iterable colors) throws IllegalArgumentException { Validate.notNull(colors, "Cannot have null colors"); @@ -193,6 +205,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * @throws IllegalArgumentException If any color is null (may be * thrown after changes have occurred) */ + @Deprecated public Builder withFade(Color color) throws IllegalArgumentException { Validate.notNull(color, "Cannot have null color"); @@ -214,6 +227,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * @throws IllegalArgumentException If any color is null (may be * thrown after changes have occurred) */ + @Deprecated public Builder withFade(Color...colors) throws IllegalArgumentException { Validate.notNull(colors, "Cannot have null colors"); if (colors.length == 0) { @@ -243,6 +257,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * @throws IllegalArgumentException If any color is null (may be * thrown after changes have occurred) */ + @Deprecated public Builder withFade(Iterable colors) throws IllegalArgumentException { Validate.notNull(colors, "Cannot have null colors"); @@ -269,6 +284,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * * @return The representative firework effect */ + @Deprecated public FireworkEffect build() { return new FireworkEffect( flicker, @@ -280,17 +296,28 @@ public final class FireworkEffect implements ConfigurationSerializable { } } + @Deprecated private static final String FLICKER = "flicker"; + @Deprecated private static final String TRAIL = "trail"; + @Deprecated private static final String COLORS = "colors"; + @Deprecated private static final String FADE_COLORS = "fade-colors"; + @Deprecated private static final String TYPE = "type"; + @Deprecated private final boolean flicker; + @Deprecated private final boolean trail; + @Deprecated private final ImmutableList colors; + @Deprecated private final ImmutableList fadeColors; + @Deprecated private final Type type; + @Deprecated private String string = null; FireworkEffect(boolean flicker, boolean trail, ImmutableList colors, ImmutableList fadeColors, Type type) { @@ -309,6 +336,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * * @return true if it flickers, false if not */ + @Deprecated public boolean hasFlicker() { return flicker; } @@ -318,6 +346,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * * @return true if it has a trail, false if not */ + @Deprecated public boolean hasTrail() { return trail; } @@ -327,6 +356,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * * @return An immutable list of the primary colors */ + @Deprecated public List getColors() { return colors; } @@ -336,6 +366,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * * @return An immutable list of the fade colors */ + @Deprecated public List getFadeColors() { return fadeColors; } @@ -345,6 +376,7 @@ public final class FireworkEffect implements ConfigurationSerializable { * * @return The effect type */ + @Deprecated public Type getType() { return type; } @@ -352,6 +384,7 @@ public final class FireworkEffect implements ConfigurationSerializable { /** * @see ConfigurationSerializable */ + @Deprecated public static ConfigurationSerializable deserialize(Map map) { Type type = Type.valueOf((String) map.get(TYPE)); if (type == null) { @@ -367,6 +400,7 @@ public final class FireworkEffect implements ConfigurationSerializable { .build(); } + @Deprecated public Map serialize() { return ImmutableMap.of( FLICKER, flicker, @@ -378,6 +412,7 @@ public final class FireworkEffect implements ConfigurationSerializable { } @Override + @Deprecated public String toString() { final String string = this.string; if (string == null) { @@ -387,6 +422,7 @@ public final class FireworkEffect implements ConfigurationSerializable { } @Override + @Deprecated public int hashCode() { /** * TRUE and FALSE as per boolean.hashCode() @@ -402,6 +438,7 @@ public final class FireworkEffect implements ConfigurationSerializable { } @Override + @Deprecated public boolean equals(Object obj) { if (this == obj) { return true; diff --git a/src/main/java/org/bukkit/GameMode.java b/src/main/java/org/bukkit/GameMode.java index 47b2d90..2079012 100644 --- a/src/main/java/org/bukkit/GameMode.java +++ b/src/main/java/org/bukkit/GameMode.java @@ -10,6 +10,7 @@ import com.google.common.collect.Maps; * Represents the various type of game modes that {@link HumanEntity}s may * have */ +@Deprecated public enum GameMode { /** * Creative mode may fly, build instantly, become invulnerable and create @@ -27,9 +28,12 @@ public enum GameMode { */ ADVENTURE(2); + @Deprecated private final int value; + @Deprecated private final static Map BY_ID = Maps.newHashMap(); + @Deprecated private GameMode(final int value) { this.value = value; } diff --git a/src/main/java/org/bukkit/GrassSpecies.java b/src/main/java/org/bukkit/GrassSpecies.java index 1111515..299e7ac 100644 --- a/src/main/java/org/bukkit/GrassSpecies.java +++ b/src/main/java/org/bukkit/GrassSpecies.java @@ -7,6 +7,7 @@ import com.google.common.collect.Maps; /** * Represents the different types of grass. */ +@Deprecated public enum GrassSpecies { /** @@ -22,9 +23,12 @@ public enum GrassSpecies { */ FERN_LIKE(0x2); + @Deprecated private final byte data; + @Deprecated private final static Map BY_DATA = Maps.newHashMap(); + @Deprecated private GrassSpecies(final int data) { this.data = (byte) data; } diff --git a/src/main/java/org/bukkit/Instrument.java b/src/main/java/org/bukkit/Instrument.java index 891a2b1..fc58b84 100644 --- a/src/main/java/org/bukkit/Instrument.java +++ b/src/main/java/org/bukkit/Instrument.java @@ -4,6 +4,7 @@ import java.util.Map; import com.google.common.collect.Maps; +@Deprecated public enum Instrument { /** @@ -31,9 +32,12 @@ public enum Instrument { */ BASS_GUITAR(0x4); + @Deprecated private final byte type; + @Deprecated private final static Map BY_DATA = Maps.newHashMap(); + @Deprecated private Instrument(final int type) { this.type = (byte) type; } diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java index 9e1e604..8075998 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -7,12 +7,19 @@ import org.bukkit.util.Vector; /** * Represents a 3-dimensional position in a world */ +@Deprecated public class Location implements Cloneable { + @Deprecated private World world; + @Deprecated private double x; + @Deprecated private double y; + @Deprecated private double z; + @Deprecated private float pitch; + @Deprecated private float yaw; /** @@ -23,6 +30,7 @@ public class Location implements Cloneable { * @param y The y-coordinate of this new location * @param z The z-coordinate of this new location */ + @Deprecated public Location(final World world, final double x, final double y, final double z) { this(world, x, y, z, 0, 0); } @@ -37,6 +45,7 @@ public class Location implements Cloneable { * @param yaw The absolute rotation on the x-plane, in degrees * @param pitch The absolute rotation on the y-plane, in degrees */ + @Deprecated public Location(final World world, final double x, final double y, final double z, final float yaw, final float pitch) { this.world = world; this.x = x; @@ -51,6 +60,7 @@ public class Location implements Cloneable { * * @param world New world that this location resides in */ + @Deprecated public void setWorld(World world) { this.world = world; } @@ -60,6 +70,7 @@ public class Location implements Cloneable { * * @return World that contains this location */ + @Deprecated public World getWorld() { return world; } @@ -69,6 +80,7 @@ public class Location implements Cloneable { * * @return Chunk at the represented location */ + @Deprecated public Chunk getChunk() { return world.getChunkAt(this); } @@ -78,6 +90,7 @@ public class Location implements Cloneable { * * @return Block at the represented location */ + @Deprecated public Block getBlock() { return world.getBlockAt(this); } @@ -87,6 +100,7 @@ public class Location implements Cloneable { * * @param x X-coordinate */ + @Deprecated public void setX(double x) { this.x = x; } @@ -96,6 +110,7 @@ public class Location implements Cloneable { * * @return x-coordinate */ + @Deprecated public double getX() { return x; } @@ -106,6 +121,7 @@ public class Location implements Cloneable { * * @return block X */ + @Deprecated public int getBlockX() { return locToBlock(x); } @@ -115,6 +131,7 @@ public class Location implements Cloneable { * * @param y y-coordinate */ + @Deprecated public void setY(double y) { this.y = y; } @@ -124,6 +141,7 @@ public class Location implements Cloneable { * * @return y-coordinate */ + @Deprecated public double getY() { return y; } @@ -134,6 +152,7 @@ public class Location implements Cloneable { * * @return block y */ + @Deprecated public int getBlockY() { return locToBlock(y); } @@ -143,6 +162,7 @@ public class Location implements Cloneable { * * @param z z-coordinate */ + @Deprecated public void setZ(double z) { this.z = z; } @@ -152,6 +172,7 @@ public class Location implements Cloneable { * * @return z-coordinate */ + @Deprecated public double getZ() { return z; } @@ -162,6 +183,7 @@ public class Location implements Cloneable { * * @return block z */ + @Deprecated public int getBlockZ() { return locToBlock(z); } @@ -180,6 +202,7 @@ public class Location implements Cloneable { * * @param yaw new rotation's yaw */ + @Deprecated public void setYaw(float yaw) { this.yaw = yaw; } @@ -198,6 +221,7 @@ public class Location implements Cloneable { * * @return the rotation's yaw */ + @Deprecated public float getYaw() { return yaw; } @@ -214,6 +238,7 @@ public class Location implements Cloneable { * * @param pitch new incline's pitch */ + @Deprecated public void setPitch(float pitch) { this.pitch = pitch; } @@ -230,6 +255,7 @@ public class Location implements Cloneable { * * @return the incline's pitch */ + @Deprecated public float getPitch() { return pitch; } @@ -241,6 +267,7 @@ public class Location implements Cloneable { * @return a vector pointing the direction of this location's {@link * #getPitch() pitch} and {@link #getYaw() yaw} */ + @Deprecated public Vector getDirection() { Vector vector = new Vector(); @@ -261,6 +288,7 @@ public class Location implements Cloneable { * Sets the {@link #getYaw() yaw} and {@link #getPitch() pitch} to point * in the direction of the vector. */ + @Deprecated public Location setDirection(Vector vector) { /* * Sin = Opp / Hyp @@ -298,6 +326,7 @@ public class Location implements Cloneable { * @return the same location * @throws IllegalArgumentException for differing worlds */ + @Deprecated public Location add(Location vec) { if (vec == null || vec.getWorld() != getWorld()) { throw new IllegalArgumentException("Cannot add Locations of differing worlds"); @@ -316,6 +345,7 @@ public class Location implements Cloneable { * @param vec Vector to use * @return the same location */ + @Deprecated public Location add(Vector vec) { this.x += vec.getX(); this.y += vec.getY(); @@ -332,6 +362,7 @@ public class Location implements Cloneable { * @param z Z coordinate * @return the same location */ + @Deprecated public Location add(double x, double y, double z) { this.x += x; this.y += y; @@ -347,6 +378,7 @@ public class Location implements Cloneable { * @return the same location * @throws IllegalArgumentException for differing worlds */ + @Deprecated public Location subtract(Location vec) { if (vec == null || vec.getWorld() != getWorld()) { throw new IllegalArgumentException("Cannot add Locations of differing worlds"); @@ -365,6 +397,7 @@ public class Location implements Cloneable { * @param vec The vector to use * @return the same location */ + @Deprecated public Location subtract(Vector vec) { this.x -= vec.getX(); this.y -= vec.getY(); @@ -382,6 +415,7 @@ public class Location implements Cloneable { * @param z Z coordinate * @return the same location */ + @Deprecated public Location subtract(double x, double y, double z) { this.x -= x; this.y -= y; @@ -400,6 +434,7 @@ public class Location implements Cloneable { * @see Vector * @return the magnitude */ + @Deprecated public double length() { return Math.sqrt(NumberConversions.square(x) + NumberConversions.square(y) + NumberConversions.square(z)); } @@ -411,6 +446,7 @@ public class Location implements Cloneable { * @see Vector * @return the magnitude */ + @Deprecated public double lengthSquared() { return NumberConversions.square(x) + NumberConversions.square(y) + NumberConversions.square(z); } @@ -427,6 +463,7 @@ public class Location implements Cloneable { * @return the distance * @throws IllegalArgumentException for differing worlds */ + @Deprecated public double distance(Location o) { return Math.sqrt(distanceSquared(o)); } @@ -439,6 +476,7 @@ public class Location implements Cloneable { * @return the distance * @throws IllegalArgumentException for differing worlds */ + @Deprecated public double distanceSquared(Location o) { if (o == null) { throw new IllegalArgumentException("Cannot measure distance to a null location"); @@ -459,6 +497,7 @@ public class Location implements Cloneable { * @see Vector * @return the same location */ + @Deprecated public Location multiply(double m) { x *= m; y *= m; @@ -472,6 +511,7 @@ public class Location implements Cloneable { * @see Vector * @return the same location */ + @Deprecated public Location zero() { x = 0; y = 0; @@ -480,6 +520,7 @@ public class Location implements Cloneable { } @Override + @Deprecated public boolean equals(Object obj) { if (obj == null) { return false; @@ -511,6 +552,7 @@ public class Location implements Cloneable { } @Override + @Deprecated public int hashCode() { int hash = 3; @@ -524,6 +566,7 @@ public class Location implements Cloneable { } @Override + @Deprecated public String toString() { return "Location{" + "world=" + world + ",x=" + x + ",y=" + y + ",z=" + z + ",pitch=" + pitch + ",yaw=" + yaw + '}'; } @@ -534,11 +577,13 @@ public class Location implements Cloneable { * @return New Vector containing the coordinates represented by this * Location */ + @Deprecated public Vector toVector() { return new Vector(x, y, z); } @Override + @Deprecated public Location clone() { try { return (Location) super.clone(); @@ -554,6 +599,7 @@ public class Location implements Cloneable { * @param loc Precise coordinate * @return Block coordinate */ + @Deprecated public static int locToBlock(double loc) { return NumberConversions.floor(loc); } diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index c45c180..e54c40d 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -61,6 +61,7 @@ import com.google.common.collect.Maps; /** * An enum of all material IDs accepted by the official server and client */ +@Deprecated public enum Material { AIR(0, 0), STONE(1), @@ -415,33 +416,45 @@ public enum Material { RECORD_12(2267, 1), ; + @Deprecated private final int id; + @Deprecated private final Constructor ctor; + @Deprecated private static Material[] byId = new Material[383]; + @Deprecated private final static Map BY_NAME = Maps.newHashMap(); + @Deprecated private final int maxStack; + @Deprecated private final short durability; + @Deprecated private Material(final int id) { this(id, 64); } + @Deprecated private Material(final int id, final int stack) { this(id, stack, MaterialData.class); } + @Deprecated private Material(final int id, final int stack, final int durability) { this(id, stack, durability, MaterialData.class); } + @Deprecated private Material(final int id, final Class data) { this(id, 64, data); } + @Deprecated private Material(final int id, final int stack, final Class data) { this(id, stack, 0, data); } + @Deprecated private Material(final int id, final int stack, final int durability, final Class data) { this.id = id; this.durability = (short) durability; @@ -472,6 +485,7 @@ public enum Material { * * @return Maximum stack size for this material */ + @Deprecated public int getMaxStackSize() { return maxStack; } @@ -481,6 +495,7 @@ public enum Material { * * @return Maximum durability for this material */ + @Deprecated public short getMaxDurability() { return durability; } @@ -490,6 +505,7 @@ public enum Material { * * @return MaterialData associated with this Material */ + @Deprecated public Class getData() { return ctor.getDeclaringClass(); } @@ -525,6 +541,7 @@ public enum Material { * * @return true if this material is a block */ + @Deprecated public boolean isBlock() { return id < 256; } @@ -534,6 +551,7 @@ public enum Material { * * @return true if this Material is edible. */ + @Deprecated public boolean isEdible() { switch (this) { case BREAD: @@ -589,6 +607,7 @@ public enum Material { * @param name Name of the material to get * @return Material if found, or null */ + @Deprecated public static Material getMaterial(final String name) { return BY_NAME.get(name); } @@ -605,6 +624,7 @@ public enum Material { * @param name Name of the material to get * @return Material if found, or null */ + @Deprecated public static Material matchMaterial(final String name) { Validate.notNull(name, "Name cannot be null"); @@ -639,6 +659,7 @@ public enum Material { /** * @return True if this material represents a playable music disk. */ + @Deprecated public boolean isRecord() { return id >= GOLD_RECORD.id && id <= RECORD_12.id; } @@ -649,6 +670,7 @@ public enum Material { * * @return True if this material is a block and solid */ + @Deprecated public boolean isSolid() { if (!isBlock() || id == 0) { return false; @@ -788,6 +810,7 @@ public enum Material { * * @return True if this material is a block and does not block any light */ + @Deprecated public boolean isTransparent() { if (!isBlock()) { return false; @@ -848,6 +871,7 @@ public enum Material { * * @return True if this material is a block and can catch fire */ + @Deprecated public boolean isFlammable() { if (!isBlock()) { return false; @@ -900,6 +924,7 @@ public enum Material { * * @return True if this material is a block and can burn away */ + @Deprecated public boolean isBurnable() { if (!isBlock()) { return false; @@ -939,6 +964,7 @@ public enum Material { * * @return True if this material is a block and completely blocks vision */ + @Deprecated public boolean isOccluding() { if (!isBlock()) { return false; @@ -1018,6 +1044,7 @@ public enum Material { /** * @return True if this material is affected by gravity. */ + @Deprecated public boolean hasGravity() { if (!isBlock()) { return false; diff --git a/src/main/java/org/bukkit/NetherWartsState.java b/src/main/java/org/bukkit/NetherWartsState.java index f43209c..98b8349 100644 --- a/src/main/java/org/bukkit/NetherWartsState.java +++ b/src/main/java/org/bukkit/NetherWartsState.java @@ -1,5 +1,6 @@ package org.bukkit; +@Deprecated public enum NetherWartsState { /** diff --git a/src/main/java/org/bukkit/Note.java b/src/main/java/org/bukkit/Note.java index 417936f..7756750 100644 --- a/src/main/java/org/bukkit/Note.java +++ b/src/main/java/org/bukkit/Note.java @@ -9,11 +9,13 @@ import com.google.common.collect.Maps; /** * A note class to store a specific note. */ +@Deprecated public class Note { /** * An enum holding tones. */ + @Deprecated public enum Tone { G(0x1, true), A(0x3, true), @@ -23,13 +25,18 @@ public class Note { E(0xA, false), F(0xB, true); + @Deprecated private final boolean sharpable; + @Deprecated private final byte id; + @Deprecated private static final Map BY_DATA = Maps.newHashMap(); /** The number of tones including sharped tones. */ + @Deprecated public static final byte TONES_COUNT = 12; + @Deprecated private Tone(int id, boolean sharpable) { this.id = (byte) (id % TONES_COUNT); this.sharpable = sharpable; @@ -67,6 +74,7 @@ public class Note { * * @return if this tone could be sharped. */ + @Deprecated public boolean isSharpable() { return sharpable; } @@ -117,6 +125,7 @@ public class Note { } } + @Deprecated private final byte note; /** @@ -125,6 +134,7 @@ public class Note { * @param note Internal note id. {@link #getId()} always return this * value. The value has to be in the interval [0; 24]. */ + @Deprecated public Note(int note) { Validate.isTrue(note >= 0 && note <= 24, "The note value has to be between 0 and 24."); @@ -139,6 +149,7 @@ public class Note { * to be F#. * @param sharped Set if the tone is sharped (e.g. for F#). */ + @Deprecated public Note(int octave, Tone tone, boolean sharped) { if (sharped && !tone.isSharpable()) { tone = Tone.values()[tone.ordinal() + 1]; @@ -158,6 +169,7 @@ public class Note { * @param tone The tone within the octave. * @return The new note. */ + @Deprecated public static Note flat(int octave, Tone tone) { Validate.isTrue(octave != 2, "Octave cannot be 2 for flats"); tone = tone == Tone.G ? Tone.F : Tone.values()[tone.ordinal() - 1]; @@ -172,6 +184,7 @@ public class Note { * to be F#. * @return The new note. */ + @Deprecated public static Note sharp(int octave, Tone tone) { return new Note(octave, tone, true); } @@ -183,6 +196,7 @@ public class Note { * @param tone The tone within the octave. * @return The new note. */ + @Deprecated public static Note natural(int octave, Tone tone) { Validate.isTrue(octave != 2, "Octave cannot be 2 for naturals"); return new Note(octave, tone, false); @@ -191,6 +205,7 @@ public class Note { /** * @return The note a semitone above this one. */ + @Deprecated public Note sharped() { Validate.isTrue(note < 24, "This note cannot be sharped because it is the highest known note!"); return new Note(note + 1); @@ -199,6 +214,7 @@ public class Note { /** * @return The note a semitone below this one. */ + @Deprecated public Note flattened() { Validate.isTrue(note > 0, "This note cannot be flattened because it is the lowest known note!"); return new Note(note - 1); @@ -220,10 +236,12 @@ public class Note { * * @return the octave of this note. */ + @Deprecated public int getOctave() { return note / Tone.TONES_COUNT; } + @Deprecated private byte getToneByte() { return (byte) (note % Tone.TONES_COUNT); } @@ -233,6 +251,7 @@ public class Note { * * @return the tone of this note. */ + @Deprecated public Tone getTone() { return Tone.getById(getToneByte()); } @@ -242,12 +261,14 @@ public class Note { * * @return if this note is sharped. */ + @Deprecated public boolean isSharped() { byte note = getToneByte(); return Tone.getById(note).isSharped(note); } @Override + @Deprecated public int hashCode() { final int prime = 31; int result = 1; @@ -256,6 +277,7 @@ public class Note { } @Override + @Deprecated public boolean equals(Object obj) { if (this == obj) return true; @@ -270,6 +292,7 @@ public class Note { } @Override + @Deprecated public String toString() { return "Note{" + getTone().toString() + (isSharped() ? "#" : "") + "}"; } diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java index 7da5ab6..bd614e1 100644 --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java @@ -8,6 +8,7 @@ import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.Player; import org.bukkit.permissions.ServerOperator; +@Deprecated public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable { /** @@ -15,6 +16,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return true if they are online */ + @Deprecated public boolean isOnline(); /** @@ -24,6 +26,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * guaranteed to be unique * @return Player name */ + @Deprecated public String getName(); /** @@ -31,6 +34,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return Player UUID */ + @Deprecated public UUID getUniqueId(); /** @@ -38,6 +42,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return true if banned, otherwise false */ + @Deprecated public boolean isBanned(); /** @@ -56,6 +61,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return true if whitelisted */ + @Deprecated public boolean isWhitelisted(); /** @@ -63,6 +69,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @param value true if whitelisted */ + @Deprecated public void setWhitelisted(boolean value); /** @@ -73,6 +80,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return Online player */ + @Deprecated public Player getPlayer(); /** @@ -85,6 +93,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return Date of first log-in for this player, or 0 */ + @Deprecated public long getFirstPlayed(); /** @@ -97,6 +106,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return Date of last log-in for this player, or 0 */ + @Deprecated public long getLastPlayed(); /** @@ -104,6 +114,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return True if the player has played before, otherwise false */ + @Deprecated public boolean hasPlayedBefore(); /** @@ -112,6 +123,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * * @return Bed Spawn Location if bed exists, otherwise null. */ + @Deprecated public Location getBedSpawnLocation(); } diff --git a/src/main/java/org/bukkit/PortalType.java b/src/main/java/org/bukkit/PortalType.java index 427cfbb..7f48a56 100644 --- a/src/main/java/org/bukkit/PortalType.java +++ b/src/main/java/org/bukkit/PortalType.java @@ -3,6 +3,7 @@ package org.bukkit; /** * Represents various types of portals that can be made in a world. */ +@Deprecated public enum PortalType { /** diff --git a/src/main/java/org/bukkit/Rotation.java b/src/main/java/org/bukkit/Rotation.java index dfdb0e5..ecbb7a5 100644 --- a/src/main/java/org/bukkit/Rotation.java +++ b/src/main/java/org/bukkit/Rotation.java @@ -5,6 +5,7 @@ package org.bukkit; *

* It represents how something is viewed, as opposed to cardinal directions. */ +@Deprecated public enum Rotation { /** @@ -25,6 +26,7 @@ public enum Rotation { COUNTER_CLOCKWISE, ; + @Deprecated private static final Rotation [] rotations = values(); /** @@ -32,6 +34,7 @@ public enum Rotation { * * @return the relative rotation */ + @Deprecated public Rotation rotateClockwise() { return rotations[(this.ordinal() + 1) & 0x3]; } @@ -41,6 +44,7 @@ public enum Rotation { * * @return the relative rotation */ + @Deprecated public Rotation rotateCounterClockwise() { return rotations[(this.ordinal() - 1) & 0x3]; } diff --git a/src/main/java/org/bukkit/SandstoneType.java b/src/main/java/org/bukkit/SandstoneType.java index a9ac16e..7ef1e3e 100644 --- a/src/main/java/org/bukkit/SandstoneType.java +++ b/src/main/java/org/bukkit/SandstoneType.java @@ -7,14 +7,18 @@ import com.google.common.collect.Maps; /** * Represents the three different types of Sandstone */ +@Deprecated public enum SandstoneType { CRACKED(0x0), GLYPHED(0x1), SMOOTH(0x2); + @Deprecated private final byte data; + @Deprecated private final static Map BY_DATA = Maps.newHashMap(); + @Deprecated private SandstoneType(final int data) { this.data = (byte) data; } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 72ef028..be8e5f6 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -40,6 +40,7 @@ import org.bukkit.inventory.meta.ItemMeta; /** * Represents a server implementation. */ +@Deprecated public interface Server extends PluginMessageRecipient { /** @@ -48,6 +49,7 @@ public interface Server extends PluginMessageRecipient { *

* For use in {@link #broadcast(java.lang.String, java.lang.String)}. */ + @Deprecated public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin"; /** @@ -56,6 +58,7 @@ public interface Server extends PluginMessageRecipient { *

* For use in {@link #broadcast(java.lang.String, java.lang.String)}. */ + @Deprecated public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user"; /** @@ -63,6 +66,7 @@ public interface Server extends PluginMessageRecipient { * * @return name of this server implementation */ + @Deprecated public String getName(); /** @@ -70,6 +74,7 @@ public interface Server extends PluginMessageRecipient { * * @return version of this server implementation */ + @Deprecated public String getVersion(); /** @@ -77,6 +82,7 @@ public interface Server extends PluginMessageRecipient { * * @return version of Bukkit */ + @Deprecated public String getBukkitVersion(); /** @@ -84,6 +90,7 @@ public interface Server extends PluginMessageRecipient { * * @return an array of Players that are currently online */ + @Deprecated public Player[] getOnlinePlayers(); /** @@ -91,6 +98,7 @@ public interface Server extends PluginMessageRecipient { * * @return the amount of players this server allows */ + @Deprecated public int getMaxPlayers(); /** @@ -98,6 +106,7 @@ public interface Server extends PluginMessageRecipient { * * @return the port number of this server */ + @Deprecated public int getPort(); /** @@ -105,6 +114,7 @@ public interface Server extends PluginMessageRecipient { * * @return the view distance from this server. */ + @Deprecated public int getViewDistance(); /** @@ -114,6 +124,7 @@ public interface Server extends PluginMessageRecipient { * @return the IP string that this server is bound to, otherwise empty * string */ + @Deprecated public String getIp(); /** @@ -121,6 +132,7 @@ public interface Server extends PluginMessageRecipient { * * @return the name of this server */ + @Deprecated public String getServerName(); /** @@ -129,6 +141,7 @@ public interface Server extends PluginMessageRecipient { * * @return the ID of this server */ + @Deprecated public String getServerId(); /** @@ -136,6 +149,7 @@ public interface Server extends PluginMessageRecipient { * * @return the value of level-type (e.g. DEFAULT, FLAT, DEFAULT_1_1) */ + @Deprecated public String getWorldType(); /** @@ -143,6 +157,7 @@ public interface Server extends PluginMessageRecipient { * * @return true if structure generation is enabled, false otherwise */ + @Deprecated public boolean getGenerateStructures(); /** @@ -150,6 +165,7 @@ public interface Server extends PluginMessageRecipient { * * @return whether this server allows the End or not */ + @Deprecated public boolean getAllowEnd(); /** @@ -157,6 +173,7 @@ public interface Server extends PluginMessageRecipient { * * @return whether this server allows the Nether or not */ + @Deprecated public boolean getAllowNether(); /** @@ -164,6 +181,7 @@ public interface Server extends PluginMessageRecipient { * * @return whether this server has a whitelist or not */ + @Deprecated public boolean hasWhitelist(); /** @@ -171,6 +189,7 @@ public interface Server extends PluginMessageRecipient { * * @param value true for whitelist on, false for off */ + @Deprecated public void setWhitelist(boolean value); /** @@ -178,11 +197,13 @@ public interface Server extends PluginMessageRecipient { * * @return a set containing all whitelisted players */ + @Deprecated public Set getWhitelistedPlayers(); /** * Reloads the whitelist from disk. */ + @Deprecated public void reloadWhitelist(); /** @@ -194,6 +215,7 @@ public interface Server extends PluginMessageRecipient { * @param message the message * @return the number of players */ + @Deprecated public int broadcastMessage(String message); /** @@ -204,6 +226,7 @@ public interface Server extends PluginMessageRecipient { * * @return the name of the update folder */ + @Deprecated public String getUpdateFolder(); /** @@ -212,6 +235,7 @@ public interface Server extends PluginMessageRecipient { * * @return the update folder */ + @Deprecated public File getUpdateFolderFile(); /** @@ -219,6 +243,7 @@ public interface Server extends PluginMessageRecipient { * * @return the value of the connection throttle setting */ + @Deprecated public long getConnectionThrottle(); /** @@ -240,6 +265,7 @@ public interface Server extends PluginMessageRecipient { * * @return the default ticks per animal spawns value */ + @Deprecated public int getTicksPerAnimalSpawns(); /** @@ -261,6 +287,7 @@ public interface Server extends PluginMessageRecipient { * * @return the default ticks per monsters spawn value */ + @Deprecated public int getTicksPerMonsterSpawns(); /** @@ -273,6 +300,7 @@ public interface Server extends PluginMessageRecipient { * @param name the name to look up * @return a player if one was found, null otherwise */ + @Deprecated public Player getPlayer(String name); /** @@ -283,6 +311,7 @@ public interface Server extends PluginMessageRecipient { * @param name Exact name of the player to retrieve * @return a player object if one was found, null otherwise */ + @Deprecated public Player getPlayerExact(String name); /** @@ -297,6 +326,7 @@ public interface Server extends PluginMessageRecipient { * @param name the (partial) name to match * @return list of all possible players */ + @Deprecated public List matchPlayer(String name); /** @@ -305,6 +335,7 @@ public interface Server extends PluginMessageRecipient { * @param id UUID of the player to retrieve * @return a player object if one was found, null otherwise */ + @Deprecated public Player getPlayer(UUID id); /** @@ -312,6 +343,7 @@ public interface Server extends PluginMessageRecipient { * * @return a plugin manager for this Server instance */ + @Deprecated public PluginManager getPluginManager(); /** @@ -319,6 +351,7 @@ public interface Server extends PluginMessageRecipient { * * @return a scheduling service for this server */ + @Deprecated public BukkitScheduler getScheduler(); /** @@ -326,6 +359,7 @@ public interface Server extends PluginMessageRecipient { * * @return s services manager */ + @Deprecated public ServicesManager getServicesManager(); /** @@ -333,6 +367,7 @@ public interface Server extends PluginMessageRecipient { * * @return a list of worlds */ + @Deprecated public List getWorlds(); /** @@ -345,6 +380,7 @@ public interface Server extends PluginMessageRecipient { * @param creator the options to use when creating the world * @return newly created or loaded world */ + @Deprecated public World createWorld(WorldCreator creator); /** @@ -354,6 +390,7 @@ public interface Server extends PluginMessageRecipient { * @param save whether to save the chunks before unloading * @return true if successful, false otherwise */ + @Deprecated public boolean unloadWorld(String name, boolean save); /** @@ -363,6 +400,7 @@ public interface Server extends PluginMessageRecipient { * @param save whether to save the chunks before unloading * @return true if successful, false otherwise */ + @Deprecated public boolean unloadWorld(World world, boolean save); /** @@ -371,6 +409,7 @@ public interface Server extends PluginMessageRecipient { * @param name the name of the world to retrieve * @return a world with the given name, or null if none exists */ + @Deprecated public World getWorld(String name); /** @@ -379,6 +418,7 @@ public interface Server extends PluginMessageRecipient { * @param uid a unique-id of the world to retrieve * @return a world with the given Unique ID, or null if none exists */ + @Deprecated public World getWorld(UUID uid); /** @@ -397,11 +437,13 @@ public interface Server extends PluginMessageRecipient { * @param world the world the map will belong to * @return a newly created map view */ + @Deprecated public MapView createMap(World world); /** * Reloads the server, refreshing settings and plugin information. */ + @Deprecated public void reload(); /** @@ -409,6 +451,7 @@ public interface Server extends PluginMessageRecipient { * * @return Logger associated with this server */ + @Deprecated public Logger getLogger(); /** @@ -417,11 +460,13 @@ public interface Server extends PluginMessageRecipient { * @param name the name of the command to retrieve * @return a plugin command if found, null otherwise */ + @Deprecated public PluginCommand getPluginCommand(String name); /** * Writes loaded players to disk. */ + @Deprecated public void savePlayers(); /** @@ -434,6 +479,7 @@ public interface Server extends PluginMessageRecipient { * @throws CommandException thrown when the executor for the given command * fails with an unhandled exception */ + @Deprecated public boolean dispatchCommand(CommandSender sender, String commandLine) throws CommandException; /** @@ -442,6 +488,7 @@ public interface Server extends PluginMessageRecipient { * * @param config the server config to populate */ + @Deprecated public void configureDbConfig(ServerConfig config); /** @@ -451,6 +498,7 @@ public interface Server extends PluginMessageRecipient { * @return true if the recipe was added, false if it wasn't for some * reason */ + @Deprecated public boolean addRecipe(Recipe recipe); /** @@ -460,6 +508,7 @@ public interface Server extends PluginMessageRecipient { * @param result the item to match against recipe results * @return a list of recipes with the given result */ + @Deprecated public List getRecipesFor(ItemStack result); /** @@ -467,16 +516,19 @@ public interface Server extends PluginMessageRecipient { * * @return an iterator */ + @Deprecated public Iterator recipeIterator(); /** * Clears the list of crafting recipes. */ + @Deprecated public void clearRecipes(); /** * Resets the list of crafting recipes to the default. */ + @Deprecated public void resetRecipes(); /** @@ -484,6 +536,7 @@ public interface Server extends PluginMessageRecipient { * * @return a map of aliases to command names */ + @Deprecated public Map getCommandAliases(); /** @@ -491,6 +544,7 @@ public interface Server extends PluginMessageRecipient { * * @return spawn radius, or 0 if none */ + @Deprecated public int getSpawnRadius(); /** @@ -498,6 +552,7 @@ public interface Server extends PluginMessageRecipient { * * @param value new spawn radius, or 0 if none */ + @Deprecated public void setSpawnRadius(int value); /** @@ -505,6 +560,7 @@ public interface Server extends PluginMessageRecipient { * * @return true if the server authenticates clients, false otherwise */ + @Deprecated public boolean getOnlineMode(); /** @@ -512,6 +568,7 @@ public interface Server extends PluginMessageRecipient { * * @return true if the server allows flight, false otherwise */ + @Deprecated public boolean getAllowFlight(); /** @@ -519,6 +576,7 @@ public interface Server extends PluginMessageRecipient { * * @return true if the server mode is hardcore, false otherwise */ + @Deprecated public boolean isHardcore(); /** @@ -533,11 +591,13 @@ public interface Server extends PluginMessageRecipient { * @return true if exact location locations are used for spawning, false * for vanilla collision detection or otherwise */ + @Deprecated public boolean useExactLoginLocation(); /** * Shutdowns the server, stopping everything. */ + @Deprecated public void shutdown(); /** @@ -549,6 +609,7 @@ public interface Server extends PluginMessageRecipient { * permissibles} must have to receive the broadcast * @return number of message recipients */ + @Deprecated public int broadcast(String message, String permission); /** @@ -576,6 +637,7 @@ public interface Server extends PluginMessageRecipient { * @param id the UUID of the player to retrieve * @return an offline player */ + @Deprecated public OfflinePlayer getOfflinePlayer(UUID id); /** @@ -583,6 +645,7 @@ public interface Server extends PluginMessageRecipient { * * @return a set containing banned IP addresses */ + @Deprecated public Set getIPBans(); /** @@ -590,6 +653,7 @@ public interface Server extends PluginMessageRecipient { * * @param address the IP address to ban */ + @Deprecated public void banIP(String address); /** @@ -597,6 +661,7 @@ public interface Server extends PluginMessageRecipient { * * @param address the IP address to unban */ + @Deprecated public void unbanIP(String address); /** @@ -604,6 +669,7 @@ public interface Server extends PluginMessageRecipient { * * @return a set containing banned players */ + @Deprecated public Set getBannedPlayers(); /** @@ -612,6 +678,7 @@ public interface Server extends PluginMessageRecipient { * @param type the type of list to fetch, cannot be null * @return a ban list of the specified type */ + @Deprecated public BanList getBanList(BanList.Type type); /** @@ -619,6 +686,7 @@ public interface Server extends PluginMessageRecipient { * * @return a set containing player operators */ + @Deprecated public Set getOperators(); /** @@ -626,6 +694,7 @@ public interface Server extends PluginMessageRecipient { * * @return the default game mode */ + @Deprecated public GameMode getDefaultGameMode(); /** @@ -633,6 +702,7 @@ public interface Server extends PluginMessageRecipient { * * @param mode the new game mode */ + @Deprecated public void setDefaultGameMode(GameMode mode); /** @@ -641,6 +711,7 @@ public interface Server extends PluginMessageRecipient { * * @return a console command sender */ + @Deprecated public ConsoleCommandSender getConsoleSender(); /** @@ -648,6 +719,7 @@ public interface Server extends PluginMessageRecipient { * * @return folder that contains all worlds */ + @Deprecated public File getWorldContainer(); /** @@ -655,6 +727,7 @@ public interface Server extends PluginMessageRecipient { * * @return an array containing all previous players */ + @Deprecated public OfflinePlayer[] getOfflinePlayers(); /** @@ -662,6 +735,7 @@ public interface Server extends PluginMessageRecipient { * * @return messenger responsible for this server */ + @Deprecated public Messenger getMessenger(); /** @@ -669,6 +743,7 @@ public interface Server extends PluginMessageRecipient { * * @return a help map for this server */ + @Deprecated public HelpMap getHelpMap(); /** @@ -771,6 +846,7 @@ public interface Server extends PluginMessageRecipient { * * @return the configured warning state */ + @Deprecated public WarningState getWarningState(); /** @@ -838,6 +914,7 @@ public interface Server extends PluginMessageRecipient { * * @param threshold the idle timeout in minutes */ + @Deprecated public void setIdleTimeout(int threshold); /** @@ -845,6 +922,7 @@ public interface Server extends PluginMessageRecipient { * * @return the idle timeout in minutes */ + @Deprecated public int getIdleTimeout(); /** diff --git a/src/main/java/org/bukkit/SkullType.java b/src/main/java/org/bukkit/SkullType.java index abd07c2..c1a2b9a 100644 --- a/src/main/java/org/bukkit/SkullType.java +++ b/src/main/java/org/bukkit/SkullType.java @@ -3,6 +3,7 @@ package org.bukkit; /** * Represents the different types of skulls. */ +@Deprecated public enum SkullType { SKELETON, WITHER, diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java index 0913530..829e3a3 100644 --- a/src/main/java/org/bukkit/Sound.java +++ b/src/main/java/org/bukkit/Sound.java @@ -8,6 +8,7 @@ package org.bukkit; * guarantee values will not be removed from this Enum. As such, you should * not depend on the ordinal values of this class. */ +@Deprecated public enum Sound { AMBIENCE_CAVE, AMBIENCE_RAIN, diff --git a/src/main/java/org/bukkit/Statistic.java b/src/main/java/org/bukkit/Statistic.java index 57df72b..bf0c82e 100644 --- a/src/main/java/org/bukkit/Statistic.java +++ b/src/main/java/org/bukkit/Statistic.java @@ -3,6 +3,7 @@ package org.bukkit; /** * Represents a countable statistic, which is tracked by the server. */ +@Deprecated public enum Statistic { DAMAGE_DEALT, DAMAGE_TAKEN, @@ -34,12 +35,15 @@ public enum Statistic { KILL_ENTITY(Type.ENTITY), ENTITY_KILLED_BY(Type.ENTITY); + @Deprecated private final Type type; + @Deprecated private Statistic() { this(Type.UNTYPED); } + @Deprecated private Statistic(Type type) { this.type = type; } @@ -49,6 +53,7 @@ public enum Statistic { * * @return the type of this statistic */ + @Deprecated public Type getType() { return type; } @@ -64,6 +69,7 @@ public enum Statistic { * * @return true if this is a substatistic */ + @Deprecated public boolean isSubstatistic() { return type != Type.UNTYPED; } @@ -76,6 +82,7 @@ public enum Statistic { * * @return true if this deals with blocks */ + @Deprecated public boolean isBlock() { return type == Type.BLOCK; } @@ -84,6 +91,7 @@ public enum Statistic { * The type of statistic. * */ + @Deprecated public enum Type { /** * Statistics of this type do not require a qualifier. diff --git a/src/main/java/org/bukkit/TravelAgent.java b/src/main/java/org/bukkit/TravelAgent.java index 2dfeffa..e1e7eb6 100644 --- a/src/main/java/org/bukkit/TravelAgent.java +++ b/src/main/java/org/bukkit/TravelAgent.java @@ -8,6 +8,7 @@ package org.bukkit; * {@link org.bukkit.event.player.PlayerPortalEvent} to help developers * reproduce and/or modify Vanilla behaviour. */ +@Deprecated public interface TravelAgent { /** @@ -17,6 +18,7 @@ public interface TravelAgent { * location * @return this travel agent */ + @Deprecated public TravelAgent setSearchRadius(int radius); /** @@ -24,6 +26,7 @@ public interface TravelAgent { * * @return the currently set search radius */ + @Deprecated public int getSearchRadius(); /** @@ -32,6 +35,7 @@ public interface TravelAgent { * @param radius the radius in which to create a portal from the location * @return this travel agent */ + @Deprecated public TravelAgent setCreationRadius(int radius); /** @@ -39,6 +43,7 @@ public interface TravelAgent { * * @return the currently set creation radius */ + @Deprecated public int getCreationRadius(); /** @@ -48,6 +53,7 @@ public interface TravelAgent { * @return whether the TravelAgent should create a destination portal or * not */ + @Deprecated public boolean getCanCreatePortal(); /** @@ -57,6 +63,7 @@ public interface TravelAgent { * @param create Sets whether the TravelAgent should create a destination * portal or not */ + @Deprecated public void setCanCreatePortal(boolean create); /** @@ -68,6 +75,7 @@ public interface TravelAgent { * location passed to the method if unsuccessful * @see #createPortal(Location) */ + @Deprecated public Location findOrCreate(Location location); /** @@ -76,6 +84,7 @@ public interface TravelAgent { * @param location the desired location of the portal * @return the location of the nearest portal to the location */ + @Deprecated public Location findPortal(Location location); /** @@ -90,5 +99,6 @@ public interface TravelAgent { * @param location the desired location of the portal * @return true if a portal was successfully created */ + @Deprecated public boolean createPortal(Location location); } diff --git a/src/main/java/org/bukkit/TreeSpecies.java b/src/main/java/org/bukkit/TreeSpecies.java index f29062a..b550b71 100644 --- a/src/main/java/org/bukkit/TreeSpecies.java +++ b/src/main/java/org/bukkit/TreeSpecies.java @@ -7,6 +7,7 @@ import com.google.common.collect.Maps; /** * Represents the different species of trees regardless of size. */ +@Deprecated public enum TreeSpecies { /** @@ -35,9 +36,12 @@ public enum TreeSpecies { DARK_OAK(0x5), ; + @Deprecated private final byte data; + @Deprecated private final static Map BY_DATA = Maps.newHashMap(); + @Deprecated private TreeSpecies(final int data) { this.data = (byte) data; } diff --git a/src/main/java/org/bukkit/TreeType.java b/src/main/java/org/bukkit/TreeType.java index bae8232..e83fe37 100644 --- a/src/main/java/org/bukkit/TreeType.java +++ b/src/main/java/org/bukkit/TreeType.java @@ -3,6 +3,7 @@ package org.bukkit; /** * Tree and organic structure types. */ +@Deprecated public enum TreeType { /** diff --git a/src/main/java/org/bukkit/Utility.java b/src/main/java/org/bukkit/Utility.java index da66853..3590290 100644 --- a/src/main/java/org/bukkit/Utility.java +++ b/src/main/java/org/bukkit/Utility.java @@ -14,5 +14,6 @@ import java.lang.annotation.Target; */ @Target({ElementType.CONSTRUCTOR, ElementType.METHOD}) @Retention(RetentionPolicy.SOURCE) +@Deprecated public @interface Utility { } diff --git a/src/main/java/org/bukkit/Warning.java b/src/main/java/org/bukkit/Warning.java index 6a2a3b0..081af58 100644 --- a/src/main/java/org/bukkit/Warning.java +++ b/src/main/java/org/bukkit/Warning.java @@ -16,11 +16,13 @@ import com.google.common.collect.ImmutableMap; */ @Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) +@Deprecated public @interface Warning { /** * This represents the states that server verbose for warnings may be. */ + @Deprecated public enum WarningState { /** @@ -37,6 +39,7 @@ public @interface Warning { */ DEFAULT; + @Deprecated private static final Map values = ImmutableMap.builder() .put("off", OFF) .put("false", OFF) @@ -65,6 +68,7 @@ public @interface Warning { * specifies false for {@link Warning#value()}, true otherwise. * */ + @Deprecated public boolean printFor(Warning warning) { if (this == DEFAULT) { return warning == null || warning.value(); @@ -80,6 +84,7 @@ public @interface Warning { * @return {@link #DEFAULT} if not found, or the respective * WarningState */ + @Deprecated public static WarningState value(final String value) { if (value == null) { return DEFAULT; diff --git a/src/main/java/org/bukkit/WeatherType.java b/src/main/java/org/bukkit/WeatherType.java index 36b993f..d68296c 100644 --- a/src/main/java/org/bukkit/WeatherType.java +++ b/src/main/java/org/bukkit/WeatherType.java @@ -3,6 +3,7 @@ package org.bukkit; /** * An enum of all current weather types */ +@Deprecated public enum WeatherType { /** diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 8a16221..0392a83 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -20,6 +20,7 @@ import org.bukkit.util.Vector; /** * Represents a world, which may contain entities, chunks and blocks */ +@Deprecated public interface World extends PluginMessageRecipient, Metadatable { /** @@ -32,6 +33,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @see #getBlockTypeIdAt(int, int, int) Returns the current type ID of * the block */ + @Deprecated public Block getBlockAt(int x, int y, int z); /** @@ -42,6 +44,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @see #getBlockTypeIdAt(org.bukkit.Location) Returns the current type ID * of the block */ + @Deprecated public Block getBlockAt(Location location); /** @@ -77,6 +80,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z-coordinate of the blocks * @return Y-coordinate of the highest non-air block */ + @Deprecated public int getHighestBlockYAt(int x, int z); /** @@ -85,6 +89,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param location Location of the blocks * @return Y-coordinate of the highest non-air block */ + @Deprecated public int getHighestBlockYAt(Location location); /** @@ -94,6 +99,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z-coordinate of the block * @return Highest non-empty block */ + @Deprecated public Block getHighestBlockAt(int x, int z); /** @@ -102,6 +108,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param location Coordinates to get the highest block * @return Highest non-empty block */ + @Deprecated public Block getHighestBlockAt(Location location); /** @@ -111,6 +118,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z-coordinate of the chunk * @return Chunk at the given coordinates */ + @Deprecated public Chunk getChunkAt(int x, int z); /** @@ -119,6 +127,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param location Location of the chunk * @return Chunk at the given location */ + @Deprecated public Chunk getChunkAt(Location location); /** @@ -127,6 +136,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param block Block to get the containing chunk from * @return The chunk that contains the given block */ + @Deprecated public Chunk getChunkAt(Block block); /** @@ -135,6 +145,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param chunk The chunk to check * @return true if the chunk is loaded, otherwise false */ + @Deprecated public boolean isChunkLoaded(Chunk chunk); /** @@ -142,6 +153,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return Chunk[] containing all loaded chunks */ + @Deprecated public Chunk[] getLoadedChunks(); /** @@ -149,6 +161,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @param chunk The chunk to load */ + @Deprecated public void loadChunk(Chunk chunk); /** @@ -158,6 +171,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z-coordinate of the chunk * @return true if the chunk is loaded, otherwise false */ + @Deprecated public boolean isChunkLoaded(int x, int z); /** @@ -169,6 +183,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @return true if the chunk is loaded and in use by one or more players, * otherwise false */ + @Deprecated public boolean isChunkInUse(int x, int z); /** @@ -182,6 +197,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param x X-coordinate of the chunk * @param z Z-coordinate of the chunk */ + @Deprecated public void loadChunk(int x, int z); /** @@ -193,6 +209,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * already exist * @return true if the chunk has loaded successfully, otherwise false */ + @Deprecated public boolean loadChunk(int x, int z, boolean generate); /** @@ -204,6 +221,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param chunk the chunk to unload * @return true if the chunk has unloaded successfully, otherwise false */ + @Deprecated public boolean unloadChunk(Chunk chunk); /** @@ -216,6 +234,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z-coordinate of the chunk * @return true if the chunk has unloaded successfully, otherwise false */ + @Deprecated public boolean unloadChunk(int x, int z); /** @@ -230,6 +249,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param save Whether or not to save the chunk * @return true if the chunk has unloaded successfully, otherwise false */ + @Deprecated public boolean unloadChunk(int x, int z, boolean save); /** @@ -243,6 +263,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * nearby * @return true if the chunk has unloaded successfully, otherwise false */ + @Deprecated public boolean unloadChunk(int x, int z, boolean save, boolean safe); /** @@ -256,6 +277,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z-coordinate of the chunk * @return true is the queue attempt was successful, otherwise false */ + @Deprecated public boolean unloadChunkRequest(int x, int z); /** @@ -266,6 +288,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param safe Controls whether to queue the chunk when players are nearby * @return Whether the chunk was actually queued */ + @Deprecated public boolean unloadChunkRequest(int x, int z, boolean safe); /** @@ -275,6 +298,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z-coordinate of the chunk * @return Whether the chunk was actually regenerated */ + @Deprecated public boolean regenerateChunk(int x, int z); /** @@ -284,6 +308,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z-coordinate of the chunk * @return Whether the chunk was actually refreshed */ + @Deprecated public boolean refreshChunk(int x, int z); /** @@ -293,6 +318,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param item ItemStack to drop * @return ItemDrop entity created as a result of this method */ + @Deprecated public Item dropItem(Location location, ItemStack item); /** @@ -302,6 +328,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param item ItemStack to drop * @return ItemDrop entity created as a result of this method */ + @Deprecated public Item dropItemNaturally(Location location, ItemStack item); /** @@ -313,6 +340,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param spread Spread of the arrow. A recommend spread is 12 * @return Arrow entity spawned as a result of this method */ + @Deprecated public Arrow spawnArrow(Location location, Vector direction, float speed, float spread); /** @@ -322,6 +350,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param type Type of the tree to create * @return true if the tree was created successfully, otherwise false */ + @Deprecated public boolean generateTree(Location location, TreeType type); /** @@ -333,6 +362,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * this method * @return true if the tree was created successfully, otherwise false */ + @Deprecated public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate); /** @@ -342,6 +372,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param type The entity to spawn * @return Resulting Entity of this method, or null if it was unsuccessful */ + @Deprecated public Entity spawnEntity(Location loc, EntityType type); /** @@ -374,6 +405,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param loc The location to strike lightning * @return The lightning entity. */ + @Deprecated public LightningStrike strikeLightning(Location loc); /** @@ -382,6 +414,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param loc The location to strike lightning * @return The lightning entity. */ + @Deprecated public LightningStrike strikeLightningEffect(Location loc); /** @@ -389,6 +422,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return A List of all Entities currently residing in this world */ + @Deprecated public List getEntities(); /** @@ -396,6 +430,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return A List of all LivingEntities currently residing in this world */ + @Deprecated public List getLivingEntities(); /** @@ -417,6 +452,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @return A List of all Entities currently residing in this world that * match the given class/interface */ + @Deprecated public Collection getEntitiesByClass(Class cls); /** @@ -427,6 +463,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @return A List of all Entities currently residing in this world that * match one or more of the given classes/interfaces */ + @Deprecated public Collection getEntitiesByClasses(Class... classes); /** @@ -434,6 +471,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return A list of all Players currently residing in this world */ + @Deprecated public List getPlayers(); /** @@ -441,6 +479,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return Name of this world */ + @Deprecated public String getName(); /** @@ -448,6 +487,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return Unique ID of this world. */ + @Deprecated public UUID getUID(); /** @@ -455,6 +495,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return The spawn location of this world */ + @Deprecated public Location getSpawnLocation(); /** @@ -465,6 +506,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z coordinate * @return True if it was successfully set. */ + @Deprecated public boolean setSpawnLocation(int x, int y, int z); /** @@ -475,6 +517,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @return The current relative time * @see #getFullTime() Returns an absolute time of this world */ + @Deprecated public long getTime(); /** @@ -490,6 +533,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * hours*1000) * @see #setFullTime(long) Sets the absolute time of this world */ + @Deprecated public void setTime(long time); /** @@ -498,6 +542,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @return The current absolute time * @see #getTime() Returns a relative time of this world */ + @Deprecated public long getFullTime(); /** @@ -509,6 +554,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param time The new absolute time to set this world to * @see #setTime(long) Sets the relative time of this world */ + @Deprecated public void setFullTime(long time); /** @@ -516,6 +562,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return Whether there is an ongoing storm */ + @Deprecated public boolean hasStorm(); /** @@ -524,6 +571,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @param hasStorm Whether there is rain and snow */ + @Deprecated public void setStorm(boolean hasStorm); /** @@ -531,6 +579,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return Time in ticks */ + @Deprecated public int getWeatherDuration(); /** @@ -538,6 +587,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @param duration Time in ticks */ + @Deprecated public void setWeatherDuration(int duration); /** @@ -545,6 +595,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return Whether there is thunder */ + @Deprecated public boolean isThundering(); /** @@ -552,6 +603,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @param thundering Whether it is thundering */ + @Deprecated public void setThundering(boolean thundering); /** @@ -559,6 +611,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return Duration in ticks */ + @Deprecated public int getThunderDuration(); /** @@ -566,6 +619,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @param duration Duration in ticks */ + @Deprecated public void setThunderDuration(int duration); /** @@ -577,6 +631,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param power The power of explosion, where 4F is TNT * @return false if explosion was canceled, otherwise true */ + @Deprecated public boolean createExplosion(double x, double y, double z, float power); /** @@ -590,6 +645,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param setFire Whether or not to set blocks on fire * @return false if explosion was canceled, otherwise true */ + @Deprecated public boolean createExplosion(double x, double y, double z, float power, boolean setFire); /** @@ -604,6 +660,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param breakBlocks Whether or not to have blocks be destroyed * @return false if explosion was canceled, otherwise true */ + @Deprecated public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks); /** @@ -613,6 +670,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param power The power of explosion, where 4F is TNT * @return false if explosion was canceled, otherwise true */ + @Deprecated public boolean createExplosion(Location loc, float power); /** @@ -624,6 +682,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param setFire Whether or not to set blocks on fire * @return false if explosion was canceled, otherwise true */ + @Deprecated public boolean createExplosion(Location loc, float power, boolean setFire); /** @@ -631,6 +690,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return This worlds Environment type */ + @Deprecated public Environment getEnvironment(); /** @@ -638,6 +698,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return This worlds Seed */ + @Deprecated public long getSeed(); /** @@ -645,6 +706,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return True if PVP is enabled */ + @Deprecated public boolean getPVP(); /** @@ -652,6 +714,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @param pvp True/False whether PVP should be Enabled. */ + @Deprecated public void setPVP(boolean pvp); /** @@ -659,11 +722,13 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return ChunkGenerator associated with this world */ + @Deprecated public ChunkGenerator getGenerator(); /** * Saves world to disk */ + @Deprecated public void save(); /** @@ -671,6 +736,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return List containing any or none BlockPopulators */ + @Deprecated public List getPopulators(); /** @@ -683,6 +749,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @throws IllegalArgumentException if either parameter is null or the * {@link Entity} requested cannot be spawned */ + @Deprecated public T spawn(Location location, Class clazz) throws IllegalArgumentException; /** @@ -700,6 +767,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @throws IllegalArgumentException if {@link Location} or {@link * Material} are null or {@link Material} is not a block */ + @Deprecated public FallingBlock spawnFallingBlock(Location location, Material material, byte data) throws IllegalArgumentException; /** @@ -714,6 +782,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * invalid * @see #spawnFallingBlock(org.bukkit.Location, org.bukkit.Material, byte) */ + @Deprecated public FallingBlock spawnFallingBlock(Location location, int blockId, byte blockData) throws IllegalArgumentException; /** @@ -725,6 +794,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param effect the {@link Effect} * @param data a data bit needed for some effects */ + @Deprecated public void playEffect(Location location, Effect effect, int data); /** @@ -736,6 +806,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param data a data bit needed for some effects * @param radius the radius around the location */ + @Deprecated public void playEffect(Location location, Effect effect, int data, int radius); /** @@ -747,6 +818,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param effect the {@link Effect} * @param data a data bit needed for some effects */ + @Deprecated public void playEffect(Location location, Effect effect, T data); /** @@ -758,6 +830,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param data a data bit needed for some effects * @param radius the radius around the location */ + @Deprecated public void playEffect(Location location, Effect effect, T data, int radius); /** @@ -773,6 +846,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * raw biome temperature and rainfall * @return The empty snapshot. */ + @Deprecated public ChunkSnapshot getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTempRain); /** @@ -783,6 +857,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param allowAnimals - if true, animals are allowed to spawn in this * world. */ + @Deprecated public void setSpawnFlags(boolean allowMonsters, boolean allowAnimals); /** @@ -790,6 +865,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return whether animals can spawn in this world. */ + @Deprecated public boolean getAllowAnimals(); /** @@ -797,6 +873,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return whether monsters can spawn in this world. */ + @Deprecated public boolean getAllowMonsters(); /** @@ -827,6 +904,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z coordinate of the block * @return Temperature of the requested block */ + @Deprecated public double getTemperature(int x, int z); /** @@ -839,6 +917,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z coordinate of the block * @return Humidity of the requested block */ + @Deprecated public double getHumidity(int x, int z); /** @@ -848,6 +927,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return Maximum height of the world */ + @Deprecated public int getMaxHeight(); /** @@ -857,6 +937,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return Sea level */ + @Deprecated public int getSeaLevel(); /** @@ -865,6 +946,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return true if the world's spawn area will be kept loaded into memory. */ + @Deprecated public boolean getKeepSpawnInMemory(); /** @@ -874,6 +956,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param keepLoaded if true then the world's spawn area will be kept * loaded into memory. */ + @Deprecated public void setKeepSpawnInMemory(boolean keepLoaded); /** @@ -881,6 +964,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return true if the world will automatically save, otherwise false */ + @Deprecated public boolean isAutoSave(); /** @@ -889,6 +973,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param value true if the world should automatically save, otherwise * false */ + @Deprecated public void setAutoSave(boolean value); /** @@ -896,6 +981,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @param difficulty the new difficulty you want to set the world to */ + @Deprecated public void setDifficulty(Difficulty difficulty); /** @@ -903,6 +989,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return The difficulty of the world. */ + @Deprecated public Difficulty getDifficulty(); /** @@ -910,6 +997,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return The folder of this world. */ + @Deprecated public File getWorldFolder(); /** @@ -917,6 +1005,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return Type of this world. */ + @Deprecated public WorldType getWorldType(); /** @@ -924,6 +1013,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return True if structures are being generated. */ + @Deprecated public boolean canGenerateStructures(); /** @@ -950,6 +1040,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return The world's ticks per animal spawns value */ + @Deprecated public long getTicksPerAnimalSpawns(); /** @@ -977,6 +1068,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param ticksPerAnimalSpawns the ticks per animal spawns value you want * to set the world to */ + @Deprecated public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns); /** @@ -1003,6 +1095,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return The world's ticks per monster spawns value */ + @Deprecated public long getTicksPerMonsterSpawns(); /** @@ -1030,6 +1123,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param ticksPerMonsterSpawns the ticks per monster spawns value you * want to set the world to */ + @Deprecated public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns); /** @@ -1117,6 +1211,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * * @return An array of rules */ + @Deprecated public String[] getGameRules(); /** @@ -1127,6 +1222,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param rule Rule to look up value of * @return String value of rule */ + @Deprecated public String getGameRuleValue(String rule); /** @@ -1141,6 +1237,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param value Value to set rule to * @return True if rule was set */ + @Deprecated public boolean setGameRuleValue(String rule, String value); /** @@ -1149,9 +1246,11 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param rule Rule to check * @return True if rule exists */ + @Deprecated public boolean isGameRule(String rule); // Spigot start + @Deprecated public class Spigot { @@ -1165,6 +1264,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @throws IllegalArgumentException if the location or effect is null. * It also throws when the effect requires a material or a material data */ + @Deprecated public void playEffect(Location location, Effect effect) { throw new UnsupportedOperationException( "Not supported yet." ); @@ -1192,6 +1292,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param particleCount the number of particles * @param radius the radius around the location */ + @Deprecated 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." ); @@ -1204,6 +1305,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param isSilent Whether this strike makes no sound * @return The lightning entity. */ + @Deprecated public LightningStrike strikeLightning(Location loc, boolean isSilent) { throw new UnsupportedOperationException( "Not supported yet." ); @@ -1216,6 +1318,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param isSilent Whether this strike makes no sound * @return The lightning entity. */ + @Deprecated public LightningStrike strikeLightningEffect(Location loc, boolean isSilent) { throw new UnsupportedOperationException( "Not supported yet." ); @@ -1228,6 +1331,7 @@ public interface World extends PluginMessageRecipient, Metadatable { /** * Represents various map environment types that a world may be */ + @Deprecated public enum Environment { /** @@ -1243,9 +1347,12 @@ public interface World extends PluginMessageRecipient, Metadatable { */ THE_END(1); + @Deprecated private final int id; + @Deprecated private static final Map lookup = new HashMap(); + @Deprecated private Environment(int id) { this.id = id; } diff --git a/src/main/java/org/bukkit/WorldCreator.java b/src/main/java/org/bukkit/WorldCreator.java index 9a5afd2..068f097 100644 --- a/src/main/java/org/bukkit/WorldCreator.java +++ b/src/main/java/org/bukkit/WorldCreator.java @@ -8,12 +8,19 @@ import org.bukkit.plugin.Plugin; /** * Represents various types of options that may be used to create a world. */ +@Deprecated public class WorldCreator { + @Deprecated private final String name; + @Deprecated private long seed; + @Deprecated private World.Environment environment = World.Environment.NORMAL; + @Deprecated private ChunkGenerator generator = null; + @Deprecated private WorldType type = WorldType.NORMAL; + @Deprecated private boolean generateStructures = true; /** @@ -21,6 +28,7 @@ public class WorldCreator { * * @param name Name of the world that will be created */ + @Deprecated public WorldCreator(String name) { if (name == null) { throw new IllegalArgumentException("World name cannot be null"); @@ -36,6 +44,7 @@ public class WorldCreator { * @param world World to copy options from * @return This object, for chaining */ + @Deprecated public WorldCreator copy(World world) { if (world == null) { throw new IllegalArgumentException("World cannot be null"); @@ -54,6 +63,7 @@ public class WorldCreator { * @param creator World creator to copy options from * @return This object, for chaining */ + @Deprecated public WorldCreator copy(WorldCreator creator) { if (creator == null) { throw new IllegalArgumentException("Creator cannot be null"); @@ -71,6 +81,7 @@ public class WorldCreator { * * @return World name */ + @Deprecated public String name() { return name; } @@ -80,6 +91,7 @@ public class WorldCreator { * * @return World seed */ + @Deprecated public long seed() { return seed; } @@ -90,6 +102,7 @@ public class WorldCreator { * @param seed World seed * @return This object, for chaining */ + @Deprecated public WorldCreator seed(long seed) { this.seed = seed; @@ -101,6 +114,7 @@ public class WorldCreator { * * @return World environment */ + @Deprecated public World.Environment environment() { return environment; } @@ -111,6 +125,7 @@ public class WorldCreator { * @param env World environment * @return This object, for chaining */ + @Deprecated public WorldCreator environment(World.Environment env) { this.environment = env; @@ -122,6 +137,7 @@ public class WorldCreator { * * @return World type */ + @Deprecated public WorldType type() { return type; } @@ -132,6 +148,7 @@ public class WorldCreator { * @param type World type * @return This object, for chaining */ + @Deprecated public WorldCreator type(WorldType type) { this.type = type; @@ -146,6 +163,7 @@ public class WorldCreator { * * @return Chunk generator */ + @Deprecated public ChunkGenerator generator() { return generator; } @@ -159,6 +177,7 @@ public class WorldCreator { * @param generator Chunk generator * @return This object, for chaining */ + @Deprecated public WorldCreator generator(ChunkGenerator generator) { this.generator = generator; @@ -178,6 +197,7 @@ public class WorldCreator { * @param generator Name of the generator to use, in "plugin:id" notation * @return This object, for chaining */ + @Deprecated public WorldCreator generator(String generator) { this.generator = getGeneratorForName(name, generator, Bukkit.getConsoleSender()); @@ -199,6 +219,7 @@ public class WorldCreator { * messages * @return This object, for chaining */ + @Deprecated public WorldCreator generator(String generator, CommandSender output) { this.generator = getGeneratorForName(name, generator, output); @@ -212,6 +233,7 @@ public class WorldCreator { * @param generate Whether to generate structures * @return This object, for chaining */ + @Deprecated public WorldCreator generateStructures(boolean generate) { this.generateStructures = generate; @@ -223,6 +245,7 @@ public class WorldCreator { * * @return True if structures will be generated */ + @Deprecated public boolean generateStructures() { return generateStructures; } @@ -235,6 +258,7 @@ public class WorldCreator { * * @return Newly created or loaded world */ + @Deprecated public World createWorld() { return Bukkit.createWorld(this); } @@ -245,6 +269,7 @@ public class WorldCreator { * @param name Name of the world to load or create * @return Resulting WorldCreator */ + @Deprecated public static WorldCreator name(String name) { return new WorldCreator(name); } @@ -265,6 +290,7 @@ public class WorldCreator { * @param output Where to output if errors are present * @return Resulting generator, or null */ + @Deprecated public static ChunkGenerator getGeneratorForName(String world, String name, CommandSender output) { ChunkGenerator result = null; diff --git a/src/main/java/org/bukkit/WorldType.java b/src/main/java/org/bukkit/WorldType.java index 201852d..6869d58 100644 --- a/src/main/java/org/bukkit/WorldType.java +++ b/src/main/java/org/bukkit/WorldType.java @@ -6,6 +6,7 @@ import java.util.Map; /** * Represents various types of worlds that may exist */ +@Deprecated public enum WorldType { NORMAL("DEFAULT"), FLAT("FLAT"), @@ -13,9 +14,12 @@ public enum WorldType { LARGE_BIOMES("LARGEBIOMES"), AMPLIFIED("AMPLIFIED"); + @Deprecated private final static Map BY_NAME = Maps.newHashMap(); + @Deprecated private final String name; + @Deprecated private WorldType(String name) { this.name = name; } @@ -25,6 +29,7 @@ public enum WorldType { * * @return Name of this type */ + @Deprecated public String getName() { return name; } @@ -35,6 +40,7 @@ public enum WorldType { * @param name Name of the WorldType to get * @return Requested WorldType, or null if not found */ + @Deprecated public static WorldType getByName(String name) { return BY_NAME.get(name.toUpperCase()); } diff --git a/src/main/java/org/bukkit/block/Beacon.java b/src/main/java/org/bukkit/block/Beacon.java index 2de0583..37d5d13 100644 --- a/src/main/java/org/bukkit/block/Beacon.java +++ b/src/main/java/org/bukkit/block/Beacon.java @@ -5,5 +5,6 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a beacon. */ +@Deprecated public interface Beacon extends BlockState, InventoryHolder { } diff --git a/src/main/java/org/bukkit/block/Biome.java b/src/main/java/org/bukkit/block/Biome.java index 8b902f4..804c3e2 100644 --- a/src/main/java/org/bukkit/block/Biome.java +++ b/src/main/java/org/bukkit/block/Biome.java @@ -3,6 +3,7 @@ package org.bukkit.block; /** * Holds all accepted Biomes in the default server */ +@Deprecated public enum Biome { SWAMPLAND, FOREST, diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java index 4a53109..3a3acab 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -15,6 +15,7 @@ import org.bukkit.metadata.Metadatable; * concurrently to your own handling of it; use block.getState() to get a * snapshot state of a block which will not be modified. */ +@Deprecated public interface Block extends Metadatable { /** diff --git a/src/main/java/org/bukkit/block/BlockFace.java b/src/main/java/org/bukkit/block/BlockFace.java index 58fb195..7cb52c3 100644 --- a/src/main/java/org/bukkit/block/BlockFace.java +++ b/src/main/java/org/bukkit/block/BlockFace.java @@ -3,6 +3,7 @@ package org.bukkit.block; /** * Represents the face of a block */ +@Deprecated public enum BlockFace { NORTH(0, 0, -1), EAST(1, 0, 0), @@ -24,16 +25,21 @@ public enum BlockFace { WEST_SOUTH_WEST(WEST, SOUTH_WEST), SELF(0, 0, 0); + @Deprecated private final int modX; + @Deprecated private final int modY; + @Deprecated private final int modZ; + @Deprecated private BlockFace(final int modX, final int modY, final int modZ) { this.modX = modX; this.modY = modY; this.modZ = modZ; } + @Deprecated private BlockFace(final BlockFace face1, final BlockFace face2) { this.modX = face1.getModX() + face2.getModX(); this.modY = face1.getModY() + face2.getModY(); @@ -45,6 +51,7 @@ public enum BlockFace { * * @return Amount of X-coordinates to modify */ + @Deprecated public int getModX() { return modX; } @@ -54,6 +61,7 @@ public enum BlockFace { * * @return Amount of Y-coordinates to modify */ + @Deprecated public int getModY() { return modY; } @@ -63,10 +71,12 @@ public enum BlockFace { * * @return Amount of Z-coordinates to modify */ + @Deprecated public int getModZ() { return modZ; } + @Deprecated public BlockFace getOppositeFace() { switch (this) { case NORTH: diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java index ca57173..c061823 100644 --- a/src/main/java/org/bukkit/block/BlockState.java +++ b/src/main/java/org/bukkit/block/BlockState.java @@ -16,6 +16,7 @@ import org.bukkit.metadata.Metadatable; * 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. */ +@Deprecated public interface BlockState extends Metadatable { /** diff --git a/src/main/java/org/bukkit/block/BrewingStand.java b/src/main/java/org/bukkit/block/BrewingStand.java index c66a51c..5fc8dfb 100644 --- a/src/main/java/org/bukkit/block/BrewingStand.java +++ b/src/main/java/org/bukkit/block/BrewingStand.java @@ -5,6 +5,7 @@ import org.bukkit.inventory.BrewerInventory; /** * Represents a brewing stand. */ +@Deprecated public interface BrewingStand extends BlockState, ContainerBlock { /** @@ -21,5 +22,6 @@ public interface BrewingStand extends BlockState, ContainerBlock { */ void setBrewingTime(int brewTime); + @Deprecated public BrewerInventory getInventory(); } diff --git a/src/main/java/org/bukkit/block/Chest.java b/src/main/java/org/bukkit/block/Chest.java index 125d5e7..b61c302 100644 --- a/src/main/java/org/bukkit/block/Chest.java +++ b/src/main/java/org/bukkit/block/Chest.java @@ -5,6 +5,7 @@ import org.bukkit.inventory.Inventory; /** * Represents a chest. */ +@Deprecated public interface Chest extends BlockState, ContainerBlock { /** diff --git a/src/main/java/org/bukkit/block/CommandBlock.java b/src/main/java/org/bukkit/block/CommandBlock.java index 85d5345..1c7dc29 100644 --- a/src/main/java/org/bukkit/block/CommandBlock.java +++ b/src/main/java/org/bukkit/block/CommandBlock.java @@ -1,5 +1,6 @@ package org.bukkit.block; +@Deprecated public interface CommandBlock extends BlockState { /** @@ -9,6 +10,7 @@ public interface CommandBlock extends BlockState { * * @return Command that this CommandBlock will run when powered. */ + @Deprecated public String getCommand(); /** @@ -18,6 +20,7 @@ public interface CommandBlock extends BlockState { * * @param command Command that this CommandBlock will run when powered. */ + @Deprecated public void setCommand(String command); /** @@ -27,6 +30,7 @@ public interface CommandBlock extends BlockState { * * @return Name of this CommandBlock. */ + @Deprecated public String getName(); /** @@ -36,5 +40,6 @@ public interface CommandBlock extends BlockState { * * @param name New name for this CommandBlock. */ + @Deprecated public void setName(String name); } diff --git a/src/main/java/org/bukkit/block/CreatureSpawner.java b/src/main/java/org/bukkit/block/CreatureSpawner.java index e54d997..7c82f05 100644 --- a/src/main/java/org/bukkit/block/CreatureSpawner.java +++ b/src/main/java/org/bukkit/block/CreatureSpawner.java @@ -6,6 +6,7 @@ import org.bukkit.entity.EntityType; /** * Represents a creature spawner. */ +@Deprecated public interface CreatureSpawner extends BlockState { /** @@ -22,6 +23,7 @@ public interface CreatureSpawner extends BlockState { * * @return The creature type. */ + @Deprecated public EntityType getSpawnedType(); /** @@ -29,6 +31,7 @@ public interface CreatureSpawner extends BlockState { * * @param creatureType The creature type. */ + @Deprecated public void setSpawnedType(EntityType creatureType); /** @@ -54,6 +57,7 @@ public interface CreatureSpawner extends BlockState { * * @param creatureType The creature type's name. */ + @Deprecated public void setCreatureTypeByName(String creatureType); /** @@ -61,6 +65,7 @@ public interface CreatureSpawner extends BlockState { * * @return The creature type's name. */ + @Deprecated public String getCreatureTypeName(); /** @@ -77,6 +82,7 @@ public interface CreatureSpawner extends BlockState { * * @return The delay. */ + @Deprecated public int getDelay(); /** @@ -84,5 +90,6 @@ public interface CreatureSpawner extends BlockState { * * @param delay The delay. */ + @Deprecated public void setDelay(int delay); } diff --git a/src/main/java/org/bukkit/block/Dispenser.java b/src/main/java/org/bukkit/block/Dispenser.java index bba753e..1f599ce 100644 --- a/src/main/java/org/bukkit/block/Dispenser.java +++ b/src/main/java/org/bukkit/block/Dispenser.java @@ -5,6 +5,7 @@ import org.bukkit.projectiles.BlockProjectileSource; /** * Represents a dispenser. */ +@Deprecated public interface Dispenser extends BlockState, ContainerBlock { /** @@ -14,6 +15,7 @@ public interface Dispenser extends BlockState, ContainerBlock { * * @return a BlockProjectileSource if valid, otherwise null */ + @Deprecated public BlockProjectileSource getBlockProjectileSource(); /** @@ -23,5 +25,6 @@ public interface Dispenser extends BlockState, ContainerBlock { * * @return true if successful, otherwise false */ + @Deprecated public boolean dispense(); } diff --git a/src/main/java/org/bukkit/block/DoubleChest.java b/src/main/java/org/bukkit/block/DoubleChest.java index 148099c..046b2e6 100644 --- a/src/main/java/org/bukkit/block/DoubleChest.java +++ b/src/main/java/org/bukkit/block/DoubleChest.java @@ -9,41 +9,52 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a double chest. */ +@Deprecated public class DoubleChest implements InventoryHolder { + @Deprecated private DoubleChestInventory inventory; + @Deprecated public DoubleChest(DoubleChestInventory chest) { inventory = chest; } + @Deprecated public Inventory getInventory() { return inventory; } + @Deprecated public InventoryHolder getLeftSide() { return inventory.getLeftSide().getHolder(); } + @Deprecated public InventoryHolder getRightSide() { return inventory.getRightSide().getHolder(); } + @Deprecated public Location getLocation() { return new Location(getWorld(), getX(), getY(), getZ()); } + @Deprecated public World getWorld() { return ((Chest)getLeftSide()).getWorld(); } + @Deprecated public double getX() { return 0.5 * (((Chest)getLeftSide()).getX() + ((Chest)getRightSide()).getX()); } + @Deprecated public double getY() { return 0.5 * (((Chest)getLeftSide()).getY() + ((Chest)getRightSide()).getY()); } + @Deprecated public double getZ() { return 0.5 * (((Chest)getLeftSide()).getZ() + ((Chest)getRightSide()).getZ()); } diff --git a/src/main/java/org/bukkit/block/Dropper.java b/src/main/java/org/bukkit/block/Dropper.java index 21fbedc..6702350 100644 --- a/src/main/java/org/bukkit/block/Dropper.java +++ b/src/main/java/org/bukkit/block/Dropper.java @@ -5,6 +5,7 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a dropper. */ +@Deprecated public interface Dropper extends BlockState, InventoryHolder { /** * Tries to drop a randomly selected item from the Dropper's inventory, @@ -21,5 +22,6 @@ public interface Dropper extends BlockState, InventoryHolder { * ContainerBlock, the randomly selected ItemStack is dropped on * the ground in the form of an {@link org.bukkit.entity.Item Item}. */ + @Deprecated public void drop(); } diff --git a/src/main/java/org/bukkit/block/Furnace.java b/src/main/java/org/bukkit/block/Furnace.java index 94af85e..b1870c0 100644 --- a/src/main/java/org/bukkit/block/Furnace.java +++ b/src/main/java/org/bukkit/block/Furnace.java @@ -5,6 +5,7 @@ import org.bukkit.inventory.FurnaceInventory; /** * Represents a furnace. */ +@Deprecated public interface Furnace extends BlockState, ContainerBlock { /** @@ -12,6 +13,7 @@ public interface Furnace extends BlockState, ContainerBlock { * * @return Burn time */ + @Deprecated public short getBurnTime(); /** @@ -19,6 +21,7 @@ public interface Furnace extends BlockState, ContainerBlock { * * @param burnTime Burn time */ + @Deprecated public void setBurnTime(short burnTime); /** @@ -26,6 +29,7 @@ public interface Furnace extends BlockState, ContainerBlock { * * @return Cook time */ + @Deprecated public short getCookTime(); /** @@ -33,7 +37,9 @@ public interface Furnace extends BlockState, ContainerBlock { * * @param cookTime Cook time */ + @Deprecated public void setCookTime(short cookTime); + @Deprecated public FurnaceInventory getInventory(); } diff --git a/src/main/java/org/bukkit/block/Hopper.java b/src/main/java/org/bukkit/block/Hopper.java index e097157..8c3cda0 100644 --- a/src/main/java/org/bukkit/block/Hopper.java +++ b/src/main/java/org/bukkit/block/Hopper.java @@ -5,6 +5,7 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a hopper. */ +@Deprecated public interface Hopper extends BlockState, InventoryHolder { } diff --git a/src/main/java/org/bukkit/block/Jukebox.java b/src/main/java/org/bukkit/block/Jukebox.java index 7b45b83..8b97a8e 100644 --- a/src/main/java/org/bukkit/block/Jukebox.java +++ b/src/main/java/org/bukkit/block/Jukebox.java @@ -5,12 +5,14 @@ import org.bukkit.Material; /** * Represents a Jukebox */ +@Deprecated public interface Jukebox extends BlockState { /** * Get the record currently playing * * @return The record Material, or AIR if none is playing */ + @Deprecated public Material getPlaying(); /** @@ -18,6 +20,7 @@ public interface Jukebox extends BlockState { * * @param record The record Material, or null/AIR to stop playing */ + @Deprecated public void setPlaying(Material record); /** @@ -25,6 +28,7 @@ public interface Jukebox extends BlockState { * * @return True if there is a record playing */ + @Deprecated public boolean isPlaying(); /** @@ -32,5 +36,6 @@ public interface Jukebox extends BlockState { * * @return True if a record was ejected; false if there was none playing */ + @Deprecated public boolean eject(); } diff --git a/src/main/java/org/bukkit/block/NoteBlock.java b/src/main/java/org/bukkit/block/NoteBlock.java index 8380068..e81728f 100644 --- a/src/main/java/org/bukkit/block/NoteBlock.java +++ b/src/main/java/org/bukkit/block/NoteBlock.java @@ -6,6 +6,7 @@ import org.bukkit.Note; /** * Represents a note. */ +@Deprecated public interface NoteBlock extends BlockState { /** @@ -13,6 +14,7 @@ public interface NoteBlock extends BlockState { * * @return The note. */ + @Deprecated public Note getNote(); /** @@ -29,6 +31,7 @@ public interface NoteBlock extends BlockState { * * @param note The note. */ + @Deprecated public void setNote(Note note); /** @@ -47,6 +50,7 @@ public interface NoteBlock extends BlockState { * * @return true if successful, otherwise false */ + @Deprecated public boolean play(); /** @@ -68,5 +72,6 @@ public interface NoteBlock extends BlockState { * @return true if successful, otherwise false * @see Instrument Note */ + @Deprecated public boolean play(Instrument instrument, Note note); } diff --git a/src/main/java/org/bukkit/block/PistonMoveReaction.java b/src/main/java/org/bukkit/block/PistonMoveReaction.java index e5279f7..1e89d4b 100644 --- a/src/main/java/org/bukkit/block/PistonMoveReaction.java +++ b/src/main/java/org/bukkit/block/PistonMoveReaction.java @@ -3,6 +3,7 @@ package org.bukkit.block; import java.util.HashMap; import java.util.Map; +@Deprecated public enum PistonMoveReaction { /** @@ -18,7 +19,9 @@ public enum PistonMoveReaction { */ BLOCK(2); + @Deprecated private int id; + @Deprecated private static Map byId = new HashMap(); static { for (PistonMoveReaction reaction : PistonMoveReaction.values()) { @@ -26,6 +29,7 @@ public enum PistonMoveReaction { } } + @Deprecated private PistonMoveReaction(int id) { this.id = id; } diff --git a/src/main/java/org/bukkit/block/Sign.java b/src/main/java/org/bukkit/block/Sign.java index 5d7a633..919e2e6 100644 --- a/src/main/java/org/bukkit/block/Sign.java +++ b/src/main/java/org/bukkit/block/Sign.java @@ -3,6 +3,7 @@ package org.bukkit.block; /** * Represents either a SignPost or a WallSign */ +@Deprecated public interface Sign extends BlockState { /** @@ -10,6 +11,7 @@ public interface Sign extends BlockState { * * @return Array of Strings containing each line of text */ + @Deprecated public String[] getLines(); /** @@ -21,6 +23,7 @@ public interface Sign extends BlockState { * @throws IndexOutOfBoundsException Thrown when the line does not exist * @return Text on the given line */ + @Deprecated public String getLine(int index) throws IndexOutOfBoundsException; /** @@ -33,5 +36,6 @@ public interface Sign extends BlockState { * @param line New text to set at the specified index * @throws IndexOutOfBoundsException If the index is out of the range 0..3 */ + @Deprecated public void setLine(int index, String line) throws IndexOutOfBoundsException; } diff --git a/src/main/java/org/bukkit/block/Skull.java b/src/main/java/org/bukkit/block/Skull.java index 974aea2..fe4e1ac 100644 --- a/src/main/java/org/bukkit/block/Skull.java +++ b/src/main/java/org/bukkit/block/Skull.java @@ -5,6 +5,7 @@ import org.bukkit.SkullType; /** * Represents a Skull */ +@Deprecated public interface Skull extends BlockState { /** @@ -12,6 +13,7 @@ public interface Skull extends BlockState { * * @return true if the skull has an owner */ + @Deprecated public boolean hasOwner(); /** @@ -19,6 +21,7 @@ public interface Skull extends BlockState { * * @return the owner of the skull */ + @Deprecated public String getOwner(); /** @@ -27,6 +30,7 @@ public interface Skull extends BlockState { * @param name the new owner of the skull * @return true if the owner was successfully set */ + @Deprecated public boolean setOwner(String name); /** @@ -34,6 +38,7 @@ public interface Skull extends BlockState { * * @return the rotation of the skull */ + @Deprecated public BlockFace getRotation(); /** @@ -41,6 +46,7 @@ public interface Skull extends BlockState { * * @param rotation the rotation of the skull */ + @Deprecated public void setRotation(BlockFace rotation); /** @@ -48,6 +54,7 @@ public interface Skull extends BlockState { * * @return the type of skull */ + @Deprecated public SkullType getSkullType(); /** @@ -55,5 +62,6 @@ public interface Skull extends BlockState { * * @param skullType the type of skull */ + @Deprecated public void setSkullType(SkullType skullType); } diff --git a/src/main/java/org/bukkit/command/BlockCommandSender.java b/src/main/java/org/bukkit/command/BlockCommandSender.java index ce229d2..0f6cf4f 100644 --- a/src/main/java/org/bukkit/command/BlockCommandSender.java +++ b/src/main/java/org/bukkit/command/BlockCommandSender.java @@ -2,6 +2,7 @@ package org.bukkit.command; import org.bukkit.block.Block; +@Deprecated public interface BlockCommandSender extends CommandSender { /** @@ -9,5 +10,6 @@ public interface BlockCommandSender extends CommandSender { * * @return Block for the command sender */ + @Deprecated public Block getBlock(); } diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java index 87c33d9..ec35d85 100644 --- a/src/main/java/org/bukkit/command/Command.java +++ b/src/main/java/org/bukkit/command/Command.java @@ -20,22 +20,35 @@ import com.google.common.collect.ImmutableList; /** * Represents a Command, which executes various tasks upon user input */ +@Deprecated public abstract class Command { + @Deprecated private final String name; + @Deprecated private String nextLabel; + @Deprecated private String label; + @Deprecated private List aliases; + @Deprecated private List activeAliases; + @Deprecated private CommandMap commandMap = null; + @Deprecated protected String description = ""; + @Deprecated protected String usageMessage; + @Deprecated private String permission; + @Deprecated private String permissionMessage; + @Deprecated protected Command(String name) { this(name, "", "/" + name, new ArrayList()); } + @Deprecated protected Command(String name, String description, String usageMessage, List aliases) { this.name = name; this.nextLabel = name; @@ -54,6 +67,7 @@ public abstract class Command { * @param args All arguments passed to the command, split via ' ' * @return true if the command was successful, otherwise false */ + @Deprecated public abstract boolean execute(CommandSender sender, String commandLabel, String[] args); /** @@ -75,6 +89,7 @@ public abstract class Command { * will never be null. List may be immutable. * @throws IllegalArgumentException if sender, alias, or args is null */ + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); @@ -105,6 +120,7 @@ public abstract class Command { * * @return Name of this command */ + @Deprecated public String getName() { return name; } @@ -115,6 +131,7 @@ public abstract class Command { * * @return Permission name, or null if none */ + @Deprecated public String getPermission() { return permission; } @@ -125,6 +142,7 @@ public abstract class Command { * * @param permission Permission name or null */ + @Deprecated public void setPermission(String permission) { this.permission = permission; } @@ -139,6 +157,7 @@ public abstract class Command { * @param target User to test * @return true if they can use it, otherwise false */ + @Deprecated public boolean testPermission(CommandSender target) { if (testPermissionSilent(target)) { return true; @@ -164,6 +183,7 @@ public abstract class Command { * @param target User to test * @return true if they can use it, otherwise false */ + @Deprecated public boolean testPermissionSilent(CommandSender target) { if ((permission == null) || (permission.length() == 0)) { return true; @@ -183,6 +203,7 @@ public abstract class Command { * * @return Label of this command or null if not registered */ + @Deprecated public String getLabel() { return label; } @@ -197,6 +218,7 @@ public abstract class Command { * @return returns true if the name change happened instantly or false if * it was scheduled for re-registration */ + @Deprecated public boolean setLabel(String name) { this.nextLabel = name; if (!isRegistered()) { @@ -214,6 +236,7 @@ public abstract class Command { * @return true if the registration was successful (the current registered * CommandMap was the passed CommandMap or null) false otherwise */ + @Deprecated public boolean register(CommandMap commandMap) { if (allowChangesFrom(commandMap)) { this.commandMap = commandMap; @@ -232,6 +255,7 @@ public abstract class Command { * registered CommandMap was the passed CommandMap or null) false * otherwise */ + @Deprecated public boolean unregister(CommandMap commandMap) { if (allowChangesFrom(commandMap)) { this.commandMap = null; @@ -243,6 +267,7 @@ public abstract class Command { return false; } + @Deprecated private boolean allowChangesFrom(CommandMap commandMap) { return (null == this.commandMap || this.commandMap == commandMap); } @@ -252,6 +277,7 @@ public abstract class Command { * * @return true if this command is currently registered false otherwise */ + @Deprecated public boolean isRegistered() { return (null != this.commandMap); } @@ -261,6 +287,7 @@ public abstract class Command { * * @return List of aliases */ + @Deprecated public List getAliases() { return activeAliases; } @@ -271,6 +298,7 @@ public abstract class Command { * * @return Permission check failed message */ + @Deprecated public String getPermissionMessage() { return permissionMessage; } @@ -280,6 +308,7 @@ public abstract class Command { * * @return Description of this command */ + @Deprecated public String getDescription() { return description; } @@ -289,6 +318,7 @@ public abstract class Command { * * @return One or more example usages */ + @Deprecated public String getUsage() { return usageMessage; } @@ -302,6 +332,7 @@ public abstract class Command { * @param aliases aliases to register to this command * @return this command object, for chaining */ + @Deprecated public Command setAliases(List aliases) { this.aliases = aliases; if (!isRegistered()) { @@ -318,6 +349,7 @@ public abstract class Command { * @param description new command description * @return this command object, for chaining */ + @Deprecated public Command setDescription(String description) { this.description = description; return this; @@ -330,6 +362,7 @@ public abstract class Command { * default message, or an empty string to indicate no message * @return this command object, for chaining */ + @Deprecated public Command setPermissionMessage(String permissionMessage) { this.permissionMessage = permissionMessage; return this; @@ -341,15 +374,18 @@ public abstract class Command { * @param usage new example usage * @return this command object, for chaining */ + @Deprecated public Command setUsage(String usage) { this.usageMessage = usage; return this; } + @Deprecated public static void broadcastCommandMessage(CommandSender source, String message) { broadcastCommandMessage(source, message, true); } + @Deprecated public static void broadcastCommandMessage(CommandSender source, String message, boolean sendToSource) { String result = source.getName() + ": " + message; @@ -390,6 +426,7 @@ public abstract class Command { } @Override + @Deprecated public String toString() { return getClass().getName() + '(' + name + ')'; } diff --git a/src/main/java/org/bukkit/command/CommandException.java b/src/main/java/org/bukkit/command/CommandException.java index b63015f..6aadb9f 100644 --- a/src/main/java/org/bukkit/command/CommandException.java +++ b/src/main/java/org/bukkit/command/CommandException.java @@ -4,12 +4,14 @@ package org.bukkit.command; * Thrown when an unhandled exception occurs during the execution of a Command */ @SuppressWarnings("serial") +@Deprecated public class CommandException extends RuntimeException { /** * Creates a new instance of CommandException without detail * message. */ + @Deprecated public CommandException() {} /** @@ -18,10 +20,12 @@ public class CommandException extends RuntimeException { * * @param msg the detail message. */ + @Deprecated public CommandException(String msg) { super(msg); } + @Deprecated public CommandException(String msg, Throwable cause) { super(msg, cause); } diff --git a/src/main/java/org/bukkit/command/CommandExecutor.java b/src/main/java/org/bukkit/command/CommandExecutor.java index c75586f..3139c31 100644 --- a/src/main/java/org/bukkit/command/CommandExecutor.java +++ b/src/main/java/org/bukkit/command/CommandExecutor.java @@ -3,6 +3,7 @@ package org.bukkit.command; /** * Represents a class which contains a single method for executing commands */ +@Deprecated public interface CommandExecutor { /** @@ -14,5 +15,6 @@ public interface CommandExecutor { * @param args Passed command arguments * @return true if a valid command, otherwise false */ + @Deprecated public boolean onCommand(CommandSender sender, Command command, String label, String[] args); } diff --git a/src/main/java/org/bukkit/command/CommandMap.java b/src/main/java/org/bukkit/command/CommandMap.java index e7e20d8..111001a 100644 --- a/src/main/java/org/bukkit/command/CommandMap.java +++ b/src/main/java/org/bukkit/command/CommandMap.java @@ -2,6 +2,7 @@ package org.bukkit.command; import java.util.List; +@Deprecated public interface CommandMap { /** @@ -19,6 +20,7 @@ public interface CommandMap { * a ':' one or more times to make the command unique * @param commands a list of commands to register */ + @Deprecated public void registerAll(String fallbackPrefix, List commands); /** @@ -41,6 +43,7 @@ public interface CommandMap { * otherwise, which indicates the fallbackPrefix was used one or more * times */ + @Deprecated public boolean register(String label, String fallbackPrefix, Command command); /** @@ -63,6 +66,7 @@ public interface CommandMap { * otherwise, which indicates the fallbackPrefix was used one or more * times */ + @Deprecated public boolean register(String fallbackPrefix, Command command); /** @@ -74,11 +78,13 @@ public interface CommandMap { * @throws CommandException Thrown when the executor for the given command * fails with an unhandled exception */ + @Deprecated public boolean dispatch(CommandSender sender, String cmdLine) throws CommandException; /** * Clears all registered commands. */ + @Deprecated public void clearCommands(); /** @@ -88,6 +94,7 @@ public interface CommandMap { * @return Command with the specified name or null if a command with that * label doesn't exist */ + @Deprecated public Command getCommand(String name); @@ -105,5 +112,6 @@ public interface CommandMap { * command fails with an unhandled exception * @throws IllegalArgumentException if either sender or cmdLine are null */ + @Deprecated public List tabComplete(CommandSender sender, String cmdLine) throws IllegalArgumentException; } diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java index 148756b..28311c5 100644 --- a/src/main/java/org/bukkit/command/CommandSender.java +++ b/src/main/java/org/bukkit/command/CommandSender.java @@ -3,6 +3,7 @@ package org.bukkit.command; import org.bukkit.Server; import org.bukkit.permissions.Permissible; +@Deprecated public interface CommandSender extends Permissible { /** @@ -10,6 +11,7 @@ public interface CommandSender extends Permissible { * * @param message Message to be displayed */ + @Deprecated public void sendMessage(String message); /** @@ -17,6 +19,7 @@ public interface CommandSender extends Permissible { * * @param messages An array of messages to be displayed */ + @Deprecated public void sendMessage(String[] messages); /** @@ -24,6 +27,7 @@ public interface CommandSender extends Permissible { * * @return Server instance */ + @Deprecated public Server getServer(); /** @@ -31,5 +35,6 @@ public interface CommandSender extends Permissible { * * @return Name of the sender */ + @Deprecated public String getName(); } diff --git a/src/main/java/org/bukkit/command/ConsoleCommandSender.java b/src/main/java/org/bukkit/command/ConsoleCommandSender.java index f309c2e..fee3b57 100644 --- a/src/main/java/org/bukkit/command/ConsoleCommandSender.java +++ b/src/main/java/org/bukkit/command/ConsoleCommandSender.java @@ -2,5 +2,6 @@ package org.bukkit.command; import org.bukkit.conversations.Conversable; +@Deprecated public interface ConsoleCommandSender extends CommandSender, Conversable { } diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java index 3f07d7f..aaddd02 100644 --- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java +++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java @@ -9,15 +9,19 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.server.RemoteServerCommandEvent; import org.bukkit.event.server.ServerCommandEvent; +@Deprecated public class FormattedCommandAlias extends Command { + @Deprecated private final String[] formatStrings; + @Deprecated public FormattedCommandAlias(String alias, String[] formatStrings) { super(alias); this.formatStrings = formatStrings; } @Override + @Deprecated public boolean execute(CommandSender sender, String commandLabel, String[] args) { boolean result = false; ArrayList commands = new ArrayList(); @@ -41,6 +45,7 @@ public class FormattedCommandAlias extends Command { return result; } + @Deprecated private String buildCommand(String formatString, String[] args) { int index = formatString.indexOf("$"); while (index != -1) { @@ -118,6 +123,7 @@ public class FormattedCommandAlias extends Command { return formatString; } + @Deprecated private static boolean inRange(int i, int j, int k) { return i >= j && i <= k; } diff --git a/src/main/java/org/bukkit/command/MultipleCommandAlias.java b/src/main/java/org/bukkit/command/MultipleCommandAlias.java index a0a4129..48b7391 100644 --- a/src/main/java/org/bukkit/command/MultipleCommandAlias.java +++ b/src/main/java/org/bukkit/command/MultipleCommandAlias.java @@ -3,9 +3,12 @@ package org.bukkit.command; /** * Represents a command that delegates to one or more other commands */ +@Deprecated public class MultipleCommandAlias extends Command { + @Deprecated private Command[] commands; + @Deprecated public MultipleCommandAlias(String name, Command[] commands) { super(name); this.commands = commands; @@ -16,11 +19,13 @@ public class MultipleCommandAlias extends Command { * * @return commands associated with alias */ + @Deprecated public Command[] getCommands() { return commands; } @Override + @Deprecated public boolean execute(CommandSender sender, String commandLabel, String[] args) { boolean result = false; diff --git a/src/main/java/org/bukkit/command/PluginCommand.java b/src/main/java/org/bukkit/command/PluginCommand.java index 3bfa31f..d1382e5 100644 --- a/src/main/java/org/bukkit/command/PluginCommand.java +++ b/src/main/java/org/bukkit/command/PluginCommand.java @@ -8,11 +8,16 @@ import org.bukkit.plugin.Plugin; /** * Represents a {@link Command} belonging to a plugin */ +@Deprecated public final class PluginCommand extends Command implements PluginIdentifiableCommand { + @Deprecated private final Plugin owningPlugin; + @Deprecated private CommandExecutor executor; + @Deprecated private TabCompleter completer; + @Deprecated protected PluginCommand(String name, Plugin owner) { super(name); this.executor = owner; @@ -29,6 +34,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo * @return true if the command was successful, otherwise false */ @Override + @Deprecated public boolean execute(CommandSender sender, String commandLabel, String[] args) { boolean success = false; @@ -60,6 +66,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo * * @param executor New executor to run */ + @Deprecated public void setExecutor(CommandExecutor executor) { this.executor = executor == null ? owningPlugin : executor; } @@ -69,6 +76,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo * * @return CommandExecutor object linked to this command */ + @Deprecated public CommandExecutor getExecutor() { return executor; } @@ -81,6 +89,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo * * @param completer New tab completer */ + @Deprecated public void setTabCompleter(TabCompleter completer) { this.completer = completer; } @@ -90,6 +99,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo * * @return TabCompleter object linked to this command */ + @Deprecated public TabCompleter getTabCompleter() { return completer; } @@ -99,6 +109,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo * * @return Plugin that owns this command */ + @Deprecated public Plugin getPlugin() { return owningPlugin; } @@ -121,6 +132,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo * @throws IllegalArgumentException if sender, alias, or args is null */ @Override + @Deprecated public java.util.List tabComplete(CommandSender sender, String alias, String[] args) throws CommandException, IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); @@ -151,6 +163,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo } @Override + @Deprecated public String toString() { StringBuilder stringBuilder = new StringBuilder(super.toString()); stringBuilder.deleteCharAt(stringBuilder.length() - 1); diff --git a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java b/src/main/java/org/bukkit/command/PluginCommandYamlParser.java index 5854583..a39c0e8 100644 --- a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java +++ b/src/main/java/org/bukkit/command/PluginCommandYamlParser.java @@ -8,8 +8,10 @@ import java.util.Map.Entry; import org.bukkit.Bukkit; import org.bukkit.plugin.Plugin; +@Deprecated public class PluginCommandYamlParser { + @Deprecated public static List parse(Plugin plugin) { List pluginCmds = new ArrayList(); diff --git a/src/main/java/org/bukkit/command/PluginIdentifiableCommand.java b/src/main/java/org/bukkit/command/PluginIdentifiableCommand.java index c5e0d2c..7383cc0 100644 --- a/src/main/java/org/bukkit/command/PluginIdentifiableCommand.java +++ b/src/main/java/org/bukkit/command/PluginIdentifiableCommand.java @@ -8,6 +8,7 @@ import org.bukkit.plugin.Plugin; * implementations will need to implement this interface to have a sub-index * automatically generated on the plugin's behalf. */ +@Deprecated public interface PluginIdentifiableCommand { /** @@ -15,5 +16,6 @@ public interface PluginIdentifiableCommand { * * @return Plugin that owns this PluginIdentifiableCommand. */ + @Deprecated public Plugin getPlugin(); } diff --git a/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java b/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java index dc3bc1d..a5a1cd8 100644 --- a/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java +++ b/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java @@ -1,4 +1,5 @@ package org.bukkit.command; +@Deprecated public interface RemoteConsoleCommandSender extends CommandSender { } diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java index d75380c..25a53f5 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -17,16 +17,22 @@ import org.bukkit.command.defaults.*; import org.bukkit.entity.Player; import org.bukkit.util.StringUtil; +@Deprecated public class SimpleCommandMap implements CommandMap { + @Deprecated private static final Pattern PATTERN_ON_SPACE = Pattern.compile(" ", Pattern.LITERAL); + @Deprecated protected final Map knownCommands = new HashMap(); + @Deprecated private final Server server; + @Deprecated public SimpleCommandMap(final Server server) { this.server = server; setDefaultCommands(); } + @Deprecated private void setDefaultCommands() { register("bukkit", new SaveCommand()); register("bukkit", new SaveOnCommand()); @@ -38,6 +44,7 @@ public class SimpleCommandMap implements CommandMap { register("bukkit", new TimingsCommand("timings")); } + @Deprecated public void setFallbackCommands() { register("bukkit", new ListCommand()); register("bukkit", new OpCommand()); @@ -81,6 +88,7 @@ public class SimpleCommandMap implements CommandMap { /** * {@inheritDoc} */ + @Deprecated public void registerAll(String fallbackPrefix, List commands) { if (commands != null) { for (Command c : commands) { @@ -92,6 +100,7 @@ public class SimpleCommandMap implements CommandMap { /** * {@inheritDoc} */ + @Deprecated public boolean register(String fallbackPrefix, Command command) { return register(command.getName(), fallbackPrefix, command); } @@ -99,6 +108,7 @@ public class SimpleCommandMap implements CommandMap { /** * {@inheritDoc} */ + @Deprecated public boolean register(String label, String fallbackPrefix, Command command) { label = label.toLowerCase().trim(); fallbackPrefix = fallbackPrefix.toLowerCase().trim(); @@ -133,6 +143,7 @@ public class SimpleCommandMap implements CommandMap { * unique address * @return true if command was registered, false otherwise. */ + @Deprecated private synchronized boolean register(String label, Command command, boolean isAlias, String fallbackPrefix) { knownCommands.put(fallbackPrefix + ":" + label, command); if ((command instanceof VanillaCommand || isAlias) && knownCommands.containsKey(label)) { @@ -161,6 +172,7 @@ public class SimpleCommandMap implements CommandMap { /** * {@inheritDoc} */ + @Deprecated public boolean dispatch(CommandSender sender, String commandLine) throws CommandException { String[] args = PATTERN_ON_SPACE.split(commandLine); @@ -188,6 +200,7 @@ public class SimpleCommandMap implements CommandMap { return true; } + @Deprecated public synchronized void clearCommands() { for (Map.Entry entry : knownCommands.entrySet()) { entry.getValue().unregister(this); @@ -196,11 +209,13 @@ public class SimpleCommandMap implements CommandMap { setDefaultCommands(); } + @Deprecated public Command getCommand(String name) { Command target = knownCommands.get(name.toLowerCase()); return target; } + @Deprecated public List tabComplete(CommandSender sender, String cmdLine) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(cmdLine, "Command line cannot null"); @@ -254,10 +269,12 @@ public class SimpleCommandMap implements CommandMap { } } + @Deprecated public Collection getCommands() { return Collections.unmodifiableCollection(knownCommands.values()); } + @Deprecated public void registerServerAliases() { Map values = server.getCommandAliases(); diff --git a/src/main/java/org/bukkit/command/TabCommandExecutor.java b/src/main/java/org/bukkit/command/TabCommandExecutor.java index d24d795..43bc1b1 100644 --- a/src/main/java/org/bukkit/command/TabCommandExecutor.java +++ b/src/main/java/org/bukkit/command/TabCommandExecutor.java @@ -11,6 +11,7 @@ import java.util.List; */ @Deprecated public interface TabCommandExecutor extends CommandExecutor { + @Deprecated public List onTabComplete(); } diff --git a/src/main/java/org/bukkit/command/TabCompleter.java b/src/main/java/org/bukkit/command/TabCompleter.java index 6d61e3a..2d47932 100644 --- a/src/main/java/org/bukkit/command/TabCompleter.java +++ b/src/main/java/org/bukkit/command/TabCompleter.java @@ -5,6 +5,7 @@ import java.util.List; /** * Represents a class which can suggest tab completions for commands. */ +@Deprecated public interface TabCompleter { /** @@ -18,5 +19,6 @@ public interface TabCompleter { * @return A List of possible completions for the final argument, or null * to default to the command executor */ + @Deprecated public List onTabComplete(CommandSender sender, Command command, String alias, String[] args); } diff --git a/src/main/java/org/bukkit/command/TabExecutor.java b/src/main/java/org/bukkit/command/TabExecutor.java index 6b8e3fb..afe0574 100644 --- a/src/main/java/org/bukkit/command/TabExecutor.java +++ b/src/main/java/org/bukkit/command/TabExecutor.java @@ -4,5 +4,6 @@ package org.bukkit.command; * This class is provided as a convenience to implement both TabCompleter and * CommandExecutor. */ +@Deprecated public interface TabExecutor extends TabCompleter, CommandExecutor { } diff --git a/src/main/java/org/bukkit/command/defaults/AchievementCommand.java b/src/main/java/org/bukkit/command/defaults/AchievementCommand.java index d490732..c417984 100644 --- a/src/main/java/org/bukkit/command/defaults/AchievementCommand.java +++ b/src/main/java/org/bukkit/command/defaults/AchievementCommand.java @@ -20,7 +20,9 @@ import org.bukkit.event.player.PlayerStatisticIncrementEvent; import com.google.common.collect.ImmutableList; +@Deprecated public class AchievementCommand extends VanillaCommand { + @Deprecated public AchievementCommand() { super("achievement"); this.description = "Gives the specified player an achievement or changes a statistic value. Use '*' to give all achievements."; @@ -29,6 +31,7 @@ public class AchievementCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -166,6 +169,7 @@ public class AchievementCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/BanCommand.java b/src/main/java/org/bukkit/command/defaults/BanCommand.java index df891b8..5a25e8a 100644 --- a/src/main/java/org/bukkit/command/defaults/BanCommand.java +++ b/src/main/java/org/bukkit/command/defaults/BanCommand.java @@ -13,7 +13,9 @@ import org.bukkit.entity.Player; import com.google.common.collect.ImmutableList; +@Deprecated public class BanCommand extends VanillaCommand { + @Deprecated public BanCommand() { super("ban"); this.description = "Prevents the specified player from using this server"; @@ -22,6 +24,7 @@ public class BanCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length == 0) { @@ -42,6 +45,7 @@ public class BanCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/BanIpCommand.java b/src/main/java/org/bukkit/command/defaults/BanIpCommand.java index 6f7c8bd..683adc8 100644 --- a/src/main/java/org/bukkit/command/defaults/BanIpCommand.java +++ b/src/main/java/org/bukkit/command/defaults/BanIpCommand.java @@ -14,9 +14,12 @@ import org.bukkit.entity.Player; import com.google.common.collect.ImmutableList; +@Deprecated public class BanIpCommand extends VanillaCommand { + @Deprecated public static final Pattern ipValidity = Pattern.compile("^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"); + @Deprecated public BanIpCommand() { super("ban-ip"); this.description = "Prevents the specified IP address from using this server"; @@ -25,6 +28,7 @@ public class BanIpCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length < 1) { @@ -50,6 +54,7 @@ public class BanIpCommand extends VanillaCommand { return true; } + @Deprecated private void processIPBan(String ip, CommandSender sender, String reason) { Bukkit.getBanList(BanList.Type.IP).addBan(ip, reason, null, sender.getName()); @@ -64,6 +69,7 @@ public class BanIpCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/BanListCommand.java b/src/main/java/org/bukkit/command/defaults/BanListCommand.java index 262a237..5f998f2 100644 --- a/src/main/java/org/bukkit/command/defaults/BanListCommand.java +++ b/src/main/java/org/bukkit/command/defaults/BanListCommand.java @@ -13,9 +13,12 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; +@Deprecated public class BanListCommand extends VanillaCommand { + @Deprecated private static final List BANLIST_TYPES = ImmutableList.of("ips", "players"); + @Deprecated public BanListCommand() { super("banlist"); this.description = "View all players banned from this server"; @@ -24,6 +27,7 @@ public class BanListCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -57,6 +61,7 @@ public class BanListCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/BukkitCommand.java b/src/main/java/org/bukkit/command/defaults/BukkitCommand.java index 23c8580..6d7e1f9 100644 --- a/src/main/java/org/bukkit/command/defaults/BukkitCommand.java +++ b/src/main/java/org/bukkit/command/defaults/BukkitCommand.java @@ -4,11 +4,14 @@ import java.util.List; import org.bukkit.command.Command; +@Deprecated public abstract class BukkitCommand extends Command { + @Deprecated protected BukkitCommand(String name) { super(name); } + @Deprecated protected BukkitCommand(String name, String description, String usageMessage, List aliases) { super(name, description, usageMessage, aliases); } diff --git a/src/main/java/org/bukkit/command/defaults/ClearCommand.java b/src/main/java/org/bukkit/command/defaults/ClearCommand.java index a9df4f9..0aaa17e 100644 --- a/src/main/java/org/bukkit/command/defaults/ClearCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ClearCommand.java @@ -14,7 +14,9 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +@Deprecated public class ClearCommand extends VanillaCommand { + @Deprecated private static List materials; static { ArrayList materialList = new ArrayList(); @@ -25,6 +27,7 @@ public class ClearCommand extends VanillaCommand { materials = ImmutableList.copyOf(materialList); } + @Deprecated public ClearCommand() { super("clear"); this.description = "Clears the player's inventory. Can specify item and data filters too."; @@ -33,6 +36,7 @@ public class ClearCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -72,6 +76,7 @@ public class ClearCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/DefaultGameModeCommand.java b/src/main/java/org/bukkit/command/defaults/DefaultGameModeCommand.java index 77ba678..3e99772 100644 --- a/src/main/java/org/bukkit/command/defaults/DefaultGameModeCommand.java +++ b/src/main/java/org/bukkit/command/defaults/DefaultGameModeCommand.java @@ -12,9 +12,12 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; +@Deprecated public class DefaultGameModeCommand extends VanillaCommand { + @Deprecated private static final List GAMEMODE_NAMES = ImmutableList.of("adventure", "creative", "survival"); + @Deprecated public DefaultGameModeCommand() { super("defaultgamemode"); this.description = "Set the default gamemode"; @@ -23,6 +26,7 @@ public class DefaultGameModeCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!testPermission(sender)) return true; if (args.length == 0) { @@ -56,6 +60,7 @@ public class DefaultGameModeCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/DeopCommand.java b/src/main/java/org/bukkit/command/defaults/DeopCommand.java index 1b71d49..0a53721 100644 --- a/src/main/java/org/bukkit/command/defaults/DeopCommand.java +++ b/src/main/java/org/bukkit/command/defaults/DeopCommand.java @@ -14,7 +14,9 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; +@Deprecated public class DeopCommand extends VanillaCommand { + @Deprecated public DeopCommand() { super("deop"); this.description = "Takes the specified player's operator status"; @@ -23,6 +25,7 @@ public class DeopCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length != 1 || args[0].length() == 0) { @@ -42,6 +45,7 @@ public class DeopCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/DifficultyCommand.java b/src/main/java/org/bukkit/command/defaults/DifficultyCommand.java index ca98559..254f3cf 100644 --- a/src/main/java/org/bukkit/command/defaults/DifficultyCommand.java +++ b/src/main/java/org/bukkit/command/defaults/DifficultyCommand.java @@ -12,9 +12,12 @@ import org.bukkit.Difficulty; import java.util.ArrayList; import java.util.List; +@Deprecated public class DifficultyCommand extends VanillaCommand { + @Deprecated private static final List DIFFICULTY_NAMES = ImmutableList.of("peaceful", "easy", "normal", "hard"); + @Deprecated public DifficultyCommand() { super("difficulty"); this.description = "Sets the game difficulty"; @@ -23,6 +26,7 @@ public class DifficultyCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length != 1 || args[0].length() == 0) { @@ -52,6 +56,7 @@ public class DifficultyCommand extends VanillaCommand { return true; } + @Deprecated protected int getDifficultyForString(CommandSender sender, String name) { if (name.equalsIgnoreCase("peaceful") || name.equalsIgnoreCase("p")) { return 0; @@ -67,6 +72,7 @@ public class DifficultyCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/EffectCommand.java b/src/main/java/org/bukkit/command/defaults/EffectCommand.java index 7d0662e..e2018bf 100644 --- a/src/main/java/org/bukkit/command/defaults/EffectCommand.java +++ b/src/main/java/org/bukkit/command/defaults/EffectCommand.java @@ -10,9 +10,12 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.StringUtil; +@Deprecated public class EffectCommand extends VanillaCommand { + @Deprecated private static final List effects; + @Deprecated public EffectCommand() { super("effect"); this.description = "Adds/Removes effects on players"; @@ -33,6 +36,7 @@ public class EffectCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!testPermission(sender)) { return true; @@ -107,6 +111,7 @@ public class EffectCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String commandLabel, String[] args) { if (args.length == 1) { return super.tabComplete(sender, commandLabel, args); diff --git a/src/main/java/org/bukkit/command/defaults/EnchantCommand.java b/src/main/java/org/bukkit/command/defaults/EnchantCommand.java index 2976649..5e950b3 100644 --- a/src/main/java/org/bukkit/command/defaults/EnchantCommand.java +++ b/src/main/java/org/bukkit/command/defaults/EnchantCommand.java @@ -19,9 +19,12 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.util.StringUtil; +@Deprecated public class EnchantCommand extends VanillaCommand { + @Deprecated private static final List ENCHANTMENT_NAMES = new ArrayList(); + @Deprecated public EnchantCommand() { super("enchant"); this.description = "Adds enchantments to the item the player is currently holding. Specify 0 for the level to remove an enchantment. Specify force to ignore normal enchantment restrictions"; @@ -30,6 +33,7 @@ public class EnchantCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!testPermission(sender)) return true; if (args.length < 2) { @@ -120,6 +124,7 @@ public class EnchantCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); @@ -142,6 +147,7 @@ public class EnchantCommand extends VanillaCommand { return ImmutableList.of(); } + @Deprecated private Enchantment getEnchantment(String lookup) { Enchantment enchantment = Enchantment.getByName(lookup); @@ -155,6 +161,7 @@ public class EnchantCommand extends VanillaCommand { return enchantment; } + @Deprecated public static void buildEnchantments() { if (!ENCHANTMENT_NAMES.isEmpty()) { throw new IllegalStateException("Enchantments have already been built!"); diff --git a/src/main/java/org/bukkit/command/defaults/ExpCommand.java b/src/main/java/org/bukkit/command/defaults/ExpCommand.java index 2749760..b273bb9 100644 --- a/src/main/java/org/bukkit/command/defaults/ExpCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ExpCommand.java @@ -11,7 +11,9 @@ import org.bukkit.entity.Player; import com.google.common.collect.ImmutableList; +@Deprecated public class ExpCommand extends VanillaCommand { + @Deprecated public ExpCommand() { super("xp"); this.description = "Gives the specified player a certain amount of experience. Specify L to give levels instead, with a negative amount resulting in taking levels."; @@ -20,6 +22,7 @@ public class ExpCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -76,6 +79,7 @@ public class ExpCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/GameModeCommand.java b/src/main/java/org/bukkit/command/defaults/GameModeCommand.java index c58f906..a12a772 100644 --- a/src/main/java/org/bukkit/command/defaults/GameModeCommand.java +++ b/src/main/java/org/bukkit/command/defaults/GameModeCommand.java @@ -14,9 +14,12 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; +@Deprecated public class GameModeCommand extends VanillaCommand { + @Deprecated private static final List GAMEMODE_NAMES = ImmutableList.of("adventure", "creative", "survival"); + @Deprecated public GameModeCommand() { super("gamemode"); this.description = "Changes the player to a specific game mode"; @@ -25,6 +28,7 @@ public class GameModeCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length == 0) { @@ -83,6 +87,7 @@ public class GameModeCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/GameRuleCommand.java b/src/main/java/org/bukkit/command/defaults/GameRuleCommand.java index 40c531b..cf5ba27 100644 --- a/src/main/java/org/bukkit/command/defaults/GameRuleCommand.java +++ b/src/main/java/org/bukkit/command/defaults/GameRuleCommand.java @@ -15,9 +15,12 @@ import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.entity.HumanEntity; +@Deprecated public class GameRuleCommand extends VanillaCommand { + @Deprecated private static final List GAMERULE_STATES = ImmutableList.of("true", "false"); + @Deprecated public GameRuleCommand() { super("gamerule"); this.description = "Sets a server's game rules"; @@ -26,6 +29,7 @@ public class GameRuleCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -56,6 +60,7 @@ public class GameRuleCommand extends VanillaCommand { } } + @Deprecated private World getGameWorld(CommandSender sender) { if (sender instanceof HumanEntity) { World world = ((HumanEntity) sender).getWorld(); @@ -70,6 +75,7 @@ public class GameRuleCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/GiveCommand.java b/src/main/java/org/bukkit/command/defaults/GiveCommand.java index 14f27be..b8ea720 100644 --- a/src/main/java/org/bukkit/command/defaults/GiveCommand.java +++ b/src/main/java/org/bukkit/command/defaults/GiveCommand.java @@ -18,7 +18,9 @@ import org.bukkit.util.StringUtil; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; +@Deprecated public class GiveCommand extends VanillaCommand { + @Deprecated private static List materials; static { ArrayList materialList = new ArrayList(); @@ -29,6 +31,7 @@ public class GiveCommand extends VanillaCommand { materials = ImmutableList.copyOf(materialList); } + @Deprecated public GiveCommand() { super("give"); this.description = "Gives the specified player a certain amount of items"; @@ -37,6 +40,7 @@ public class GiveCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if ((args.length < 2)) { @@ -92,6 +96,7 @@ public class GiveCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/HelpCommand.java b/src/main/java/org/bukkit/command/defaults/HelpCommand.java index ff73b26..13ed373 100644 --- a/src/main/java/org/bukkit/command/defaults/HelpCommand.java +++ b/src/main/java/org/bukkit/command/defaults/HelpCommand.java @@ -24,7 +24,9 @@ import org.bukkit.util.ChatPaginator; import com.google.common.collect.ImmutableList; +@Deprecated public class HelpCommand extends VanillaCommand { + @Deprecated public HelpCommand() { super("help"); this.description = "Shows the help menu"; @@ -34,6 +36,7 @@ public class HelpCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -112,6 +115,7 @@ public class HelpCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); @@ -132,6 +136,7 @@ public class HelpCommand extends VanillaCommand { return ImmutableList.of(); } + @Deprecated protected HelpTopic findPossibleMatches(String searchString) { int maxDistance = (searchString.length() / 5) + 3; Set possibleMatches = new TreeSet(HelpTopicComparator.helpTopicComparatorInstance()); @@ -172,6 +177,7 @@ public class HelpCommand extends VanillaCommand { * @return The number of substitutions, deletions, insertions, and * transpositions required to get from s1 to s2. */ + @Deprecated protected static int damerauLevenshteinDistance(String s1, String s2) { if (s1 == null && s2 == null) { return 0; diff --git a/src/main/java/org/bukkit/command/defaults/KickCommand.java b/src/main/java/org/bukkit/command/defaults/KickCommand.java index b6c3f79..29d88d9 100644 --- a/src/main/java/org/bukkit/command/defaults/KickCommand.java +++ b/src/main/java/org/bukkit/command/defaults/KickCommand.java @@ -11,7 +11,9 @@ import org.bukkit.entity.Player; import com.google.common.collect.ImmutableList; +@Deprecated public class KickCommand extends VanillaCommand { + @Deprecated public KickCommand() { super("kick"); this.description = "Removes the specified player from the server"; @@ -20,6 +22,7 @@ public class KickCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length < 1 || args[0].length() == 0) { @@ -46,6 +49,7 @@ public class KickCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/KillCommand.java b/src/main/java/org/bukkit/command/defaults/KillCommand.java index 3270db5..af009fb 100644 --- a/src/main/java/org/bukkit/command/defaults/KillCommand.java +++ b/src/main/java/org/bukkit/command/defaults/KillCommand.java @@ -10,7 +10,9 @@ import org.bukkit.event.entity.EntityDamageEvent; import com.google.common.collect.ImmutableList; +@Deprecated public class KillCommand extends VanillaCommand { + @Deprecated public KillCommand() { super("kill"); this.description = "Commits suicide, only usable as a player"; @@ -19,6 +21,7 @@ public class KillCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -40,6 +43,7 @@ public class KillCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/ListCommand.java b/src/main/java/org/bukkit/command/defaults/ListCommand.java index 80c6135..f4f86f6 100644 --- a/src/main/java/org/bukkit/command/defaults/ListCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ListCommand.java @@ -9,7 +9,9 @@ import org.bukkit.entity.Player; import com.google.common.collect.ImmutableList; +@Deprecated public class ListCommand extends VanillaCommand { + @Deprecated public ListCommand() { super("list"); this.description = "Lists all online players"; @@ -18,6 +20,7 @@ public class ListCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -43,6 +46,7 @@ public class ListCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/MeCommand.java b/src/main/java/org/bukkit/command/defaults/MeCommand.java index ddcd9ad..3cb945e 100644 --- a/src/main/java/org/bukkit/command/defaults/MeCommand.java +++ b/src/main/java/org/bukkit/command/defaults/MeCommand.java @@ -4,7 +4,9 @@ import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; +@Deprecated public class MeCommand extends VanillaCommand { + @Deprecated public MeCommand() { super("me"); this.description = "Performs the specified action in chat"; @@ -13,6 +15,7 @@ public class MeCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length < 1) { diff --git a/src/main/java/org/bukkit/command/defaults/OpCommand.java b/src/main/java/org/bukkit/command/defaults/OpCommand.java index e1f8452..781689a 100644 --- a/src/main/java/org/bukkit/command/defaults/OpCommand.java +++ b/src/main/java/org/bukkit/command/defaults/OpCommand.java @@ -15,7 +15,9 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; +@Deprecated public class OpCommand extends VanillaCommand { + @Deprecated public OpCommand() { super("op"); this.description = "Gives the specified player operator status"; @@ -24,6 +26,7 @@ public class OpCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length != 1 || args[0].length() == 0) { @@ -39,6 +42,7 @@ public class OpCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/PardonCommand.java b/src/main/java/org/bukkit/command/defaults/PardonCommand.java index 82c7a95..a529816 100644 --- a/src/main/java/org/bukkit/command/defaults/PardonCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PardonCommand.java @@ -14,7 +14,9 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; +@Deprecated public class PardonCommand extends VanillaCommand { + @Deprecated public PardonCommand() { super("pardon"); this.description = "Allows the specified player to use this server"; @@ -23,6 +25,7 @@ public class PardonCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length != 1) { @@ -36,6 +39,7 @@ public class PardonCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/PardonIpCommand.java b/src/main/java/org/bukkit/command/defaults/PardonIpCommand.java index 689a0bd..411cd02 100644 --- a/src/main/java/org/bukkit/command/defaults/PardonIpCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PardonIpCommand.java @@ -12,7 +12,9 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; +@Deprecated public class PardonIpCommand extends VanillaCommand { + @Deprecated public PardonIpCommand() { super("pardon-ip"); this.description = "Allows the specified IP address to use this server"; @@ -21,6 +23,7 @@ public class PardonIpCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length != 1) { @@ -39,6 +42,7 @@ public class PardonIpCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/PlaySoundCommand.java b/src/main/java/org/bukkit/command/defaults/PlaySoundCommand.java index 0cb5ca2..9e28416 100644 --- a/src/main/java/org/bukkit/command/defaults/PlaySoundCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PlaySoundCommand.java @@ -6,7 +6,9 @@ import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +@Deprecated public class PlaySoundCommand extends VanillaCommand { + @Deprecated public PlaySoundCommand() { super("playsound"); this.description = "Plays a sound to a given player"; @@ -15,6 +17,7 @@ public class PlaySoundCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) { return true; diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java index e21d167..6d7ff7a 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java @@ -7,7 +7,9 @@ import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.plugin.Plugin; +@Deprecated public class PluginsCommand extends BukkitCommand { + @Deprecated public PluginsCommand(String name) { super(name); this.description = "Gets a list of plugins running on the server"; @@ -17,6 +19,7 @@ public class PluginsCommand extends BukkitCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -24,6 +27,7 @@ public class PluginsCommand extends BukkitCommand { return true; } + @Deprecated private String getPluginList() { StringBuilder pluginList = new StringBuilder(); Plugin[] plugins = Bukkit.getPluginManager().getPlugins(); @@ -43,6 +47,7 @@ public class PluginsCommand extends BukkitCommand { // Spigot Start @Override + @Deprecated public java.util.List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { return java.util.Collections.emptyList(); diff --git a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java index 16dfdbd..e3c2942 100644 --- a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java @@ -7,7 +7,9 @@ import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; +@Deprecated public class ReloadCommand extends BukkitCommand { + @Deprecated public ReloadCommand(String name) { super(name); this.description = "Reloads the server configuration and plugins"; @@ -17,6 +19,7 @@ public class ReloadCommand extends BukkitCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -29,6 +32,7 @@ public class ReloadCommand extends BukkitCommand { // Spigot Start @Override + @Deprecated public java.util.List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { return java.util.Collections.emptyList(); diff --git a/src/main/java/org/bukkit/command/defaults/SaveCommand.java b/src/main/java/org/bukkit/command/defaults/SaveCommand.java index 8a44f9c..aaee41c 100644 --- a/src/main/java/org/bukkit/command/defaults/SaveCommand.java +++ b/src/main/java/org/bukkit/command/defaults/SaveCommand.java @@ -10,7 +10,9 @@ import org.bukkit.command.CommandSender; import com.google.common.collect.ImmutableList; +@Deprecated public class SaveCommand extends VanillaCommand { + @Deprecated public SaveCommand() { super("save-all"); this.description = "Saves the server to disk"; @@ -19,6 +21,7 @@ public class SaveCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -36,6 +39,7 @@ public class SaveCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/SaveOffCommand.java b/src/main/java/org/bukkit/command/defaults/SaveOffCommand.java index 1fbb3f0..83ef452 100644 --- a/src/main/java/org/bukkit/command/defaults/SaveOffCommand.java +++ b/src/main/java/org/bukkit/command/defaults/SaveOffCommand.java @@ -10,7 +10,9 @@ import org.bukkit.command.CommandSender; import com.google.common.collect.ImmutableList; +@Deprecated public class SaveOffCommand extends VanillaCommand { + @Deprecated public SaveOffCommand() { super("save-off"); this.description = "Disables server autosaving"; @@ -19,6 +21,7 @@ public class SaveOffCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -31,6 +34,7 @@ public class SaveOffCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/SaveOnCommand.java b/src/main/java/org/bukkit/command/defaults/SaveOnCommand.java index 9774f67..4680fd3 100644 --- a/src/main/java/org/bukkit/command/defaults/SaveOnCommand.java +++ b/src/main/java/org/bukkit/command/defaults/SaveOnCommand.java @@ -10,7 +10,9 @@ import org.bukkit.command.CommandSender; import com.google.common.collect.ImmutableList; +@Deprecated public class SaveOnCommand extends VanillaCommand { + @Deprecated public SaveOnCommand() { super("save-on"); this.description = "Enables server autosaving"; @@ -19,6 +21,7 @@ public class SaveOnCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -31,6 +34,7 @@ public class SaveOnCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/SayCommand.java b/src/main/java/org/bukkit/command/defaults/SayCommand.java index 658fe21..9681514 100644 --- a/src/main/java/org/bukkit/command/defaults/SayCommand.java +++ b/src/main/java/org/bukkit/command/defaults/SayCommand.java @@ -11,7 +11,9 @@ import org.bukkit.entity.Player; import com.google.common.collect.ImmutableList; +@Deprecated public class SayCommand extends VanillaCommand { + @Deprecated public SayCommand() { super("say"); this.description = "Broadcasts the given message as the sender"; @@ -20,6 +22,7 @@ public class SayCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length == 0) { @@ -50,6 +53,7 @@ public class SayCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/ScoreboardCommand.java b/src/main/java/org/bukkit/command/defaults/ScoreboardCommand.java index a805f7c..e5265ea 100644 --- a/src/main/java/org/bukkit/command/defaults/ScoreboardCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ScoreboardCommand.java @@ -26,15 +26,24 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +@Deprecated public class ScoreboardCommand extends VanillaCommand { + @Deprecated private static final List MAIN_CHOICES = ImmutableList.of("objectives", "players", "teams"); + @Deprecated private static final List OBJECTIVES_CHOICES = ImmutableList.of("list", "add", "remove", "setdisplay"); + @Deprecated private static final List OBJECTIVES_CRITERIA = ImmutableList.of("health", "playerKillCount", "totalKillCount", "deathCount", "dummy"); + @Deprecated private static final List PLAYERS_CHOICES = ImmutableList.of("set", "add", "remove", "reset", "list"); + @Deprecated private static final List TEAMS_CHOICES = ImmutableList.of("add", "remove", "join", "leave", "empty", "list", "option"); + @Deprecated private static final List TEAMS_OPTION_CHOICES = ImmutableList.of("color", "friendlyfire", "seeFriendlyInvisibles"); + @Deprecated private static final Map OBJECTIVES_DISPLAYSLOT = ImmutableMap.of("belowName", DisplaySlot.BELOW_NAME, "list", DisplaySlot.PLAYER_LIST, "sidebar", DisplaySlot.SIDEBAR); + @Deprecated private static final Map TEAMS_OPTION_COLOR = ImmutableMap.builder() .put("aqua", ChatColor.AQUA) .put("black", ChatColor.BLACK) @@ -59,8 +68,10 @@ public class ScoreboardCommand extends VanillaCommand { .put("white", ChatColor.WHITE) .put("yellow", ChatColor.YELLOW) .build(); + @Deprecated private static final List BOOLEAN = ImmutableList.of("true", "false"); + @Deprecated public ScoreboardCommand() { super("scoreboard"); this.description = "Scoreboard control"; @@ -69,6 +80,7 @@ public class ScoreboardCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -478,6 +490,7 @@ public class ScoreboardCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); @@ -561,6 +574,7 @@ public class ScoreboardCommand extends VanillaCommand { return ImmutableList.of(); } + @Deprecated private static String offlinePlayerSetToString(Set set) { StringBuilder string = new StringBuilder(); String lastValue = null; @@ -575,6 +589,7 @@ public class ScoreboardCommand extends VanillaCommand { } + @Deprecated private static String stringCollectionToString(Collection set) { StringBuilder string = new StringBuilder(); String lastValue = null; @@ -588,6 +603,7 @@ public class ScoreboardCommand extends VanillaCommand { return string.toString(); } + @Deprecated private List getCurrentObjectives() { List list = new ArrayList(); for (Objective objective : Bukkit.getScoreboardManager().getMainScoreboard().getObjectives()) { @@ -597,6 +613,7 @@ public class ScoreboardCommand extends VanillaCommand { return list; } + @Deprecated private List getCurrentPlayers() { List list = new ArrayList(); for (OfflinePlayer player : Bukkit.getScoreboardManager().getMainScoreboard().getPlayers()) { @@ -606,6 +623,7 @@ public class ScoreboardCommand extends VanillaCommand { return list; } + @Deprecated private List getCurrentTeams() { List list = new ArrayList(); for (Team team : Bukkit.getScoreboardManager().getMainScoreboard().getTeams()) { diff --git a/src/main/java/org/bukkit/command/defaults/SeedCommand.java b/src/main/java/org/bukkit/command/defaults/SeedCommand.java index b64fd40..f6efb4f 100644 --- a/src/main/java/org/bukkit/command/defaults/SeedCommand.java +++ b/src/main/java/org/bukkit/command/defaults/SeedCommand.java @@ -9,7 +9,9 @@ import org.bukkit.entity.Player; import com.google.common.collect.ImmutableList; +@Deprecated public class SeedCommand extends VanillaCommand { + @Deprecated public SeedCommand() { super("seed"); this.description = "Shows the world seed"; @@ -18,6 +20,7 @@ public class SeedCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!testPermission(sender)) return true; long seed; @@ -31,6 +34,7 @@ public class SeedCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/SetIdleTimeoutCommand.java b/src/main/java/org/bukkit/command/defaults/SetIdleTimeoutCommand.java index 6b8bb2d..71ce4bb 100644 --- a/src/main/java/org/bukkit/command/defaults/SetIdleTimeoutCommand.java +++ b/src/main/java/org/bukkit/command/defaults/SetIdleTimeoutCommand.java @@ -10,8 +10,10 @@ import org.bukkit.command.CommandSender; import java.util.List; +@Deprecated public class SetIdleTimeoutCommand extends VanillaCommand { + @Deprecated public SetIdleTimeoutCommand() { super("setidletimeout"); this.description = "Sets the server's idle timeout"; @@ -20,6 +22,7 @@ public class SetIdleTimeoutCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -43,6 +46,7 @@ public class SetIdleTimeoutCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/SetWorldSpawnCommand.java b/src/main/java/org/bukkit/command/defaults/SetWorldSpawnCommand.java index 59c5059..004cd83 100644 --- a/src/main/java/org/bukkit/command/defaults/SetWorldSpawnCommand.java +++ b/src/main/java/org/bukkit/command/defaults/SetWorldSpawnCommand.java @@ -12,8 +12,10 @@ import org.bukkit.entity.Player; import java.util.List; +@Deprecated public class SetWorldSpawnCommand extends VanillaCommand { + @Deprecated public SetWorldSpawnCommand() { super("setworldspawn"); this.description = "Sets a worlds's spawn point. If no coordinates are specified, the player's coordinates will be used."; @@ -22,6 +24,7 @@ public class SetWorldSpawnCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -69,6 +72,7 @@ public class SetWorldSpawnCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/SpawnpointCommand.java b/src/main/java/org/bukkit/command/defaults/SpawnpointCommand.java index 4214bee..582bebd 100644 --- a/src/main/java/org/bukkit/command/defaults/SpawnpointCommand.java +++ b/src/main/java/org/bukkit/command/defaults/SpawnpointCommand.java @@ -12,8 +12,10 @@ import org.bukkit.entity.Player; import java.util.List; +@Deprecated public class SpawnpointCommand extends VanillaCommand { + @Deprecated public SpawnpointCommand() { super("spawnpoint"); this.description = "Sets a player's spawn point"; @@ -22,6 +24,7 @@ public class SpawnpointCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -73,6 +76,7 @@ public class SpawnpointCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/SpreadPlayersCommand.java b/src/main/java/org/bukkit/command/defaults/SpreadPlayersCommand.java index 5297cf7..c659be3 100644 --- a/src/main/java/org/bukkit/command/defaults/SpreadPlayersCommand.java +++ b/src/main/java/org/bukkit/command/defaults/SpreadPlayersCommand.java @@ -16,9 +16,12 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.scoreboard.Team; +@Deprecated public class SpreadPlayersCommand extends VanillaCommand { + @Deprecated private static final Random random = new Random(); + @Deprecated public SpreadPlayersCommand() { super("spreadplayers"); this.description = "Spreads players around a point"; @@ -27,6 +30,7 @@ public class SpreadPlayersCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!testPermission(sender)) { return true; @@ -105,6 +109,7 @@ public class SpreadPlayersCommand extends VanillaCommand { return true; } + @Deprecated private int range(World world, double distance, double xRangeMin, double zRangeMin, double xRangeMax, double zRangeMax, Location[] locations) { boolean flag = true; double max; @@ -203,6 +208,7 @@ public class SpreadPlayersCommand extends VanillaCommand { } } + @Deprecated private double spread(World world, List list, Location[] locations, boolean teams) { double distance = 0.0D; int i = 0; @@ -241,6 +247,7 @@ public class SpreadPlayersCommand extends VanillaCommand { return distance; } + @Deprecated private int getTeams(List players) { Set teams = Sets.newHashSet(); @@ -251,6 +258,7 @@ public class SpreadPlayersCommand extends VanillaCommand { return teams.size(); } + @Deprecated private Location[] getSpreadLocations(World world, int size, double xRangeMin, double zRangeMin, double xRangeMax, double zRangeMax) { Location[] locations = new Location[size]; diff --git a/src/main/java/org/bukkit/command/defaults/StopCommand.java b/src/main/java/org/bukkit/command/defaults/StopCommand.java index be70e63..b915fec 100644 --- a/src/main/java/org/bukkit/command/defaults/StopCommand.java +++ b/src/main/java/org/bukkit/command/defaults/StopCommand.java @@ -12,7 +12,9 @@ import org.bukkit.entity.Player; import com.google.common.collect.ImmutableList; +@Deprecated public class StopCommand extends VanillaCommand { + @Deprecated public StopCommand() { super("stop"); this.description = "Stops the server with optional reason"; @@ -21,6 +23,7 @@ public class StopCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -38,6 +41,7 @@ public class StopCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/TeleportCommand.java b/src/main/java/org/bukkit/command/defaults/TeleportCommand.java index 2147d3e..ac74062 100644 --- a/src/main/java/org/bukkit/command/defaults/TeleportCommand.java +++ b/src/main/java/org/bukkit/command/defaults/TeleportCommand.java @@ -13,8 +13,10 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import com.google.common.collect.ImmutableList; +@Deprecated public class TeleportCommand extends VanillaCommand { + @Deprecated public TeleportCommand() { super("tp"); this.description = "Teleports the given player (or yourself) to another player or coordinates"; @@ -23,6 +25,7 @@ public class TeleportCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length < 1 || args.length > 4) { @@ -77,10 +80,12 @@ public class TeleportCommand extends VanillaCommand { return true; } + @Deprecated private double getCoordinate(CommandSender sender, double current, String input) { return getCoordinate(sender, current, input, MIN_COORD, MAX_COORD); } + @Deprecated private double getCoordinate(CommandSender sender, double current, String input, int min, int max) { boolean relative = input.startsWith("~"); double result = relative ? current : 0; @@ -111,6 +116,7 @@ public class TeleportCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/TellCommand.java b/src/main/java/org/bukkit/command/defaults/TellCommand.java index fc49207..de4bfd0 100644 --- a/src/main/java/org/bukkit/command/defaults/TellCommand.java +++ b/src/main/java/org/bukkit/command/defaults/TellCommand.java @@ -7,7 +7,9 @@ import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +@Deprecated public class TellCommand extends VanillaCommand { + @Deprecated public TellCommand() { super("tell"); this.description = "Sends a private message to the given player"; @@ -17,6 +19,7 @@ public class TellCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length < 2) { @@ -48,6 +51,7 @@ public class TellCommand extends VanillaCommand { // Spigot Start @Override + @Deprecated public java.util.List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { if ( args.length == 0 ) diff --git a/src/main/java/org/bukkit/command/defaults/TestForCommand.java b/src/main/java/org/bukkit/command/defaults/TestForCommand.java index a687fef..064dcd7 100644 --- a/src/main/java/org/bukkit/command/defaults/TestForCommand.java +++ b/src/main/java/org/bukkit/command/defaults/TestForCommand.java @@ -4,7 +4,9 @@ import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; +@Deprecated public class TestForCommand extends VanillaCommand { + @Deprecated public TestForCommand() { super("testfor"); this.description = "Tests whether a specifed player is online"; @@ -13,6 +15,7 @@ public class TestForCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length < 1) { @@ -26,6 +29,7 @@ public class TestForCommand extends VanillaCommand { // Spigot Start @Override + @Deprecated public java.util.List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { if ( args.length == 0 ) diff --git a/src/main/java/org/bukkit/command/defaults/TimeCommand.java b/src/main/java/org/bukkit/command/defaults/TimeCommand.java index 86083b4..9232f9a 100644 --- a/src/main/java/org/bukkit/command/defaults/TimeCommand.java +++ b/src/main/java/org/bukkit/command/defaults/TimeCommand.java @@ -13,10 +13,14 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; +@Deprecated public class TimeCommand extends VanillaCommand { + @Deprecated private static final List TABCOMPLETE_ADD_SET = ImmutableList.of("add", "set"); + @Deprecated private static final List TABCOMPLETE_DAY_NIGHT = ImmutableList.of("day", "night"); + @Deprecated public TimeCommand() { super("time"); this.description = "Changes the time on each world"; @@ -25,6 +29,7 @@ public class TimeCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (args.length < 2) { sender.sendMessage(ChatColor.RED + "Incorrect usage. Correct usage:\n" + usageMessage); @@ -73,6 +78,7 @@ public class TimeCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java index 69d629c..8f6bac7 100644 --- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java @@ -28,10 +28,14 @@ import java.net.URLEncoder; import java.util.logging.Level; // Spigot end +@Deprecated public class TimingsCommand extends BukkitCommand { + @Deprecated private static final List TIMINGS_SUBCOMMANDS = ImmutableList.of("merged", "reset", "separate"); + @Deprecated public static long timingStart = 0; // Spigot + @Deprecated public TimingsCommand(String name) { super(name); this.description = "Records timings for all plugin events"; @@ -40,6 +44,7 @@ public class TimingsCommand extends BukkitCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length < 1) { // Spigot @@ -161,6 +166,7 @@ public class TimingsCommand extends BukkitCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); @@ -173,12 +179,16 @@ public class TimingsCommand extends BukkitCommand { } // Spigot start + @Deprecated private static class PasteThread extends Thread { + @Deprecated private final CommandSender sender; + @Deprecated private final ByteArrayOutputStream bout; + @Deprecated public PasteThread(CommandSender sender, ByteArrayOutputStream bout) { super( "Timings paste thread" ); @@ -187,6 +197,7 @@ public class TimingsCommand extends BukkitCommand { } @Override + @Deprecated public void run() { try diff --git a/src/main/java/org/bukkit/command/defaults/ToggleDownfallCommand.java b/src/main/java/org/bukkit/command/defaults/ToggleDownfallCommand.java index ac78bfb..4250d67 100644 --- a/src/main/java/org/bukkit/command/defaults/ToggleDownfallCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ToggleDownfallCommand.java @@ -12,7 +12,9 @@ import org.bukkit.entity.Player; import com.google.common.collect.ImmutableList; +@Deprecated public class ToggleDownfallCommand extends VanillaCommand { + @Deprecated public ToggleDownfallCommand() { super("toggledownfall"); this.description = "Toggles rain on/off on a given world"; @@ -21,6 +23,7 @@ public class ToggleDownfallCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -46,6 +49,7 @@ public class ToggleDownfallCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/VanillaCommand.java b/src/main/java/org/bukkit/command/defaults/VanillaCommand.java index 9b13ac6..73bd7d8 100644 --- a/src/main/java/org/bukkit/command/defaults/VanillaCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VanillaCommand.java @@ -5,23 +5,28 @@ import java.util.List; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; +@Deprecated public abstract class VanillaCommand extends Command { static final int MAX_COORD = 30000000; static final int MIN_COORD_MINUS_ONE = -30000001; static final int MIN_COORD = -30000000; + @Deprecated protected VanillaCommand(String name) { super(name); } + @Deprecated protected VanillaCommand(String name, String description, String usageMessage, List aliases) { super(name, description, usageMessage, aliases); } + @Deprecated public boolean matches(String input) { return input.equalsIgnoreCase(this.getName()); } + @Deprecated protected int getInteger(CommandSender sender, String value, int min) { return getInteger(sender, value, min, Integer.MAX_VALUE); } @@ -58,6 +63,7 @@ public abstract class VanillaCommand extends Command { } } + @Deprecated public static double getRelativeDouble(double original, CommandSender sender, String input) { if (input.startsWith("~")) { double value = getDouble(sender, input.substring(1)); @@ -70,6 +76,7 @@ public abstract class VanillaCommand extends Command { } } + @Deprecated public static double getDouble(CommandSender sender, String input) { try { return Double.parseDouble(input); @@ -78,6 +85,7 @@ public abstract class VanillaCommand extends Command { } } + @Deprecated public static double getDouble(CommandSender sender, String input, double min, double max) { double result = getDouble(sender, input); diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java index 902f9d1..6e2724a 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java @@ -14,7 +14,9 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; +@Deprecated public class VersionCommand extends BukkitCommand { + @Deprecated public VersionCommand(String name) { super(name); @@ -25,6 +27,7 @@ public class VersionCommand extends BukkitCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -65,6 +68,7 @@ public class VersionCommand extends BukkitCommand { return true; } + @Deprecated private void describeToSender(Plugin plugin, CommandSender sender) { PluginDescriptionFile desc = plugin.getDescription(); sender.sendMessage(ChatColor.GREEN + desc.getName() + ChatColor.WHITE + " version " + ChatColor.GREEN + desc.getVersion()); @@ -86,6 +90,7 @@ public class VersionCommand extends BukkitCommand { } } + @Deprecated private String getAuthors(final PluginDescriptionFile desc) { StringBuilder result = new StringBuilder(); List authors = desc.getAuthors(); @@ -109,6 +114,7 @@ public class VersionCommand extends BukkitCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/WeatherCommand.java b/src/main/java/org/bukkit/command/defaults/WeatherCommand.java index a39c1b0..2871e2f 100644 --- a/src/main/java/org/bukkit/command/defaults/WeatherCommand.java +++ b/src/main/java/org/bukkit/command/defaults/WeatherCommand.java @@ -13,9 +13,12 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; +@Deprecated public class WeatherCommand extends VanillaCommand { + @Deprecated private static final List WEATHER_TYPES = ImmutableList.of("clear", "rain", "thunder"); + @Deprecated public WeatherCommand() { super("weather"); this.description = "Changes the weather"; @@ -24,6 +27,7 @@ public class WeatherCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; if (args.length == 0) { @@ -59,6 +63,7 @@ public class WeatherCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java b/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java index b3fa4f8..53a90e7 100644 --- a/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java +++ b/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java @@ -13,9 +13,12 @@ import org.bukkit.util.StringUtil; import com.google.common.collect.ImmutableList; +@Deprecated public class WhitelistCommand extends VanillaCommand { + @Deprecated private static final List WHITELIST_SUBCOMMANDS = ImmutableList.of("add", "remove", "on", "off", "list", "reload"); + @Deprecated public WhitelistCommand() { super("whitelist"); this.description = "Manages the list of players allowed to use this server"; @@ -24,6 +27,7 @@ public class WhitelistCommand extends VanillaCommand { } @Override + @Deprecated public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; @@ -84,6 +88,7 @@ public class WhitelistCommand extends VanillaCommand { return false; } + @Deprecated private boolean badPerm(CommandSender sender, String perm) { if (!sender.hasPermission("bukkit.command.whitelist." + perm)) { sender.sendMessage(ChatColor.RED + "You do not have permission to perform this action."); @@ -94,6 +99,7 @@ public class WhitelistCommand extends VanillaCommand { } @Override + @Deprecated public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); diff --git a/src/main/java/org/bukkit/configuration/Configuration.java b/src/main/java/org/bukkit/configuration/Configuration.java index 9289c21..ff2edb6 100644 --- a/src/main/java/org/bukkit/configuration/Configuration.java +++ b/src/main/java/org/bukkit/configuration/Configuration.java @@ -5,6 +5,7 @@ import java.util.Map; /** * Represents a source of configurable options and settings */ +@Deprecated public interface Configuration extends ConfigurationSection { /** * Sets the default value of the given path as provided. @@ -20,6 +21,7 @@ public interface Configuration extends ConfigurationSection { * @param value Value to set the default to. * @throws IllegalArgumentException Thrown if path is null. */ + @Deprecated public void addDefault(String path, Object value); /** @@ -32,6 +34,7 @@ public interface Configuration extends ConfigurationSection { * @param defaults A map of Path->Values to add to defaults. * @throws IllegalArgumentException Thrown if defaults is null. */ + @Deprecated public void addDefaults(Map defaults); /** @@ -49,6 +52,7 @@ public interface Configuration extends ConfigurationSection { * @param defaults A configuration holding a list of defaults to copy. * @throws IllegalArgumentException Thrown if defaults is null or this. */ + @Deprecated public void addDefaults(Configuration defaults); /** @@ -60,6 +64,7 @@ public interface Configuration extends ConfigurationSection { * @param defaults New source of default values for this configuration. * @throws IllegalArgumentException Thrown if defaults is null or this. */ + @Deprecated public void setDefaults(Configuration defaults); /** @@ -71,6 +76,7 @@ public interface Configuration extends ConfigurationSection { * * @return Configuration source for default values, or null if none exist. */ + @Deprecated public Configuration getDefaults(); /** @@ -80,5 +86,6 @@ public interface Configuration extends ConfigurationSection { * * @return Options for this configuration */ + @Deprecated public ConfigurationOptions options(); } diff --git a/src/main/java/org/bukkit/configuration/ConfigurationOptions.java b/src/main/java/org/bukkit/configuration/ConfigurationOptions.java index 2f59382..338a381 100644 --- a/src/main/java/org/bukkit/configuration/ConfigurationOptions.java +++ b/src/main/java/org/bukkit/configuration/ConfigurationOptions.java @@ -4,11 +4,16 @@ package org.bukkit.configuration; * Various settings for controlling the input and output of a {@link * Configuration} */ +@Deprecated public class ConfigurationOptions { + @Deprecated private char pathSeparator = '.'; + @Deprecated private boolean copyDefaults = false; + @Deprecated private final Configuration configuration; + @Deprecated protected ConfigurationOptions(Configuration configuration) { this.configuration = configuration; } @@ -18,6 +23,7 @@ public class ConfigurationOptions { * * @return Parent configuration */ + @Deprecated public Configuration configuration() { return configuration; } @@ -31,6 +37,7 @@ public class ConfigurationOptions { * * @return Path separator */ + @Deprecated public char pathSeparator() { return pathSeparator; } @@ -45,6 +52,7 @@ public class ConfigurationOptions { * @param value Path separator * @return This object, for chaining */ + @Deprecated public ConfigurationOptions pathSeparator(char value) { this.pathSeparator = value; return this; @@ -64,6 +72,7 @@ public class ConfigurationOptions { * * @return Whether or not defaults are directly copied */ + @Deprecated public boolean copyDefaults() { return copyDefaults; } @@ -83,6 +92,7 @@ public class ConfigurationOptions { * @param value Whether or not defaults are directly copied * @return This object, for chaining */ + @Deprecated public ConfigurationOptions copyDefaults(boolean value) { this.copyDefaults = value; return this; diff --git a/src/main/java/org/bukkit/configuration/ConfigurationSection.java b/src/main/java/org/bukkit/configuration/ConfigurationSection.java index 1bd7fb5..b11e048 100644 --- a/src/main/java/org/bukkit/configuration/ConfigurationSection.java +++ b/src/main/java/org/bukkit/configuration/ConfigurationSection.java @@ -12,6 +12,7 @@ import org.bukkit.inventory.ItemStack; /** * Represents a section of a {@link Configuration} */ +@Deprecated public interface ConfigurationSection { /** * Gets a set containing all keys in this section. @@ -27,6 +28,7 @@ public interface ConfigurationSection { * list. * @return Set of keys contained within this ConfigurationSection. */ + @Deprecated public Set getKeys(boolean deep); /** @@ -43,6 +45,7 @@ public interface ConfigurationSection { * list. * @return Map of keys and values of this section. */ + @Deprecated public Map getValues(boolean deep); /** @@ -56,6 +59,7 @@ public interface ConfigurationSection { * default or being set. * @throws IllegalArgumentException Thrown when path is null. */ + @Deprecated public boolean contains(String path); /** @@ -70,6 +74,7 @@ public interface ConfigurationSection { * having a default. * @throws IllegalArgumentException Thrown when path is null. */ + @Deprecated public boolean isSet(String path); /** @@ -87,6 +92,7 @@ public interface ConfigurationSection { * * @return Path of this section relative to its root */ + @Deprecated public String getCurrentPath(); /** @@ -98,6 +104,7 @@ public interface ConfigurationSection { * * @return Name of this section */ + @Deprecated public String getName(); /** @@ -112,6 +119,7 @@ public interface ConfigurationSection { * * @return Root configuration containing this section. */ + @Deprecated public Configuration getRoot(); /** @@ -125,6 +133,7 @@ public interface ConfigurationSection { * * @return Parent section containing this section. */ + @Deprecated public ConfigurationSection getParent(); /** @@ -137,6 +146,7 @@ public interface ConfigurationSection { * @param path Path of the Object to get. * @return Requested Object. */ + @Deprecated public Object get(String path); /** @@ -151,6 +161,7 @@ public interface ConfigurationSection { * @param def The default value to return if the path is not found. * @return Requested Object. */ + @Deprecated public Object get(String path, Object def); /** @@ -167,6 +178,7 @@ public interface ConfigurationSection { * @param path Path of the object to set. * @param value New value to set the path to. */ + @Deprecated public void set(String path, Object value); /** @@ -179,6 +191,7 @@ public interface ConfigurationSection { * @param path Path to create the section at. * @return Newly created section */ + @Deprecated public ConfigurationSection createSection(String path); /** @@ -193,6 +206,7 @@ public interface ConfigurationSection { * @param map The values to used. * @return Newly created section */ + @Deprecated public ConfigurationSection createSection(String path, Map map); // Primitives @@ -206,6 +220,7 @@ public interface ConfigurationSection { * @param path Path of the String to get. * @return Requested String. */ + @Deprecated public String getString(String path); /** @@ -221,6 +236,7 @@ public interface ConfigurationSection { * not a String. * @return Requested String. */ + @Deprecated public String getString(String path, String def); /** @@ -234,6 +250,7 @@ public interface ConfigurationSection { * @param path Path of the String to check. * @return Whether or not the specified path is a String. */ + @Deprecated public boolean isString(String path); /** @@ -246,6 +263,7 @@ public interface ConfigurationSection { * @param path Path of the int to get. * @return Requested int. */ + @Deprecated public int getInt(String path); /** @@ -260,6 +278,7 @@ public interface ConfigurationSection { * not an int. * @return Requested int. */ + @Deprecated public int getInt(String path, int def); /** @@ -273,6 +292,7 @@ public interface ConfigurationSection { * @param path Path of the int to check. * @return Whether or not the specified path is an int. */ + @Deprecated public boolean isInt(String path); /** @@ -285,6 +305,7 @@ public interface ConfigurationSection { * @param path Path of the boolean to get. * @return Requested boolean. */ + @Deprecated public boolean getBoolean(String path); /** @@ -300,6 +321,7 @@ public interface ConfigurationSection { * not a boolean. * @return Requested boolean. */ + @Deprecated public boolean getBoolean(String path, boolean def); /** @@ -313,6 +335,7 @@ public interface ConfigurationSection { * @param path Path of the boolean to check. * @return Whether or not the specified path is a boolean. */ + @Deprecated public boolean isBoolean(String path); /** @@ -325,6 +348,7 @@ public interface ConfigurationSection { * @param path Path of the double to get. * @return Requested double. */ + @Deprecated public double getDouble(String path); /** @@ -340,6 +364,7 @@ public interface ConfigurationSection { * not a double. * @return Requested double. */ + @Deprecated public double getDouble(String path, double def); /** @@ -353,6 +378,7 @@ public interface ConfigurationSection { * @param path Path of the double to check. * @return Whether or not the specified path is a double. */ + @Deprecated public boolean isDouble(String path); /** @@ -365,6 +391,7 @@ public interface ConfigurationSection { * @param path Path of the long to get. * @return Requested long. */ + @Deprecated public long getLong(String path); /** @@ -380,6 +407,7 @@ public interface ConfigurationSection { * not a long. * @return Requested long. */ + @Deprecated public long getLong(String path, long def); /** @@ -393,6 +421,7 @@ public interface ConfigurationSection { * @param path Path of the long to check. * @return Whether or not the specified path is a long. */ + @Deprecated public boolean isLong(String path); // Java @@ -406,6 +435,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List. */ + @Deprecated public List getList(String path); /** @@ -421,6 +451,7 @@ public interface ConfigurationSection { * not a List. * @return Requested List. */ + @Deprecated public List getList(String path, List def); /** @@ -434,6 +465,7 @@ public interface ConfigurationSection { * @param path Path of the List to check. * @return Whether or not the specified path is a List. */ + @Deprecated public boolean isList(String path); /** @@ -449,6 +481,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List of String. */ + @Deprecated public List getStringList(String path); /** @@ -464,6 +497,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List of Integer. */ + @Deprecated public List getIntegerList(String path); /** @@ -479,6 +513,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List of Boolean. */ + @Deprecated public List getBooleanList(String path); /** @@ -494,6 +529,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List of Double. */ + @Deprecated public List getDoubleList(String path); /** @@ -509,6 +545,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List of Float. */ + @Deprecated public List getFloatList(String path); /** @@ -524,6 +561,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List of Long. */ + @Deprecated public List getLongList(String path); /** @@ -539,6 +577,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List of Byte. */ + @Deprecated public List getByteList(String path); /** @@ -554,6 +593,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List of Character. */ + @Deprecated public List getCharacterList(String path); /** @@ -569,6 +609,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List of Short. */ + @Deprecated public List getShortList(String path); /** @@ -584,6 +625,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List of Maps. */ + @Deprecated public List> getMapList(String path); // Bukkit @@ -597,6 +639,7 @@ public interface ConfigurationSection { * @param path Path of the Vector to get. * @return Requested Vector. */ + @Deprecated public Vector getVector(String path); /** @@ -612,6 +655,7 @@ public interface ConfigurationSection { * not a Vector. * @return Requested Vector. */ + @Deprecated public Vector getVector(String path, Vector def); /** @@ -625,6 +669,7 @@ public interface ConfigurationSection { * @param path Path of the Vector to check. * @return Whether or not the specified path is a Vector. */ + @Deprecated public boolean isVector(String path); /** @@ -638,6 +683,7 @@ public interface ConfigurationSection { * @param path Path of the OfflinePlayer to get. * @return Requested OfflinePlayer. */ + @Deprecated public OfflinePlayer getOfflinePlayer(String path); /** @@ -653,6 +699,7 @@ public interface ConfigurationSection { * not an OfflinePlayer. * @return Requested OfflinePlayer. */ + @Deprecated public OfflinePlayer getOfflinePlayer(String path, OfflinePlayer def); /** @@ -666,6 +713,7 @@ public interface ConfigurationSection { * @param path Path of the OfflinePlayer to check. * @return Whether or not the specified path is an OfflinePlayer. */ + @Deprecated public boolean isOfflinePlayer(String path); /** @@ -678,6 +726,7 @@ public interface ConfigurationSection { * @param path Path of the ItemStack to get. * @return Requested ItemStack. */ + @Deprecated public ItemStack getItemStack(String path); /** @@ -693,6 +742,7 @@ public interface ConfigurationSection { * not an ItemStack. * @return Requested ItemStack. */ + @Deprecated public ItemStack getItemStack(String path, ItemStack def); /** @@ -706,6 +756,7 @@ public interface ConfigurationSection { * @param path Path of the ItemStack to check. * @return Whether or not the specified path is an ItemStack. */ + @Deprecated public boolean isItemStack(String path); /** @@ -718,6 +769,7 @@ public interface ConfigurationSection { * @param path Path of the Color to get. * @return Requested Color. */ + @Deprecated public Color getColor(String path); /** @@ -733,6 +785,7 @@ public interface ConfigurationSection { * not a Color. * @return Requested Color. */ + @Deprecated public Color getColor(String path, Color def); /** @@ -746,6 +799,7 @@ public interface ConfigurationSection { * @param path Path of the Color to check. * @return Whether or not the specified path is a Color. */ + @Deprecated public boolean isColor(String path); /** @@ -759,6 +813,7 @@ public interface ConfigurationSection { * @param path Path of the ConfigurationSection to get. * @return Requested ConfigurationSection. */ + @Deprecated public ConfigurationSection getConfigurationSection(String path); /** @@ -773,6 +828,7 @@ public interface ConfigurationSection { * @param path Path of the ConfigurationSection to check. * @return Whether or not the specified path is a ConfigurationSection. */ + @Deprecated public boolean isConfigurationSection(String path); /** @@ -785,6 +841,7 @@ public interface ConfigurationSection { * * @return Equivalent section in root configuration */ + @Deprecated public ConfigurationSection getDefaultSection(); /** @@ -805,5 +862,6 @@ public interface ConfigurationSection { * @param value Value to set the default to. * @throws IllegalArgumentException Thrown if path is null. */ + @Deprecated public void addDefault(String path, Object value); } diff --git a/src/main/java/org/bukkit/configuration/InvalidConfigurationException.java b/src/main/java/org/bukkit/configuration/InvalidConfigurationException.java index d23480e..0110ff1 100644 --- a/src/main/java/org/bukkit/configuration/InvalidConfigurationException.java +++ b/src/main/java/org/bukkit/configuration/InvalidConfigurationException.java @@ -4,12 +4,14 @@ package org.bukkit.configuration; * Exception thrown when attempting to load an invalid {@link Configuration} */ @SuppressWarnings("serial") +@Deprecated public class InvalidConfigurationException extends Exception { /** * Creates a new instance of InvalidConfigurationException without a * message or cause. */ + @Deprecated public InvalidConfigurationException() {} /** @@ -18,6 +20,7 @@ public class InvalidConfigurationException extends Exception { * * @param msg The details of the exception. */ + @Deprecated public InvalidConfigurationException(String msg) { super(msg); } @@ -28,6 +31,7 @@ public class InvalidConfigurationException extends Exception { * * @param cause The cause of the exception. */ + @Deprecated public InvalidConfigurationException(Throwable cause) { super(cause); } @@ -39,6 +43,7 @@ public class InvalidConfigurationException extends Exception { * @param cause The cause of the exception. * @param msg The details of the exception. */ + @Deprecated public InvalidConfigurationException(String msg, Throwable cause) { super(msg, cause); } diff --git a/src/main/java/org/bukkit/configuration/MemoryConfiguration.java b/src/main/java/org/bukkit/configuration/MemoryConfiguration.java index 19c27a1..ec1db16 100644 --- a/src/main/java/org/bukkit/configuration/MemoryConfiguration.java +++ b/src/main/java/org/bukkit/configuration/MemoryConfiguration.java @@ -9,13 +9,17 @@ import org.apache.commons.lang.Validate; * from any source, and stores all values in memory only. * This is useful for temporary Configurations for providing defaults. */ +@Deprecated public class MemoryConfiguration extends MemorySection implements Configuration { + @Deprecated protected Configuration defaults; + @Deprecated protected MemoryConfigurationOptions options; /** * Creates an empty {@link MemoryConfiguration} with no default values. */ + @Deprecated public MemoryConfiguration() {} /** @@ -25,11 +29,13 @@ public class MemoryConfiguration extends MemorySection implements Configuration * @param defaults Default value provider * @throws IllegalArgumentException Thrown if defaults is null */ + @Deprecated public MemoryConfiguration(Configuration defaults) { this.defaults = defaults; } @Override + @Deprecated public void addDefault(String path, Object value) { Validate.notNull(path, "Path may not be null"); @@ -40,6 +46,7 @@ public class MemoryConfiguration extends MemorySection implements Configuration defaults.set(path, value); } + @Deprecated public void addDefaults(Map defaults) { Validate.notNull(defaults, "Defaults may not be null"); @@ -48,27 +55,32 @@ public class MemoryConfiguration extends MemorySection implements Configuration } } + @Deprecated public void addDefaults(Configuration defaults) { Validate.notNull(defaults, "Defaults may not be null"); addDefaults(defaults.getValues(true)); } + @Deprecated public void setDefaults(Configuration defaults) { Validate.notNull(defaults, "Defaults may not be null"); this.defaults = defaults; } + @Deprecated public Configuration getDefaults() { return defaults; } @Override + @Deprecated public ConfigurationSection getParent() { return null; } + @Deprecated public MemoryConfigurationOptions options() { if (options == null) { options = new MemoryConfigurationOptions(this); diff --git a/src/main/java/org/bukkit/configuration/MemoryConfigurationOptions.java b/src/main/java/org/bukkit/configuration/MemoryConfigurationOptions.java index 44c046c..03f1824 100644 --- a/src/main/java/org/bukkit/configuration/MemoryConfigurationOptions.java +++ b/src/main/java/org/bukkit/configuration/MemoryConfigurationOptions.java @@ -4,23 +4,28 @@ package org.bukkit.configuration; * Various settings for controlling the input and output of a {@link * MemoryConfiguration} */ +@Deprecated public class MemoryConfigurationOptions extends ConfigurationOptions { + @Deprecated protected MemoryConfigurationOptions(MemoryConfiguration configuration) { super(configuration); } @Override + @Deprecated public MemoryConfiguration configuration() { return (MemoryConfiguration) super.configuration(); } @Override + @Deprecated public MemoryConfigurationOptions copyDefaults(boolean value) { super.copyDefaults(value); return this; } @Override + @Deprecated public MemoryConfigurationOptions pathSeparator(char value) { super.pathSeparator(value); return this; diff --git a/src/main/java/org/bukkit/configuration/MemorySection.java b/src/main/java/org/bukkit/configuration/MemorySection.java index f180bf5..836a95e 100644 --- a/src/main/java/org/bukkit/configuration/MemorySection.java +++ b/src/main/java/org/bukkit/configuration/MemorySection.java @@ -18,11 +18,17 @@ import org.bukkit.util.Vector; /** * A type of {@link ConfigurationSection} that is stored in memory. */ +@Deprecated public class MemorySection implements ConfigurationSection { + @Deprecated protected final Map map = new LinkedHashMap(); + @Deprecated private final Configuration root; + @Deprecated private final ConfigurationSection parent; + @Deprecated private final String path; + @Deprecated private final String fullPath; /** @@ -35,6 +41,7 @@ public class MemorySection implements ConfigurationSection { * @throws IllegalStateException Thrown if this is not a {@link * Configuration} root. */ + @Deprecated protected MemorySection() { if (!(this instanceof Configuration)) { throw new IllegalStateException("Cannot construct a root MemorySection when not a Configuration"); @@ -55,6 +62,7 @@ public class MemorySection implements ConfigurationSection { * @throws IllegalArgumentException Thrown is parent or path is null, or * if parent contains no root Configuration. */ + @Deprecated protected MemorySection(ConfigurationSection parent, String path) { Validate.notNull(parent, "Parent cannot be null"); Validate.notNull(path, "Path cannot be null"); @@ -68,6 +76,7 @@ public class MemorySection implements ConfigurationSection { this.fullPath = createPath(parent, path); } + @Deprecated public Set getKeys(boolean deep) { Set result = new LinkedHashSet(); @@ -85,6 +94,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public Map getValues(boolean deep) { Map result = new LinkedHashMap(); @@ -102,10 +112,12 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public boolean contains(String path) { return get(path) != null; } + @Deprecated public boolean isSet(String path) { Configuration root = getRoot(); if (root == null) { @@ -117,22 +129,27 @@ public class MemorySection implements ConfigurationSection { return get(path, null) != null; } + @Deprecated public String getCurrentPath() { return fullPath; } + @Deprecated public String getName() { return path; } + @Deprecated public Configuration getRoot() { return root; } + @Deprecated public ConfigurationSection getParent() { return parent; } + @Deprecated public void addDefault(String path, Object value) { Validate.notNull(path, "Path cannot be null"); @@ -146,6 +163,7 @@ public class MemorySection implements ConfigurationSection { root.addDefault(createPath(this, path), value); } + @Deprecated public ConfigurationSection getDefaultSection() { Configuration root = getRoot(); Configuration defaults = root == null ? null : root.getDefaults(); @@ -159,6 +177,7 @@ public class MemorySection implements ConfigurationSection { return null; } + @Deprecated public void set(String path, Object value) { Validate.notEmpty(path, "Cannot set to an empty path"); @@ -194,10 +213,12 @@ public class MemorySection implements ConfigurationSection { } } + @Deprecated public Object get(String path) { return get(path, getDefault(path)); } + @Deprecated public Object get(String path, Object def) { Validate.notNull(path, "Path cannot be null"); @@ -230,6 +251,7 @@ public class MemorySection implements ConfigurationSection { return section.get(key, def); } + @Deprecated public ConfigurationSection createSection(String path) { Validate.notEmpty(path, "Cannot create section at empty path"); Configuration root = getRoot(); @@ -261,6 +283,7 @@ public class MemorySection implements ConfigurationSection { return section.createSection(key); } + @Deprecated public ConfigurationSection createSection(String path, Map map) { ConfigurationSection section = createSection(path); @@ -276,97 +299,116 @@ public class MemorySection implements ConfigurationSection { } // Primitives + @Deprecated public String getString(String path) { Object def = getDefault(path); return getString(path, def != null ? def.toString() : null); } + @Deprecated public String getString(String path, String def) { Object val = get(path, def); return (val != null) ? val.toString() : def; } + @Deprecated public boolean isString(String path) { Object val = get(path); return val instanceof String; } + @Deprecated public int getInt(String path) { Object def = getDefault(path); return getInt(path, (def instanceof Number) ? toInt(def) : 0); } + @Deprecated public int getInt(String path, int def) { Object val = get(path, def); return (val instanceof Number) ? toInt(val) : def; } + @Deprecated public boolean isInt(String path) { Object val = get(path); return val instanceof Integer; } + @Deprecated public boolean getBoolean(String path) { Object def = getDefault(path); return getBoolean(path, (def instanceof Boolean) ? (Boolean) def : false); } + @Deprecated public boolean getBoolean(String path, boolean def) { Object val = get(path, def); return (val instanceof Boolean) ? (Boolean) val : def; } + @Deprecated public boolean isBoolean(String path) { Object val = get(path); return val instanceof Boolean; } + @Deprecated public double getDouble(String path) { Object def = getDefault(path); return getDouble(path, (def instanceof Number) ? toDouble(def) : 0); } + @Deprecated public double getDouble(String path, double def) { Object val = get(path, def); return (val instanceof Number) ? toDouble(val) : def; } + @Deprecated public boolean isDouble(String path) { Object val = get(path); return val instanceof Double; } + @Deprecated public long getLong(String path) { Object def = getDefault(path); return getLong(path, (def instanceof Number) ? toLong(def) : 0); } + @Deprecated public long getLong(String path, long def) { Object val = get(path, def); return (val instanceof Number) ? toLong(val) : def; } + @Deprecated public boolean isLong(String path) { Object val = get(path); return val instanceof Long; } // Java + @Deprecated public List getList(String path) { Object def = getDefault(path); return getList(path, (def instanceof List) ? (List) def : null); } + @Deprecated public List getList(String path, List def) { Object val = get(path, def); return (List) ((val instanceof List) ? val : def); } + @Deprecated public boolean isList(String path) { Object val = get(path); return val instanceof List; } + @Deprecated public List getStringList(String path) { List list = getList(path); @@ -385,6 +427,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public List getIntegerList(String path) { List list = getList(path); @@ -412,6 +455,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public List getBooleanList(String path) { List list = getList(path); @@ -436,6 +480,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public List getDoubleList(String path) { List list = getList(path); @@ -463,6 +508,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public List getFloatList(String path) { List list = getList(path); @@ -490,6 +536,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public List getLongList(String path) { List list = getList(path); @@ -517,6 +564,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public List getByteList(String path) { List list = getList(path); @@ -544,6 +592,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public List getCharacterList(String path) { List list = getList(path); @@ -570,6 +619,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public List getShortList(String path) { List list = getList(path); @@ -597,6 +647,7 @@ public class MemorySection implements ConfigurationSection { return result; } + @Deprecated public List> getMapList(String path) { List list = getList(path); List> result = new ArrayList>(); @@ -615,66 +666,79 @@ public class MemorySection implements ConfigurationSection { } // Bukkit + @Deprecated public Vector getVector(String path) { Object def = getDefault(path); return getVector(path, (def instanceof Vector) ? (Vector) def : null); } + @Deprecated public Vector getVector(String path, Vector def) { Object val = get(path, def); return (val instanceof Vector) ? (Vector) val : def; } + @Deprecated public boolean isVector(String path) { Object val = get(path); return val instanceof Vector; } + @Deprecated public OfflinePlayer getOfflinePlayer(String path) { Object def = getDefault(path); return getOfflinePlayer(path, (def instanceof OfflinePlayer) ? (OfflinePlayer) def : null); } + @Deprecated public OfflinePlayer getOfflinePlayer(String path, OfflinePlayer def) { Object val = get(path, def); return (val instanceof OfflinePlayer) ? (OfflinePlayer) val : def; } + @Deprecated public boolean isOfflinePlayer(String path) { Object val = get(path); return val instanceof OfflinePlayer; } + @Deprecated public ItemStack getItemStack(String path) { Object def = getDefault(path); return getItemStack(path, (def instanceof ItemStack) ? (ItemStack) def : null); } + @Deprecated public ItemStack getItemStack(String path, ItemStack def) { Object val = get(path, def); return (val instanceof ItemStack) ? (ItemStack) val : def; } + @Deprecated public boolean isItemStack(String path) { Object val = get(path); return val instanceof ItemStack; } + @Deprecated public Color getColor(String path) { Object def = getDefault(path); return getColor(path, (def instanceof Color) ? (Color) def : null); } + @Deprecated public Color getColor(String path, Color def) { Object val = get(path, def); return (val instanceof Color) ? (Color) val : def; } + @Deprecated public boolean isColor(String path) { Object val = get(path); return val instanceof Color; } + @Deprecated public ConfigurationSection getConfigurationSection(String path) { Object val = get(path, null); if (val != null) { @@ -685,11 +749,13 @@ public class MemorySection implements ConfigurationSection { return (val instanceof ConfigurationSection) ? createSection(path) : null; } + @Deprecated public boolean isConfigurationSection(String path) { Object val = get(path); return val instanceof ConfigurationSection; } + @Deprecated protected boolean isPrimitiveWrapper(Object input) { return input instanceof Integer || input instanceof Boolean || input instanceof Character || input instanceof Byte || @@ -697,6 +763,7 @@ public class MemorySection implements ConfigurationSection { input instanceof Long || input instanceof Float; } + @Deprecated protected Object getDefault(String path) { Validate.notNull(path, "Path cannot be null"); @@ -705,6 +772,7 @@ public class MemorySection implements ConfigurationSection { return (defaults == null) ? null : defaults.get(createPath(this, path)); } + @Deprecated protected void mapChildrenKeys(Set output, ConfigurationSection section, boolean deep) { if (section instanceof MemorySection) { MemorySection sec = (MemorySection) section; @@ -726,6 +794,7 @@ public class MemorySection implements ConfigurationSection { } } + @Deprecated protected void mapChildrenValues(Map output, ConfigurationSection section, boolean deep) { if (section instanceof MemorySection) { MemorySection sec = (MemorySection) section; @@ -759,6 +828,7 @@ public class MemorySection implements ConfigurationSection { * @param key Name of the specified section. * @return Full path of the section from its root. */ + @Deprecated public static String createPath(ConfigurationSection section, String key) { return createPath(section, key, (section == null) ? null : section.getRoot()); } @@ -775,6 +845,7 @@ public class MemorySection implements ConfigurationSection { * @param relativeTo Section to create the path relative to. * @return Full path of the section from its root. */ + @Deprecated public static String createPath(ConfigurationSection section, String key, ConfigurationSection relativeTo) { Validate.notNull(section, "Cannot create path without a section"); Configuration root = section.getRoot(); @@ -806,6 +877,7 @@ public class MemorySection implements ConfigurationSection { } @Override + @Deprecated public String toString() { Configuration root = getRoot(); return new StringBuilder() diff --git a/src/main/java/org/bukkit/configuration/file/FileConfiguration.java b/src/main/java/org/bukkit/configuration/file/FileConfiguration.java index 3f9992e..078e71e 100644 --- a/src/main/java/org/bukkit/configuration/file/FileConfiguration.java +++ b/src/main/java/org/bukkit/configuration/file/FileConfiguration.java @@ -19,10 +19,12 @@ import org.bukkit.configuration.MemoryConfiguration; * This is a base class for all File based implementations of {@link * Configuration} */ +@Deprecated public abstract class FileConfiguration extends MemoryConfiguration { /** * Creates an empty {@link FileConfiguration} with no default values. */ + @Deprecated public FileConfiguration() { super(); } @@ -33,6 +35,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { * * @param defaults Default value provider */ + @Deprecated public FileConfiguration(Configuration defaults) { super(defaults); } @@ -49,6 +52,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { * any reason. * @throws IllegalArgumentException Thrown when file is null. */ + @Deprecated public void save(File file) throws IOException { Validate.notNull(file, "File cannot be null"); @@ -77,6 +81,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { * any reason. * @throws IllegalArgumentException Thrown when file is null. */ + @Deprecated public void save(String file) throws IOException { Validate.notNull(file, "File cannot be null"); @@ -88,6 +93,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { * * @return String containing this configuration. */ + @Deprecated public abstract String saveToString(); /** @@ -108,6 +114,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { * a valid Configuration. * @throws IllegalArgumentException Thrown when file is null. */ + @Deprecated public void load(File file) throws FileNotFoundException, IOException, InvalidConfigurationException { Validate.notNull(file, "File cannot be null"); @@ -127,6 +134,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { * a valid Configuration. * @throws IllegalArgumentException Thrown when stream is null. */ + @Deprecated public void load(InputStream stream) throws IOException, InvalidConfigurationException { Validate.notNull(stream, "Stream cannot be null"); @@ -167,6 +175,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { * a valid Configuration. * @throws IllegalArgumentException Thrown when file is null. */ + @Deprecated public void load(String file) throws FileNotFoundException, IOException, InvalidConfigurationException { Validate.notNull(file, "File cannot be null"); @@ -188,6 +197,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { * invalid. * @throws IllegalArgumentException Thrown if contents is null. */ + @Deprecated public abstract void loadFromString(String contents) throws InvalidConfigurationException; /** @@ -200,9 +210,11 @@ public abstract class FileConfiguration extends MemoryConfiguration { * * @return Compiled header */ + @Deprecated protected abstract String buildHeader(); @Override + @Deprecated public FileConfigurationOptions options() { if (options == null) { options = new FileConfigurationOptions(this); diff --git a/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java b/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java index ccf81e0..617e00b 100644 --- a/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java +++ b/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java @@ -6,26 +6,33 @@ import org.bukkit.configuration.*; * Various settings for controlling the input and output of a {@link * FileConfiguration} */ +@Deprecated public class FileConfigurationOptions extends MemoryConfigurationOptions { + @Deprecated private String header = null; + @Deprecated private boolean copyHeader = true; + @Deprecated protected FileConfigurationOptions(MemoryConfiguration configuration) { super(configuration); } @Override + @Deprecated public FileConfiguration configuration() { return (FileConfiguration) super.configuration(); } @Override + @Deprecated public FileConfigurationOptions copyDefaults(boolean value) { super.copyDefaults(value); return this; } @Override + @Deprecated public FileConfigurationOptions pathSeparator(char value) { super.pathSeparator(value); return this; @@ -45,6 +52,7 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions { * * @return Header */ + @Deprecated public String header() { return header; } @@ -64,6 +72,7 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions { * @param value New header * @return This object, for chaining */ + @Deprecated public FileConfigurationOptions header(String value) { this.header = value; return this; @@ -87,6 +96,7 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions { * * @return Whether or not to copy the header */ + @Deprecated public boolean copyHeader() { return copyHeader; } @@ -110,6 +120,7 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions { * @param value Whether or not to copy the header * @return This object, for chaining */ + @Deprecated public FileConfigurationOptions copyHeader(boolean value) { copyHeader = value; diff --git a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java index 18be0dc..1ff55bd 100644 --- a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java +++ b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java @@ -21,14 +21,21 @@ import org.yaml.snakeyaml.representer.Representer; * An implementation of {@link Configuration} which saves all files in Yaml. * Note that this implementation is not synchronized. */ +@Deprecated public class YamlConfiguration extends FileConfiguration { + @Deprecated protected static final String COMMENT_PREFIX = "# "; + @Deprecated protected static final String BLANK_CONFIG = "{}\n"; + @Deprecated private final DumperOptions yamlOptions = new DumperOptions(); + @Deprecated private final Representer yamlRepresenter = new YamlRepresenter(); + @Deprecated private final Yaml yaml = new Yaml(new YamlConstructor(), yamlRepresenter, yamlOptions); @Override + @Deprecated public String saveToString() { yamlOptions.setIndent(options().indent()); yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); @@ -45,6 +52,7 @@ public class YamlConfiguration extends FileConfiguration { } @Override + @Deprecated public void loadFromString(String contents) throws InvalidConfigurationException { Validate.notNull(contents, "Contents cannot be null"); @@ -67,6 +75,7 @@ public class YamlConfiguration extends FileConfiguration { } } + @Deprecated protected void convertMapsToSections(Map input, ConfigurationSection section) { for (Map.Entry entry : input.entrySet()) { String key = entry.getKey().toString(); @@ -80,6 +89,7 @@ public class YamlConfiguration extends FileConfiguration { } } + @Deprecated protected String parseHeader(String input) { String[] lines = input.split("\r?\n", -1); StringBuilder result = new StringBuilder(); @@ -110,6 +120,7 @@ public class YamlConfiguration extends FileConfiguration { } @Override + @Deprecated protected String buildHeader() { String header = options().header(); @@ -148,6 +159,7 @@ public class YamlConfiguration extends FileConfiguration { } @Override + @Deprecated public YamlConfigurationOptions options() { if (options == null) { options = new YamlConfigurationOptions(this); @@ -167,6 +179,7 @@ public class YamlConfiguration extends FileConfiguration { * @return Resulting configuration * @throws IllegalArgumentException Thrown if file is null */ + @Deprecated public static YamlConfiguration loadConfiguration(File file) { Validate.notNull(file, "File cannot be null"); @@ -195,6 +208,7 @@ public class YamlConfiguration extends FileConfiguration { * @return Resulting configuration * @throws IllegalArgumentException Thrown if stream is null */ + @Deprecated public static YamlConfiguration loadConfiguration(InputStream stream) { Validate.notNull(stream, "Stream cannot be null"); diff --git a/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java b/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java index 57894e3..065a1e0 100644 --- a/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java +++ b/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java @@ -6,37 +6,45 @@ import org.apache.commons.lang.Validate; * Various settings for controlling the input and output of a {@link * YamlConfiguration} */ +@Deprecated public class YamlConfigurationOptions extends FileConfigurationOptions { + @Deprecated private int indent = 2; + @Deprecated protected YamlConfigurationOptions(YamlConfiguration configuration) { super(configuration); } @Override + @Deprecated public YamlConfiguration configuration() { return (YamlConfiguration) super.configuration(); } @Override + @Deprecated public YamlConfigurationOptions copyDefaults(boolean value) { super.copyDefaults(value); return this; } @Override + @Deprecated public YamlConfigurationOptions pathSeparator(char value) { super.pathSeparator(value); return this; } @Override + @Deprecated public YamlConfigurationOptions header(String value) { super.header(value); return this; } @Override + @Deprecated public YamlConfigurationOptions copyHeader(boolean value) { super.copyHeader(value); return this; @@ -49,6 +57,7 @@ public class YamlConfigurationOptions extends FileConfigurationOptions { * * @return How much to indent by */ + @Deprecated public int indent() { return indent; } @@ -61,6 +70,7 @@ public class YamlConfigurationOptions extends FileConfigurationOptions { * @param value New indent * @return This object, for chaining */ + @Deprecated public YamlConfigurationOptions indent(int value) { Validate.isTrue(value >= 2, "Indent must be at least 2 characters"); Validate.isTrue(value <= 9, "Indent cannot be greater than 9 characters"); diff --git a/src/main/java/org/bukkit/configuration/file/YamlConstructor.java b/src/main/java/org/bukkit/configuration/file/YamlConstructor.java index 73ad722..a0752f6 100644 --- a/src/main/java/org/bukkit/configuration/file/YamlConstructor.java +++ b/src/main/java/org/bukkit/configuration/file/YamlConstructor.java @@ -10,14 +10,18 @@ import org.yaml.snakeyaml.nodes.Tag; import org.bukkit.configuration.serialization.ConfigurationSerialization; +@Deprecated public class YamlConstructor extends SafeConstructor { + @Deprecated public YamlConstructor() { this.yamlConstructors.put(Tag.MAP, new ConstructCustomObject()); } + @Deprecated private class ConstructCustomObject extends ConstructYamlMap { @Override + @Deprecated public Object construct(Node node) { if (node.isTwoStepsConstruction()) { throw new YAMLException("Unexpected referential mapping structure. Node: " + node); @@ -42,6 +46,7 @@ public class YamlConstructor extends SafeConstructor { } @Override + @Deprecated public void construct2ndStep(Node node, Object object) { throw new YAMLException("Unexpected referential mapping structure. Node: " + node); } diff --git a/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java b/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java index bc9c098..a808882 100644 --- a/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java +++ b/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java @@ -10,22 +10,28 @@ import org.bukkit.configuration.serialization.ConfigurationSerialization; import org.yaml.snakeyaml.nodes.Node; import org.yaml.snakeyaml.representer.Representer; +@Deprecated public class YamlRepresenter extends Representer { + @Deprecated public YamlRepresenter() { this.multiRepresenters.put(ConfigurationSection.class, new RepresentConfigurationSection()); this.multiRepresenters.put(ConfigurationSerializable.class, new RepresentConfigurationSerializable()); } + @Deprecated private class RepresentConfigurationSection extends RepresentMap { @Override + @Deprecated public Node representData(Object data) { return super.representData(((ConfigurationSection) data).getValues(false)); } } + @Deprecated private class RepresentConfigurationSerializable extends RepresentMap { @Override + @Deprecated public Node representData(Object data) { ConfigurationSerializable serializable = (ConfigurationSerializable) data; Map values = new LinkedHashMap(); diff --git a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java index ba3c8c4..aab85ab 100644 --- a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java +++ b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java @@ -21,6 +21,7 @@ import java.util.Map; * @see DelegateDeserialization * @see SerializableAs */ +@Deprecated public interface ConfigurationSerializable { /** @@ -31,5 +32,6 @@ public interface ConfigurationSerializable { * * @return Map containing the current state of this class */ + @Deprecated public Map serialize(); } diff --git a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java index 96a806f..a4aae5e 100644 --- a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java +++ b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java @@ -21,9 +21,13 @@ import org.bukkit.util.Vector; /** * Utility class for storing and retrieving classes for {@link Configuration}. */ +@Deprecated public class ConfigurationSerialization { + @Deprecated public static final String SERIALIZED_TYPE_KEY = "=="; + @Deprecated private final Class clazz; + @Deprecated private static Map> aliases = new HashMap>(); static { @@ -35,10 +39,12 @@ public class ConfigurationSerialization { registerClass(FireworkEffect.class); } + @Deprecated protected ConfigurationSerialization(Class clazz) { this.clazz = clazz; } + @Deprecated protected Method getMethod(String name, boolean isStatic) { try { Method method = clazz.getDeclaredMethod(name, Map.class); @@ -58,6 +64,7 @@ public class ConfigurationSerialization { } } + @Deprecated protected Constructor getConstructor() { try { return clazz.getConstructor(Map.class); @@ -68,6 +75,7 @@ public class ConfigurationSerialization { } } + @Deprecated protected ConfigurationSerializable deserializeViaMethod(Method method, Map args) { try { ConfigurationSerializable result = (ConfigurationSerializable) method.invoke(null, args); @@ -87,6 +95,7 @@ public class ConfigurationSerialization { return null; } + @Deprecated protected ConfigurationSerializable deserializeViaCtor(Constructor ctor, Map args) { try { return ctor.newInstance(args); @@ -100,6 +109,7 @@ public class ConfigurationSerialization { return null; } + @Deprecated public ConfigurationSerializable deserialize(Map args) { Validate.notNull(args, "Args must not be null"); @@ -148,6 +158,7 @@ public class ConfigurationSerialization { * @param clazz Class to deserialize into * @return New instance of the specified class */ + @Deprecated public static ConfigurationSerializable deserializeObject(Map args, Class clazz) { return new ConfigurationSerialization(clazz).deserialize(args); } @@ -166,6 +177,7 @@ public class ConfigurationSerialization { * @param args Arguments for deserialization * @return New instance of the specified class */ + @Deprecated public static ConfigurationSerializable deserializeObject(Map args) { Class clazz = null; @@ -197,6 +209,7 @@ public class ConfigurationSerialization { * * @param clazz Class to register */ + @Deprecated public static void registerClass(Class clazz) { DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); @@ -214,6 +227,7 @@ public class ConfigurationSerialization { * @param alias Alias to register as * @see SerializableAs */ + @Deprecated public static void registerClass(Class clazz, String alias) { aliases.put(alias, clazz); } @@ -223,6 +237,7 @@ public class ConfigurationSerialization { * * @param alias Alias to unregister */ + @Deprecated public static void unregisterClass(String alias) { aliases.remove(alias); } @@ -233,6 +248,7 @@ public class ConfigurationSerialization { * * @param clazz Class to unregister */ + @Deprecated public static void unregisterClass(Class clazz) { while (aliases.values().remove(clazz)) { ; @@ -246,6 +262,7 @@ public class ConfigurationSerialization { * @param alias Alias of the serializable * @return Registered class, or null if not found */ + @Deprecated public static Class getClassByAlias(String alias) { return aliases.get(alias); } @@ -257,6 +274,7 @@ public class ConfigurationSerialization { * @param clazz Class to get alias for * @return Alias to use for the class */ + @Deprecated public static String getAlias(Class clazz) { DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); diff --git a/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java b/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java index 1cfae94..119e6e0 100644 --- a/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java +++ b/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java @@ -11,6 +11,7 @@ import java.lang.annotation.Target; */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) +@Deprecated public @interface DelegateDeserialization { /** * Which class should be used as a delegate for this classes @@ -18,5 +19,6 @@ public @interface DelegateDeserialization { * * @return Delegate class */ + @Deprecated public Class value(); } diff --git a/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java b/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java index c5ee998..e9c1a28 100644 --- a/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java +++ b/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java @@ -21,6 +21,7 @@ import java.lang.annotation.Target; */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) +@Deprecated public @interface SerializableAs { /** * This is the name your class will be stored and retrieved as. @@ -30,5 +31,6 @@ public @interface SerializableAs { * * @return Name to serialize the class as. */ + @Deprecated public String value(); } diff --git a/src/main/java/org/bukkit/conversations/BooleanPrompt.java b/src/main/java/org/bukkit/conversations/BooleanPrompt.java index 81ef78c..6a02745 100644 --- a/src/main/java/org/bukkit/conversations/BooleanPrompt.java +++ b/src/main/java/org/bukkit/conversations/BooleanPrompt.java @@ -7,19 +7,23 @@ import org.apache.commons.lang.BooleanUtils; * BooleanPrompt is the base class for any prompt that requires a boolean * response from the user. */ +@Deprecated public abstract class BooleanPrompt extends ValidatingPrompt{ + @Deprecated public BooleanPrompt() { super(); } @Override + @Deprecated protected boolean isInputValid(ConversationContext context, String input) { String[] accepted = {"true", "false", "on", "off", "yes", "no" /* Spigot: */, "y", "n", "1", "0", "right", "wrong", "correct", "incorrect", "valid", "invalid"}; // Spigot return ArrayUtils.contains(accepted, input.toLowerCase()); } @Override + @Deprecated protected Prompt acceptValidatedInput(ConversationContext context, String input) { if (input.equalsIgnoreCase("y") || input.equals("1") || input.equalsIgnoreCase("right") || input.equalsIgnoreCase("correct") || input.equalsIgnoreCase("valid")) input = "true"; // Spigot return acceptValidatedInput(context, BooleanUtils.toBoolean(input)); @@ -33,5 +37,6 @@ public abstract class BooleanPrompt extends ValidatingPrompt{ * @param input The user's boolean response. * @return The next {@link Prompt} in the prompt graph. */ + @Deprecated protected abstract Prompt acceptValidatedInput(ConversationContext context, boolean input); } diff --git a/src/main/java/org/bukkit/conversations/Conversable.java b/src/main/java/org/bukkit/conversations/Conversable.java index 55674b5..5b3881c 100644 --- a/src/main/java/org/bukkit/conversations/Conversable.java +++ b/src/main/java/org/bukkit/conversations/Conversable.java @@ -6,6 +6,7 @@ import org.bukkit.command.CommandSender; * The Conversable interface is used to indicate objects that can have * conversations. */ +@Deprecated public interface Conversable { /** @@ -14,6 +15,7 @@ public interface Conversable { * * @return True if a conversation is in progress */ + @Deprecated public boolean isConversing(); /** @@ -22,6 +24,7 @@ public interface Conversable { * * @param input The input message into the conversation */ + @Deprecated public void acceptConversationInput(String input); /** @@ -31,6 +34,7 @@ public interface Conversable { * @return True if the conversation should proceed, false if it has been * enqueued */ + @Deprecated public boolean beginConversation(Conversation conversation); /** @@ -38,6 +42,7 @@ public interface Conversable { * * @param conversation The conversation to abandon */ + @Deprecated public void abandonConversation(Conversation conversation); /** @@ -46,6 +51,7 @@ public interface Conversable { * @param conversation The conversation to abandon * @param details Details about why the conversation was abandoned */ + @Deprecated public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details); /** @@ -53,5 +59,6 @@ public interface Conversable { * * @param message Message to be displayed */ + @Deprecated public void sendRawMessage(String message); } diff --git a/src/main/java/org/bukkit/conversations/Conversation.java b/src/main/java/org/bukkit/conversations/Conversation.java index 46912c8..69d47d6 100644 --- a/src/main/java/org/bukkit/conversations/Conversation.java +++ b/src/main/java/org/bukkit/conversations/Conversation.java @@ -32,16 +32,26 @@ import java.util.Map; * You should not construct a conversation manually. Instead, use the {@link * ConversationFactory} for access to all available options. */ +@Deprecated public class Conversation { + @Deprecated private Prompt firstPrompt; + @Deprecated private boolean abandoned; + @Deprecated protected Prompt currentPrompt; + @Deprecated protected ConversationContext context; + @Deprecated protected boolean modal; + @Deprecated protected boolean localEchoEnabled; + @Deprecated protected ConversationPrefix prefix; + @Deprecated protected List cancellers; + @Deprecated protected List abandonedListeners; /** @@ -51,6 +61,7 @@ public class Conversation { * @param forWhom The entity for whom this conversation is mediating. * @param firstPrompt The first prompt in the conversation graph. */ + @Deprecated public Conversation(Plugin plugin, Conversable forWhom, Prompt firstPrompt) { this(plugin, forWhom, firstPrompt, new HashMap()); } @@ -64,6 +75,7 @@ public class Conversation { * @param initialSessionData Any initial values to put in the conversation * context sessionData map. */ + @Deprecated public Conversation(Plugin plugin, Conversable forWhom, Prompt firstPrompt, Map initialSessionData) { this.firstPrompt = firstPrompt; this.context = new ConversationContext(plugin, forWhom, initialSessionData); @@ -79,6 +91,7 @@ public class Conversation { * * @return The entity. */ + @Deprecated public Conversable getForWhom() { return context.getForWhom(); } @@ -90,6 +103,7 @@ public class Conversation { * * @return The conversation modality. */ + @Deprecated public boolean isModal() { return modal; } @@ -112,6 +126,7 @@ public class Conversation { * * @return The status of local echo. */ + @Deprecated public boolean isLocalEchoEnabled() { return localEchoEnabled; } @@ -123,6 +138,7 @@ public class Conversation { * * @param localEchoEnabled The status of local echo. */ + @Deprecated public void setLocalEchoEnabled(boolean localEchoEnabled) { this.localEchoEnabled = localEchoEnabled; } @@ -133,6 +149,7 @@ public class Conversation { * * @return The ConversationPrefix in use. */ + @Deprecated public ConversationPrefix getPrefix() { return prefix; } @@ -162,6 +179,7 @@ public class Conversation { * * @return The list. */ + @Deprecated public List getCancellers() { return cancellers; } @@ -171,6 +189,7 @@ public class Conversation { * * @return The ConversationContext. */ + @Deprecated public ConversationContext getContext() { return context; } @@ -179,6 +198,7 @@ public class Conversation { * Displays the first prompt of this conversation and begins redirecting * the user's chat responses. */ + @Deprecated public void begin() { if (currentPrompt == null) { abandoned = false; @@ -192,6 +212,7 @@ public class Conversation { * * @return The current state of the conversation. */ + @Deprecated public ConversationState getState() { if (currentPrompt != null) { return ConversationState.STARTED; @@ -208,6 +229,7 @@ public class Conversation { * * @param input The user's chat text. */ + @Deprecated public void acceptInput(String input) { try { // Spigot if (currentPrompt != null) { @@ -242,6 +264,7 @@ public class Conversation { * * @param listener The listener to add. */ + @Deprecated public synchronized void addConversationAbandonedListener(ConversationAbandonedListener listener) { abandonedListeners.add(listener); } @@ -251,6 +274,7 @@ public class Conversation { * * @param listener The listener to remove. */ + @Deprecated public synchronized void removeConversationAbandonedListener(ConversationAbandonedListener listener) { abandonedListeners.remove(listener); } @@ -259,6 +283,7 @@ public class Conversation { * Abandons and resets the current conversation. Restores the user's * normal chat behavior. */ + @Deprecated public void abandon() { abandon(new ConversationAbandonedEvent(this, new ManuallyAbandonedConversationCanceller())); } @@ -269,6 +294,7 @@ public class Conversation { * * @param details Details about why the conversation was abandoned */ + @Deprecated public synchronized void abandon(ConversationAbandonedEvent details) { if (!abandoned) { abandoned = true; @@ -284,6 +310,7 @@ public class Conversation { * Displays the next user prompt and abandons the conversation if the next * prompt is null. */ + @Deprecated public void outputNextPrompt() { if (currentPrompt == null) { abandon(new ConversationAbandonedEvent(this)); @@ -296,6 +323,7 @@ public class Conversation { } } + @Deprecated public enum ConversationState { UNSTARTED, STARTED, diff --git a/src/main/java/org/bukkit/conversations/ConversationAbandonedEvent.java b/src/main/java/org/bukkit/conversations/ConversationAbandonedEvent.java index 63c4a2a..a988f6b 100644 --- a/src/main/java/org/bukkit/conversations/ConversationAbandonedEvent.java +++ b/src/main/java/org/bukkit/conversations/ConversationAbandonedEvent.java @@ -6,15 +6,20 @@ import java.util.EventObject; * ConversationAbandonedEvent contains information about an abandoned * conversation. */ +@Deprecated public class ConversationAbandonedEvent extends EventObject { + @Deprecated private ConversationContext context; + @Deprecated private ConversationCanceller canceller; + @Deprecated public ConversationAbandonedEvent(Conversation conversation) { this(conversation, null); } + @Deprecated public ConversationAbandonedEvent(Conversation conversation, ConversationCanceller canceller) { super(conversation); this.context = conversation.getContext(); @@ -26,6 +31,7 @@ public class ConversationAbandonedEvent extends EventObject { * * @return The object that abandoned the conversation. */ + @Deprecated public ConversationCanceller getCanceller() { return canceller; } @@ -35,6 +41,7 @@ public class ConversationAbandonedEvent extends EventObject { * * @return The abandoned conversation's conversation context. */ + @Deprecated public ConversationContext getContext() { return context; } @@ -47,6 +54,7 @@ public class ConversationAbandonedEvent extends EventObject { * Prompt} returning null or the next prompt. False of the * conversations is abandoned prematurely by a ConversationCanceller. */ + @Deprecated public boolean gracefulExit() { return canceller == null; } diff --git a/src/main/java/org/bukkit/conversations/ConversationAbandonedListener.java b/src/main/java/org/bukkit/conversations/ConversationAbandonedListener.java index dc046b1..110bdc0 100644 --- a/src/main/java/org/bukkit/conversations/ConversationAbandonedListener.java +++ b/src/main/java/org/bukkit/conversations/ConversationAbandonedListener.java @@ -4,6 +4,7 @@ import java.util.EventListener; /** */ +@Deprecated public interface ConversationAbandonedListener extends EventListener { /** * Called whenever a {@link Conversation} is abandoned. @@ -11,5 +12,6 @@ public interface ConversationAbandonedListener extends EventListener { * @param abandonedEvent Contains details about the abandoned * conversation. */ + @Deprecated public void conversationAbandoned(ConversationAbandonedEvent abandonedEvent); } diff --git a/src/main/java/org/bukkit/conversations/ConversationCanceller.java b/src/main/java/org/bukkit/conversations/ConversationCanceller.java index db43bb1..cd63d25 100644 --- a/src/main/java/org/bukkit/conversations/ConversationCanceller.java +++ b/src/main/java/org/bukkit/conversations/ConversationCanceller.java @@ -4,6 +4,7 @@ package org.bukkit.conversations; * A ConversationCanceller is a class that cancels an active {@link * Conversation}. A Conversation can have more than one ConversationCanceller. */ +@Deprecated public interface ConversationCanceller extends Cloneable { /** @@ -11,6 +12,7 @@ public interface ConversationCanceller extends Cloneable { * * @param conversation A conversation. */ + @Deprecated public void setConversation(Conversation conversation); /** @@ -20,6 +22,7 @@ public interface ConversationCanceller extends Cloneable { * @param input The input text from the user. * @return True to cancel the conversation, False otherwise. */ + @Deprecated public boolean cancelBasedOnInput(ConversationContext context, String input); /** @@ -30,5 +33,6 @@ public interface ConversationCanceller extends Cloneable { * * @return A clone. */ + @Deprecated public ConversationCanceller clone(); } diff --git a/src/main/java/org/bukkit/conversations/ConversationContext.java b/src/main/java/org/bukkit/conversations/ConversationContext.java index 7390a77..614708f 100644 --- a/src/main/java/org/bukkit/conversations/ConversationContext.java +++ b/src/main/java/org/bukkit/conversations/ConversationContext.java @@ -10,9 +10,13 @@ import java.util.Map; * generic map for storing values that are shared between all {@link Prompt} * invocations. */ +@Deprecated public class ConversationContext { + @Deprecated private Conversable forWhom; + @Deprecated private Map sessionData; + @Deprecated private Plugin plugin; /** @@ -21,6 +25,7 @@ public class ConversationContext { * @param initialSessionData Any initial values to put in the sessionData * map. */ + @Deprecated public ConversationContext(Plugin plugin, Conversable forWhom, Map initialSessionData) { this.plugin = plugin; this.forWhom = forWhom; @@ -32,6 +37,7 @@ public class ConversationContext { * * @return The owning plugin. */ + @Deprecated public Plugin getPlugin() { return plugin; } @@ -41,6 +47,7 @@ public class ConversationContext { * * @return The subject of the conversation. */ + @Deprecated public Conversable getForWhom() { return forWhom; } @@ -49,6 +56,7 @@ public class ConversationContext { * Gets the entire sessionData map. * @return The full sessionData map. */ + @Deprecated public Map getAllSessionData() { return sessionData; } @@ -61,6 +69,7 @@ public class ConversationContext { * @param key The session data key. * @return The requested session data. */ + @Deprecated public Object getSessionData(Object key) { return sessionData.get(key); } @@ -73,6 +82,7 @@ public class ConversationContext { * @param key The session data key. * @param value The session data value. */ + @Deprecated public void setSessionData(Object key, Object value) { sessionData.put(key, value); } diff --git a/src/main/java/org/bukkit/conversations/ConversationFactory.java b/src/main/java/org/bukkit/conversations/ConversationFactory.java index e7cbd52..1e89f58 100644 --- a/src/main/java/org/bukkit/conversations/ConversationFactory.java +++ b/src/main/java/org/bukkit/conversations/ConversationFactory.java @@ -18,16 +18,26 @@ import java.util.Map; * The ConversationFactory implements a fluid API, allowing parameters to be * set as an extension to the constructor. */ +@Deprecated public class ConversationFactory { + @Deprecated protected Plugin plugin; + @Deprecated protected boolean isModal; + @Deprecated protected boolean localEchoEnabled; + @Deprecated protected ConversationPrefix prefix; + @Deprecated protected Prompt firstPrompt; + @Deprecated protected Map initialSessionData; + @Deprecated protected String playerOnlyMessage; + @Deprecated protected List cancellers; + @Deprecated protected List abandonedListeners; /** @@ -35,6 +45,7 @@ public class ConversationFactory { * * @param plugin The plugin that owns the factory. */ + @Deprecated public ConversationFactory(Plugin plugin) { this.plugin = plugin; @@ -58,6 +69,7 @@ public class ConversationFactory { * @param modal The modality of all conversations to be created. * @return This object. */ + @Deprecated public ConversationFactory withModality(boolean modal) { isModal = modal; @@ -72,6 +84,7 @@ public class ConversationFactory { * @param localEchoEnabled The status of local echo. * @return This object. */ + @Deprecated public ConversationFactory withLocalEcho(boolean localEchoEnabled) { this.localEchoEnabled = localEchoEnabled; return this; @@ -86,6 +99,7 @@ public class ConversationFactory { * @param prefix The ConversationPrefix to use. * @return This object. */ + @Deprecated public ConversationFactory withPrefix(ConversationPrefix prefix) { this.prefix = prefix; return this; @@ -100,6 +114,7 @@ public class ConversationFactory { * @param timeoutSeconds The number of seconds to wait. * @return This object. */ + @Deprecated public ConversationFactory withTimeout(int timeoutSeconds) { return withConversationCanceller(new InactivityConversationCanceller(plugin, timeoutSeconds)); } @@ -112,6 +127,7 @@ public class ConversationFactory { * @param firstPrompt The first prompt. * @return This object. */ + @Deprecated public ConversationFactory withFirstPrompt(Prompt firstPrompt) { this.firstPrompt = firstPrompt; return this; @@ -125,6 +141,7 @@ public class ConversationFactory { * sessionData. * @return This object. */ + @Deprecated public ConversationFactory withInitialSessionData(Map initialSessionData) { this.initialSessionData = initialSessionData; return this; @@ -137,6 +154,7 @@ public class ConversationFactory { * @param escapeSequence Input to terminate the conversation. * @return This object. */ + @Deprecated public ConversationFactory withEscapeSequence(String escapeSequence) { return withConversationCanceller(new ExactMatchConversationCanceller(escapeSequence)); } @@ -148,6 +166,7 @@ public class ConversationFactory { * @param canceller The {@link ConversationCanceller} to add. * @return This object. */ + @Deprecated public ConversationFactory withConversationCanceller(ConversationCanceller canceller) { cancellers.add(canceller); return this; @@ -161,6 +180,7 @@ public class ConversationFactory { * starting a conversation. * @return This object. */ + @Deprecated public ConversationFactory thatExcludesNonPlayersWithMessage(String playerOnlyMessage) { this.playerOnlyMessage = playerOnlyMessage; return this; @@ -173,6 +193,7 @@ public class ConversationFactory { * @param listener The listener to add. * @return This object. */ + @Deprecated public ConversationFactory addConversationAbandonedListener(ConversationAbandonedListener listener) { abandonedListeners.add(listener); return this; @@ -185,6 +206,7 @@ public class ConversationFactory { * @param forWhom The entity for whom the new conversation is mediating. * @return A new conversation. */ + @Deprecated public Conversation buildConversation(Conversable forWhom) { //Abort conversation construction if we aren't supposed to talk to non-players if (playerOnlyMessage != null && !(forWhom instanceof Player)) { @@ -214,13 +236,16 @@ public class ConversationFactory { return conversation; } + @Deprecated private class NotPlayerMessagePrompt extends MessagePrompt { + @Deprecated public String getPromptText(ConversationContext context) { return playerOnlyMessage; } @Override + @Deprecated protected Prompt getNextPrompt(ConversationContext context) { return Prompt.END_OF_CONVERSATION; } diff --git a/src/main/java/org/bukkit/conversations/ConversationPrefix.java b/src/main/java/org/bukkit/conversations/ConversationPrefix.java index 9889f17..bcbb82c 100644 --- a/src/main/java/org/bukkit/conversations/ConversationPrefix.java +++ b/src/main/java/org/bukkit/conversations/ConversationPrefix.java @@ -7,6 +7,7 @@ import org.bukkit.command.CommandSender; * conversation to the player. The ConversationPrefix can be used to display * the plugin name or conversation status as the conversation evolves. */ +@Deprecated public interface ConversationPrefix { /** diff --git a/src/main/java/org/bukkit/conversations/ExactMatchConversationCanceller.java b/src/main/java/org/bukkit/conversations/ExactMatchConversationCanceller.java index 327b9d9..6704c5f 100644 --- a/src/main/java/org/bukkit/conversations/ExactMatchConversationCanceller.java +++ b/src/main/java/org/bukkit/conversations/ExactMatchConversationCanceller.java @@ -4,7 +4,9 @@ package org.bukkit.conversations; * An ExactMatchConversationCanceller cancels a conversation if the user * enters an exact input string */ +@Deprecated public class ExactMatchConversationCanceller implements ConversationCanceller { + @Deprecated private String escapeSequence; /** @@ -13,16 +15,20 @@ public class ExactMatchConversationCanceller implements ConversationCanceller { * @param escapeSequence The string that, if entered by the user, will * cancel the conversation. */ + @Deprecated public ExactMatchConversationCanceller(String escapeSequence) { this.escapeSequence = escapeSequence; } + @Deprecated public void setConversation(Conversation conversation) {} + @Deprecated public boolean cancelBasedOnInput(ConversationContext context, String input) { return input.equals(escapeSequence); } + @Deprecated public ConversationCanceller clone() { return new ExactMatchConversationCanceller(escapeSequence); } diff --git a/src/main/java/org/bukkit/conversations/FixedSetPrompt.java b/src/main/java/org/bukkit/conversations/FixedSetPrompt.java index b867c11..2aeee03 100644 --- a/src/main/java/org/bukkit/conversations/FixedSetPrompt.java +++ b/src/main/java/org/bukkit/conversations/FixedSetPrompt.java @@ -9,8 +9,10 @@ import java.util.List; * FixedSetPrompt is the base class for any prompt that requires a fixed set * response from the user. */ +@Deprecated public abstract class FixedSetPrompt extends ValidatingPrompt { + @Deprecated protected List fixedSet; /** @@ -21,14 +23,17 @@ public abstract class FixedSetPrompt extends ValidatingPrompt { * @param fixedSet A fixed set of strings, one of which the user must * type. */ + @Deprecated public FixedSetPrompt(String... fixedSet) { super(); this.fixedSet = Arrays.asList(fixedSet); } + @Deprecated private FixedSetPrompt() {} @Override + @Deprecated protected boolean isInputValid(ConversationContext context, String input) { return fixedSet.contains(input); } @@ -40,6 +45,7 @@ public abstract class FixedSetPrompt extends ValidatingPrompt { * @return the options formatted like "[bar, cheese, panda]" if bar, * cheese, and panda were the options used */ + @Deprecated protected String formatFixedSet() { return "[" + StringUtils.join(fixedSet, ", ") + "]"; } diff --git a/src/main/java/org/bukkit/conversations/InactivityConversationCanceller.java b/src/main/java/org/bukkit/conversations/InactivityConversationCanceller.java index 760a518..a969c9a 100644 --- a/src/main/java/org/bukkit/conversations/InactivityConversationCanceller.java +++ b/src/main/java/org/bukkit/conversations/InactivityConversationCanceller.java @@ -7,10 +7,15 @@ import org.bukkit.plugin.Plugin; * An InactivityConversationCanceller will cancel a {@link Conversation} after * a period of inactivity by the user. */ +@Deprecated public class InactivityConversationCanceller implements ConversationCanceller { + @Deprecated protected Plugin plugin; + @Deprecated protected int timeoutSeconds; + @Deprecated protected Conversation conversation; + @Deprecated private int taskId = -1; /** @@ -19,16 +24,19 @@ public class InactivityConversationCanceller implements ConversationCanceller { * @param plugin The owning plugin. * @param timeoutSeconds The number of seconds of inactivity to wait. */ + @Deprecated public InactivityConversationCanceller(Plugin plugin, int timeoutSeconds) { this.plugin = plugin; this.timeoutSeconds = timeoutSeconds; } + @Deprecated public void setConversation(Conversation conversation) { this.conversation = conversation; startTimer(); } + @Deprecated public boolean cancelBasedOnInput(ConversationContext context, String input) { // Reset the inactivity timer stopTimer(); @@ -36,6 +44,7 @@ public class InactivityConversationCanceller implements ConversationCanceller { return false; } + @Deprecated public ConversationCanceller clone() { return new InactivityConversationCanceller(plugin, timeoutSeconds); } @@ -43,8 +52,10 @@ public class InactivityConversationCanceller implements ConversationCanceller { /** * Starts an inactivity timer. */ + @Deprecated private void startTimer() { taskId = plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { + @Deprecated public void run() { if (conversation.getState() == Conversation.ConversationState.UNSTARTED) { startTimer(); @@ -59,6 +70,7 @@ public class InactivityConversationCanceller implements ConversationCanceller { /** * Stops the active inactivity timer. */ + @Deprecated private void stopTimer() { if (taskId != -1) { plugin.getServer().getScheduler().cancelTask(taskId); @@ -73,6 +85,7 @@ public class InactivityConversationCanceller implements ConversationCanceller { * * @param conversation The conversation being abandoned. */ + @Deprecated protected void cancelling(Conversation conversation) { } diff --git a/src/main/java/org/bukkit/conversations/ManuallyAbandonedConversationCanceller.java b/src/main/java/org/bukkit/conversations/ManuallyAbandonedConversationCanceller.java index 3e80de1..e58c7f0 100644 --- a/src/main/java/org/bukkit/conversations/ManuallyAbandonedConversationCanceller.java +++ b/src/main/java/org/bukkit/conversations/ManuallyAbandonedConversationCanceller.java @@ -5,15 +5,19 @@ package org.bukkit.conversations; * ConversationAbandonedEvent} to indicate that the conversation was manually * abandoned by programmatically calling the abandon() method on it. */ +@Deprecated public class ManuallyAbandonedConversationCanceller implements ConversationCanceller{ + @Deprecated public void setConversation(Conversation conversation) { throw new UnsupportedOperationException(); } + @Deprecated public boolean cancelBasedOnInput(ConversationContext context, String input) { throw new UnsupportedOperationException(); } + @Deprecated public ConversationCanceller clone() { throw new UnsupportedOperationException(); } diff --git a/src/main/java/org/bukkit/conversations/MessagePrompt.java b/src/main/java/org/bukkit/conversations/MessagePrompt.java index fa1775a..bd6eed3 100644 --- a/src/main/java/org/bukkit/conversations/MessagePrompt.java +++ b/src/main/java/org/bukkit/conversations/MessagePrompt.java @@ -4,8 +4,10 @@ package org.bukkit.conversations; * MessagePrompt is the base class for any prompt that only displays a message * to the user and requires no input. */ +@Deprecated public abstract class MessagePrompt implements Prompt{ + @Deprecated public MessagePrompt() { super(); } @@ -16,6 +18,7 @@ public abstract class MessagePrompt implements Prompt{ * @param context Context information about the conversation. * @return Always false. */ + @Deprecated public boolean blocksForInput(ConversationContext context) { return false; } @@ -28,6 +31,7 @@ public abstract class MessagePrompt implements Prompt{ * @param input Ignored. * @return The next prompt in the prompt graph. */ + @Deprecated public Prompt acceptInput(ConversationContext context, String input) { return getNextPrompt(context); } @@ -38,5 +42,6 @@ public abstract class MessagePrompt implements Prompt{ * @param context Context information about the conversation. * @return The next prompt in the prompt graph. */ + @Deprecated protected abstract Prompt getNextPrompt(ConversationContext context); } diff --git a/src/main/java/org/bukkit/conversations/NullConversationPrefix.java b/src/main/java/org/bukkit/conversations/NullConversationPrefix.java index 7d8a7d8..e888a25 100644 --- a/src/main/java/org/bukkit/conversations/NullConversationPrefix.java +++ b/src/main/java/org/bukkit/conversations/NullConversationPrefix.java @@ -6,6 +6,7 @@ import org.bukkit.command.CommandSender; * NullConversationPrefix is a {@link ConversationPrefix} implementation that * displays nothing in front of conversation output. */ +@Deprecated public class NullConversationPrefix implements ConversationPrefix{ /** @@ -14,6 +15,7 @@ public class NullConversationPrefix implements ConversationPrefix{ * @param context Context information about the conversation. * @return An empty string. */ + @Deprecated public String getPrefix(ConversationContext context) { return ""; } diff --git a/src/main/java/org/bukkit/conversations/NumericPrompt.java b/src/main/java/org/bukkit/conversations/NumericPrompt.java index f0fdea1..4f34b1f 100644 --- a/src/main/java/org/bukkit/conversations/NumericPrompt.java +++ b/src/main/java/org/bukkit/conversations/NumericPrompt.java @@ -6,12 +6,15 @@ import org.apache.commons.lang.math.NumberUtils; * NumericPrompt is the base class for any prompt that requires a {@link * Number} response from the user. */ +@Deprecated public abstract class NumericPrompt extends ValidatingPrompt{ + @Deprecated public NumericPrompt() { super(); } @Override + @Deprecated protected boolean isInputValid(ConversationContext context, String input) { return NumberUtils.isNumber(input) && isNumberValid(context, NumberUtils.createNumber(input)); } @@ -24,11 +27,13 @@ public abstract class NumericPrompt extends ValidatingPrompt{ * @param input The number the player provided. * @return The validity of the player's input. */ + @Deprecated protected boolean isNumberValid(ConversationContext context, Number input) { return true; } @Override + @Deprecated protected Prompt acceptValidatedInput(ConversationContext context, String input) { try { @@ -46,9 +51,11 @@ public abstract class NumericPrompt extends ValidatingPrompt{ * @param input The user's response as a {@link Number}. * @return The next {@link Prompt} in the prompt graph. */ + @Deprecated protected abstract Prompt acceptValidatedInput(ConversationContext context, Number input); @Override + @Deprecated protected String getFailedValidationText(ConversationContext context, String invalidInput) { if (NumberUtils.isNumber(invalidInput)) { return getFailedValidationText(context, NumberUtils.createNumber(invalidInput)); @@ -65,6 +72,7 @@ public abstract class NumericPrompt extends ValidatingPrompt{ * @param invalidInput The invalid input provided by the user. * @return A message explaining how to correct the input. */ + @Deprecated protected String getInputNotNumericText(ConversationContext context, String invalidInput) { return null; } @@ -77,6 +85,7 @@ public abstract class NumericPrompt extends ValidatingPrompt{ * @param invalidInput The invalid input provided by the user. * @return A message explaining how to correct the input. */ + @Deprecated protected String getFailedValidationText(ConversationContext context, Number invalidInput) { return null; } diff --git a/src/main/java/org/bukkit/conversations/PlayerNamePrompt.java b/src/main/java/org/bukkit/conversations/PlayerNamePrompt.java index feeb715..8cda82d 100644 --- a/src/main/java/org/bukkit/conversations/PlayerNamePrompt.java +++ b/src/main/java/org/bukkit/conversations/PlayerNamePrompt.java @@ -7,21 +7,26 @@ import org.bukkit.plugin.Plugin; * PlayerNamePrompt is the base class for any prompt that requires the player * to enter another player's name. */ +@Deprecated public abstract class PlayerNamePrompt extends ValidatingPrompt{ + @Deprecated private Plugin plugin; + @Deprecated public PlayerNamePrompt(Plugin plugin) { super(); this.plugin = plugin; } @Override + @Deprecated protected boolean isInputValid(ConversationContext context, String input) { return plugin.getServer().getPlayer(input) != null; } @Override + @Deprecated protected Prompt acceptValidatedInput(ConversationContext context, String input) { return acceptValidatedInput(context, plugin.getServer().getPlayer(input)); } @@ -34,5 +39,6 @@ public abstract class PlayerNamePrompt extends ValidatingPrompt{ * @param input The user's player name response. * @return The next {@link Prompt} in the prompt graph. */ + @Deprecated protected abstract Prompt acceptValidatedInput(ConversationContext context, Player input); } diff --git a/src/main/java/org/bukkit/conversations/PluginNameConversationPrefix.java b/src/main/java/org/bukkit/conversations/PluginNameConversationPrefix.java index 2290979..0790043 100644 --- a/src/main/java/org/bukkit/conversations/PluginNameConversationPrefix.java +++ b/src/main/java/org/bukkit/conversations/PluginNameConversationPrefix.java @@ -8,18 +8,25 @@ import org.bukkit.plugin.Plugin; * PluginNameConversationPrefix is a {@link ConversationPrefix} implementation * that displays the plugin name in front of conversation output. */ +@Deprecated public class PluginNameConversationPrefix implements ConversationPrefix { + @Deprecated protected String separator; + @Deprecated protected ChatColor prefixColor; + @Deprecated protected Plugin plugin; + @Deprecated private String cachedPrefix; + @Deprecated public PluginNameConversationPrefix(Plugin plugin) { this(plugin, " > ", ChatColor.LIGHT_PURPLE); } + @Deprecated public PluginNameConversationPrefix(Plugin plugin, String separator, ChatColor prefixColor) { this.separator = separator; this.prefixColor = prefixColor; @@ -34,6 +41,7 @@ public class PluginNameConversationPrefix implements ConversationPrefix { * @param context Context information about the conversation. * @return An empty string. */ + @Deprecated public String getPrefix(ConversationContext context) { return cachedPrefix; } diff --git a/src/main/java/org/bukkit/conversations/Prompt.java b/src/main/java/org/bukkit/conversations/Prompt.java index 7519c84..1776f0a 100644 --- a/src/main/java/org/bukkit/conversations/Prompt.java +++ b/src/main/java/org/bukkit/conversations/Prompt.java @@ -7,6 +7,7 @@ package org.bukkit.conversations; * conversation flow. To halt a conversation, END_OF_CONVERSATION is returned * in liu of another Prompt object. */ +@Deprecated public interface Prompt extends Cloneable { /** diff --git a/src/main/java/org/bukkit/conversations/RegexPrompt.java b/src/main/java/org/bukkit/conversations/RegexPrompt.java index a3c7d1f..a90931f 100644 --- a/src/main/java/org/bukkit/conversations/RegexPrompt.java +++ b/src/main/java/org/bukkit/conversations/RegexPrompt.java @@ -6,22 +6,28 @@ import java.util.regex.Pattern; * RegexPrompt is the base class for any prompt that requires an input * validated by a regular expression. */ +@Deprecated public abstract class RegexPrompt extends ValidatingPrompt { + @Deprecated private Pattern pattern; + @Deprecated public RegexPrompt(String regex) { this(Pattern.compile(regex)); } + @Deprecated public RegexPrompt(Pattern pattern) { super(); this.pattern = pattern; } + @Deprecated private RegexPrompt() {} @Override + @Deprecated protected boolean isInputValid(ConversationContext context, String input) { return pattern.matcher(input).matches(); } diff --git a/src/main/java/org/bukkit/conversations/StringPrompt.java b/src/main/java/org/bukkit/conversations/StringPrompt.java index 2934459..f18f333 100644 --- a/src/main/java/org/bukkit/conversations/StringPrompt.java +++ b/src/main/java/org/bukkit/conversations/StringPrompt.java @@ -4,6 +4,7 @@ package org.bukkit.conversations; * StringPrompt is the base class for any prompt that accepts an arbitrary * string from the user. */ +@Deprecated public abstract class StringPrompt implements Prompt{ /** @@ -12,6 +13,7 @@ public abstract class StringPrompt implements Prompt{ * @param context Context information about the conversation. * @return True. */ + @Deprecated public boolean blocksForInput(ConversationContext context) { return true; } diff --git a/src/main/java/org/bukkit/conversations/ValidatingPrompt.java b/src/main/java/org/bukkit/conversations/ValidatingPrompt.java index f41adb4..af35b79 100644 --- a/src/main/java/org/bukkit/conversations/ValidatingPrompt.java +++ b/src/main/java/org/bukkit/conversations/ValidatingPrompt.java @@ -7,7 +7,9 @@ import org.bukkit.ChatColor; * ValidatingPrompt will keep replaying the prompt text until the user enters * a valid response. */ +@Deprecated public abstract class ValidatingPrompt implements Prompt { + @Deprecated public ValidatingPrompt() { super(); } @@ -21,6 +23,7 @@ public abstract class ValidatingPrompt implements Prompt { * @param input The input text from the user. * @return This prompt or the next Prompt in the prompt graph. */ + @Deprecated public Prompt acceptInput(ConversationContext context, String input) { if (isInputValid(context, input)) { return acceptValidatedInput(context, input); @@ -40,6 +43,7 @@ public abstract class ValidatingPrompt implements Prompt { * @param context Context information about the conversation. * @return True. */ + @Deprecated public boolean blocksForInput(ConversationContext context) { return true; } @@ -51,6 +55,7 @@ public abstract class ValidatingPrompt implements Prompt { * @param input The player's raw console input. * @return True or false depending on the validity of the input. */ + @Deprecated protected abstract boolean isInputValid(ConversationContext context, String input); /** @@ -62,6 +67,7 @@ public abstract class ValidatingPrompt implements Prompt { * @param input The validated input text from the user. * @return The next Prompt in the prompt graph. */ + @Deprecated protected abstract Prompt acceptValidatedInput(ConversationContext context, String input); /** @@ -72,6 +78,7 @@ public abstract class ValidatingPrompt implements Prompt { * @param invalidInput The invalid input provided by the user. * @return A message explaining how to correct the input. */ + @Deprecated protected String getFailedValidationText(ConversationContext context, String invalidInput) { return null; } diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java index e038412..a82354d 100644 --- a/src/main/java/org/bukkit/enchantments/Enchantment.java +++ b/src/main/java/org/bukkit/enchantments/Enchantment.java @@ -9,133 +9,163 @@ import org.bukkit.inventory.ItemStack; /** * The various type of enchantments that may be added to armour or weapons */ +@Deprecated public abstract class Enchantment { /** * Provides protection against environmental damage */ + @Deprecated public static final Enchantment PROTECTION_ENVIRONMENTAL = new EnchantmentWrapper(0); /** * Provides protection against fire damage */ + @Deprecated public static final Enchantment PROTECTION_FIRE = new EnchantmentWrapper(1); /** * Provides protection against fall damage */ + @Deprecated public static final Enchantment PROTECTION_FALL = new EnchantmentWrapper(2); /** * Provides protection against explosive damage */ + @Deprecated public static final Enchantment PROTECTION_EXPLOSIONS = new EnchantmentWrapper(3); /** * Provides protection against projectile damage */ + @Deprecated public static final Enchantment PROTECTION_PROJECTILE = new EnchantmentWrapper(4); /** * Decreases the rate of air loss whilst underwater */ + @Deprecated public static final Enchantment OXYGEN = new EnchantmentWrapper(5); /** * Increases the speed at which a player may mine underwater */ + @Deprecated public static final Enchantment WATER_WORKER = new EnchantmentWrapper(6); /** * Damages the attacker */ + @Deprecated public static final Enchantment THORNS = new EnchantmentWrapper(7); /** * Increases damage against all targets */ + @Deprecated public static final Enchantment DAMAGE_ALL = new EnchantmentWrapper(16); /** * Increases damage against undead targets */ + @Deprecated public static final Enchantment DAMAGE_UNDEAD = new EnchantmentWrapper(17); /** * Increases damage against arthropod targets */ + @Deprecated public static final Enchantment DAMAGE_ARTHROPODS = new EnchantmentWrapper(18); /** * All damage to other targets will knock them back when hit */ + @Deprecated public static final Enchantment KNOCKBACK = new EnchantmentWrapper(19); /** * When attacking a target, has a chance to set them on fire */ + @Deprecated public static final Enchantment FIRE_ASPECT = new EnchantmentWrapper(20); /** * Provides a chance of gaining extra loot when killing monsters */ + @Deprecated public static final Enchantment LOOT_BONUS_MOBS = new EnchantmentWrapper(21); /** * Increases the rate at which you mine/dig */ + @Deprecated public static final Enchantment DIG_SPEED = new EnchantmentWrapper(32); /** * Allows blocks to drop themselves instead of fragments (for example, * stone instead of cobblestone) */ + @Deprecated public static final Enchantment SILK_TOUCH = new EnchantmentWrapper(33); /** * Decreases the rate at which a tool looses durability */ + @Deprecated public static final Enchantment DURABILITY = new EnchantmentWrapper(34); /** * Provides a chance of gaining extra loot when destroying blocks */ + @Deprecated public static final Enchantment LOOT_BONUS_BLOCKS = new EnchantmentWrapper(35); /** * Provides extra damage when shooting arrows from bows */ + @Deprecated public static final Enchantment ARROW_DAMAGE = new EnchantmentWrapper(48); /** * Provides a knockback when an entity is hit by an arrow from a bow */ + @Deprecated public static final Enchantment ARROW_KNOCKBACK = new EnchantmentWrapper(49); /** * Sets entities on fire when hit by arrows shot from a bow */ + @Deprecated public static final Enchantment ARROW_FIRE = new EnchantmentWrapper(50); /** * Provides infinite arrows when shooting a bow */ + @Deprecated public static final Enchantment ARROW_INFINITE = new EnchantmentWrapper(51); /** * Decreases odds of catching worthless junk */ + @Deprecated public static final Enchantment LUCK = new EnchantmentWrapper(61); /** * Increases rate of fish biting your hook */ + @Deprecated public static final Enchantment LURE = new EnchantmentWrapper(62); + @Deprecated private static final Map byId = new HashMap(); + @Deprecated private static final Map byName = new HashMap(); + @Deprecated private static boolean acceptingNew = true; + @Deprecated private final int id; + @Deprecated public Enchantment(int id) { this.id = id; } @@ -156,6 +186,7 @@ public abstract class Enchantment { * * @return Unique name */ + @Deprecated public abstract String getName(); /** @@ -163,6 +194,7 @@ public abstract class Enchantment { * * @return Maximum level of the Enchantment */ + @Deprecated public abstract int getMaxLevel(); /** @@ -170,6 +202,7 @@ public abstract class Enchantment { * * @return Starting level of the Enchantment */ + @Deprecated public abstract int getStartLevel(); /** @@ -177,6 +210,7 @@ public abstract class Enchantment { * * @return Target type of the Enchantment */ + @Deprecated public abstract EnchantmentTarget getItemTarget(); /** @@ -185,6 +219,7 @@ public abstract class Enchantment { * @param other The enchantment to check against * @return True if there is a conflict. */ + @Deprecated public abstract boolean conflictsWith(Enchantment other); /** @@ -197,9 +232,11 @@ public abstract class Enchantment { * @param item Item to test * @return True if the enchantment may be applied, otherwise False */ + @Deprecated public abstract boolean canEnchantItem(ItemStack item); @Override + @Deprecated public boolean equals(Object obj) { if (obj == null) { return false; @@ -215,11 +252,13 @@ public abstract class Enchantment { } @Override + @Deprecated public int hashCode() { return id; } @Override + @Deprecated public String toString() { return "Enchantment[" + id + ", " + getName() + "]"; } @@ -231,6 +270,7 @@ public abstract class Enchantment { * * @param enchantment Enchantment to register */ + @Deprecated public static void registerEnchantment(Enchantment enchantment) { if (byId.containsKey(enchantment.id) || byName.containsKey(enchantment.getName())) { throw new IllegalArgumentException("Cannot set already-set enchantment"); @@ -247,6 +287,7 @@ public abstract class Enchantment { * * @return True if the server Implementation may add enchantments */ + @Deprecated public static boolean isAcceptingRegistrations() { return acceptingNew; } @@ -254,6 +295,7 @@ public abstract class Enchantment { /** * Stops accepting any enchantment registrations */ + @Deprecated public static void stopAcceptingRegistrations() { acceptingNew = false; EnchantCommand.buildEnchantments(); @@ -277,6 +319,7 @@ public abstract class Enchantment { * @param name Name to fetch * @return Resulting Enchantment, or null if not found */ + @Deprecated public static Enchantment getByName(String name) { return byName.get(name); } @@ -286,6 +329,7 @@ public abstract class Enchantment { * * @return Array of enchantments */ + @Deprecated public static Enchantment[] values() { return byId.values().toArray(new Enchantment[byId.size()]); } diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java index d9b98ed..0a0d8f9 100644 --- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java +++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java @@ -6,12 +6,14 @@ import org.bukkit.inventory.ItemStack; /** * Represents the applicable target for a {@link Enchantment} */ +@Deprecated public enum EnchantmentTarget { /** * Allows the Enchantment to be placed on all items */ ALL { @Override + @Deprecated public boolean includes(Material item) { return true; } @@ -22,6 +24,7 @@ public enum EnchantmentTarget { */ ARMOR { @Override + @Deprecated public boolean includes(Material item) { return ARMOR_FEET.includes(item) || ARMOR_LEGS.includes(item) @@ -35,6 +38,7 @@ public enum EnchantmentTarget { */ ARMOR_FEET { @Override + @Deprecated public boolean includes(Material item) { return item.equals(Material.LEATHER_BOOTS) || item.equals(Material.CHAINMAIL_BOOTS) @@ -49,6 +53,7 @@ public enum EnchantmentTarget { */ ARMOR_LEGS { @Override + @Deprecated public boolean includes(Material item) { return item.equals(Material.LEATHER_LEGGINGS) || item.equals(Material.CHAINMAIL_LEGGINGS) @@ -63,6 +68,7 @@ public enum EnchantmentTarget { */ ARMOR_TORSO { @Override + @Deprecated public boolean includes(Material item) { return item.equals(Material.LEATHER_CHESTPLATE) || item.equals(Material.CHAINMAIL_CHESTPLATE) @@ -77,6 +83,7 @@ public enum EnchantmentTarget { */ ARMOR_HEAD { @Override + @Deprecated public boolean includes(Material item) { return item.equals(Material.LEATHER_HELMET) || item.equals(Material.CHAINMAIL_HELMET) @@ -91,6 +98,7 @@ public enum EnchantmentTarget { */ WEAPON { @Override + @Deprecated public boolean includes(Material item) { return item.equals(Material.WOOD_SWORD) || item.equals(Material.STONE_SWORD) @@ -106,6 +114,7 @@ public enum EnchantmentTarget { */ TOOL { @Override + @Deprecated public boolean includes(Material item) { return item.equals(Material.WOOD_SPADE) || item.equals(Material.STONE_SPADE) @@ -137,6 +146,7 @@ public enum EnchantmentTarget { */ BOW { @Override + @Deprecated public boolean includes(Material item) { return item.equals(Material.BOW); } @@ -147,6 +157,7 @@ public enum EnchantmentTarget { */ FISHING_ROD { @Override + @Deprecated public boolean includes(Material item) { return item.equals(Material.FISHING_ROD); } @@ -158,6 +169,7 @@ public enum EnchantmentTarget { * @param item The item to check * @return True if the target includes the item */ + @Deprecated public abstract boolean includes(Material item); /** @@ -166,6 +178,7 @@ public enum EnchantmentTarget { * @param item The item to check * @return True if the target includes the item */ + @Deprecated public boolean includes(ItemStack item) { return includes(item.getType()); } diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java index 6a0aeb3..a0de775 100644 --- a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java +++ b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java @@ -5,7 +5,9 @@ import org.bukkit.inventory.ItemStack; /** * A simple wrapper for ease of selecting {@link Enchantment}s */ +@Deprecated public class EnchantmentWrapper extends Enchantment { + @Deprecated public EnchantmentWrapper(int id) { super(id); } @@ -15,36 +17,43 @@ public class EnchantmentWrapper extends Enchantment { * * @return Enchantment */ + @Deprecated public Enchantment getEnchantment() { return Enchantment.getById(getId()); } @Override + @Deprecated public int getMaxLevel() { return getEnchantment().getMaxLevel(); } @Override + @Deprecated public int getStartLevel() { return getEnchantment().getStartLevel(); } @Override + @Deprecated public EnchantmentTarget getItemTarget() { return getEnchantment().getItemTarget(); } @Override + @Deprecated public boolean canEnchantItem(ItemStack item) { return getEnchantment().canEnchantItem(item); } @Override + @Deprecated public String getName() { return getEnchantment().getName(); } @Override + @Deprecated public boolean conflictsWith(Enchantment other) { return getEnchantment().conflictsWith(other); } diff --git a/src/main/java/org/bukkit/entity/Ageable.java b/src/main/java/org/bukkit/entity/Ageable.java index e9fccb2..e746da0 100644 --- a/src/main/java/org/bukkit/entity/Ageable.java +++ b/src/main/java/org/bukkit/entity/Ageable.java @@ -3,12 +3,14 @@ package org.bukkit.entity; /** * Represents an entity that can age and breed. */ +@Deprecated public interface Ageable extends Creature { /** * Gets the age of this animal. * * @return Age */ + @Deprecated public int getAge(); /** @@ -16,6 +18,7 @@ public interface Ageable extends Creature { * * @param age New age */ + @Deprecated public void setAge(int age); /** @@ -24,6 +27,7 @@ public interface Ageable extends Creature { * * @param lock new lock */ + @Deprecated public void setAgeLock(boolean lock); /** @@ -31,16 +35,19 @@ public interface Ageable extends Creature { * * @return the current agelock */ + @Deprecated public boolean getAgeLock(); /** * Sets the age of the animal to a baby */ + @Deprecated public void setBaby(); /** * Sets the age of the animal to an adult */ + @Deprecated public void setAdult(); /** @@ -48,6 +55,7 @@ public interface Ageable extends Creature { * * @return return true if the animal is an adult */ + @Deprecated public boolean isAdult(); /** @@ -55,6 +63,7 @@ public interface Ageable extends Creature { * * @return the ability to breed of the animal */ + @Deprecated public boolean canBreed(); /** @@ -63,5 +72,6 @@ public interface Ageable extends Creature { * * @param breed breedability of the animal */ + @Deprecated public void setBreed(boolean breed); } diff --git a/src/main/java/org/bukkit/entity/Ambient.java b/src/main/java/org/bukkit/entity/Ambient.java index 779e389..c80965f 100644 --- a/src/main/java/org/bukkit/entity/Ambient.java +++ b/src/main/java/org/bukkit/entity/Ambient.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents an ambient mob */ +@Deprecated public interface Ambient extends LivingEntity {} diff --git a/src/main/java/org/bukkit/entity/AnimalTamer.java b/src/main/java/org/bukkit/entity/AnimalTamer.java index a80d31a..ab88142 100644 --- a/src/main/java/org/bukkit/entity/AnimalTamer.java +++ b/src/main/java/org/bukkit/entity/AnimalTamer.java @@ -1,5 +1,6 @@ package org.bukkit.entity; +@Deprecated public interface AnimalTamer { /** @@ -7,5 +8,6 @@ public interface AnimalTamer { * * @return The name to reference on tamed animals */ + @Deprecated public String getName(); } diff --git a/src/main/java/org/bukkit/entity/Animals.java b/src/main/java/org/bukkit/entity/Animals.java index f0dc157..1a050e7 100644 --- a/src/main/java/org/bukkit/entity/Animals.java +++ b/src/main/java/org/bukkit/entity/Animals.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents an Animal. */ +@Deprecated public interface Animals extends Ageable {} diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java index e7a32f7..1d65197 100644 --- a/src/main/java/org/bukkit/entity/Arrow.java +++ b/src/main/java/org/bukkit/entity/Arrow.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents an arrow. */ +@Deprecated public interface Arrow extends Projectile { /** @@ -12,6 +13,7 @@ public interface Arrow extends Projectile { * * @return the knockback strength value */ + @Deprecated public int getKnockbackStrength(); /** @@ -19,6 +21,7 @@ public interface Arrow extends Projectile { * * @param knockbackStrength the knockback strength value */ + @Deprecated public void setKnockbackStrength(int knockbackStrength); /** @@ -31,6 +34,7 @@ public interface Arrow extends Projectile { * * @return true if it is critical */ + @Deprecated public boolean isCritical(); /** @@ -38,16 +42,20 @@ public interface Arrow extends Projectile { * * @param critical whether or not it should be critical */ + @Deprecated public void setCritical(boolean critical); + @Deprecated public class Spigot extends Entity.Spigot { + @Deprecated public double getDamage() { throw new UnsupportedOperationException( "Not supported yet." ); } + @Deprecated public void setDamage(double damage) { throw new UnsupportedOperationException( "Not supported yet." ); diff --git a/src/main/java/org/bukkit/entity/Bat.java b/src/main/java/org/bukkit/entity/Bat.java index a1e400e..00c31f8 100644 --- a/src/main/java/org/bukkit/entity/Bat.java +++ b/src/main/java/org/bukkit/entity/Bat.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Bat */ +@Deprecated public interface Bat extends Ambient {} diff --git a/src/main/java/org/bukkit/entity/Blaze.java b/src/main/java/org/bukkit/entity/Blaze.java index 7a5505b..dd140a2 100644 --- a/src/main/java/org/bukkit/entity/Blaze.java +++ b/src/main/java/org/bukkit/entity/Blaze.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a Blaze monster */ +@Deprecated public interface Blaze extends Monster { } diff --git a/src/main/java/org/bukkit/entity/Boat.java b/src/main/java/org/bukkit/entity/Boat.java index ed2d178..4ddd271 100644 --- a/src/main/java/org/bukkit/entity/Boat.java +++ b/src/main/java/org/bukkit/entity/Boat.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a boat entity. */ +@Deprecated public interface Boat extends Vehicle { /** @@ -11,6 +12,7 @@ public interface Boat extends Vehicle { * * @return The max speed. */ + @Deprecated public double getMaxSpeed(); /** @@ -18,6 +20,7 @@ public interface Boat extends Vehicle { * * @param speed The max speed. */ + @Deprecated public void setMaxSpeed(double speed); /** @@ -26,6 +29,7 @@ public interface Boat extends Vehicle { * * @return The rate of deceleration */ + @Deprecated public double getOccupiedDeceleration(); /** @@ -35,6 +39,7 @@ public interface Boat extends Vehicle { * * @param rate deceleration rate */ + @Deprecated public void setOccupiedDeceleration(double rate); /** @@ -44,6 +49,7 @@ public interface Boat extends Vehicle { * * @return The rate of deceleration */ + @Deprecated public double getUnoccupiedDeceleration(); /** @@ -54,6 +60,7 @@ public interface Boat extends Vehicle { * * @param rate deceleration rate */ + @Deprecated public void setUnoccupiedDeceleration(double rate); /** @@ -61,6 +68,7 @@ public interface Boat extends Vehicle { * * @return whether boats can work on land */ + @Deprecated public boolean getWorkOnLand(); /** @@ -68,5 +76,6 @@ public interface Boat extends Vehicle { * * @param workOnLand whether boats can work on land */ + @Deprecated public void setWorkOnLand(boolean workOnLand); } diff --git a/src/main/java/org/bukkit/entity/CaveSpider.java b/src/main/java/org/bukkit/entity/CaveSpider.java index 9c37646..a314052 100644 --- a/src/main/java/org/bukkit/entity/CaveSpider.java +++ b/src/main/java/org/bukkit/entity/CaveSpider.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Spider. */ +@Deprecated public interface CaveSpider extends Spider {} diff --git a/src/main/java/org/bukkit/entity/Chicken.java b/src/main/java/org/bukkit/entity/Chicken.java index cb3ec6e..2c63fdb 100644 --- a/src/main/java/org/bukkit/entity/Chicken.java +++ b/src/main/java/org/bukkit/entity/Chicken.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Chicken. */ +@Deprecated public interface Chicken extends Animals {} diff --git a/src/main/java/org/bukkit/entity/ComplexEntityPart.java b/src/main/java/org/bukkit/entity/ComplexEntityPart.java index f4ab0bb..4c57d1d 100644 --- a/src/main/java/org/bukkit/entity/ComplexEntityPart.java +++ b/src/main/java/org/bukkit/entity/ComplexEntityPart.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a single part of a {@link ComplexLivingEntity} */ +@Deprecated public interface ComplexEntityPart extends Entity { /** @@ -10,5 +11,6 @@ public interface ComplexEntityPart extends Entity { * * @return Parent complex entity */ + @Deprecated public ComplexLivingEntity getParent(); } diff --git a/src/main/java/org/bukkit/entity/ComplexLivingEntity.java b/src/main/java/org/bukkit/entity/ComplexLivingEntity.java index f74411c..6e7d6c1 100644 --- a/src/main/java/org/bukkit/entity/ComplexLivingEntity.java +++ b/src/main/java/org/bukkit/entity/ComplexLivingEntity.java @@ -6,11 +6,13 @@ import java.util.Set; * Represents a complex living entity - one that is made up of various smaller * parts */ +@Deprecated public interface ComplexLivingEntity extends LivingEntity { /** * Gets a list of parts that belong to this complex entity * * @return List of parts */ + @Deprecated public Set getParts(); } diff --git a/src/main/java/org/bukkit/entity/Cow.java b/src/main/java/org/bukkit/entity/Cow.java index cd4ed4d..1d8e9a0 100644 --- a/src/main/java/org/bukkit/entity/Cow.java +++ b/src/main/java/org/bukkit/entity/Cow.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Cow. */ +@Deprecated public interface Cow extends Animals {} diff --git a/src/main/java/org/bukkit/entity/Creature.java b/src/main/java/org/bukkit/entity/Creature.java index f223f55..df01c9b 100644 --- a/src/main/java/org/bukkit/entity/Creature.java +++ b/src/main/java/org/bukkit/entity/Creature.java @@ -4,6 +4,7 @@ package org.bukkit.entity; * Represents a Creature. Creatures are non-intelligent monsters or animals * which have very simple abilities. */ +@Deprecated public interface Creature extends LivingEntity { /** @@ -15,6 +16,7 @@ public interface Creature extends LivingEntity { * * @param target New LivingEntity to target, or null to clear the target */ + @Deprecated public void setTarget(LivingEntity target); /** @@ -22,5 +24,6 @@ public interface Creature extends LivingEntity { * * @return Current target of this creature, or null if none exists */ + @Deprecated public LivingEntity getTarget(); } diff --git a/src/main/java/org/bukkit/entity/CreatureType.java b/src/main/java/org/bukkit/entity/CreatureType.java index fd23093..e1c43e0 100644 --- a/src/main/java/org/bukkit/entity/CreatureType.java +++ b/src/main/java/org/bukkit/entity/CreatureType.java @@ -36,11 +36,16 @@ public enum CreatureType { SNOWMAN("SnowMan", Snowman.class, 97), VILLAGER("Villager", Villager.class, 120); + @Deprecated private String name; + @Deprecated private Class clazz; + @Deprecated private short typeId; + @Deprecated private static final Map NAME_MAP = new HashMap(); + @Deprecated private static final Map ID_MAP = new HashMap(); static { @@ -52,16 +57,19 @@ public enum CreatureType { } } + @Deprecated private CreatureType(String name, Class clazz, int typeId) { this.name = name; this.clazz = clazz; this.typeId = (short) typeId; } + @Deprecated public String getName() { return name; } + @Deprecated public Class getEntityClass() { return clazz; } @@ -75,6 +83,7 @@ public enum CreatureType { return typeId; } + @Deprecated public static CreatureType fromName(String name) { return NAME_MAP.get(name); } @@ -96,6 +105,7 @@ public enum CreatureType { return EntityType.fromName(getName()); } + @Deprecated public static CreatureType fromEntityType(EntityType creatureType) { return fromName(creatureType.getName()); } diff --git a/src/main/java/org/bukkit/entity/Creeper.java b/src/main/java/org/bukkit/entity/Creeper.java index a2f7809..4c8adf2 100644 --- a/src/main/java/org/bukkit/entity/Creeper.java +++ b/src/main/java/org/bukkit/entity/Creeper.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a Creeper */ +@Deprecated public interface Creeper extends Monster { /** @@ -10,6 +11,7 @@ public interface Creeper extends Monster { * * @return true if this creeper is powered */ + @Deprecated public boolean isPowered(); /** @@ -17,5 +19,6 @@ public interface Creeper extends Monster { * * @param value New Powered status */ + @Deprecated public void setPowered(boolean value); } diff --git a/src/main/java/org/bukkit/entity/Damageable.java b/src/main/java/org/bukkit/entity/Damageable.java index 53877a8..0c6e8f5 100644 --- a/src/main/java/org/bukkit/entity/Damageable.java +++ b/src/main/java/org/bukkit/entity/Damageable.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents an {@link Entity} that has health and can take damage. */ +@Deprecated public interface Damageable extends Entity { /** * Deals the given amount of damage to this entity. diff --git a/src/main/java/org/bukkit/entity/Egg.java b/src/main/java/org/bukkit/entity/Egg.java index 2dcc00b..62b4b36 100644 --- a/src/main/java/org/bukkit/entity/Egg.java +++ b/src/main/java/org/bukkit/entity/Egg.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a thrown egg. */ +@Deprecated public interface Egg extends Projectile {} diff --git a/src/main/java/org/bukkit/entity/EnderCrystal.java b/src/main/java/org/bukkit/entity/EnderCrystal.java index bac547e..f5e4520 100644 --- a/src/main/java/org/bukkit/entity/EnderCrystal.java +++ b/src/main/java/org/bukkit/entity/EnderCrystal.java @@ -3,5 +3,6 @@ package org.bukkit.entity; /** * A crystal that heals nearby EnderDragons */ +@Deprecated public interface EnderCrystal extends Entity { } diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java index 609f3ba..216292f 100644 --- a/src/main/java/org/bukkit/entity/EnderDragon.java +++ b/src/main/java/org/bukkit/entity/EnderDragon.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents an Ender Dragon */ +@Deprecated public interface EnderDragon extends ComplexLivingEntity { } diff --git a/src/main/java/org/bukkit/entity/EnderDragonPart.java b/src/main/java/org/bukkit/entity/EnderDragonPart.java index 9516f56..51bd882 100644 --- a/src/main/java/org/bukkit/entity/EnderDragonPart.java +++ b/src/main/java/org/bukkit/entity/EnderDragonPart.java @@ -3,6 +3,8 @@ package org.bukkit.entity; /** * Represents an ender dragon part */ +@Deprecated public interface EnderDragonPart extends ComplexEntityPart, Damageable { + @Deprecated public EnderDragon getParent(); } diff --git a/src/main/java/org/bukkit/entity/EnderPearl.java b/src/main/java/org/bukkit/entity/EnderPearl.java index db18a90..bc73cd1 100644 --- a/src/main/java/org/bukkit/entity/EnderPearl.java +++ b/src/main/java/org/bukkit/entity/EnderPearl.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a thrown Ender Pearl entity */ +@Deprecated public interface EnderPearl extends Projectile { } diff --git a/src/main/java/org/bukkit/entity/EnderSignal.java b/src/main/java/org/bukkit/entity/EnderSignal.java index 3d2d76c..f01d5f8 100644 --- a/src/main/java/org/bukkit/entity/EnderSignal.java +++ b/src/main/java/org/bukkit/entity/EnderSignal.java @@ -4,6 +4,7 @@ package org.bukkit.entity; * Represents an Ender Signal, which is often created upon throwing an ender * eye */ +@Deprecated public interface EnderSignal extends Entity { } diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java index 0b66a92..a5440d8 100644 --- a/src/main/java/org/bukkit/entity/Enderman.java +++ b/src/main/java/org/bukkit/entity/Enderman.java @@ -5,6 +5,7 @@ import org.bukkit.material.MaterialData; /** * Represents an Enderman. */ +@Deprecated public interface Enderman extends Monster { /** @@ -12,6 +13,7 @@ public interface Enderman extends Monster { * * @return MaterialData containing the id and data of the block */ + @Deprecated public MaterialData getCarriedMaterial(); /** @@ -19,5 +21,6 @@ public interface Enderman extends Monster { * * @param material data to set the carried block to */ + @Deprecated public void setCarriedMaterial(MaterialData material); } diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java index 294e80b..bf43a78 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -15,6 +15,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; /** * Represents a base entity in the world */ +@Deprecated public interface Entity extends Metadatable { /** @@ -22,6 +23,7 @@ public interface Entity extends Metadatable { * * @return a new copy of Location containing the position of this entity */ + @Deprecated public Location getLocation(); /** @@ -32,6 +34,7 @@ public interface Entity extends Metadatable { * * @return The Location object provided or null */ + @Deprecated public Location getLocation(Location loc); /** @@ -39,6 +42,7 @@ public interface Entity extends Metadatable { * * @param velocity New velocity to travel with */ + @Deprecated public void setVelocity(Vector velocity); /** @@ -46,6 +50,7 @@ public interface Entity extends Metadatable { * * @return Current travelling velocity of this entity */ + @Deprecated public Vector getVelocity(); /** @@ -55,6 +60,7 @@ public interface Entity extends Metadatable { * * @return True if entity is on ground. */ + @Deprecated public boolean isOnGround(); /** @@ -62,6 +68,7 @@ public interface Entity extends Metadatable { * * @return World */ + @Deprecated public World getWorld(); /** @@ -70,6 +77,7 @@ public interface Entity extends Metadatable { * @param location New location to teleport this entity to * @return true if the teleport was successful */ + @Deprecated public boolean teleport(Location location); /** @@ -79,6 +87,7 @@ public interface Entity extends Metadatable { * @param cause The cause of this teleportation * @return true if the teleport was successful */ + @Deprecated public boolean teleport(Location location, TeleportCause cause); /** @@ -87,6 +96,7 @@ public interface Entity extends Metadatable { * @param destination Entity to teleport this entity to * @return true if the teleport was successful */ + @Deprecated public boolean teleport(Entity destination); /** @@ -96,6 +106,7 @@ public interface Entity extends Metadatable { * @param cause The cause of this teleportation * @return true if the teleport was successful */ + @Deprecated public boolean teleport(Entity destination, TeleportCause cause); /** @@ -107,6 +118,7 @@ public interface Entity extends Metadatable { * @param z 1/2 the size of the box along z axis * @return List List of entities nearby */ + @Deprecated public List getNearbyEntities(double x, double y, double z); /** @@ -114,6 +126,7 @@ public interface Entity extends Metadatable { * * @return Entity id */ + @Deprecated public int getEntityId(); /** @@ -122,6 +135,7 @@ public interface Entity extends Metadatable { * * @return int fireTicks */ + @Deprecated public int getFireTicks(); /** @@ -129,6 +143,7 @@ public interface Entity extends Metadatable { * * @return int maxFireTicks */ + @Deprecated public int getMaxFireTicks(); /** @@ -137,11 +152,13 @@ public interface Entity extends Metadatable { * * @param ticks Current ticks remaining */ + @Deprecated public void setFireTicks(int ticks); /** * Mark the entity's removal. */ + @Deprecated public void remove(); /** @@ -149,6 +166,7 @@ public interface Entity extends Metadatable { * * @return True if it is dead. */ + @Deprecated public boolean isDead(); /** @@ -157,6 +175,7 @@ public interface Entity extends Metadatable { * * @return True if valid. */ + @Deprecated public boolean isValid(); /** @@ -164,6 +183,7 @@ public interface Entity extends Metadatable { * * @return Server instance running this Entity */ + @Deprecated public Server getServer(); /** @@ -172,6 +192,7 @@ public interface Entity extends Metadatable { * * @return an entity */ + @Deprecated public abstract Entity getPassenger(); /** @@ -180,6 +201,7 @@ public interface Entity extends Metadatable { * @param passenger The new passenger. * @return false if it could not be done for whatever reason */ + @Deprecated public abstract boolean setPassenger(Entity passenger); /** @@ -187,6 +209,7 @@ public interface Entity extends Metadatable { * * @return True if the vehicle has no passengers. */ + @Deprecated public abstract boolean isEmpty(); /** @@ -194,6 +217,7 @@ public interface Entity extends Metadatable { * * @return True if there was a passenger. */ + @Deprecated public abstract boolean eject(); /** @@ -201,6 +225,7 @@ public interface Entity extends Metadatable { * * @return The distance. */ + @Deprecated public float getFallDistance(); /** @@ -208,6 +233,7 @@ public interface Entity extends Metadatable { * * @param distance The new distance. */ + @Deprecated public void setFallDistance(float distance); /** @@ -215,6 +241,7 @@ public interface Entity extends Metadatable { * * @param event a {@link EntityDamageEvent} */ + @Deprecated public void setLastDamageCause(EntityDamageEvent event); /** @@ -224,6 +251,7 @@ public interface Entity extends Metadatable { * @return the last known {@link EntityDamageEvent} or null if hitherto * unharmed */ + @Deprecated public EntityDamageEvent getLastDamageCause(); /** @@ -231,6 +259,7 @@ public interface Entity extends Metadatable { * * @return unique id */ + @Deprecated public UUID getUniqueId(); /** @@ -240,6 +269,7 @@ public interface Entity extends Metadatable { * * @return Age of entity */ + @Deprecated public int getTicksLived(); /** @@ -250,6 +280,7 @@ public interface Entity extends Metadatable { * * @param value Age of entity */ + @Deprecated public void setTicksLived(int value); /** @@ -259,6 +290,7 @@ public interface Entity extends Metadatable { * * @param type Effect to play. */ + @Deprecated public void playEffect(EntityEffect type); /** @@ -266,6 +298,7 @@ public interface Entity extends Metadatable { * * @return The entity type. */ + @Deprecated public EntityType getType(); /** @@ -273,6 +306,7 @@ public interface Entity extends Metadatable { * * @return True if the entity is in a vehicle. */ + @Deprecated public boolean isInsideVehicle(); /** @@ -282,6 +316,7 @@ public interface Entity extends Metadatable { * * @return True if the entity was in a vehicle. */ + @Deprecated public boolean leaveVehicle(); /** @@ -290,9 +325,11 @@ public interface Entity extends Metadatable { * * @return The current vehicle. */ + @Deprecated public Entity getVehicle(); // Spigot Start + @Deprecated public class Spigot { @@ -301,6 +338,7 @@ public interface Entity extends Metadatable { * * @return True if the entity is invulnerable. */ + @Deprecated public boolean isInvulnerable() { throw new UnsupportedOperationException( "Not supported yet." ); diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java index 39ecb13..fec1f07 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java @@ -14,6 +14,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.Location; import org.bukkit.World; +@Deprecated public enum EntityType { // These strings MUST match the strings in nms.EntityTypes and are case sensitive. @@ -170,12 +171,18 @@ public enum EntityType { */ UNKNOWN(null, null, -1, false); + @Deprecated private String name; + @Deprecated private Class clazz; + @Deprecated private short typeId; + @Deprecated private boolean independent, living; + @Deprecated private static final Map NAME_MAP = new HashMap(); + @Deprecated private static final Map ID_MAP = new HashMap(); static { @@ -189,10 +196,12 @@ public enum EntityType { } } + @Deprecated private EntityType(String name, Class clazz, int typeId) { this(name, clazz, typeId, true); } + @Deprecated private EntityType(String name, Class clazz, int typeId, boolean independent) { this.name = name; this.clazz = clazz; @@ -212,6 +221,7 @@ public enum EntityType { return name; } + @Deprecated public Class getEntityClass() { return clazz; } @@ -257,10 +267,12 @@ public enum EntityType { * * @return False if the entity type cannot be spawned */ + @Deprecated public boolean isSpawnable() { return independent; } + @Deprecated public boolean isAlive() { return living; } diff --git a/src/main/java/org/bukkit/entity/ExperienceOrb.java b/src/main/java/org/bukkit/entity/ExperienceOrb.java index c286edf..eaf2a9e 100644 --- a/src/main/java/org/bukkit/entity/ExperienceOrb.java +++ b/src/main/java/org/bukkit/entity/ExperienceOrb.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents an Experience Orb. */ +@Deprecated public interface ExperienceOrb extends Entity { /** @@ -10,6 +11,7 @@ public interface ExperienceOrb extends Entity { * * @return Amount of experience */ + @Deprecated public int getExperience(); /** @@ -17,5 +19,6 @@ public interface ExperienceOrb extends Entity { * * @param value Amount of experience */ + @Deprecated public void setExperience(int value); } diff --git a/src/main/java/org/bukkit/entity/Explosive.java b/src/main/java/org/bukkit/entity/Explosive.java index 48650f6..fdf5233 100644 --- a/src/main/java/org/bukkit/entity/Explosive.java +++ b/src/main/java/org/bukkit/entity/Explosive.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * A representation of an explosive entity */ +@Deprecated public interface Explosive extends Entity { /** @@ -10,6 +11,7 @@ public interface Explosive extends Entity { * * @param yield The explosive yield */ + @Deprecated public void setYield(float yield); /** @@ -17,6 +19,7 @@ public interface Explosive extends Entity { * * @return the radius of blocks affected */ + @Deprecated public float getYield(); /** @@ -24,6 +27,7 @@ public interface Explosive extends Entity { * * @param isIncendiary Whether it should cause fire */ + @Deprecated public void setIsIncendiary(boolean isIncendiary); /** @@ -31,5 +35,6 @@ public interface Explosive extends Entity { * * @return true if the explosive creates fire, false otherwise */ + @Deprecated public boolean isIncendiary(); } diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java index 1edd6e0..efb7936 100644 --- a/src/main/java/org/bukkit/entity/FallingBlock.java +++ b/src/main/java/org/bukkit/entity/FallingBlock.java @@ -5,6 +5,7 @@ import org.bukkit.Material; /** * Represents a falling block */ +@Deprecated public interface FallingBlock extends Entity { /** diff --git a/src/main/java/org/bukkit/entity/Fireball.java b/src/main/java/org/bukkit/entity/Fireball.java index 56ed578..7242d2a 100644 --- a/src/main/java/org/bukkit/entity/Fireball.java +++ b/src/main/java/org/bukkit/entity/Fireball.java @@ -5,6 +5,7 @@ import org.bukkit.util.Vector; /** * Represents a Fireball. */ +@Deprecated public interface Fireball extends Projectile, Explosive { /** @@ -12,6 +13,7 @@ public interface Fireball extends Projectile, Explosive { * * @param direction the direction this fireball is flying toward */ + @Deprecated public void setDirection(Vector direction); /** @@ -19,6 +21,7 @@ public interface Fireball extends Projectile, Explosive { * * @return the direction */ + @Deprecated public Vector getDirection(); } diff --git a/src/main/java/org/bukkit/entity/Firework.java b/src/main/java/org/bukkit/entity/Firework.java index b8a8c07..48e6827 100644 --- a/src/main/java/org/bukkit/entity/Firework.java +++ b/src/main/java/org/bukkit/entity/Firework.java @@ -2,6 +2,7 @@ package org.bukkit.entity; import org.bukkit.inventory.meta.FireworkMeta; +@Deprecated public interface Firework extends Entity { /** diff --git a/src/main/java/org/bukkit/entity/Fish.java b/src/main/java/org/bukkit/entity/Fish.java index 9ecc4a3..6fed6c7 100644 --- a/src/main/java/org/bukkit/entity/Fish.java +++ b/src/main/java/org/bukkit/entity/Fish.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a fishing hook. */ +@Deprecated public interface Fish extends Projectile { /** @@ -13,6 +14,7 @@ public interface Fish extends Projectile { * * @return chance the bite chance */ + @Deprecated public double getBiteChance(); /** @@ -25,5 +27,6 @@ public interface Fish extends Projectile { * @throws IllegalArgumentException if the bite chance is not between 0 * and 1 */ + @Deprecated public void setBiteChance(double chance) throws IllegalArgumentException; } diff --git a/src/main/java/org/bukkit/entity/Flying.java b/src/main/java/org/bukkit/entity/Flying.java index 4f16a26..eaf3aeb 100644 --- a/src/main/java/org/bukkit/entity/Flying.java +++ b/src/main/java/org/bukkit/entity/Flying.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Flying Entity. */ +@Deprecated public interface Flying extends LivingEntity {} diff --git a/src/main/java/org/bukkit/entity/Ghast.java b/src/main/java/org/bukkit/entity/Ghast.java index 3f5edf7..154189e 100644 --- a/src/main/java/org/bukkit/entity/Ghast.java +++ b/src/main/java/org/bukkit/entity/Ghast.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Ghast. */ +@Deprecated public interface Ghast extends Flying {} diff --git a/src/main/java/org/bukkit/entity/Giant.java b/src/main/java/org/bukkit/entity/Giant.java index 610de57..3578029 100644 --- a/src/main/java/org/bukkit/entity/Giant.java +++ b/src/main/java/org/bukkit/entity/Giant.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Giant. */ +@Deprecated public interface Giant extends Monster {} diff --git a/src/main/java/org/bukkit/entity/Golem.java b/src/main/java/org/bukkit/entity/Golem.java index 4165977..b1dd6ae 100644 --- a/src/main/java/org/bukkit/entity/Golem.java +++ b/src/main/java/org/bukkit/entity/Golem.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * A mechanical creature that may harm enemies. */ +@Deprecated public interface Golem extends Creature { } diff --git a/src/main/java/org/bukkit/entity/Hanging.java b/src/main/java/org/bukkit/entity/Hanging.java index 67e9b61..5219c3b 100644 --- a/src/main/java/org/bukkit/entity/Hanging.java +++ b/src/main/java/org/bukkit/entity/Hanging.java @@ -6,6 +6,7 @@ import org.bukkit.material.Attachable; /** * Represents a Hanging entity */ +@Deprecated public interface Hanging extends Entity, Attachable { /** @@ -18,5 +19,6 @@ public interface Hanging extends Entity, Attachable { * @return False if force was false and there was no block for it to * attach to in order to face the given direction. */ + @Deprecated public boolean setFacingDirection(BlockFace face, boolean force); } diff --git a/src/main/java/org/bukkit/entity/Horse.java b/src/main/java/org/bukkit/entity/Horse.java index e90d318..3740e9d 100644 --- a/src/main/java/org/bukkit/entity/Horse.java +++ b/src/main/java/org/bukkit/entity/Horse.java @@ -6,11 +6,13 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a Horse. */ +@Deprecated public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { /** * Represents the different types of horses that may exist. */ + @Deprecated public enum Variant { /** * A normal horse @@ -38,6 +40,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { /** * Represents the base color that the horse has. */ + @Deprecated public enum Color { /** * Snow white @@ -73,6 +76,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { /** * Represents the style, or markings, that the horse has. */ + @Deprecated public enum Style { /** * No markings @@ -106,6 +110,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @return a {@link Variant} representing the horse's variant */ + @Deprecated public Variant getVariant(); /** @@ -122,6 +127,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @param variant a {@link Variant} for this horse */ + @Deprecated public void setVariant(Variant variant); /** @@ -132,6 +138,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @return a {@link Color} representing the horse's group */ + @Deprecated public Color getColor(); /** @@ -142,6 +149,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @param color a {@link Color} for this horse */ + @Deprecated public void setColor(Color color); /** @@ -153,6 +161,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @return a {@link Style} representing the horse's style */ + @Deprecated public Style getStyle(); /** @@ -164,6 +173,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @param style a {@link Style} for this horse */ + @Deprecated public void setStyle(Style style); /** @@ -171,6 +181,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @return true if the horse has chest storage */ + @Deprecated public boolean isCarryingChest(); /** @@ -179,6 +190,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @param chest true if the horse should have a chest */ + @Deprecated public void setCarryingChest(boolean chest); /** @@ -190,6 +202,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @return domestication level */ + @Deprecated public int getDomestication(); /** @@ -204,6 +217,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @param level domestication level */ + @Deprecated public void setDomestication(int level); /** @@ -214,6 +228,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @return the max domestication level */ + @Deprecated public int getMaxDomestication(); /** @@ -227,6 +242,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @param level the max domestication level */ + @Deprecated public void setMaxDomestication(int level); /** @@ -237,6 +253,7 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @return the horse's jump strength */ + @Deprecated public double getJumpStrength(); /** @@ -249,8 +266,10 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * * @param strength jump strength for this horse */ + @Deprecated public void setJumpStrength(double strength); @Override + @Deprecated public HorseInventory getInventory(); } diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java index 6f70db4..991993a 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -12,6 +12,7 @@ import org.bukkit.permissions.Permissible; /** * Represents a human entity, such as an NPC or a player */ +@Deprecated public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, InventoryHolder { /** @@ -19,6 +20,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @return Player name */ + @Deprecated public String getName(); /** @@ -27,6 +29,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * @return The inventory of the player, this also contains the armor * slots. */ + @Deprecated public PlayerInventory getInventory(); /** @@ -34,6 +37,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @return The EnderChest of the player */ + @Deprecated public Inventory getEnderChest(); /** @@ -44,6 +48,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * @param value The value to set the property to. * @return True if the property was successfully set. */ + @Deprecated public boolean setWindowProperty(InventoryView.Property prop, int value); /** @@ -52,6 +57,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @return The inventory view. */ + @Deprecated public InventoryView getOpenInventory(); /** @@ -61,6 +67,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * @param inventory The inventory to open * @return The newly opened inventory view */ + @Deprecated public InventoryView openInventory(Inventory inventory); /** @@ -74,6 +81,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * @return The newly opened inventory view, or null if it could not be * opened. */ + @Deprecated public InventoryView openWorkbench(Location location, boolean force); /** @@ -87,6 +95,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * @return The newly opened inventory view, or null if it could not be * opened. */ + @Deprecated public InventoryView openEnchanting(Location location, boolean force); /** @@ -94,11 +103,13 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @param inventory The view to open */ + @Deprecated public void openInventory(InventoryView inventory); /** * Force-closes the currently open inventory view for this player, if any. */ + @Deprecated public void closeInventory(); /** @@ -106,6 +117,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @return The ItemStack of the item you are currently holding. */ + @Deprecated public ItemStack getItemInHand(); /** @@ -114,6 +126,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @param item The ItemStack which will end up in the hand */ + @Deprecated public void setItemInHand(ItemStack item); /** @@ -122,6 +135,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @return The ItemStack of the item you are currently moving around. */ + @Deprecated public ItemStack getItemOnCursor(); /** @@ -131,6 +145,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @param item The ItemStack which will end up in the hand */ + @Deprecated public void setItemOnCursor(ItemStack item); /** @@ -138,6 +153,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @return slumber state */ + @Deprecated public boolean isSleeping(); /** @@ -145,6 +161,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @return slumber ticks */ + @Deprecated public int getSleepTicks(); /** @@ -152,6 +169,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @return Current game mode */ + @Deprecated public GameMode getGameMode(); /** @@ -159,6 +177,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @param mode New game mode */ + @Deprecated public void setGameMode(GameMode mode); /** @@ -166,6 +185,7 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @return Whether they are blocking. */ + @Deprecated public boolean isBlocking(); /** @@ -173,5 +193,6 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv * * @return Experience required to level up */ + @Deprecated public int getExpToLevel(); } diff --git a/src/main/java/org/bukkit/entity/IronGolem.java b/src/main/java/org/bukkit/entity/IronGolem.java index 655e37c..0be668d 100644 --- a/src/main/java/org/bukkit/entity/IronGolem.java +++ b/src/main/java/org/bukkit/entity/IronGolem.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * An iron Golem that protects Villages. */ +@Deprecated public interface IronGolem extends Golem { /** @@ -10,6 +11,7 @@ public interface IronGolem extends Golem { * * @return Whether this iron golem was built by a player */ + @Deprecated public boolean isPlayerCreated(); /** @@ -18,5 +20,6 @@ public interface IronGolem extends Golem { * @param playerCreated true if you want to set the iron golem as being * player created, false if you want it to be a natural village golem. */ + @Deprecated public void setPlayerCreated(boolean playerCreated); } diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java index 90260b7..fa54cc1 100644 --- a/src/main/java/org/bukkit/entity/Item.java +++ b/src/main/java/org/bukkit/entity/Item.java @@ -5,6 +5,7 @@ import org.bukkit.inventory.ItemStack; /** * Represents an Item. */ +@Deprecated public interface Item extends Entity { /** @@ -12,6 +13,7 @@ public interface Item extends Entity { * * @return An item stack. */ + @Deprecated public ItemStack getItemStack(); /** @@ -19,6 +21,7 @@ public interface Item extends Entity { * * @param stack An item stack. */ + @Deprecated public void setItemStack(ItemStack stack); /** @@ -26,6 +29,7 @@ public interface Item extends Entity { * * @return Remaining delay */ + @Deprecated public int getPickupDelay(); /** @@ -33,5 +37,6 @@ public interface Item extends Entity { * * @param delay New delay */ + @Deprecated public void setPickupDelay(int delay); } diff --git a/src/main/java/org/bukkit/entity/ItemFrame.java b/src/main/java/org/bukkit/entity/ItemFrame.java index 8b86815..c871ffa 100644 --- a/src/main/java/org/bukkit/entity/ItemFrame.java +++ b/src/main/java/org/bukkit/entity/ItemFrame.java @@ -6,6 +6,7 @@ import org.bukkit.inventory.ItemStack; /** * Represents an Item Frame */ +@Deprecated public interface ItemFrame extends Hanging { /** @@ -13,6 +14,7 @@ public interface ItemFrame extends Hanging { * * @return a defensive copy the item in this item frame */ + @Deprecated public ItemStack getItem(); /** @@ -20,6 +22,7 @@ public interface ItemFrame extends Hanging { * * @param item the new item */ + @Deprecated public void setItem(ItemStack item); /** @@ -27,6 +30,7 @@ public interface ItemFrame extends Hanging { * * @return the direction */ + @Deprecated public Rotation getRotation(); /** @@ -35,5 +39,6 @@ public interface ItemFrame extends Hanging { * @param rotation the new rotation * @throws IllegalArgumentException if rotation is null */ + @Deprecated public void setRotation(Rotation rotation) throws IllegalArgumentException; } diff --git a/src/main/java/org/bukkit/entity/LargeFireball.java b/src/main/java/org/bukkit/entity/LargeFireball.java index fc3a109..6ff7672 100644 --- a/src/main/java/org/bukkit/entity/LargeFireball.java +++ b/src/main/java/org/bukkit/entity/LargeFireball.java @@ -3,5 +3,6 @@ package org.bukkit.entity; /** * Represents a large {@link Fireball} */ +@Deprecated public interface LargeFireball extends Fireball { } diff --git a/src/main/java/org/bukkit/entity/LeashHitch.java b/src/main/java/org/bukkit/entity/LeashHitch.java index 9ac04c1..ca039fb 100644 --- a/src/main/java/org/bukkit/entity/LeashHitch.java +++ b/src/main/java/org/bukkit/entity/LeashHitch.java @@ -3,5 +3,6 @@ package org.bukkit.entity; /** * Represents a Leash Hitch on a fence */ +@Deprecated public interface LeashHitch extends Hanging { } diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java index 1ed4ac9..b996471 100644 --- a/src/main/java/org/bukkit/entity/LightningStrike.java +++ b/src/main/java/org/bukkit/entity/LightningStrike.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents an instance of a lightning strike. May or may not do damage. */ +@Deprecated public interface LightningStrike extends Weather { /** @@ -10,9 +11,11 @@ public interface LightningStrike extends Weather { * * @return whether the strike is an effect */ + @Deprecated public boolean isEffect(); + @Deprecated public class Spigot extends Entity.Spigot { @@ -21,6 +24,7 @@ public interface LightningStrike extends Weather { * * @return whether the strike is silent. */ + @Deprecated public boolean isSilent() { throw new UnsupportedOperationException( "Not supported yet." ); diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java index 6c8b4f8..d054a0f 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -14,6 +14,7 @@ import org.bukkit.projectiles.ProjectileSource; /** * Represents a living entity, such as a monster or player */ +@Deprecated public interface LivingEntity extends Entity, Damageable, ProjectileSource { /** @@ -21,6 +22,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return height of the living entity's eyes above its location */ + @Deprecated public double getEyeHeight(); /** @@ -30,6 +32,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * ignored * @return height of the living entity's eyes above its location */ + @Deprecated public double getEyeHeight(boolean ignoreSneaking); /** @@ -37,6 +40,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return a location at the eyes of the living entity */ + @Deprecated public Location getEyeLocation(); /** @@ -118,6 +122,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return amount of air remaining */ + @Deprecated public int getRemainingAir(); /** @@ -125,6 +130,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @param ticks amount of air remaining */ + @Deprecated public void setRemainingAir(int ticks); /** @@ -132,6 +138,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return maximum amount of air */ + @Deprecated public int getMaximumAir(); /** @@ -139,6 +146,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @param ticks maximum amount of air */ + @Deprecated public void setMaximumAir(int ticks); /** @@ -149,6 +157,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return maximum no damage ticks */ + @Deprecated public int getMaximumNoDamageTicks(); /** @@ -156,6 +165,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @param ticks maximum amount of no damage ticks */ + @Deprecated public void setMaximumNoDamageTicks(int ticks); /** @@ -167,6 +177,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return damage taken since the last no damage ticks time period */ + @Deprecated public double getLastDamage(); /** @@ -182,6 +193,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @param damage amount of damage */ + @Deprecated public void setLastDamage(double damage); /** @@ -197,6 +209,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return amount of no damage ticks */ + @Deprecated public int getNoDamageTicks(); /** @@ -204,6 +217,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @param ticks amount of no damage ticks */ + @Deprecated public void setNoDamageTicks(int ticks); /** @@ -213,6 +227,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return killer player, or null if none found */ + @Deprecated public Player getKiller(); /** @@ -224,6 +239,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * @param effect PotionEffect to be added * @return whether the effect could be added */ + @Deprecated public boolean addPotionEffect(PotionEffect effect); /** @@ -236,6 +252,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * @param force whether conflicting effects should be removed * @return whether the effect could be added */ + @Deprecated public boolean addPotionEffect(PotionEffect effect, boolean force); /** @@ -245,6 +262,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * @param effects the effects to add * @return whether all of the effects could be added */ + @Deprecated public boolean addPotionEffects(Collection effects); /** @@ -254,6 +272,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * @param type the potion type to check * @return whether the living entity has this potion effect active on them */ + @Deprecated public boolean hasPotionEffect(PotionEffectType type); /** @@ -261,6 +280,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @param type the potion type to remove */ + @Deprecated public void removePotionEffect(PotionEffectType type); /** @@ -269,6 +289,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return a collection of {@link PotionEffect}s */ + @Deprecated public Collection getActivePotionEffects(); /** @@ -280,6 +301,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * @param other the entity to determine line of sight to * @return true if there is a line of sight, false if not */ + @Deprecated public boolean hasLineOfSight(Entity other); /** @@ -289,6 +311,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return true if the living entity is removed when away from players */ + @Deprecated public boolean getRemoveWhenFarAway(); /** @@ -297,6 +320,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @param remove the removal status */ + @Deprecated public void setRemoveWhenFarAway(boolean remove); /** @@ -304,6 +328,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return the living entity's inventory */ + @Deprecated public EntityEquipment getEquipment(); /** @@ -311,6 +336,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @param pickup whether or not the living entity can pick up items */ + @Deprecated public void setCanPickupItems(boolean pickup); /** @@ -318,6 +344,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return whether or not the living entity can pick up items */ + @Deprecated public boolean getCanPickupItems(); /** @@ -331,6 +358,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @param name the name to set */ + @Deprecated public void setCustomName(String name); /** @@ -342,6 +370,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return name of the mob or null */ + @Deprecated public String getCustomName(); /** @@ -353,6 +382,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @param flag custom name or not */ + @Deprecated public void setCustomNameVisible(boolean flag); /** @@ -363,6 +393,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return if the custom name is displayed */ + @Deprecated public boolean isCustomNameVisible(); /** @@ -370,6 +401,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * * @return whether the entity is leashed */ + @Deprecated public boolean isLeashed(); /** @@ -378,6 +410,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * @return the entity holding the leash * @throws IllegalStateException if not currently leashed */ + @Deprecated public Entity getLeashHolder() throws IllegalStateException; /** @@ -390,5 +423,6 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { * @param holder the entity to leash this entity to * @return whether the operation was successful */ + @Deprecated public boolean setLeashHolder(Entity holder); } diff --git a/src/main/java/org/bukkit/entity/MagmaCube.java b/src/main/java/org/bukkit/entity/MagmaCube.java index 714b442..492c746 100644 --- a/src/main/java/org/bukkit/entity/MagmaCube.java +++ b/src/main/java/org/bukkit/entity/MagmaCube.java @@ -3,5 +3,6 @@ package org.bukkit.entity; /** * Represents a MagmaCube. */ +@Deprecated public interface MagmaCube extends Slime { } diff --git a/src/main/java/org/bukkit/entity/Minecart.java b/src/main/java/org/bukkit/entity/Minecart.java index a7bb094..942535a 100644 --- a/src/main/java/org/bukkit/entity/Minecart.java +++ b/src/main/java/org/bukkit/entity/Minecart.java @@ -5,6 +5,7 @@ import org.bukkit.util.Vector; /** * Represents a minecart entity. */ +@Deprecated public interface Minecart extends Vehicle { /** @@ -20,6 +21,7 @@ public interface Minecart extends Vehicle { * * @param damage over 40 to "kill" a minecart */ + @Deprecated public void setDamage(double damage); /** @@ -35,6 +37,7 @@ public interface Minecart extends Vehicle { * * @return The damage */ + @Deprecated public double getDamage(); /** @@ -43,6 +46,7 @@ public interface Minecart extends Vehicle { * * @return The max speed */ + @Deprecated public double getMaxSpeed(); /** @@ -51,6 +55,7 @@ public interface Minecart extends Vehicle { * * @param speed The max speed */ + @Deprecated public void setMaxSpeed(double speed); /** @@ -59,6 +64,7 @@ public interface Minecart extends Vehicle { * * @return Whether it decelerates faster */ + @Deprecated public boolean isSlowWhenEmpty(); /** @@ -67,6 +73,7 @@ public interface Minecart extends Vehicle { * * @param slow Whether it will decelerate faster */ + @Deprecated public void setSlowWhenEmpty(boolean slow); /** @@ -76,6 +83,7 @@ public interface Minecart extends Vehicle { * * @return The vector factor */ + @Deprecated public Vector getFlyingVelocityMod(); /** @@ -85,6 +93,7 @@ public interface Minecart extends Vehicle { * * @param flying velocity modifier vector */ + @Deprecated public void setFlyingVelocityMod(Vector flying); /** @@ -95,6 +104,7 @@ public interface Minecart extends Vehicle { * * @return derailed visible speed */ + @Deprecated public Vector getDerailedVelocityMod(); /** @@ -104,5 +114,6 @@ public interface Minecart extends Vehicle { * * @param derailed visible speed */ + @Deprecated public void setDerailedVelocityMod(Vector derailed); } diff --git a/src/main/java/org/bukkit/entity/Monster.java b/src/main/java/org/bukkit/entity/Monster.java index fce2efd..b713cda 100644 --- a/src/main/java/org/bukkit/entity/Monster.java +++ b/src/main/java/org/bukkit/entity/Monster.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Monster. */ +@Deprecated public interface Monster extends Creature {} diff --git a/src/main/java/org/bukkit/entity/MushroomCow.java b/src/main/java/org/bukkit/entity/MushroomCow.java index 84154de..6d6bc36 100644 --- a/src/main/java/org/bukkit/entity/MushroomCow.java +++ b/src/main/java/org/bukkit/entity/MushroomCow.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a mushroom {@link Cow} */ +@Deprecated public interface MushroomCow extends Cow { } diff --git a/src/main/java/org/bukkit/entity/NPC.java b/src/main/java/org/bukkit/entity/NPC.java index 0c6b175..6c1171e 100644 --- a/src/main/java/org/bukkit/entity/NPC.java +++ b/src/main/java/org/bukkit/entity/NPC.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a non-player character */ +@Deprecated public interface NPC extends Creature { } diff --git a/src/main/java/org/bukkit/entity/Ocelot.java b/src/main/java/org/bukkit/entity/Ocelot.java index d5d034d..8ca368f 100644 --- a/src/main/java/org/bukkit/entity/Ocelot.java +++ b/src/main/java/org/bukkit/entity/Ocelot.java @@ -4,6 +4,7 @@ package org.bukkit.entity; /** * A wild tameable cat */ +@Deprecated public interface Ocelot extends Animals, Tameable { /** @@ -11,6 +12,7 @@ public interface Ocelot extends Animals, Tameable { * * @return Type of the cat. */ + @Deprecated public Type getCatType(); /** @@ -18,6 +20,7 @@ public interface Ocelot extends Animals, Tameable { * * @param type New type of this cat. */ + @Deprecated public void setCatType(Type type); /** @@ -25,6 +28,7 @@ public interface Ocelot extends Animals, Tameable { * * @return true if sitting */ + @Deprecated public boolean isSitting(); /** @@ -33,18 +37,22 @@ public interface Ocelot extends Animals, Tameable { * * @param sitting true if sitting */ + @Deprecated public void setSitting(boolean sitting); /** * Represents the various different cat types there are. */ + @Deprecated public enum Type { WILD_OCELOT(0), BLACK_CAT(1), RED_CAT(2), SIAMESE_CAT(3); + @Deprecated private static final Type[] types = new Type[Type.values().length]; + @Deprecated private final int id; static { @@ -53,6 +61,7 @@ public interface Ocelot extends Animals, Tameable { } } + @Deprecated private Type(int id) { this.id = id; } diff --git a/src/main/java/org/bukkit/entity/Painting.java b/src/main/java/org/bukkit/entity/Painting.java index ca7a4cf..51b2bcb 100644 --- a/src/main/java/org/bukkit/entity/Painting.java +++ b/src/main/java/org/bukkit/entity/Painting.java @@ -6,6 +6,7 @@ import org.bukkit.event.painting.PaintingBreakEvent; /** * Represents a Painting. */ +@Deprecated public interface Painting extends Hanging { /** @@ -13,6 +14,7 @@ public interface Painting extends Hanging { * * @return The art */ + @Deprecated public Art getArt(); /** @@ -22,6 +24,7 @@ public interface Painting extends Hanging { * @return False if the new art won't fit at the painting's current * location */ + @Deprecated public boolean setArt(Art art); /** @@ -35,5 +38,6 @@ public interface Painting extends Hanging { * @return False if force was false and the new art won't fit at the * painting's current location */ + @Deprecated public boolean setArt(Art art, boolean force); } diff --git a/src/main/java/org/bukkit/entity/Pig.java b/src/main/java/org/bukkit/entity/Pig.java index 28f59f2..7042173 100644 --- a/src/main/java/org/bukkit/entity/Pig.java +++ b/src/main/java/org/bukkit/entity/Pig.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a Pig. */ +@Deprecated public interface Pig extends Animals, Vehicle { /** @@ -10,6 +11,7 @@ public interface Pig extends Animals, Vehicle { * * @return if the pig has been saddled. */ + @Deprecated public boolean hasSaddle(); /** @@ -17,5 +19,6 @@ public interface Pig extends Animals, Vehicle { * * @param saddled set if the pig has a saddle or not. */ + @Deprecated public void setSaddle(boolean saddled); } diff --git a/src/main/java/org/bukkit/entity/PigZombie.java b/src/main/java/org/bukkit/entity/PigZombie.java index 2f08672..bb66f65 100644 --- a/src/main/java/org/bukkit/entity/PigZombie.java +++ b/src/main/java/org/bukkit/entity/PigZombie.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a Pig Zombie. */ +@Deprecated public interface PigZombie extends Zombie { /** diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index 6237663..ee85308 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -22,6 +22,7 @@ import org.bukkit.scoreboard.Scoreboard; /** * Represents a player, connected or not */ +@Deprecated public interface Player extends HumanEntity, Conversable, CommandSender, OfflinePlayer, PluginMessageRecipient { /** @@ -33,6 +34,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return the friendly name */ + @Deprecated public String getDisplayName(); /** @@ -44,6 +46,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param name The new display name. */ + @Deprecated public void setDisplayName(String name); /** @@ -51,6 +54,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return the player list name */ + @Deprecated public String getPlayerListName(); /** @@ -74,6 +78,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * else * @throws IllegalArgumentException if the length of the name is too long */ + @Deprecated public void setPlayerListName(String name); /** @@ -81,6 +86,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param loc Location to point to */ + @Deprecated public void setCompassTarget(Location loc); /** @@ -88,6 +94,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return location of the target */ + @Deprecated public Location getCompassTarget(); /** @@ -95,6 +102,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return the player's address */ + @Deprecated public InetSocketAddress getAddress(); /** @@ -102,6 +110,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param message Message to be displayed */ + @Deprecated public void sendRawMessage(String message); /** @@ -109,6 +118,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param message kick message */ + @Deprecated public void kickPlayer(String message); /** @@ -116,6 +126,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param msg message to print */ + @Deprecated public void chat(String msg); /** @@ -124,6 +135,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @param command Command to perform * @return true if the command was successful, otherwise false */ + @Deprecated public boolean performCommand(String command); /** @@ -131,6 +143,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return true if player is in sneak mode */ + @Deprecated public boolean isSneaking(); /** @@ -138,6 +151,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param sneak true if player should appear sneaking */ + @Deprecated public void setSneaking(boolean sneak); /** @@ -145,6 +159,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return true if player is sprinting. */ + @Deprecated public boolean isSprinting(); /** @@ -152,6 +167,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param sprinting true if the player should be sprinting */ + @Deprecated public void setSprinting(boolean sprinting); /** @@ -159,6 +175,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * other information into the username.dat file, in the world/player * folder */ + @Deprecated public void saveData(); /** @@ -169,6 +186,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * Note: This will overwrite the players current inventory, health, * motion, etc, with the state from the saved dat file. */ + @Deprecated public void loadData(); /** @@ -179,6 +197,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param isSleeping Whether to ignore. */ + @Deprecated public void setSleepingIgnored(boolean isSleeping); /** @@ -186,6 +205,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return Whether player is ignoring sleep. */ + @Deprecated public boolean isSleepingIgnored(); /** @@ -210,6 +230,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @param instrument The instrument * @param note The note */ + @Deprecated public void playNote(Location loc, Instrument instrument, Note note); @@ -223,6 +244,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @param volume The volume of the sound * @param pitch The pitch of the sound */ + @Deprecated public void playSound(Location location, Sound sound, float volume, float pitch); /** @@ -259,6 +281,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @param effect the {@link Effect} * @param data a data bit needed for some effects */ + @Deprecated public void playEffect(Location loc, Effect effect, T data); /** @@ -311,6 +334,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param map The map to be sent */ + @Deprecated public void sendMap(MapView map); /** @@ -329,6 +353,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @param achievement Achievement to award * @throws IllegalArgumentException if achievement is null */ + @Deprecated public void awardAchievement(Achievement achievement); /** @@ -338,6 +363,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @param achievement Achievement to remove * @throws IllegalArgumentException if achievement is null */ + @Deprecated public void removeAchievement(Achievement achievement); /** @@ -346,6 +372,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @return whether the player has the achievement * @throws IllegalArgumentException if achievement is null */ + @Deprecated public boolean hasAchievement(Achievement achievement); /** @@ -359,6 +386,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the statistic requires an * additional parameter */ + @Deprecated public void incrementStatistic(Statistic statistic) throws IllegalArgumentException; /** @@ -372,6 +400,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the statistic requires an * additional parameter */ + @Deprecated public void decrementStatistic(Statistic statistic) throws IllegalArgumentException; /** @@ -384,6 +413,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the statistic requires an * additional parameter */ + @Deprecated public void incrementStatistic(Statistic statistic, int amount) throws IllegalArgumentException; /** @@ -396,6 +426,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the statistic requires an * additional parameter */ + @Deprecated public void decrementStatistic(Statistic statistic, int amount) throws IllegalArgumentException; /** @@ -408,6 +439,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the statistic requires an * additional parameter */ + @Deprecated public void setStatistic(Statistic statistic, int newValue) throws IllegalArgumentException; /** @@ -419,6 +451,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the statistic requires an * additional parameter */ + @Deprecated public int getStatistic(Statistic statistic) throws IllegalArgumentException; /** @@ -434,6 +467,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public void incrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException; /** @@ -449,6 +483,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public void decrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException; /** @@ -462,6 +497,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public int getStatistic(Statistic statistic, Material material) throws IllegalArgumentException; /** @@ -476,6 +512,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public void incrementStatistic(Statistic statistic, Material material, int amount) throws IllegalArgumentException; /** @@ -490,6 +527,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public void decrementStatistic(Statistic statistic, Material material, int amount) throws IllegalArgumentException; /** @@ -504,6 +542,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public void setStatistic(Statistic statistic, Material material, int newValue) throws IllegalArgumentException; /** @@ -519,6 +558,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public void incrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException; /** @@ -534,6 +574,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public void decrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException; /** @@ -547,6 +588,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public int getStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException; /** @@ -561,6 +603,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public void incrementStatistic(Statistic statistic, EntityType entityType, int amount) throws IllegalArgumentException; /** @@ -575,6 +618,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public void decrementStatistic(Statistic statistic, EntityType entityType, int amount); /** @@ -589,6 +633,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if the given parameter is not valid * for the statistic */ + @Deprecated public void setStatistic(Statistic statistic, EntityType entityType, int newValue); /** @@ -606,6 +651,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @param relative When true the player time is kept relative to its world * time. */ + @Deprecated public void setPlayerTime(long time, boolean relative); /** @@ -613,6 +659,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return The player's time */ + @Deprecated public long getPlayerTime(); /** @@ -621,6 +668,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return The player's time */ + @Deprecated public long getPlayerTimeOffset(); /** @@ -630,6 +678,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return true if the player's time is relative to the server time. */ + @Deprecated public boolean isPlayerTimeRelative(); /** @@ -638,6 +687,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline *

* Equivalent to calling setPlayerTime(0, true). */ + @Deprecated public void resetPlayerTime(); /** @@ -647,6 +697,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param type The WeatherType enum type the player should experience */ + @Deprecated public void setPlayerWeather(WeatherType type); /** @@ -655,12 +706,14 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @return The WeatherType that the player is currently experiencing or * null if player is seeing server weather. */ + @Deprecated public WeatherType getPlayerWeather(); /** * Restores the normal condition where the player's weather is controlled * by server conditions. */ + @Deprecated public void resetPlayerWeather(); /** @@ -668,6 +721,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param amount Exp amount to give */ + @Deprecated public void giveExp(int amount); /** @@ -676,6 +730,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param amount amount of experience levels to give or take */ + @Deprecated public void giveExpLevels(int amount); /** @@ -685,6 +740,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return Current experience points */ + @Deprecated public float getExp(); /** @@ -694,6 +750,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param exp New experience points */ + @Deprecated public void setExp(float exp); /** @@ -701,6 +758,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return Current experience level */ + @Deprecated public int getLevel(); /** @@ -708,6 +766,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param level New experience level */ + @Deprecated public void setLevel(int level); /** @@ -715,6 +774,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return Current total experience points */ + @Deprecated public int getTotalExperience(); /** @@ -722,6 +782,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param exp New experience level */ + @Deprecated public void setTotalExperience(int exp); /** @@ -733,6 +794,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return Exhaustion level */ + @Deprecated public float getExhaustion(); /** @@ -740,6 +802,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param value Exhaustion level */ + @Deprecated public void setExhaustion(float value); /** @@ -750,6 +813,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return Saturation level */ + @Deprecated public float getSaturation(); /** @@ -757,6 +821,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param value Saturation level */ + @Deprecated public void setSaturation(float value); /** @@ -764,6 +829,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return Food level */ + @Deprecated public int getFoodLevel(); /** @@ -771,6 +837,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param value New food level */ + @Deprecated public void setFoodLevel(int value); /** @@ -779,6 +846,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return Bed Spawn Location if bed exists, otherwise null. */ + @Deprecated public Location getBedSpawnLocation(); /** @@ -786,6 +854,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param location where to set the respawn location */ + @Deprecated public void setBedSpawnLocation(Location location); /** @@ -795,6 +864,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @param force whether to forcefully set the respawn location even if a * valid bed is not present */ + @Deprecated public void setBedSpawnLocation(Location location, boolean force); /** @@ -803,6 +873,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return True if the player is allowed to fly. */ + @Deprecated public boolean getAllowFlight(); /** @@ -811,6 +882,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param flight If flight should be allowed. */ + @Deprecated public void setAllowFlight(boolean flight); /** @@ -818,6 +890,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param player Player to hide */ + @Deprecated public void hidePlayer(Player player); /** @@ -825,6 +898,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param player Player to show */ + @Deprecated public void showPlayer(Player player); /** @@ -834,6 +908,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @return True if the provided player is not being hidden from this * player */ + @Deprecated public boolean canSee(Player player); /** @@ -853,6 +928,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return True if the player is flying, else false. */ + @Deprecated public boolean isFlying(); /** @@ -860,6 +936,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param value True to fly. */ + @Deprecated public void setFlying(boolean value); /** @@ -870,6 +947,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException If new speed is less than -1 or * greater than 1 */ + @Deprecated public void setFlySpeed(float value) throws IllegalArgumentException; /** @@ -880,6 +958,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException If new speed is less than -1 or * greater than 1 */ + @Deprecated public void setWalkSpeed(float value) throws IllegalArgumentException; /** @@ -887,6 +966,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return The current allowed speed, from -1 to 1 */ + @Deprecated public float getFlySpeed(); /** @@ -894,6 +974,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return The current allowed speed, from -1 to 1 */ + @Deprecated public float getWalkSpeed(); /** @@ -954,6 +1035,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException Thrown if the URL is too long. The * length restriction is an implementation specific arbitrary value. */ + @Deprecated public void setResourcePack(String url); /** @@ -961,6 +1043,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return The current scoreboard seen by this player */ + @Deprecated public Scoreboard getScoreboard(); /** @@ -973,6 +1056,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalStateException if this is a player that is not logged * yet or has logged out */ + @Deprecated public void setScoreboard(Scoreboard scoreboard) throws IllegalArgumentException, IllegalStateException; /** @@ -982,6 +1066,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @return if client health display is scaled * @see Player#setHealthScaled(boolean) */ + @Deprecated public boolean isHealthScaled(); /** @@ -993,6 +1078,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @param scale if the client health display is scaled */ + @Deprecated public void setHealthScaled(boolean scale); /** @@ -1007,6 +1093,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @throws IllegalArgumentException if scale is {@link Double#NaN} * @throws IllegalArgumentException if scale is too high */ + @Deprecated public void setHealthScale(double scale) throws IllegalArgumentException; /** @@ -1017,9 +1104,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @see Player#setHealthScale(double) * @see Player#setHealthScaled(boolean) */ + @Deprecated public double getHealthScale(); // Spigot start + @Deprecated public class Spigot extends Entity.Spigot { @@ -1029,11 +1118,13 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return the player's connection address */ + @Deprecated public InetSocketAddress getRawAddress() { throw new UnsupportedOperationException( "Not supported yet." ); } + @Deprecated 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." ); @@ -1044,6 +1135,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return the player's collision toggle state */ + @Deprecated public boolean getCollidesWithEntities() { throw new UnsupportedOperationException( "Not supported yet." ); @@ -1055,6 +1147,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * @param collides whether the player should collide with entities or * not. */ + @Deprecated public void setCollidesWithEntities(boolean collides) { throw new UnsupportedOperationException( "Not supported yet." ); @@ -1063,6 +1156,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline /** * Respawns the player if dead. */ + @Deprecated public void respawn() { throw new UnsupportedOperationException( "Not supported yet." ); @@ -1073,6 +1167,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return the player's client language settings */ + @Deprecated public String getLocale() { throw new UnsupportedOperationException( "Not supported yet." ); @@ -1083,6 +1178,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline * * @return a Set with all hidden players */ + @Deprecated public java.util.Set getHiddenPlayers() { throw new UnsupportedOperationException( "Not supported yet." ); diff --git a/src/main/java/org/bukkit/entity/Projectile.java b/src/main/java/org/bukkit/entity/Projectile.java index 90ce3b3..73c8900 100644 --- a/src/main/java/org/bukkit/entity/Projectile.java +++ b/src/main/java/org/bukkit/entity/Projectile.java @@ -5,6 +5,7 @@ import org.bukkit.projectiles.ProjectileSource; /** * Represents a shootable entity. */ +@Deprecated public interface Projectile extends Entity { /** @@ -20,6 +21,7 @@ public interface Projectile extends Entity { * * @return the {@link ProjectileSource} that shot this projectile */ + @Deprecated public ProjectileSource getShooter(); /** @@ -35,6 +37,7 @@ public interface Projectile extends Entity { * * @param source the {@link ProjectileSource} that shot this projectile */ + @Deprecated public void setShooter(ProjectileSource source); /** @@ -44,6 +47,7 @@ public interface Projectile extends Entity { * * @return true if it should bounce. */ + @Deprecated public boolean doesBounce(); /** @@ -52,5 +56,6 @@ public interface Projectile extends Entity { * * @param doesBounce whether or not it should bounce. */ + @Deprecated public void setBounce(boolean doesBounce); } diff --git a/src/main/java/org/bukkit/entity/Sheep.java b/src/main/java/org/bukkit/entity/Sheep.java index f4ce312..5966047 100644 --- a/src/main/java/org/bukkit/entity/Sheep.java +++ b/src/main/java/org/bukkit/entity/Sheep.java @@ -5,15 +5,18 @@ import org.bukkit.material.Colorable; /** * Represents a Sheep. */ +@Deprecated public interface Sheep extends Animals, Colorable { /** * @return Whether the sheep is sheared. */ + @Deprecated public boolean isSheared(); /** * @param flag Whether to shear the sheep */ + @Deprecated public void setSheared(boolean flag); } diff --git a/src/main/java/org/bukkit/entity/Silverfish.java b/src/main/java/org/bukkit/entity/Silverfish.java index fe01007..ed73264 100644 --- a/src/main/java/org/bukkit/entity/Silverfish.java +++ b/src/main/java/org/bukkit/entity/Silverfish.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Silverfish. */ +@Deprecated public interface Silverfish extends Monster {} diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java index 02b76c3..b4c257d 100644 --- a/src/main/java/org/bukkit/entity/Skeleton.java +++ b/src/main/java/org/bukkit/entity/Skeleton.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a Skeleton. */ +@Deprecated public interface Skeleton extends Monster { /** @@ -10,6 +11,7 @@ public interface Skeleton extends Monster { * * @return Current type */ + @Deprecated public SkeletonType getSkeletonType(); /** @@ -17,16 +19,20 @@ public interface Skeleton extends Monster { * * @param type New type */ + @Deprecated public void setSkeletonType(SkeletonType type); /* * Represents the various different Skeleton types. */ + @Deprecated public enum SkeletonType { NORMAL(0), WITHER(1); + @Deprecated private static final SkeletonType[] types = new SkeletonType[SkeletonType.values().length]; + @Deprecated private final int id; static { @@ -35,6 +41,7 @@ public interface Skeleton extends Monster { } } + @Deprecated private SkeletonType(int id) { this.id = id; } diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java index cbf50c8..b9232c3 100644 --- a/src/main/java/org/bukkit/entity/Slime.java +++ b/src/main/java/org/bukkit/entity/Slime.java @@ -3,15 +3,18 @@ package org.bukkit.entity; /** * Represents a Slime. */ +@Deprecated public interface Slime extends LivingEntity { /** * @return The size of the slime */ + @Deprecated public int getSize(); /** * @param sz The new size of the slime. */ + @Deprecated public void setSize(int sz); } diff --git a/src/main/java/org/bukkit/entity/SmallFireball.java b/src/main/java/org/bukkit/entity/SmallFireball.java index 33f54d3..98db10a 100644 --- a/src/main/java/org/bukkit/entity/SmallFireball.java +++ b/src/main/java/org/bukkit/entity/SmallFireball.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a small {@link Fireball} */ +@Deprecated public interface SmallFireball extends Fireball { } diff --git a/src/main/java/org/bukkit/entity/Snowball.java b/src/main/java/org/bukkit/entity/Snowball.java index 8c6b433..c964fe8 100644 --- a/src/main/java/org/bukkit/entity/Snowball.java +++ b/src/main/java/org/bukkit/entity/Snowball.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a snowball. */ +@Deprecated public interface Snowball extends Projectile {} diff --git a/src/main/java/org/bukkit/entity/Snowman.java b/src/main/java/org/bukkit/entity/Snowman.java index c8070ff..000d143 100644 --- a/src/main/java/org/bukkit/entity/Snowman.java +++ b/src/main/java/org/bukkit/entity/Snowman.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a snowman entity */ +@Deprecated public interface Snowman extends Golem { } diff --git a/src/main/java/org/bukkit/entity/Spider.java b/src/main/java/org/bukkit/entity/Spider.java index f9ee8cc..5803720 100644 --- a/src/main/java/org/bukkit/entity/Spider.java +++ b/src/main/java/org/bukkit/entity/Spider.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Spider. */ +@Deprecated public interface Spider extends Monster {} diff --git a/src/main/java/org/bukkit/entity/Squid.java b/src/main/java/org/bukkit/entity/Squid.java index fb47968..a0b10b3 100644 --- a/src/main/java/org/bukkit/entity/Squid.java +++ b/src/main/java/org/bukkit/entity/Squid.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Squid. */ +@Deprecated public interface Squid extends WaterMob {} diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java index 3ce322d..86d4c79 100644 --- a/src/main/java/org/bukkit/entity/TNTPrimed.java +++ b/src/main/java/org/bukkit/entity/TNTPrimed.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a Primed TNT. */ +@Deprecated public interface TNTPrimed extends Explosive { /** @@ -10,6 +11,7 @@ public interface TNTPrimed extends Explosive { * * @param fuseTicks The fuse ticks */ + @Deprecated public void setFuseTicks(int fuseTicks); /** @@ -18,6 +20,7 @@ public interface TNTPrimed extends Explosive { * * @return the number of ticks until this TNTPrimed explodes */ + @Deprecated public int getFuseTicks(); /** @@ -34,5 +37,6 @@ public interface TNTPrimed extends Explosive { * * @return the source of this primed TNT */ + @Deprecated public Entity getSource(); } diff --git a/src/main/java/org/bukkit/entity/Tameable.java b/src/main/java/org/bukkit/entity/Tameable.java index 014885d..8643f13 100644 --- a/src/main/java/org/bukkit/entity/Tameable.java +++ b/src/main/java/org/bukkit/entity/Tameable.java @@ -1,5 +1,6 @@ package org.bukkit.entity; +@Deprecated public interface Tameable { /** @@ -10,6 +11,7 @@ public interface Tameable { * * @return true if this has been tamed */ + @Deprecated public boolean isTamed(); /** @@ -21,6 +23,7 @@ public interface Tameable { * * @param tame true if tame */ + @Deprecated public void setTamed(boolean tame); /** @@ -28,6 +31,7 @@ public interface Tameable { * * @return the owning AnimalTamer, or null if not owned */ + @Deprecated public AnimalTamer getOwner(); /** @@ -39,6 +43,7 @@ public interface Tameable { * * @param tamer the AnimalTamer who should own this */ + @Deprecated public void setOwner(AnimalTamer tamer); } diff --git a/src/main/java/org/bukkit/entity/ThrownExpBottle.java b/src/main/java/org/bukkit/entity/ThrownExpBottle.java index 671282e..893c06c 100644 --- a/src/main/java/org/bukkit/entity/ThrownExpBottle.java +++ b/src/main/java/org/bukkit/entity/ThrownExpBottle.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a thrown Experience bottle. */ +@Deprecated public interface ThrownExpBottle extends Projectile { } diff --git a/src/main/java/org/bukkit/entity/ThrownPotion.java b/src/main/java/org/bukkit/entity/ThrownPotion.java index 8b382db..c42a053 100644 --- a/src/main/java/org/bukkit/entity/ThrownPotion.java +++ b/src/main/java/org/bukkit/entity/ThrownPotion.java @@ -8,6 +8,7 @@ import org.bukkit.potion.PotionEffect; /** * Represents a thrown potion bottle */ +@Deprecated public interface ThrownPotion extends Projectile { /** @@ -15,6 +16,7 @@ public interface ThrownPotion extends Projectile { * * @return The potion effects */ + @Deprecated public Collection getEffects(); /** @@ -26,6 +28,7 @@ public interface ThrownPotion extends Projectile { * * @return A copy of the ItemStack for this thrown potion. */ + @Deprecated public ItemStack getItem(); /** @@ -35,5 +38,6 @@ public interface ThrownPotion extends Projectile { * * @param item New ItemStack */ + @Deprecated public void setItem(ItemStack item); } diff --git a/src/main/java/org/bukkit/entity/Vehicle.java b/src/main/java/org/bukkit/entity/Vehicle.java index 7d7607c..1ee68f7 100644 --- a/src/main/java/org/bukkit/entity/Vehicle.java +++ b/src/main/java/org/bukkit/entity/Vehicle.java @@ -5,6 +5,7 @@ import org.bukkit.util.Vector; /** * Represents a vehicle entity. */ +@Deprecated public interface Vehicle extends Entity { /** @@ -12,6 +13,7 @@ public interface Vehicle extends Entity { * * @return velocity vector */ + @Deprecated public Vector getVelocity(); /** @@ -19,5 +21,6 @@ public interface Vehicle extends Entity { * * @param vel velocity vector */ + @Deprecated public void setVelocity(Vector vel); } diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java index 51035c9..1f91da2 100644 --- a/src/main/java/org/bukkit/entity/Villager.java +++ b/src/main/java/org/bukkit/entity/Villager.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a villager NPC */ +@Deprecated public interface Villager extends Ageable, NPC { /** @@ -10,6 +11,7 @@ public interface Villager extends Ageable, NPC { * * @return Current profession. */ + @Deprecated public Profession getProfession(); /** @@ -17,12 +19,14 @@ public interface Villager extends Ageable, NPC { * * @param profession New profession. */ + @Deprecated public void setProfession(Profession profession); /** * Represents the various different Villager professions there may be. */ + @Deprecated public enum Profession { FARMER(0), LIBRARIAN(1), @@ -30,7 +34,9 @@ public interface Villager extends Ageable, NPC { BLACKSMITH(3), BUTCHER(4); + @Deprecated private static final Profession[] professions = new Profession[Profession.values().length]; + @Deprecated private final int id; static { @@ -39,6 +45,7 @@ public interface Villager extends Ageable, NPC { } } + @Deprecated private Profession(int id) { this.id = id; } diff --git a/src/main/java/org/bukkit/entity/WaterMob.java b/src/main/java/org/bukkit/entity/WaterMob.java index 62b4e89..4c6f176 100644 --- a/src/main/java/org/bukkit/entity/WaterMob.java +++ b/src/main/java/org/bukkit/entity/WaterMob.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Water Mob */ +@Deprecated public interface WaterMob extends Creature {} diff --git a/src/main/java/org/bukkit/entity/Weather.java b/src/main/java/org/bukkit/entity/Weather.java index 6d77851..a0572c7 100644 --- a/src/main/java/org/bukkit/entity/Weather.java +++ b/src/main/java/org/bukkit/entity/Weather.java @@ -3,4 +3,5 @@ package org.bukkit.entity; /** * Represents a Weather related entity, such as a storm */ +@Deprecated public interface Weather extends Entity {} diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java index 9c5dc1f..3623354 100644 --- a/src/main/java/org/bukkit/entity/Witch.java +++ b/src/main/java/org/bukkit/entity/Witch.java @@ -3,5 +3,6 @@ package org.bukkit.entity; /** * Represents a Witch */ +@Deprecated public interface Witch extends Monster { } diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java index 0922c5c..08d9e74 100644 --- a/src/main/java/org/bukkit/entity/Wither.java +++ b/src/main/java/org/bukkit/entity/Wither.java @@ -3,5 +3,6 @@ package org.bukkit.entity; /** * Represents a Wither boss */ +@Deprecated public interface Wither extends Monster { } diff --git a/src/main/java/org/bukkit/entity/WitherSkull.java b/src/main/java/org/bukkit/entity/WitherSkull.java index 33d20ab..e5d43db 100644 --- a/src/main/java/org/bukkit/entity/WitherSkull.java +++ b/src/main/java/org/bukkit/entity/WitherSkull.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a wither skull {@link Fireball}. */ +@Deprecated public interface WitherSkull extends Fireball { /** @@ -10,6 +11,7 @@ public interface WitherSkull extends Fireball { * * @param charged whether it should be charged */ + @Deprecated public void setCharged(boolean charged); /** @@ -17,5 +19,6 @@ public interface WitherSkull extends Fireball { * * @return whether the wither skull is charged */ + @Deprecated public boolean isCharged(); } diff --git a/src/main/java/org/bukkit/entity/Wolf.java b/src/main/java/org/bukkit/entity/Wolf.java index 9d5a896..8abfe25 100644 --- a/src/main/java/org/bukkit/entity/Wolf.java +++ b/src/main/java/org/bukkit/entity/Wolf.java @@ -5,6 +5,7 @@ import org.bukkit.DyeColor; /** * Represents a Wolf */ +@Deprecated public interface Wolf extends Animals, Tameable { /** @@ -12,6 +13,7 @@ public interface Wolf extends Animals, Tameable { * * @return Anger true if angry */ + @Deprecated public boolean isAngry(); /** @@ -22,6 +24,7 @@ public interface Wolf extends Animals, Tameable { * * @param angry true if angry */ + @Deprecated public void setAngry(boolean angry); /** @@ -29,6 +32,7 @@ public interface Wolf extends Animals, Tameable { * * @return true if sitting */ + @Deprecated public boolean isSitting(); /** @@ -38,6 +42,7 @@ public interface Wolf extends Animals, Tameable { * * @param sitting true if sitting */ + @Deprecated public void setSitting(boolean sitting); /** @@ -45,6 +50,7 @@ public interface Wolf extends Animals, Tameable { * * @return the color of the collar */ + @Deprecated public DyeColor getCollarColor(); /** @@ -52,5 +58,6 @@ public interface Wolf extends Animals, Tameable { * * @param color the color to apply */ + @Deprecated public void setCollarColor(DyeColor color); } diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java index 59b52fd..4c65455 100644 --- a/src/main/java/org/bukkit/entity/Zombie.java +++ b/src/main/java/org/bukkit/entity/Zombie.java @@ -3,6 +3,7 @@ package org.bukkit.entity; /** * Represents a Zombie. */ +@Deprecated public interface Zombie extends Monster { /** @@ -10,6 +11,7 @@ public interface Zombie extends Monster { * * @return Whether the zombie is a baby */ + @Deprecated public boolean isBaby(); /** @@ -17,6 +19,7 @@ public interface Zombie extends Monster { * * @param flag Whether the zombie is a baby */ + @Deprecated public void setBaby(boolean flag); /** @@ -24,6 +27,7 @@ public interface Zombie extends Monster { * * @return Whether the zombie is a villager */ + @Deprecated public boolean isVillager(); /** @@ -31,5 +35,6 @@ public interface Zombie extends Monster { * * @param flag Whether the zombie is a villager */ + @Deprecated public void setVillager(boolean flag); } diff --git a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java index e502680..5c56fc2 100644 --- a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java @@ -3,6 +3,7 @@ package org.bukkit.entity.minecart; import org.bukkit.command.CommandSender; import org.bukkit.entity.Minecart; +@Deprecated public interface CommandMinecart extends Minecart, CommandSender { /** @@ -12,6 +13,7 @@ public interface CommandMinecart extends Minecart, CommandSender { * * @return Command that this CommandMinecart will run when powered. */ + @Deprecated public String getCommand(); /** @@ -22,6 +24,7 @@ public interface CommandMinecart extends Minecart, CommandSender { * @param command Command that this CommandMinecart will run when * activated. */ + @Deprecated public void setCommand(String command); /** @@ -31,6 +34,7 @@ public interface CommandMinecart extends Minecart, CommandSender { * * @param name New name for this CommandMinecart. */ + @Deprecated public void setName(String name); } diff --git a/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java b/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java index a4411da..3e7a666 100644 --- a/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java @@ -5,5 +5,6 @@ import org.bukkit.entity.Minecart; /** * Represents a Minecart with TNT inside it that can explode when triggered. */ +@Deprecated public interface ExplosiveMinecart extends Minecart { } diff --git a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java index 5da9ce4..da9a8f2 100644 --- a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java @@ -6,5 +6,6 @@ import org.bukkit.inventory.InventoryHolder; /** * Represents a Minecart with a Hopper inside it */ +@Deprecated public interface HopperMinecart extends Minecart, InventoryHolder { } diff --git a/src/main/java/org/bukkit/entity/minecart/PoweredMinecart.java b/src/main/java/org/bukkit/entity/minecart/PoweredMinecart.java index 57e8b1d..6fad8d6 100644 --- a/src/main/java/org/bukkit/entity/minecart/PoweredMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/PoweredMinecart.java @@ -6,5 +6,6 @@ import org.bukkit.entity.Minecart; * Represents a powered minecart. A powered minecart moves on its own when a * player deposits {@link org.bukkit.Material#COAL fuel}. */ +@Deprecated public interface PoweredMinecart extends Minecart { } diff --git a/src/main/java/org/bukkit/entity/minecart/RideableMinecart.java b/src/main/java/org/bukkit/entity/minecart/RideableMinecart.java index 1b82645..cd3de7d 100644 --- a/src/main/java/org/bukkit/entity/minecart/RideableMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/RideableMinecart.java @@ -10,5 +10,6 @@ import org.bukkit.entity.Minecart; * Non-player entities that meet normal passenger criteria automatically * mount these minecarts when close enough. */ +@Deprecated public interface RideableMinecart extends Minecart { } diff --git a/src/main/java/org/bukkit/entity/minecart/SpawnerMinecart.java b/src/main/java/org/bukkit/entity/minecart/SpawnerMinecart.java index 0ce3592..b6607a9 100644 --- a/src/main/java/org/bukkit/entity/minecart/SpawnerMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/SpawnerMinecart.java @@ -6,5 +6,6 @@ import org.bukkit.entity.Minecart; * Represents a Minecart with an {@link org.bukkit.block.CreatureSpawner * entity spawner} inside it. */ +@Deprecated public interface SpawnerMinecart extends Minecart { } diff --git a/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java b/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java index 4f04ab4..27c67b6 100644 --- a/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java @@ -8,5 +8,6 @@ import org.bukkit.inventory.InventoryHolder; * minecarts} have their own inventory that can be accessed using methods * from the {@link InventoryHolder} interface. */ +@Deprecated public interface StorageMinecart extends Minecart, InventoryHolder { } diff --git a/src/main/java/org/bukkit/event/Cancellable.java b/src/main/java/org/bukkit/event/Cancellable.java index 799b0b0..4e3a740 100644 --- a/src/main/java/org/bukkit/event/Cancellable.java +++ b/src/main/java/org/bukkit/event/Cancellable.java @@ -1,5 +1,6 @@ package org.bukkit.event; +@Deprecated public interface Cancellable { /** @@ -8,6 +9,7 @@ public interface Cancellable { * * @return true if this event is cancelled */ + @Deprecated public boolean isCancelled(); /** @@ -16,5 +18,6 @@ public interface Cancellable { * * @param cancel true if you wish to cancel this event */ + @Deprecated public void setCancelled(boolean cancel); } diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java index fa29c27..c7c2606 100644 --- a/src/main/java/org/bukkit/event/Event.java +++ b/src/main/java/org/bukkit/event/Event.java @@ -8,14 +8,18 @@ import org.bukkit.plugin.PluginManager; * @see PluginManager#callEvent(Event) * @see PluginManager#registerEvents(Listener,Plugin) */ +@Deprecated public abstract class Event { + @Deprecated private String name; + @Deprecated private final boolean async; /** * The default constructor is defined for cleaner code. This constructor * assumes the event is synchronous. */ + @Deprecated public Event() { this(false); } @@ -27,6 +31,7 @@ public abstract class Event { * @param isAsync true indicates the event will fire asynchronously, false * by default from default constructor */ + @Deprecated public Event(boolean isAsync) { this.async = isAsync; } @@ -38,6 +43,7 @@ public abstract class Event { * * @return name of this event */ + @Deprecated public String getEventName() { if (name == null) { name = getClass().getSimpleName(); @@ -45,6 +51,7 @@ public abstract class Event { return name; } + @Deprecated public abstract HandlerList getHandlers(); /** @@ -69,10 +76,12 @@ public abstract class Event { * * @return false by default, true if the event fires asynchronously */ + @Deprecated public final boolean isAsynchronous() { return async; } + @Deprecated public enum Result { /** diff --git a/src/main/java/org/bukkit/event/EventException.java b/src/main/java/org/bukkit/event/EventException.java index 84638e8..2de46d5 100644 --- a/src/main/java/org/bukkit/event/EventException.java +++ b/src/main/java/org/bukkit/event/EventException.java @@ -1,7 +1,10 @@ package org.bukkit.event; +@Deprecated public class EventException extends Exception { + @Deprecated private static final long serialVersionUID = 3532808232324183999L; + @Deprecated private final Throwable cause; /** @@ -9,6 +12,7 @@ public class EventException extends Exception { * * @param throwable Exception that triggered this Exception */ + @Deprecated public EventException(Throwable throwable) { cause = throwable; } @@ -16,6 +20,7 @@ public class EventException extends Exception { /** * Constructs a new EventException */ + @Deprecated public EventException() { cause = null; } @@ -26,6 +31,7 @@ public class EventException extends Exception { * @param cause The exception that caused this * @param message The message */ + @Deprecated public EventException(Throwable cause, String message) { super(message); this.cause = cause; @@ -36,6 +42,7 @@ public class EventException extends Exception { * * @param message The message */ + @Deprecated public EventException(String message) { super(message); cause = null; @@ -47,6 +54,7 @@ public class EventException extends Exception { * @return Inner exception, or null if one does not exist */ @Override + @Deprecated public Throwable getCause() { return cause; } diff --git a/src/main/java/org/bukkit/event/EventHandler.java b/src/main/java/org/bukkit/event/EventHandler.java index e42acc1..12c031b 100644 --- a/src/main/java/org/bukkit/event/EventHandler.java +++ b/src/main/java/org/bukkit/event/EventHandler.java @@ -10,6 +10,7 @@ import java.lang.annotation.Target; */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) +@Deprecated public @interface EventHandler { /** diff --git a/src/main/java/org/bukkit/event/EventPriority.java b/src/main/java/org/bukkit/event/EventPriority.java index 61ffa50..508ffab 100644 --- a/src/main/java/org/bukkit/event/EventPriority.java +++ b/src/main/java/org/bukkit/event/EventPriority.java @@ -3,6 +3,7 @@ package org.bukkit.event; /** * Represents an event's priority in execution */ +@Deprecated public enum EventPriority { /** @@ -35,12 +36,15 @@ public enum EventPriority { */ MONITOR(5); + @Deprecated private final int slot; + @Deprecated private EventPriority(int slot) { this.slot = slot; } + @Deprecated public int getSlot() { return slot; } diff --git a/src/main/java/org/bukkit/event/HandlerList.java b/src/main/java/org/bukkit/event/HandlerList.java index 7d5efff..3d8a53c 100644 --- a/src/main/java/org/bukkit/event/HandlerList.java +++ b/src/main/java/org/bukkit/event/HandlerList.java @@ -9,12 +9,14 @@ import java.util.Map.Entry; /** * A list of event handlers, stored per-event. Based on lahwran's fevents. */ +@Deprecated public class HandlerList { /** * Handler array. This field being an array is the key to this system's * speed. */ + @Deprecated private volatile RegisteredListener[] handlers = null; /** @@ -22,11 +24,13 @@ public class HandlerList { * unregister() and are automatically baked to the handlers array any time * they have changed. */ + @Deprecated private final EnumMap> handlerslots; /** * List of all HandlerLists which have been created, for use in bakeAll() */ + @Deprecated private static ArrayList allLists = new ArrayList(); /** @@ -34,6 +38,7 @@ public class HandlerList { * registration is complete, ie just after all plugins are loaded if * you're using fevents in a plugin system. */ + @Deprecated public static void bakeAll() { synchronized (allLists) { for (HandlerList h : allLists) { @@ -45,6 +50,7 @@ public class HandlerList { /** * Unregister all listeners from all handler lists. */ + @Deprecated public static void unregisterAll() { synchronized (allLists) { for (HandlerList h : allLists) { @@ -63,6 +69,7 @@ public class HandlerList { * * @param plugin plugin to unregister */ + @Deprecated public static void unregisterAll(Plugin plugin) { synchronized (allLists) { for (HandlerList h : allLists) { @@ -76,6 +83,7 @@ public class HandlerList { * * @param listener listener to unregister */ + @Deprecated public static void unregisterAll(Listener listener) { synchronized (allLists) { for (HandlerList h : allLists) { @@ -89,6 +97,7 @@ public class HandlerList { *

* The HandlerList is then added to meta-list for use in bakeAll() */ + @Deprecated public HandlerList() { handlerslots = new EnumMap>(EventPriority.class); for (EventPriority o : EventPriority.values()) { @@ -104,6 +113,7 @@ public class HandlerList { * * @param listener listener to register */ + @Deprecated public synchronized void register(RegisteredListener listener) { if (handlerslots.get(listener.getPriority()).contains(listener)) throw new IllegalStateException("This listener is already registered to priority " + listener.getPriority().toString()); @@ -116,6 +126,7 @@ public class HandlerList { * * @param listeners listeners to register */ + @Deprecated public void registerAll(Collection listeners) { for (RegisteredListener listener : listeners) { register(listener); @@ -127,6 +138,7 @@ public class HandlerList { * * @param listener listener to remove */ + @Deprecated public synchronized void unregister(RegisteredListener listener) { if (handlerslots.get(listener.getPriority()).remove(listener)) { handlers = null; @@ -138,6 +150,7 @@ public class HandlerList { * * @param plugin plugin to remove */ + @Deprecated public synchronized void unregister(Plugin plugin) { boolean changed = false; for (List list : handlerslots.values()) { @@ -156,6 +169,7 @@ public class HandlerList { * * @param listener listener to remove */ + @Deprecated public synchronized void unregister(Listener listener) { boolean changed = false; for (List list : handlerslots.values()) { @@ -172,6 +186,7 @@ public class HandlerList { /** * Bake HashMap and ArrayLists to 2d array - does nothing if not necessary */ + @Deprecated public synchronized void bake() { if (handlers != null) return; // don't re-bake when still valid List entries = new ArrayList(); @@ -186,6 +201,7 @@ public class HandlerList { * * @return the array of registered listeners */ + @Deprecated public RegisteredListener[] getRegisteredListeners() { RegisteredListener[] handlers; while ((handlers = this.handlers) == null) bake(); // This prevents fringe cases of returning null @@ -199,6 +215,7 @@ public class HandlerList { * @param plugin the plugin to get the listeners of * @return the list of registered listeners */ + @Deprecated public static ArrayList getRegisteredListeners(Plugin plugin) { ArrayList listeners = new ArrayList(); synchronized (allLists) { @@ -223,6 +240,7 @@ public class HandlerList { * @return the list of all handler lists */ @SuppressWarnings("unchecked") + @Deprecated public static ArrayList getHandlerLists() { synchronized (allLists) { return (ArrayList) allLists.clone(); diff --git a/src/main/java/org/bukkit/event/Listener.java b/src/main/java/org/bukkit/event/Listener.java index ff083e6..152740a 100644 --- a/src/main/java/org/bukkit/event/Listener.java +++ b/src/main/java/org/bukkit/event/Listener.java @@ -3,4 +3,5 @@ package org.bukkit.event; /** * Simple interface for tagging all EventListeners */ +@Deprecated public interface Listener {} diff --git a/src/main/java/org/bukkit/event/block/Action.java b/src/main/java/org/bukkit/event/block/Action.java index 25d26e3..7b7c343 100644 --- a/src/main/java/org/bukkit/event/block/Action.java +++ b/src/main/java/org/bukkit/event/block/Action.java @@ -1,5 +1,6 @@ package org.bukkit.event.block; +@Deprecated public enum Action { /** diff --git a/src/main/java/org/bukkit/event/block/BlockBreakEvent.java b/src/main/java/org/bukkit/event/block/BlockBreakEvent.java index a011f61..c730948 100644 --- a/src/main/java/org/bukkit/event/block/BlockBreakEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockBreakEvent.java @@ -26,10 +26,14 @@ import org.bukkit.event.HandlerList; * If a Block Break event is cancelled, the block will not break and * experience will not drop. */ +@Deprecated public class BlockBreakEvent extends BlockExpEvent implements Cancellable { + @Deprecated private final Player player; + @Deprecated private boolean cancel; + @Deprecated public BlockBreakEvent(final Block theBlock, final Player player) { super(theBlock, 0); @@ -41,14 +45,17 @@ public class BlockBreakEvent extends BlockExpEvent implements Cancellable { * * @return The Player that is breaking the block involved in this event */ + @Deprecated public Player getPlayer() { return player; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/src/main/java/org/bukkit/event/block/BlockBurnEvent.java b/src/main/java/org/bukkit/event/block/BlockBurnEvent.java index 1592a15..f846b79 100644 --- a/src/main/java/org/bukkit/event/block/BlockBurnEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockBurnEvent.java @@ -10,28 +10,36 @@ import org.bukkit.event.HandlerList; * If a Block Burn event is cancelled, the block will not be destroyed as a * result of being burnt by fire. */ +@Deprecated public class BlockBurnEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated public BlockBurnEvent(final Block block) { super(block); this.cancelled = false; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java b/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java index 3860f44..4075710 100644 --- a/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java @@ -15,8 +15,11 @@ import org.bukkit.event.HandlerList; * #getMaterial()} or {@link #getMaterialId()} instead. * */ +@Deprecated public class BlockCanBuildEvent extends BlockEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected boolean buildable; /** @@ -45,6 +48,7 @@ public class BlockCanBuildEvent extends BlockEvent { * * @return boolean whether or not the block can be built */ + @Deprecated public boolean isBuildable() { return buildable; } @@ -55,6 +59,7 @@ public class BlockCanBuildEvent extends BlockEvent { * @param cancel true if you want to allow the block to be built here * despite Minecraft's default behaviour */ + @Deprecated public void setBuildable(boolean cancel) { this.buildable = cancel; } @@ -64,6 +69,7 @@ public class BlockCanBuildEvent extends BlockEvent { * * @return The Material that we are trying to place */ + @Deprecated public Material getMaterial() { return Material.getMaterial(material); } @@ -80,10 +86,12 @@ public class BlockCanBuildEvent extends BlockEvent { } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockDamageEvent.java b/src/main/java/org/bukkit/event/block/BlockDamageEvent.java index d80e00e..0bc391c 100644 --- a/src/main/java/org/bukkit/event/block/BlockDamageEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockDamageEvent.java @@ -11,13 +11,20 @@ import org.bukkit.inventory.ItemStack; *

* If a Block Damage event is cancelled, the block will not be damaged. */ +@Deprecated public class BlockDamageEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Player player; + @Deprecated private boolean instaBreak; + @Deprecated private boolean cancel; + @Deprecated private final ItemStack itemstack; + @Deprecated public BlockDamageEvent(final Player player, final Block block, final ItemStack itemInHand, final boolean instaBreak) { super(block); this.instaBreak = instaBreak; @@ -31,6 +38,7 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable { * * @return The player damaging the block involved in this event */ + @Deprecated public Player getPlayer() { return player; } @@ -41,6 +49,7 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable { * @return true if the block should instantly break when damaged by the * player */ + @Deprecated public boolean getInstaBreak() { return instaBreak; } @@ -51,6 +60,7 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable { * @param bool true if you want the block to instantly break when damaged * by the player */ + @Deprecated public void setInstaBreak(boolean bool) { this.instaBreak = bool; } @@ -60,23 +70,28 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable { * * @return The ItemStack for the item currently in the player's hand */ + @Deprecated public ItemStack getItemInHand() { return itemstack; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java b/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java index 16ee59b..7c5b2dd 100644 --- a/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java @@ -12,12 +12,18 @@ import org.bukkit.util.Vector; * If a Block Dispense event is cancelled, the block will not dispense the * item. */ +@Deprecated public class BlockDispenseEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled = false; + @Deprecated private ItemStack item; + @Deprecated private Vector velocity; + @Deprecated public BlockDispenseEvent(final Block block, final ItemStack dispensed, final Vector velocity) { super(block); this.item = dispensed; @@ -31,6 +37,7 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable { * * @return An ItemStack for the item being dispensed */ + @Deprecated public ItemStack getItem() { return item.clone(); } @@ -40,6 +47,7 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable { * * @param item the item being dispensed */ + @Deprecated public void setItem(ItemStack item) { this.item = item; } @@ -52,6 +60,7 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable { * * @return A Vector for the dispensed item's velocity */ + @Deprecated public Vector getVelocity() { return velocity.clone(); } @@ -61,23 +70,28 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable { * * @param vel the velocity of the item being dispensed */ + @Deprecated public void setVelocity(Vector vel) { velocity = vel; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockEvent.java b/src/main/java/org/bukkit/event/block/BlockEvent.java index 2405205..ebb843b 100644 --- a/src/main/java/org/bukkit/event/block/BlockEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockEvent.java @@ -6,9 +6,12 @@ import org.bukkit.event.Event; /** * Represents a block related event. */ +@Deprecated public abstract class BlockEvent extends Event { + @Deprecated protected Block block; + @Deprecated public BlockEvent(final Block theBlock) { block = theBlock; } @@ -18,6 +21,7 @@ public abstract class BlockEvent extends Event { * * @return The Block which block is involved in this event */ + @Deprecated public final Block getBlock() { return block; } diff --git a/src/main/java/org/bukkit/event/block/BlockExpEvent.java b/src/main/java/org/bukkit/event/block/BlockExpEvent.java index 08636a2..e5a497a 100644 --- a/src/main/java/org/bukkit/event/block/BlockExpEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockExpEvent.java @@ -6,10 +6,14 @@ import org.bukkit.event.HandlerList; /** * An event that's called when a block yields experience. */ +@Deprecated public class BlockExpEvent extends BlockEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private int exp; + @Deprecated public BlockExpEvent(Block block, int exp) { super(block); @@ -21,6 +25,7 @@ public class BlockExpEvent extends BlockEvent { * * @return The experience to drop */ + @Deprecated public int getExpToDrop() { return exp; } @@ -31,14 +36,17 @@ public class BlockExpEvent extends BlockEvent { * * @param exp 1 or higher to drop experience, else nothing will drop */ + @Deprecated public void setExpToDrop(int exp) { this.exp = exp; } + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockFadeEvent.java b/src/main/java/org/bukkit/event/block/BlockFadeEvent.java index 673bc5f..be134fd 100644 --- a/src/main/java/org/bukkit/event/block/BlockFadeEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockFadeEvent.java @@ -18,11 +18,16 @@ import org.bukkit.event.HandlerList; * If a Block Fade event is cancelled, the block will not fade, melt or * disappear. */ +@Deprecated public class BlockFadeEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final BlockState newState; + @Deprecated public BlockFadeEvent(final Block block, final BlockState newState) { super(block); this.newState = newState; @@ -36,23 +41,28 @@ public class BlockFadeEvent extends BlockEvent implements Cancellable { * @return The block state of the block that will be fading, melting or * disappearing */ + @Deprecated public BlockState getNewState() { return newState; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockFormEvent.java b/src/main/java/org/bukkit/event/block/BlockFormEvent.java index df0401f..be46924 100644 --- a/src/main/java/org/bukkit/event/block/BlockFormEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockFormEvent.java @@ -21,18 +21,23 @@ import org.bukkit.event.HandlerList; * * @see BlockSpreadEvent */ +@Deprecated public class BlockFormEvent extends BlockGrowEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public BlockFormEvent(final Block block, final BlockState newState) { super(block, newState); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockFromToEvent.java b/src/main/java/org/bukkit/event/block/BlockFromToEvent.java index f976bea..a195ffb 100644 --- a/src/main/java/org/bukkit/event/block/BlockFromToEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockFromToEvent.java @@ -12,18 +12,25 @@ import org.bukkit.event.HandlerList; * If a Block From To event is cancelled, the block will not move (the liquid * will not flow). */ +@Deprecated public class BlockFromToEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected Block to; + @Deprecated protected BlockFace face; + @Deprecated protected boolean cancel; + @Deprecated public BlockFromToEvent(final Block block, final BlockFace face) { super(block); this.face = face; this.cancel = false; } + @Deprecated public BlockFromToEvent(final Block block, final Block toBlock) { super(block); this.to = toBlock; @@ -36,6 +43,7 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable { * * @return The BlockFace that the block is moving to */ + @Deprecated public BlockFace getFace() { return face; } @@ -45,6 +53,7 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable { * * @return The faced Block */ + @Deprecated public Block getToBlock() { if (to == null) { to = block.getRelative(face); @@ -52,19 +61,23 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable { return to; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockGrowEvent.java b/src/main/java/org/bukkit/event/block/BlockGrowEvent.java index 2a959fd..398f2a2 100644 --- a/src/main/java/org/bukkit/event/block/BlockGrowEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockGrowEvent.java @@ -19,11 +19,16 @@ import org.bukkit.event.HandlerList; *

* If a Block Grow event is cancelled, the block will not grow. */ +@Deprecated public class BlockGrowEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final BlockState newState; + @Deprecated private boolean cancelled = false; + @Deprecated public BlockGrowEvent(final Block block, final BlockState newState) { super(block); this.newState = newState; @@ -34,22 +39,27 @@ public class BlockGrowEvent extends BlockEvent implements Cancellable { * * @return The block state for this events block */ + @Deprecated public BlockState getNewState() { return newState; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java b/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java index 733a15e..8af35ae 100644 --- a/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java @@ -12,11 +12,17 @@ import org.bukkit.event.HandlerList; *

* If a Block Ignite event is cancelled, the block will not be ignited. */ +@Deprecated public class BlockIgniteEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final IgniteCause cause; + @Deprecated private final Entity ignitingEntity; + @Deprecated private final Block ignitingBlock; + @Deprecated private boolean cancel; /** @@ -28,14 +34,17 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { this(theBlock, cause, (Entity) thePlayer); } + @Deprecated public BlockIgniteEvent(final Block theBlock, final IgniteCause cause, final Entity ignitingEntity) { this(theBlock, cause, ignitingEntity, null); } + @Deprecated public BlockIgniteEvent(final Block theBlock, final IgniteCause cause, final Block ignitingBlock) { this(theBlock, cause, null, ignitingBlock); } + @Deprecated public BlockIgniteEvent(final Block theBlock, final IgniteCause cause, final Entity ignitingEntity, final Block ignitingBlock) { super(theBlock); this.cause = cause; @@ -44,10 +53,12 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { this.cancel = false; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -57,6 +68,7 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { * * @return An IgniteCause value detailing the cause of block ignition */ + @Deprecated public IgniteCause getCause() { return cause; } @@ -66,6 +78,7 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { * * @return The Player that placed/ignited the fire block, or null if not ignited by a Player. */ + @Deprecated public Player getPlayer() { if (ignitingEntity instanceof Player) { return (Player) ignitingEntity; @@ -79,6 +92,7 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { * * @return The Entity that placed/ignited the fire block, or null if not ignited by a Entity. */ + @Deprecated public Entity getIgnitingEntity() { return ignitingEntity; } @@ -88,6 +102,7 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { * * @return The Block that placed/ignited the fire block, or null if not ignited by a Block. */ + @Deprecated public Block getIgnitingBlock() { return ignitingBlock; } @@ -95,6 +110,7 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { /** * An enum to specify the cause of the ignite */ + @Deprecated public enum IgniteCause { /** @@ -128,10 +144,12 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java index e05d1ca..2dfb977 100644 --- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java @@ -8,9 +8,13 @@ import org.bukkit.event.HandlerList; /** * Thrown when a block physics check is called */ +@Deprecated public class BlockPhysicsEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final int changed; + @Deprecated private boolean cancel = false; /** @@ -39,23 +43,28 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable { * * @return Changed block's type */ + @Deprecated public Material getChangedType() { return Material.getMaterial(changed); } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockPistonEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonEvent.java index b89006f..fed49da 100644 --- a/src/main/java/org/bukkit/event/block/BlockPistonEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPistonEvent.java @@ -8,19 +8,25 @@ import org.bukkit.event.Cancellable; /** * Called when a piston block is triggered */ +@Deprecated public abstract class BlockPistonEvent extends BlockEvent implements Cancellable { + @Deprecated private boolean cancelled; + @Deprecated private final BlockFace direction; + @Deprecated public BlockPistonEvent(final Block block, final BlockFace direction) { super(block); this.direction = direction; } + @Deprecated public boolean isCancelled() { return this.cancelled; } + @Deprecated public void setCancelled(boolean cancelled) { this.cancelled = cancelled; } @@ -30,6 +36,7 @@ public abstract class BlockPistonEvent extends BlockEvent implements Cancellable * * @return stickiness of the piston */ + @Deprecated public boolean isSticky() { return block.getType() == Material.PISTON_STICKY_BASE; } @@ -39,6 +46,7 @@ public abstract class BlockPistonEvent extends BlockEvent implements Cancellable * * @return direction of the piston */ + @Deprecated public BlockFace getDirection() { // Both are meh! // return ((PistonBaseMaterial) block.getType().getNewData(block.getData())).getFacing(); diff --git a/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java index 1058b8b..035337e 100644 --- a/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java @@ -11,11 +11,16 @@ import org.bukkit.event.HandlerList; /** * Called when a piston extends */ +@Deprecated public class BlockPistonExtendEvent extends BlockPistonEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final int length; + @Deprecated private List blocks; + @Deprecated public BlockPistonExtendEvent(final Block block, final int length, final BlockFace direction) { super(block, direction); @@ -27,6 +32,7 @@ public class BlockPistonExtendEvent extends BlockPistonEvent { * * @return the amount of moving blocks */ + @Deprecated public int getLength() { return this.length; } @@ -37,6 +43,7 @@ public class BlockPistonExtendEvent extends BlockPistonEvent { * * @return Immutable list of the moved blocks. */ + @Deprecated public List getBlocks() { if (blocks == null) { ArrayList tmp = new ArrayList(); @@ -49,10 +56,12 @@ public class BlockPistonExtendEvent extends BlockPistonEvent { } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java index 0190c4c..0e05a5f 100644 --- a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java @@ -8,8 +8,11 @@ import org.bukkit.event.HandlerList; /** * Called when a piston retracts */ +@Deprecated public class BlockPistonRetractEvent extends BlockPistonEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public BlockPistonRetractEvent(final Block block, final BlockFace direction) { super(block, direction); } @@ -20,15 +23,18 @@ public class BlockPistonRetractEvent extends BlockPistonEvent { * * @return The possible location of the possibly moving block. */ + @Deprecated public Location getRetractLocation() { return getBlock().getRelative(getDirection(), 2).getLocation(); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java index 6d0ffe8..f6f2d92 100644 --- a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java @@ -12,15 +12,24 @@ import org.bukkit.inventory.ItemStack; *

* If a Block Place event is cancelled, the block will not be placed. */ +@Deprecated public class BlockPlaceEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected boolean cancel; + @Deprecated protected boolean canBuild; + @Deprecated protected Block placedAgainst; + @Deprecated protected BlockState replacedBlockState; + @Deprecated protected ItemStack itemInHand; + @Deprecated protected Player player; + @Deprecated public BlockPlaceEvent(final Block placedBlock, final BlockState replacedBlockState, final Block placedAgainst, final ItemStack itemInHand, final Player thePlayer, final boolean canBuild) { super(placedBlock); this.placedAgainst = placedAgainst; @@ -31,10 +40,12 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { cancel = false; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -44,6 +55,7 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { * * @return The Player who placed the block involved in this event */ + @Deprecated public Player getPlayer() { return player; } @@ -54,6 +66,7 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { * * @return The Block that was placed */ + @Deprecated public Block getBlockPlaced() { return getBlock(); } @@ -64,6 +77,7 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { * * @return The BlockState for the block which was replaced. */ + @Deprecated public BlockState getBlockReplacedState() { return this.replacedBlockState; } @@ -73,6 +87,7 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { * * @return Block the block that the new block was placed against */ + @Deprecated public Block getBlockAgainst() { return placedAgainst; } @@ -83,6 +98,7 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { * @return The ItemStack for the item in the player's hand when they * placed the block */ + @Deprecated public ItemStack getItemInHand() { return itemInHand; } @@ -96,6 +112,7 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { * * @return boolean whether the server would allow a player to build here */ + @Deprecated public boolean canBuild() { return this.canBuild; } @@ -106,15 +123,18 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { * * @param canBuild true if you want the player to be able to build */ + @Deprecated public void setBuild(boolean canBuild) { this.canBuild = canBuild; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockRedstoneEvent.java b/src/main/java/org/bukkit/event/block/BlockRedstoneEvent.java index 625ec90..11f69a5 100644 --- a/src/main/java/org/bukkit/event/block/BlockRedstoneEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockRedstoneEvent.java @@ -6,11 +6,16 @@ import org.bukkit.event.HandlerList; /** * Called when a redstone current changes */ +@Deprecated public class BlockRedstoneEvent extends BlockEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final int oldCurrent; + @Deprecated private int newCurrent; + @Deprecated public BlockRedstoneEvent(final Block block, final int oldCurrent, final int newCurrent) { super(block); this.oldCurrent = oldCurrent; @@ -22,6 +27,7 @@ public class BlockRedstoneEvent extends BlockEvent { * * @return The previous current */ + @Deprecated public int getOldCurrent() { return oldCurrent; } @@ -31,6 +37,7 @@ public class BlockRedstoneEvent extends BlockEvent { * * @return The new current */ + @Deprecated public int getNewCurrent() { return newCurrent; } @@ -40,15 +47,18 @@ public class BlockRedstoneEvent extends BlockEvent { * * @param newCurrent The new current to set */ + @Deprecated public void setNewCurrent(int newCurrent) { this.newCurrent = newCurrent; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/BlockSpreadEvent.java b/src/main/java/org/bukkit/event/block/BlockSpreadEvent.java index a1fb363..c58286d 100644 --- a/src/main/java/org/bukkit/event/block/BlockSpreadEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockSpreadEvent.java @@ -20,10 +20,14 @@ import org.bukkit.event.HandlerList; * * @see BlockFormEvent */ +@Deprecated public class BlockSpreadEvent extends BlockFormEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Block source; + @Deprecated public BlockSpreadEvent(final Block block, final Block source, final BlockState newState) { super(block, newState); this.source = source; @@ -34,15 +38,18 @@ public class BlockSpreadEvent extends BlockFormEvent { * * @return the Block for the source block involved in this event. */ + @Deprecated public Block getSource() { return source; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/EntityBlockFormEvent.java b/src/main/java/org/bukkit/event/block/EntityBlockFormEvent.java index 45efc32..3085cb9 100644 --- a/src/main/java/org/bukkit/event/block/EntityBlockFormEvent.java +++ b/src/main/java/org/bukkit/event/block/EntityBlockFormEvent.java @@ -12,9 +12,12 @@ import org.bukkit.entity.Entity; *

  • Snow formed by a {@link org.bukkit.entity.Snowman}. * */ +@Deprecated public class EntityBlockFormEvent extends BlockFormEvent { + @Deprecated private final Entity entity; + @Deprecated public EntityBlockFormEvent(final Entity entity, final Block block, final BlockState blockstate) { super(block, blockstate); @@ -26,6 +29,7 @@ public class EntityBlockFormEvent extends BlockFormEvent { * * @return Entity involved in event */ + @Deprecated public Entity getEntity() { return entity; } diff --git a/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java b/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java index 84d8cfd..9273e35 100644 --- a/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java +++ b/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java @@ -9,27 +9,35 @@ import org.bukkit.event.HandlerList; *

    * If a Leaves Decay event is cancelled, the leaves will not decay. */ +@Deprecated public class LeavesDecayEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated public LeavesDecayEvent(final Block block) { super(block); } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/NotePlayEvent.java b/src/main/java/org/bukkit/event/block/NotePlayEvent.java index d4d4381..7a58d69 100644 --- a/src/main/java/org/bukkit/event/block/NotePlayEvent.java +++ b/src/main/java/org/bukkit/event/block/NotePlayEvent.java @@ -10,23 +10,31 @@ import org.bukkit.event.HandlerList; * Called when a note block is being played through player interaction or a * redstone current. */ +@Deprecated public class NotePlayEvent extends BlockEvent implements Cancellable { + @Deprecated private static HandlerList handlers = new HandlerList(); + @Deprecated private Instrument instrument; + @Deprecated private Note note; + @Deprecated private boolean cancelled = false; + @Deprecated public NotePlayEvent(Block block, Instrument instrument, Note note) { super(block); this.instrument = instrument; this.note = note; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @@ -36,6 +44,7 @@ public class NotePlayEvent extends BlockEvent implements Cancellable { * * @return the Instrument; */ + @Deprecated public Instrument getInstrument() { return instrument; } @@ -45,6 +54,7 @@ public class NotePlayEvent extends BlockEvent implements Cancellable { * * @return the Note. */ + @Deprecated public Note getNote() { return note; } @@ -54,6 +64,7 @@ public class NotePlayEvent extends BlockEvent implements Cancellable { * * @param instrument the Instrument. Has no effect if null. */ + @Deprecated public void setInstrument(Instrument instrument) { if (instrument != null) { this.instrument = instrument; @@ -66,6 +77,7 @@ public class NotePlayEvent extends BlockEvent implements Cancellable { * * @param note the Note. Has no effect if null. */ + @Deprecated public void setNote(Note note) { if (note != null) { this.note = note; @@ -73,10 +85,12 @@ public class NotePlayEvent extends BlockEvent implements Cancellable { } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/block/SignChangeEvent.java b/src/main/java/org/bukkit/event/block/SignChangeEvent.java index d1b7908..3b075b2 100644 --- a/src/main/java/org/bukkit/event/block/SignChangeEvent.java +++ b/src/main/java/org/bukkit/event/block/SignChangeEvent.java @@ -10,12 +10,18 @@ import org.bukkit.event.HandlerList; *

    * If a Sign Change event is cancelled, the sign will not be changed. */ +@Deprecated public class SignChangeEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private final Player player; + @Deprecated private final String[] lines; + @Deprecated public SignChangeEvent(final Block theBlock, final Player thePlayer, final String[] theLines) { super(theBlock); this.player = thePlayer; @@ -27,6 +33,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable { * * @return the Player involved in this event */ + @Deprecated public Player getPlayer() { return player; } @@ -36,6 +43,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable { * * @return the String array for the sign's lines new text */ + @Deprecated public String[] getLines() { return lines; } @@ -49,6 +57,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable { * @throws IndexOutOfBoundsException thrown when the provided index is > 3 * or < 0 */ + @Deprecated public String getLine(int index) throws IndexOutOfBoundsException { return lines[index]; } @@ -61,23 +70,28 @@ public class SignChangeEvent extends BlockEvent implements Cancellable { * @throws IndexOutOfBoundsException thrown when the provided index is > 3 * or < 0 */ + @Deprecated public void setLine(int index, String line) throws IndexOutOfBoundsException { lines[index] = line; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java b/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java index de28f1d..b3b224a 100644 --- a/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java +++ b/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java @@ -16,16 +16,26 @@ import org.bukkit.inventory.ItemStack; * Called when an ItemStack is successfully enchanted (currently at * enchantment table) */ +@Deprecated public class EnchantItemEvent extends InventoryEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Block table; + @Deprecated private final ItemStack item; + @Deprecated private int level; + @Deprecated private boolean cancelled; + @Deprecated private final Map enchants; + @Deprecated private final Player enchanter; + @Deprecated private int button; + @Deprecated public EnchantItemEvent(final Player enchanter, final InventoryView view, final Block table, final ItemStack item, final int level, final Map enchants, final int i) { super(view); this.enchanter = enchanter; @@ -42,6 +52,7 @@ public class EnchantItemEvent extends InventoryEvent implements Cancellable { * * @return enchanting player */ + @Deprecated public Player getEnchanter() { return enchanter; } @@ -51,6 +62,7 @@ public class EnchantItemEvent extends InventoryEvent implements Cancellable { * * @return the block used for enchanting */ + @Deprecated public Block getEnchantBlock() { return table; } @@ -60,6 +72,7 @@ public class EnchantItemEvent extends InventoryEvent implements Cancellable { * * @return ItemStack of item */ + @Deprecated public ItemStack getItem() { return item; } @@ -69,6 +82,7 @@ public class EnchantItemEvent extends InventoryEvent implements Cancellable { * * @return experience level cost */ + @Deprecated public int getExpLevelCost() { return level; } @@ -78,6 +92,7 @@ public class EnchantItemEvent extends InventoryEvent implements Cancellable { * * @param level - cost in levels */ + @Deprecated public void setExpLevelCost(int level) { this.level = level; } @@ -89,6 +104,7 @@ public class EnchantItemEvent extends InventoryEvent implements Cancellable { * * @return map of enchantment levels, keyed by enchantment */ + @Deprecated public Map getEnchantsToAdd() { return enchants; } @@ -98,23 +114,28 @@ public class EnchantItemEvent extends InventoryEvent implements Cancellable { * * @return The button index (0, 1, or 2). */ + @Deprecated public int whichButton() { return button; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java index 6c0aa9f..f972fc5 100644 --- a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java +++ b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java @@ -12,15 +12,24 @@ import org.bukkit.inventory.ItemStack; * Called when an ItemStack is inserted in an enchantment table - can be * called multiple times */ +@Deprecated public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Block table; + @Deprecated private final ItemStack item; + @Deprecated private final int[] levelsOffered; + @Deprecated private final int bonus; + @Deprecated private boolean cancelled; + @Deprecated private final Player enchanter; + @Deprecated public PrepareItemEnchantEvent(final Player enchanter, InventoryView view, final Block table, final ItemStack item, final int[] levelsOffered, final int bonus) { super(view); this.enchanter = enchanter; @@ -36,6 +45,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab * * @return enchanting player */ + @Deprecated public Player getEnchanter() { return enchanter; } @@ -45,6 +55,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab * * @return the block used for enchanting */ + @Deprecated public Block getEnchantBlock() { return table; } @@ -54,6 +65,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab * * @return ItemStack of item */ + @Deprecated public ItemStack getItem() { return item; } @@ -64,6 +76,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab * * @return experience level costs offered */ + @Deprecated public int[] getExpLevelCostsOffered() { return levelsOffered; } @@ -73,23 +86,28 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab * * @return enchantment bonus */ + @Deprecated public int getEnchantmentBonus() { return bonus; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java index 182f634..5b88335 100644 --- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java @@ -10,9 +10,12 @@ import org.bukkit.entity.LivingEntity; *

    * If a Creature Spawn event is cancelled, the creature will not spawn. */ +@Deprecated public class CreatureSpawnEvent extends EntitySpawnEvent { + @Deprecated private final SpawnReason spawnReason; + @Deprecated public CreatureSpawnEvent(final LivingEntity spawnee, final SpawnReason spawnReason) { super(spawnee); this.spawnReason = spawnReason; @@ -25,6 +28,7 @@ public class CreatureSpawnEvent extends EntitySpawnEvent { } @Override + @Deprecated public LivingEntity getEntity() { return (LivingEntity) entity; } @@ -47,6 +51,7 @@ public class CreatureSpawnEvent extends EntitySpawnEvent { * @return A SpawnReason value detailing the reason for the creature being * spawned */ + @Deprecated public SpawnReason getSpawnReason() { return spawnReason; } @@ -54,6 +59,7 @@ public class CreatureSpawnEvent extends EntitySpawnEvent { /** * An enum to specify the type of spawning */ + @Deprecated public enum SpawnReason { /** diff --git a/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java b/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java index b103a6a..761cdee 100644 --- a/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java +++ b/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java @@ -10,31 +10,41 @@ import org.bukkit.event.HandlerList; *

    * If a Creeper Power event is cancelled, the Creeper will not be powered. */ +@Deprecated public class CreeperPowerEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean canceled; + @Deprecated private final PowerCause cause; + @Deprecated private LightningStrike bolt; + @Deprecated public CreeperPowerEvent(final Creeper creeper, final LightningStrike bolt, final PowerCause cause) { this(creeper, cause); this.bolt = bolt; } + @Deprecated public CreeperPowerEvent(final Creeper creeper, final PowerCause cause) { super(creeper); this.cause = cause; } + @Deprecated public boolean isCancelled() { return canceled; } + @Deprecated public void setCancelled(boolean cancel) { canceled = cancel; } @Override + @Deprecated public Creeper getEntity() { return (Creeper) entity; } @@ -44,6 +54,7 @@ public class CreeperPowerEvent extends EntityEvent implements Cancellable { * * @return The Entity for the lightning bolt which is striking the Creeper */ + @Deprecated public LightningStrike getLightning() { return bolt; } @@ -53,15 +64,18 @@ public class CreeperPowerEvent extends EntityEvent implements Cancellable { * * @return A PowerCause value detailing the cause of change in power. */ + @Deprecated public PowerCause getCause() { return cause; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } @@ -69,6 +83,7 @@ public class CreeperPowerEvent extends EntityEvent implements Cancellable { /** * An enum to specify the cause of the change in power */ + @Deprecated public enum PowerCause { /** diff --git a/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java b/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java index 2cbbc69..e454d5b 100644 --- a/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java @@ -10,12 +10,15 @@ import org.bukkit.entity.LivingEntity; *

    * Cancelling the event will cause the event to be delayed */ +@Deprecated public class EntityBreakDoorEvent extends EntityChangeBlockEvent { + @Deprecated public EntityBreakDoorEvent(final LivingEntity entity, final Block targetBlock) { super(entity, targetBlock, Material.AIR, (byte) 0); } @Override + @Deprecated public LivingEntity getEntity() { return (LivingEntity) entity; } diff --git a/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java index 41be9ca..d71d526 100644 --- a/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java @@ -10,11 +10,17 @@ import org.bukkit.event.HandlerList; /** * Called when any Entity, excluding players, changes a block. */ +@Deprecated public class EntityChangeBlockEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Block block; + @Deprecated private boolean cancel; + @Deprecated private final Material to; + @Deprecated private final byte data; /** @@ -52,14 +58,17 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable { * * @return the block that is changing */ + @Deprecated public Block getBlock() { return block; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -69,6 +78,7 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable { * * @return the material that the block is changing into */ + @Deprecated public Material getTo() { return to; } @@ -85,10 +95,12 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable { } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityCombustByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityCombustByBlockEvent.java index c84bda9..6e18379 100644 --- a/src/main/java/org/bukkit/event/entity/EntityCombustByBlockEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityCombustByBlockEvent.java @@ -6,9 +6,12 @@ import org.bukkit.entity.Entity; /** * Called when a block causes an entity to combust. */ +@Deprecated public class EntityCombustByBlockEvent extends EntityCombustEvent { + @Deprecated private final Block combuster; + @Deprecated public EntityCombustByBlockEvent(final Block combuster, final Entity combustee, final int duration) { super(combustee, duration); this.combuster = combuster; @@ -21,6 +24,7 @@ public class EntityCombustByBlockEvent extends EntityCombustEvent { * * @return the Block that set the combustee alight. */ + @Deprecated public Block getCombuster() { return combuster; } diff --git a/src/main/java/org/bukkit/event/entity/EntityCombustByEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityCombustByEntityEvent.java index 639567b..07e764d 100644 --- a/src/main/java/org/bukkit/event/entity/EntityCombustByEntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityCombustByEntityEvent.java @@ -5,9 +5,12 @@ import org.bukkit.entity.Entity; /** * Called when an entity causes another entity to combust. */ +@Deprecated public class EntityCombustByEntityEvent extends EntityCombustEvent { + @Deprecated private final Entity combuster; + @Deprecated public EntityCombustByEntityEvent(final Entity combuster, final Entity combustee, final int duration) { super(combustee, duration); this.combuster = combuster; @@ -18,6 +21,7 @@ public class EntityCombustByEntityEvent extends EntityCombustEvent { * * @return the Entity that set the combustee alight. */ + @Deprecated public Entity getCombuster() { return combuster; } diff --git a/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java b/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java index 43c4482..4a387c7 100644 --- a/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java @@ -9,21 +9,28 @@ import org.bukkit.event.HandlerList; *

    * If an Entity Combust event is cancelled, the entity will not combust. */ +@Deprecated public class EntityCombustEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private int duration; + @Deprecated private boolean cancel; + @Deprecated public EntityCombustEvent(final Entity combustee, final int duration) { super(combustee); this.duration = duration; this.cancel = false; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -32,6 +39,7 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable { * @return the amount of time (in seconds) the combustee should be alight * for */ + @Deprecated public int getDuration() { return duration; } @@ -44,15 +52,18 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable { * * @param duration the time in seconds to be alight for. */ + @Deprecated public void setDuration(int duration) { this.duration = duration; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java b/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java index 286c206..909e3d5 100644 --- a/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java @@ -10,12 +10,18 @@ import org.bukkit.event.HandlerList; /** * Thrown when a Living Entity creates a portal in a world. */ +@Deprecated public class EntityCreatePortalEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final List blocks; + @Deprecated private boolean cancelled = false; + @Deprecated private PortalType type = PortalType.CUSTOM; + @Deprecated public EntityCreatePortalEvent(final LivingEntity what, final List blocks, final PortalType type) { super(what); @@ -24,6 +30,7 @@ public class EntityCreatePortalEvent extends EntityEvent implements Cancellable } @Override + @Deprecated public LivingEntity getEntity() { return (LivingEntity) entity; } @@ -33,14 +40,17 @@ public class EntityCreatePortalEvent extends EntityEvent implements Cancellable * * @return List of blocks that will be changed. */ + @Deprecated public List getBlocks() { return blocks; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @@ -50,15 +60,18 @@ public class EntityCreatePortalEvent extends EntityEvent implements Cancellable * * @return Type of portal. */ + @Deprecated public PortalType getPortalType() { return type; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java index c9ebdfb..78f1f18 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java @@ -6,7 +6,9 @@ import org.bukkit.entity.Entity; /** * Called when an entity is damaged by a block */ +@Deprecated public class EntityDamageByBlockEvent extends EntityDamageEvent { + @Deprecated private final Block damager; @Deprecated @@ -14,6 +16,7 @@ public class EntityDamageByBlockEvent extends EntityDamageEvent { this(damager, damagee, cause, (double) damage); } + @Deprecated public EntityDamageByBlockEvent(final Block damager, final Entity damagee, final DamageCause cause, final double damage) { super(damagee, cause, damage); this.damager = damager; @@ -24,6 +27,7 @@ public class EntityDamageByBlockEvent extends EntityDamageEvent { * * @return Block that damaged the player */ + @Deprecated public Block getDamager() { return damager; } diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java index 9eb9f27..81005e4 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java @@ -5,7 +5,9 @@ import org.bukkit.entity.Entity; /** * Called when an entity is damaged by an entity */ +@Deprecated public class EntityDamageByEntityEvent extends EntityDamageEvent { + @Deprecated private final Entity damager; @Deprecated @@ -13,6 +15,7 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent { this(damager, damagee, cause, (double) damage); } + @Deprecated public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final double damage) { super(damagee, cause, damage); this.damager = damager; @@ -23,6 +26,7 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent { * * @return Entity that damaged the defender. */ + @Deprecated public Entity getDamager() { return damager; } diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java index 6e722d2..a435ddc 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java @@ -8,10 +8,15 @@ import org.bukkit.util.NumberConversions; /** * Stores data for damage events */ +@Deprecated public class EntityDamageEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private double damage; + @Deprecated private boolean cancelled; + @Deprecated private final DamageCause cause; @Deprecated @@ -19,16 +24,19 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { this(damagee, cause, (double) damage); } + @Deprecated public EntityDamageEvent(final Entity damagee, final DamageCause cause, final double damage) { super(damagee); this.cause = cause; this.damage = damage; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @@ -38,6 +46,7 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { * * @return The amount of damage caused by the event */ + @Deprecated public double getDamage() { return damage; } @@ -57,6 +66,7 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { * * @param damage The amount of damage caused by the event */ + @Deprecated public void setDamage(double damage) { this.damage = damage; } @@ -76,15 +86,18 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { * * @return A DamageCause value detailing the cause of the damage. */ + @Deprecated public DamageCause getCause() { return cause; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } @@ -92,6 +105,7 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { /** * An enum to specify the cause of the damage */ + @Deprecated public enum DamageCause { /** diff --git a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java index ab9e81f..0c120b8 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java @@ -8,15 +8,21 @@ import org.bukkit.inventory.ItemStack; /** * Thrown whenever a LivingEntity dies */ +@Deprecated public class EntityDeathEvent extends EntityEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final List drops; + @Deprecated private int dropExp = 0; + @Deprecated public EntityDeathEvent(final LivingEntity entity, final List drops) { this(entity, drops, 0); } + @Deprecated public EntityDeathEvent(final LivingEntity what, final List drops, final int droppedExp) { super(what); this.drops = drops; @@ -24,6 +30,7 @@ public class EntityDeathEvent extends EntityEvent { } @Override + @Deprecated public LivingEntity getEntity() { return (LivingEntity) entity; } @@ -36,6 +43,7 @@ public class EntityDeathEvent extends EntityEvent { * * @return Amount of EXP to drop. */ + @Deprecated public int getDroppedExp() { return dropExp; } @@ -48,6 +56,7 @@ public class EntityDeathEvent extends EntityEvent { * * @param exp Amount of EXP to drop. */ + @Deprecated public void setDroppedExp(int exp) { this.dropExp = exp; } @@ -57,15 +66,18 @@ public class EntityDeathEvent extends EntityEvent { * * @return Items to drop when the entity dies */ + @Deprecated public List getDrops() { return drops; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityEvent.java index c9a4ab3..d8e1818 100644 --- a/src/main/java/org/bukkit/event/entity/EntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityEvent.java @@ -7,9 +7,12 @@ import org.bukkit.event.Event; /** * Represents an Entity-related event */ +@Deprecated public abstract class EntityEvent extends Event { + @Deprecated protected Entity entity; + @Deprecated public EntityEvent(final Entity what) { entity = what; } @@ -19,6 +22,7 @@ public abstract class EntityEvent extends Event { * * @return Entity who is involved in this event */ + @Deprecated public Entity getEntity() { return entity; } @@ -28,6 +32,7 @@ public abstract class EntityEvent extends Event { * * @return EntityType of the Entity involved in this event */ + @Deprecated public EntityType getEntityType() { return entity.getType(); } diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java index 287035d..afc41d9 100644 --- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java @@ -11,13 +11,20 @@ import java.util.List; /** * Called when an entity explodes */ +@Deprecated public class EntityExplodeEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel; + @Deprecated private final Location location; + @Deprecated private final List blocks; + @Deprecated private float yield; + @Deprecated public EntityExplodeEvent(final Entity what, final Location location, final List blocks, final float yield) { super(what); this.location = location; @@ -26,10 +33,12 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable { this.cancel = false; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -40,6 +49,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable { * * @return All blown-up blocks */ + @Deprecated public List blockList() { return blocks; } @@ -52,6 +62,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable { * * @return The location of the explosion */ + @Deprecated public Location getLocation() { return location; } @@ -61,6 +72,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable { * * @return The yield. */ + @Deprecated public float getYield() { return yield; } @@ -70,15 +82,18 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable { * * @param yield The new yield percentage */ + @Deprecated public void setYield(float yield) { this.yield = yield; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java b/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java index 1c4e100..f4b96e6 100644 --- a/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java @@ -8,20 +8,27 @@ import org.bukkit.event.HandlerList; /** * Called when an entity interacts with an object */ +@Deprecated public class EntityInteractEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected Block block; + @Deprecated private boolean cancelled; + @Deprecated public EntityInteractEvent(final Entity entity, final Block block) { super(entity); this.block = block; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @@ -31,15 +38,18 @@ public class EntityInteractEvent extends EntityEvent implements Cancellable { * * @return the block clicked with this item. */ + @Deprecated public Block getBlock() { return block; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java b/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java index 87d57b0..cd02a44 100644 --- a/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java @@ -7,10 +7,14 @@ import org.bukkit.event.HandlerList; /** * Called when an entity comes into contact with a portal */ +@Deprecated public class EntityPortalEnterEvent extends EntityEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Location location; + @Deprecated public EntityPortalEnterEvent(final Entity entity, final Location location) { super(entity); this.location = location; @@ -21,15 +25,18 @@ public class EntityPortalEnterEvent extends EntityEvent { * * @return The portal block the entity is touching */ + @Deprecated public Location getLocation() { return location; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java b/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java index 835c054..1263c1c 100644 --- a/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java @@ -11,11 +11,16 @@ import org.bukkit.event.HandlerList; *

    * For players see {@link org.bukkit.event.player.PlayerPortalEvent} */ +@Deprecated public class EntityPortalEvent extends EntityTeleportEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected boolean useTravelAgent = true; + @Deprecated protected TravelAgent travelAgent; + @Deprecated public EntityPortalEvent(final Entity entity, final Location from, final Location to, final TravelAgent pta) { super(entity, from, to); this.travelAgent = pta; @@ -33,6 +38,7 @@ public class EntityPortalEvent extends EntityTeleportEvent { * * @param useTravelAgent whether to use the Travel Agent */ + @Deprecated public void useTravelAgent(boolean useTravelAgent) { this.useTravelAgent = useTravelAgent; } @@ -49,6 +55,7 @@ public class EntityPortalEvent extends EntityTeleportEvent { * * @return whether to use the Travel Agent */ + @Deprecated public boolean useTravelAgent() { return useTravelAgent; } @@ -58,6 +65,7 @@ public class EntityPortalEvent extends EntityTeleportEvent { * * @return the Travel Agent used (or not) in this event */ + @Deprecated public TravelAgent getPortalTravelAgent() { return this.travelAgent; } @@ -67,15 +75,18 @@ public class EntityPortalEvent extends EntityTeleportEvent { * * @param travelAgent the Travel Agent used (or not) in this event */ + @Deprecated public void setPortalTravelAgent(TravelAgent travelAgent) { this.travelAgent = travelAgent; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityPortalExitEvent.java b/src/main/java/org/bukkit/event/entity/EntityPortalExitEvent.java index 682fe59..8d4a453 100644 --- a/src/main/java/org/bukkit/event/entity/EntityPortalExitEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityPortalExitEvent.java @@ -11,11 +11,16 @@ import org.bukkit.util.Vector; * This event allows you to modify the velocity of the entity after they have * successfully exited the portal. */ +@Deprecated public class EntityPortalExitEvent extends EntityTeleportEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private Vector before; + @Deprecated private Vector after; + @Deprecated public EntityPortalExitEvent(final Entity entity, final Location from, final Location to, final Vector before, final Vector after) { super(entity, from, to); this.before = before; @@ -28,6 +33,7 @@ public class EntityPortalExitEvent extends EntityTeleportEvent { * * @return velocity of entity before entering portal */ + @Deprecated public Vector getBefore() { return this.before.clone(); } @@ -38,6 +44,7 @@ public class EntityPortalExitEvent extends EntityTeleportEvent { * * @return velocity of entity after exiting portal */ + @Deprecated public Vector getAfter() { return this.after.clone(); } @@ -45,15 +52,18 @@ public class EntityPortalExitEvent extends EntityTeleportEvent { /** * Sets the velocity that the entity will have after exiting the portal. */ + @Deprecated public void setAfter(Vector after) { this.after = after.clone(); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java index b4291b0..188b3c0 100644 --- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java @@ -8,10 +8,15 @@ import org.bukkit.util.NumberConversions; /** * Stores data for health-regain events */ +@Deprecated public class EntityRegainHealthEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private double amount; + @Deprecated private final RegainReason regainReason; @Deprecated @@ -19,6 +24,7 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable this(entity, (double) amount, regainReason); } + @Deprecated public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason) { super(entity); this.amount = amount; @@ -30,6 +36,7 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable * * @return The amount of health regained */ + @Deprecated public double getAmount() { return amount; } @@ -49,6 +56,7 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable * * @param amount the amount of health the entity will regain */ + @Deprecated public void setAmount(double amount) { this.amount = amount; } @@ -63,10 +71,12 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable setAmount(amount); } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @@ -77,15 +87,18 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable * @return A RegainReason detailing the reason for the entity regaining * health */ + @Deprecated public RegainReason getRegainReason() { return regainReason; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } @@ -93,6 +106,7 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable /** * An enum to specify the type of health regaining that is occurring */ + @Deprecated public enum RegainReason { /** diff --git a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java index f8c91a1..4ee951a 100644 --- a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java @@ -10,13 +10,20 @@ import org.bukkit.inventory.ItemStack; /** * Called when a LivingEntity shoots a bow firing an arrow */ +@Deprecated public class EntityShootBowEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final ItemStack bow; + @Deprecated private Entity projectile; + @Deprecated private final float force; + @Deprecated private boolean cancelled; + @Deprecated public EntityShootBowEvent(final LivingEntity shooter, final ItemStack bow, final Projectile projectile, final float force) { super(shooter); this.bow = bow; @@ -25,6 +32,7 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { } @Override + @Deprecated public LivingEntity getEntity() { return (LivingEntity) entity; } @@ -34,6 +42,7 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { * * @return the bow involved in this event */ + @Deprecated public ItemStack getBow() { return bow; } @@ -43,6 +52,7 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { * * @return the launched projectile */ + @Deprecated public Entity getProjectile() { return projectile; } @@ -52,6 +62,7 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { * * @param projectile the new projectile */ + @Deprecated public void setProjectile(Entity projectile) { this.projectile = projectile; } @@ -61,23 +72,28 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { * * @return bow shooting force, up to 1.0 */ + @Deprecated public float getForce() { return force; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntitySpawnEvent.java b/src/main/java/org/bukkit/event/entity/EntitySpawnEvent.java index 5dcf98f..ed10bdf 100644 --- a/src/main/java/org/bukkit/event/entity/EntitySpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntitySpawnEvent.java @@ -9,18 +9,24 @@ import org.bukkit.event.HandlerList; *

    * If an Entity Spawn event is cancelled, the entity will not spawn. */ +@Deprecated public class EntitySpawnEvent extends EntityEvent implements org.bukkit.event.Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean canceled; + @Deprecated public EntitySpawnEvent(final Entity spawnee) { super(spawnee); } + @Deprecated public boolean isCancelled() { return canceled; } + @Deprecated public void setCancelled(boolean cancel) { canceled = cancel; } @@ -30,15 +36,18 @@ public class EntitySpawnEvent extends EntityEvent implements org.bukkit.event.Ca * * @return The location at which the entity is spawning */ + @Deprecated public Location getLocation() { return getEntity().getLocation(); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityTameEvent.java b/src/main/java/org/bukkit/event/entity/EntityTameEvent.java index f105817..4a715cb 100644 --- a/src/main/java/org/bukkit/event/entity/EntityTameEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityTameEvent.java @@ -8,25 +8,33 @@ import org.bukkit.event.HandlerList; /** * Thrown when a LivingEntity is tamed */ +@Deprecated public class EntityTameEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final AnimalTamer owner; + @Deprecated public EntityTameEvent(final LivingEntity entity, final AnimalTamer owner) { super(entity); this.owner = owner; } @Override + @Deprecated public LivingEntity getEntity() { return (LivingEntity) entity; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @@ -36,15 +44,18 @@ public class EntityTameEvent extends EntityEvent implements Cancellable { * * @return the owning AnimalTamer */ + @Deprecated public AnimalTamer getOwner() { return owner; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java b/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java index 2bcfbba..f4ce6d5 100644 --- a/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java @@ -7,22 +7,30 @@ import org.bukkit.event.HandlerList; /** * Called when a creature targets or untargets another entity */ +@Deprecated public class EntityTargetEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private Entity target; + @Deprecated private final TargetReason reason; + @Deprecated public EntityTargetEvent(final Entity entity, final Entity target, final TargetReason reason) { super(entity); this.target = target; this.reason = reason; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -32,6 +40,7 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable { * * @return The reason */ + @Deprecated public TargetReason getReason() { return reason; } @@ -44,6 +53,7 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable { * * @return The entity */ + @Deprecated public Entity getTarget() { return target; } @@ -60,15 +70,18 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable { * * @param target The entity to target */ + @Deprecated public void setTarget(Entity target) { this.target = target; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } @@ -76,6 +89,7 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable { /** * An enum to specify the reason for the targeting */ + @Deprecated public enum TargetReason { /** diff --git a/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java index cd9aea1..3911546 100644 --- a/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java @@ -7,11 +7,14 @@ import org.bukkit.entity.LivingEntity; * Called when an Entity targets a {@link LivingEntity} and can only target * LivingEntity's. */ +@Deprecated public class EntityTargetLivingEntityEvent extends EntityTargetEvent{ + @Deprecated public EntityTargetLivingEntityEvent(final Entity entity, final LivingEntity target, final TargetReason reason) { super(entity, target, reason); } + @Deprecated public LivingEntity getTarget() { return (LivingEntity) super.getTarget(); } @@ -26,6 +29,7 @@ public class EntityTargetLivingEntityEvent extends EntityTargetEvent{ * * @param target The entity to target */ + @Deprecated public void setTarget(Entity target) { if (target == null || target instanceof LivingEntity) { super.setTarget(target); diff --git a/src/main/java/org/bukkit/event/entity/EntityTeleportEvent.java b/src/main/java/org/bukkit/event/entity/EntityTeleportEvent.java index 619f8d4..c5d99f9 100644 --- a/src/main/java/org/bukkit/event/entity/EntityTeleportEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityTeleportEvent.java @@ -9,12 +9,18 @@ import org.bukkit.event.HandlerList; * Thrown when a non-player entity (such as an Enderman) tries to teleport * from one location to another. */ +@Deprecated public class EntityTeleportEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel; + @Deprecated private Location from; + @Deprecated private Location to; + @Deprecated public EntityTeleportEvent(Entity what, Location from, Location to) { super(what); this.from = from; @@ -22,10 +28,12 @@ public class EntityTeleportEvent extends EntityEvent implements Cancellable { this.cancel = false; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -35,6 +43,7 @@ public class EntityTeleportEvent extends EntityEvent implements Cancellable { * * @return Location this entity moved from */ + @Deprecated public Location getFrom() { return from; } @@ -44,6 +53,7 @@ public class EntityTeleportEvent extends EntityEvent implements Cancellable { * * @param from New location this entity moved from */ + @Deprecated public void setFrom(Location from) { this.from = from; } @@ -53,6 +63,7 @@ public class EntityTeleportEvent extends EntityEvent implements Cancellable { * * @return Location the entity moved to */ + @Deprecated public Location getTo() { return to; } @@ -62,15 +73,18 @@ public class EntityTeleportEvent extends EntityEvent implements Cancellable { * * @param to New Location this entity moved to */ + @Deprecated public void setTo(Location to) { this.to = to; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/EntityUnleashEvent.java b/src/main/java/org/bukkit/event/entity/EntityUnleashEvent.java index da7e46c..5ee8cb7 100644 --- a/src/main/java/org/bukkit/event/entity/EntityUnleashEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityUnleashEvent.java @@ -6,10 +6,14 @@ import org.bukkit.event.HandlerList; /** * Called immediately prior to an entity being unleashed. */ +@Deprecated public class EntityUnleashEvent extends EntityEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final UnleashReason reason; + @Deprecated public EntityUnleashEvent(Entity entity, UnleashReason reason) { super(entity); this.reason = reason; @@ -20,19 +24,23 @@ public class EntityUnleashEvent extends EntityEvent { * * @return The reason */ + @Deprecated public UnleashReason getReason() { return reason; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } + @Deprecated public enum UnleashReason { /** * When the entity's leashholder has died or logged out, and so is diff --git a/src/main/java/org/bukkit/event/entity/ExpBottleEvent.java b/src/main/java/org/bukkit/event/entity/ExpBottleEvent.java index 4f64424..aa2dd0c 100644 --- a/src/main/java/org/bukkit/event/entity/ExpBottleEvent.java +++ b/src/main/java/org/bukkit/event/entity/ExpBottleEvent.java @@ -6,17 +6,23 @@ import org.bukkit.event.HandlerList; /** * Called when a ThrownExpBottle hits and releases experience. */ +@Deprecated public class ExpBottleEvent extends ProjectileHitEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private int exp; + @Deprecated private boolean showEffect = true; + @Deprecated public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) { super(bottle); this.exp = exp; } @Override + @Deprecated public ThrownExpBottle getEntity() { return (ThrownExpBottle) entity; } @@ -26,6 +32,7 @@ public class ExpBottleEvent extends ProjectileHitEvent { * * @return true if the effect will be shown, false otherwise */ + @Deprecated public boolean getShowEffect() { return this.showEffect; } @@ -38,6 +45,7 @@ public class ExpBottleEvent extends ProjectileHitEvent { * @param showEffect true indicates the effect will be shown, false * indicates no effect will be shown */ + @Deprecated public void setShowEffect(final boolean showEffect) { this.showEffect = showEffect; } @@ -49,6 +57,7 @@ public class ExpBottleEvent extends ProjectileHitEvent { * * @return the total amount of experience to be created */ + @Deprecated public int getExperience() { return exp; } @@ -60,15 +69,18 @@ public class ExpBottleEvent extends ProjectileHitEvent { * * @param exp the total amount of experience to be created */ + @Deprecated public void setExperience(final int exp) { this.exp = exp; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java b/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java index 7ca6a55..c1ef724 100644 --- a/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java +++ b/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java @@ -8,12 +8,18 @@ import org.bukkit.event.HandlerList; /** * Called when an entity has made a decision to explode. */ +@Deprecated public class ExplosionPrimeEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel; + @Deprecated private float radius; + @Deprecated private boolean fire; + @Deprecated public ExplosionPrimeEvent(final Entity what, final float radius, final boolean fire) { super(what); this.cancel = false; @@ -21,14 +27,17 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable { this.fire = fire; } + @Deprecated public ExplosionPrimeEvent(final Explosive explosive) { this(explosive, explosive.getYield(), explosive.isIncendiary()); } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -38,6 +47,7 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable { * * @return returns the radius of the explosion */ + @Deprecated public float getRadius() { return radius; } @@ -47,6 +57,7 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable { * * @param radius the radius of the explosion */ + @Deprecated public void setRadius(float radius) { this.radius = radius; } @@ -56,6 +67,7 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable { * * @return true if this explosion will create fire */ + @Deprecated public boolean getFire() { return fire; } @@ -65,15 +77,18 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable { * * @param fire true if you want this explosion to create fire */ + @Deprecated public void setFire(boolean fire) { this.fire = fire; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java b/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java index f6e2472..c4c3bab 100644 --- a/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java +++ b/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java @@ -7,17 +7,23 @@ import org.bukkit.event.HandlerList; /** * Called when a human entity's food level changes */ +@Deprecated public class FoodLevelChangeEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private int level; + @Deprecated public FoodLevelChangeEvent(final HumanEntity what, final int level) { super(what); this.level = level; } @Override + @Deprecated public HumanEntity getEntity() { return (HumanEntity) entity; } @@ -30,6 +36,7 @@ public class FoodLevelChangeEvent extends EntityEvent implements Cancellable { * * @return The resultant food level */ + @Deprecated public int getFoodLevel() { return level; } @@ -41,6 +48,7 @@ public class FoodLevelChangeEvent extends EntityEvent implements Cancellable { * @param level the resultant food level that the entity involved in this * event should be set to */ + @Deprecated public void setFoodLevel(int level) { if (level > 20) level = 20; else if (level < 0) level = 0; @@ -48,19 +56,23 @@ public class FoodLevelChangeEvent extends EntityEvent implements Cancellable { this.level = level; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/HorseJumpEvent.java b/src/main/java/org/bukkit/event/entity/HorseJumpEvent.java index fad2468..93cb779 100644 --- a/src/main/java/org/bukkit/event/entity/HorseJumpEvent.java +++ b/src/main/java/org/bukkit/event/entity/HorseJumpEvent.java @@ -7,25 +7,33 @@ import org.bukkit.event.HandlerList; /** * Called when a horse jumps. */ +@Deprecated public class HorseJumpEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private float power; + @Deprecated public HorseJumpEvent(final Horse horse, final float power) { super(horse); this.power = power; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @Override + @Deprecated public Horse getEntity() { return (Horse) entity; } @@ -47,6 +55,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable { * * @return jump strength */ + @Deprecated public float getPower() { return power; } @@ -63,15 +72,18 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable { * * @param power power of the jump */ + @Deprecated public void setPower(float power) { this.power = power; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java b/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java index 356e4bd..5007b39 100644 --- a/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java @@ -12,25 +12,33 @@ import org.bukkit.event.HandlerList; * Cancelling the event results in the item being allowed to exist for 5 more * minutes. This behavior is not guaranteed and may change in future versions. */ +@Deprecated public class ItemDespawnEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean canceled; + @Deprecated private final Location location; + @Deprecated public ItemDespawnEvent(final Item despawnee, final Location loc) { super(despawnee); location = loc; } + @Deprecated public boolean isCancelled() { return canceled; } + @Deprecated public void setCancelled(boolean cancel) { canceled = cancel; } @Override + @Deprecated public Item getEntity() { return (Item) entity; } @@ -40,15 +48,18 @@ public class ItemDespawnEvent extends EntityEvent implements Cancellable { * * @return The location at which the item is despawning */ + @Deprecated public Location getLocation() { return location; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java b/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java index 776f8e7..5cfbf03 100644 --- a/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java @@ -6,7 +6,9 @@ import org.bukkit.entity.Item; /** * Called when an item is spawned into a world */ +@Deprecated public class ItemSpawnEvent extends EntitySpawnEvent { + @Deprecated public ItemSpawnEvent(final Item spawnee) { super(spawnee); } @@ -17,6 +19,7 @@ public class ItemSpawnEvent extends EntitySpawnEvent { } @Override + @Deprecated public Item getEntity() { return (Item) entity; } diff --git a/src/main/java/org/bukkit/event/entity/PigZapEvent.java b/src/main/java/org/bukkit/event/entity/PigZapEvent.java index aa80ebf..cea1add 100644 --- a/src/main/java/org/bukkit/event/entity/PigZapEvent.java +++ b/src/main/java/org/bukkit/event/entity/PigZapEvent.java @@ -9,27 +9,36 @@ import org.bukkit.event.HandlerList; /** * Stores data for pigs being zapped */ +@Deprecated public class PigZapEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean canceled; + @Deprecated private final PigZombie pigzombie; + @Deprecated private final LightningStrike bolt; + @Deprecated public PigZapEvent(final Pig pig, final LightningStrike bolt, final PigZombie pigzombie) { super(pig); this.bolt = bolt; this.pigzombie = pigzombie; } + @Deprecated public boolean isCancelled() { return canceled; } + @Deprecated public void setCancelled(boolean cancel) { canceled = cancel; } @Override + @Deprecated public Pig getEntity() { return (Pig) entity; } @@ -39,6 +48,7 @@ public class PigZapEvent extends EntityEvent implements Cancellable { * * @return lightning entity */ + @Deprecated public LightningStrike getLightning() { return bolt; } @@ -49,15 +59,18 @@ public class PigZapEvent extends EntityEvent implements Cancellable { * * @return resulting entity */ + @Deprecated public PigZombie getPigZombie() { return pigzombie; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java index b773d6e..9784b7b 100644 --- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java +++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java @@ -8,21 +8,30 @@ import org.bukkit.inventory.ItemStack; /** * Thrown whenever a {@link Player} dies */ +@Deprecated public class PlayerDeathEvent extends EntityDeathEvent { + @Deprecated private int newExp = 0; + @Deprecated private String deathMessage = ""; + @Deprecated private int newLevel = 0; + @Deprecated private int newTotalExp = 0; + @Deprecated private boolean keepLevel = false; + @Deprecated public PlayerDeathEvent(final Player player, final List drops, final int droppedExp, final String deathMessage) { this(player, drops, droppedExp, 0, deathMessage); } + @Deprecated public PlayerDeathEvent(final Player player, final List drops, final int droppedExp, final int newExp, final String deathMessage) { this(player, drops, droppedExp, newExp, 0, 0, deathMessage); } + @Deprecated public PlayerDeathEvent(final Player player, final List drops, final int droppedExp, final int newExp, final int newTotalExp, final int newLevel, final String deathMessage) { super(player, drops, droppedExp); this.newExp = newExp; @@ -32,6 +41,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { } @Override + @Deprecated public Player getEntity() { return (Player) entity; } @@ -41,6 +51,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { * * @param deathMessage Message to appear to other players on the server. */ + @Deprecated public void setDeathMessage(String deathMessage) { this.deathMessage = deathMessage; } @@ -50,6 +61,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { * * @return Message to appear to other players on the server. */ + @Deprecated public String getDeathMessage() { return deathMessage; } @@ -62,6 +74,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { * * @return New EXP of the respawned player */ + @Deprecated public int getNewExp() { return newExp; } @@ -74,6 +87,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { * * @param exp New EXP of the respawned player */ + @Deprecated public void setNewExp(int exp) { newExp = exp; } @@ -83,6 +97,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { * * @return New Level of the respawned player */ + @Deprecated public int getNewLevel() { return newLevel; } @@ -92,6 +107,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { * * @param level New Level of the respawned player */ + @Deprecated public void setNewLevel(int level) { newLevel = level; } @@ -101,6 +117,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { * * @return New Total EXP of the respawned player */ + @Deprecated public int getNewTotalExp() { return newTotalExp; } @@ -110,6 +127,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { * * @param totalExp New Total EXP of the respawned player */ + @Deprecated public void setNewTotalExp(int totalExp) { newTotalExp = totalExp; } @@ -121,6 +139,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { * * @return True if Player should keep all pre-death exp */ + @Deprecated public boolean getKeepLevel() { return keepLevel; } @@ -132,6 +151,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { * * @param keepLevel True to keep all current value levels */ + @Deprecated public void setKeepLevel(boolean keepLevel) { this.keepLevel = keepLevel; } diff --git a/src/main/java/org/bukkit/event/entity/PlayerLeashEntityEvent.java b/src/main/java/org/bukkit/event/entity/PlayerLeashEntityEvent.java index 74d458a..f96456c 100644 --- a/src/main/java/org/bukkit/event/entity/PlayerLeashEntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/PlayerLeashEntityEvent.java @@ -9,13 +9,20 @@ import org.bukkit.event.HandlerList; /** * Called immediately prior to a creature being leashed by a player. */ +@Deprecated public class PlayerLeashEntityEvent extends Event implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Entity leashHolder; + @Deprecated private final Entity entity; + @Deprecated private boolean cancelled = false; + @Deprecated private final Player player; + @Deprecated public PlayerLeashEntityEvent(Entity what, Entity leashHolder, Player leasher) { this.leashHolder = leashHolder; this.entity = what; @@ -27,6 +34,7 @@ public class PlayerLeashEntityEvent extends Event implements Cancellable { * * @return The leash holder */ + @Deprecated public Entity getLeashHolder() { return leashHolder; } @@ -36,6 +44,7 @@ public class PlayerLeashEntityEvent extends Event implements Cancellable { * * @return The entity */ + @Deprecated public Entity getEntity() { return entity; } @@ -45,23 +54,28 @@ public class PlayerLeashEntityEvent extends Event implements Cancellable { * * @return Player who is involved in this event */ + @Deprecated public final Player getPlayer() { return player; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } + @Deprecated public boolean isCancelled() { return this.cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java b/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java index b9840de..7c56753 100644 --- a/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java +++ b/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java @@ -13,11 +13,16 @@ import org.bukkit.event.HandlerList; /** * Called when a splash potion hits an area */ +@Deprecated public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final Map affectedEntities; + @Deprecated public PotionSplashEvent(final ThrownPotion potion, final Map affectedEntities) { super(potion); @@ -25,6 +30,7 @@ public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable } @Override + @Deprecated public ThrownPotion getEntity() { return (ThrownPotion) entity; } @@ -34,6 +40,7 @@ public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable * * @return The thrown potion entity */ + @Deprecated public ThrownPotion getPotion() { return (ThrownPotion) getEntity(); } @@ -43,6 +50,7 @@ public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable * * @return A fresh copy of the affected entity list */ + @Deprecated public Collection getAffectedEntities() { return new ArrayList(affectedEntities.keySet()); } @@ -55,6 +63,7 @@ public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable * @return intensity relative to maximum effect; 0.0: not affected; 1.0: * fully hit by potion effects */ + @Deprecated public double getIntensity(LivingEntity entity) { Double intensity = affectedEntities.get(entity); return intensity != null ? intensity : 0.0; @@ -66,6 +75,7 @@ public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable * @param entity For which entity to define a new intensity * @param intensity relative to maximum effect */ + @Deprecated public void setIntensity(LivingEntity entity, double intensity) { Validate.notNull(entity, "You must specify a valid entity."); if (intensity <= 0.0) { @@ -75,19 +85,23 @@ public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable } } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java index 25ae832..09e45f6 100644 --- a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java +++ b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java @@ -6,23 +6,29 @@ import org.bukkit.event.HandlerList; /** * Called when a projectile hits an object */ +@Deprecated public class ProjectileHitEvent extends EntityEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public ProjectileHitEvent(final Projectile projectile) { super(projectile); } @Override + @Deprecated public Projectile getEntity() { return (Projectile) entity; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/ProjectileLaunchEvent.java b/src/main/java/org/bukkit/event/entity/ProjectileLaunchEvent.java index 0c9190c..c11a118 100644 --- a/src/main/java/org/bukkit/event/entity/ProjectileLaunchEvent.java +++ b/src/main/java/org/bukkit/event/entity/ProjectileLaunchEvent.java @@ -8,32 +8,41 @@ import org.bukkit.event.HandlerList; /** * Called when a projectile is launched. */ +@Deprecated public class ProjectileLaunchEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated public ProjectileLaunchEvent(Entity what) { super(what); } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @Override + @Deprecated public Projectile getEntity() { return (Projectile) entity; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java b/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java index 4c17fea..f2ebba0 100644 --- a/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java +++ b/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java @@ -8,26 +8,34 @@ import org.bukkit.event.HandlerList; /** * Called when a sheep's wool is dyed */ +@Deprecated public class SheepDyeWoolEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel; + @Deprecated private DyeColor color; + @Deprecated public SheepDyeWoolEvent(final Sheep sheep, final DyeColor color) { super(sheep); this.cancel = false; this.color = color; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public Sheep getEntity() { return (Sheep) entity; } @@ -37,6 +45,7 @@ public class SheepDyeWoolEvent extends EntityEvent implements Cancellable { * * @return the DyeColor the sheep is being dyed */ + @Deprecated public DyeColor getColor() { return color; } @@ -46,15 +55,18 @@ public class SheepDyeWoolEvent extends EntityEvent implements Cancellable { * * @param color the DyeColor the sheep will be dyed */ + @Deprecated public void setColor(DyeColor color) { this.color = color; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/SheepRegrowWoolEvent.java b/src/main/java/org/bukkit/event/entity/SheepRegrowWoolEvent.java index e836f7b..059e723 100644 --- a/src/main/java/org/bukkit/event/entity/SheepRegrowWoolEvent.java +++ b/src/main/java/org/bukkit/event/entity/SheepRegrowWoolEvent.java @@ -7,33 +7,42 @@ import org.bukkit.event.HandlerList; /** * Called when a sheep regrows its wool */ +@Deprecated public class SheepRegrowWoolEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel; + @Deprecated public SheepRegrowWoolEvent(final Sheep sheep) { super(sheep); this.cancel = false; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public Sheep getEntity() { return (Sheep) entity; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java b/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java index 4b99587..5fc71e7 100644 --- a/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java +++ b/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java @@ -7,25 +7,33 @@ import org.bukkit.event.HandlerList; /** * Called when a Slime splits into smaller Slimes upon death */ +@Deprecated public class SlimeSplitEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private int count; + @Deprecated public SlimeSplitEvent(final Slime slime, final int count) { super(slime); this.count = count; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public Slime getEntity() { return (Slime) entity; } @@ -35,6 +43,7 @@ public class SlimeSplitEvent extends EntityEvent implements Cancellable { * * @return the amount of slimes to spawn */ + @Deprecated public int getCount() { return count; } @@ -44,15 +53,18 @@ public class SlimeSplitEvent extends EntityEvent implements Cancellable { * * @param count the amount of slimes to spawn */ + @Deprecated public void setCount(int count) { this.count = count; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java b/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java index 1acb3c4..3fe9512 100644 --- a/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java @@ -8,14 +8,18 @@ import org.bukkit.entity.Entity; *

    * If a Spawner Spawn event is cancelled, the entity will not spawn. */ +@Deprecated public class SpawnerSpawnEvent extends EntitySpawnEvent { + @Deprecated private final CreatureSpawner spawner; + @Deprecated public SpawnerSpawnEvent(final Entity spawnee, final CreatureSpawner spawner) { super(spawnee); this.spawner = spawner; } + @Deprecated public CreatureSpawner getSpawner() { return spawner; } diff --git a/src/main/java/org/bukkit/event/hanging/HangingBreakByEntityEvent.java b/src/main/java/org/bukkit/event/hanging/HangingBreakByEntityEvent.java index 80851ed..e2c9833 100644 --- a/src/main/java/org/bukkit/event/hanging/HangingBreakByEntityEvent.java +++ b/src/main/java/org/bukkit/event/hanging/HangingBreakByEntityEvent.java @@ -6,9 +6,12 @@ import org.bukkit.entity.Hanging; /** * Triggered when a hanging entity is removed by an entity */ +@Deprecated public class HangingBreakByEntityEvent extends HangingBreakEvent { + @Deprecated private final Entity remover; + @Deprecated public HangingBreakByEntityEvent(final Hanging hanging, final Entity remover) { super(hanging, HangingBreakEvent.RemoveCause.ENTITY); this.remover = remover; @@ -19,6 +22,7 @@ public class HangingBreakByEntityEvent extends HangingBreakEvent { * * @return the entity that removed the hanging entity */ + @Deprecated public Entity getRemover() { return remover; } diff --git a/src/main/java/org/bukkit/event/hanging/HangingBreakEvent.java b/src/main/java/org/bukkit/event/hanging/HangingBreakEvent.java index 87bbdcb..1628133 100644 --- a/src/main/java/org/bukkit/event/hanging/HangingBreakEvent.java +++ b/src/main/java/org/bukkit/event/hanging/HangingBreakEvent.java @@ -7,11 +7,16 @@ import org.bukkit.event.HandlerList; /** * Triggered when a hanging entity is removed */ +@Deprecated public class HangingBreakEvent extends HangingEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final HangingBreakEvent.RemoveCause cause; + @Deprecated public HangingBreakEvent(final Hanging hanging, final HangingBreakEvent.RemoveCause cause) { super(hanging); this.cause = cause; @@ -22,14 +27,17 @@ public class HangingBreakEvent extends HangingEvent implements Cancellable { * * @return the RemoveCause for the hanging entity's removal */ + @Deprecated public HangingBreakEvent.RemoveCause getCause() { return cause; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @@ -37,6 +45,7 @@ public class HangingBreakEvent extends HangingEvent implements Cancellable { /** * An enum to specify the cause of the removal */ + @Deprecated public enum RemoveCause { /** * Removed by an entity @@ -61,10 +70,12 @@ public class HangingBreakEvent extends HangingEvent implements Cancellable { } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/hanging/HangingEvent.java b/src/main/java/org/bukkit/event/hanging/HangingEvent.java index b370afe..92b1bd4 100644 --- a/src/main/java/org/bukkit/event/hanging/HangingEvent.java +++ b/src/main/java/org/bukkit/event/hanging/HangingEvent.java @@ -6,9 +6,12 @@ import org.bukkit.event.Event; /** * Represents a hanging entity-related event. */ +@Deprecated public abstract class HangingEvent extends Event { + @Deprecated protected Hanging hanging; + @Deprecated protected HangingEvent(final Hanging painting) { this.hanging = painting; } @@ -18,6 +21,7 @@ public abstract class HangingEvent extends Event { * * @return the hanging entity */ + @Deprecated public Hanging getEntity() { return hanging; } diff --git a/src/main/java/org/bukkit/event/hanging/HangingPlaceEvent.java b/src/main/java/org/bukkit/event/hanging/HangingPlaceEvent.java index b511c55..6903ebe 100644 --- a/src/main/java/org/bukkit/event/hanging/HangingPlaceEvent.java +++ b/src/main/java/org/bukkit/event/hanging/HangingPlaceEvent.java @@ -10,13 +10,20 @@ import org.bukkit.event.HandlerList; /** * Triggered when a hanging entity is created in the world */ +@Deprecated public class HangingPlaceEvent extends HangingEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final Player player; + @Deprecated private final Block block; + @Deprecated private final BlockFace blockFace; + @Deprecated public HangingPlaceEvent(final Hanging hanging, final Player player, final Block block, final BlockFace blockFace) { super(hanging); this.player = player; @@ -29,6 +36,7 @@ public class HangingPlaceEvent extends HangingEvent implements Cancellable { * * @return the player placing the hanging entity */ + @Deprecated public Player getPlayer() { return player; } @@ -38,6 +46,7 @@ public class HangingPlaceEvent extends HangingEvent implements Cancellable { * * @return the block that the hanging entity was placed on */ + @Deprecated public Block getBlock() { return block; } @@ -47,23 +56,28 @@ public class HangingPlaceEvent extends HangingEvent implements Cancellable { * * @return the face of the block that the hanging entity was placed on */ + @Deprecated public BlockFace getBlockFace() { return blockFace; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/BrewEvent.java b/src/main/java/org/bukkit/event/inventory/BrewEvent.java index 2295c2d..8a40680 100644 --- a/src/main/java/org/bukkit/event/inventory/BrewEvent.java +++ b/src/main/java/org/bukkit/event/inventory/BrewEvent.java @@ -10,11 +10,16 @@ import org.bukkit.inventory.BrewerInventory; * Called when the brewing of the contents inside the Brewing Stand is * complete. */ +@Deprecated public class BrewEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private BrewerInventory contents; + @Deprecated private boolean cancelled; + @Deprecated public BrewEvent(Block brewer, BrewerInventory contents) { super(brewer); this.contents = contents; @@ -25,23 +30,28 @@ public class BrewEvent extends BlockEvent implements Cancellable { * * @return the contents */ + @Deprecated public BrewerInventory getContents() { return contents; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/ClickType.java b/src/main/java/org/bukkit/event/inventory/ClickType.java index a7440aa..9442607 100644 --- a/src/main/java/org/bukkit/event/inventory/ClickType.java +++ b/src/main/java/org/bukkit/event/inventory/ClickType.java @@ -3,6 +3,7 @@ package org.bukkit.event.inventory; /** * What the client did to trigger this action (not the result). */ +@Deprecated public enum ClickType { /** @@ -70,6 +71,7 @@ public enum ClickType { * * @return true if this ClickType represents the pressing of a key */ + @Deprecated public boolean isKeyboardClick() { return (this == ClickType.NUMBER_KEY) || (this == ClickType.DROP) || (this == ClickType.CONTROL_DROP); } @@ -80,6 +82,7 @@ public enum ClickType { * * @return true if this action requires Creative mode */ + @Deprecated public boolean isCreativeAction() { // Why use middle click? return (this == ClickType.MIDDLE) || (this == ClickType.CREATIVE); @@ -90,6 +93,7 @@ public enum ClickType { * * @return true if this ClickType represents a right click */ + @Deprecated public boolean isRightClick() { return (this == ClickType.RIGHT) || (this == ClickType.SHIFT_RIGHT); } @@ -99,6 +103,7 @@ public enum ClickType { * * @return true if this ClickType represents a left click */ + @Deprecated public boolean isLeftClick() { return (this == ClickType.LEFT) || (this == ClickType.SHIFT_LEFT) || (this == ClickType.DOUBLE_CLICK) || (this == ClickType.CREATIVE); } @@ -109,6 +114,7 @@ public enum ClickType { * * @return true if the action uses Shift. */ + @Deprecated public boolean isShiftClick() { return (this == ClickType.SHIFT_LEFT) || (this == ClickType.SHIFT_RIGHT) || (this == ClickType.CONTROL_DROP); } diff --git a/src/main/java/org/bukkit/event/inventory/CraftItemEvent.java b/src/main/java/org/bukkit/event/inventory/CraftItemEvent.java index ba3f5e5..9981237 100644 --- a/src/main/java/org/bukkit/event/inventory/CraftItemEvent.java +++ b/src/main/java/org/bukkit/event/inventory/CraftItemEvent.java @@ -8,7 +8,9 @@ import org.bukkit.inventory.Recipe; /** * Called when the recipe of an Item is completed inside a crafting matrix. */ +@Deprecated public class CraftItemEvent extends InventoryClickEvent { + @Deprecated private Recipe recipe; @Deprecated @@ -16,11 +18,13 @@ public class CraftItemEvent extends InventoryClickEvent { this(recipe, what, type, slot, right ? (shift ? ClickType.SHIFT_RIGHT : ClickType.RIGHT) : (shift ? ClickType.SHIFT_LEFT : ClickType.LEFT), InventoryAction.PICKUP_ALL); } + @Deprecated public CraftItemEvent(Recipe recipe, InventoryView what, SlotType type, int slot, ClickType click, InventoryAction action) { super(what, type, slot, click, action); this.recipe = recipe; } + @Deprecated public CraftItemEvent(Recipe recipe, InventoryView what, SlotType type, int slot, ClickType click, InventoryAction action, int key) { super(what, type, slot, click, action, key); this.recipe = recipe; @@ -29,11 +33,13 @@ public class CraftItemEvent extends InventoryClickEvent { /** * @return A copy of the current recipe on the crafting matrix. */ + @Deprecated public Recipe getRecipe() { return recipe; } @Override + @Deprecated public CraftingInventory getInventory() { return (CraftingInventory) super.getInventory(); } diff --git a/src/main/java/org/bukkit/event/inventory/DragType.java b/src/main/java/org/bukkit/event/inventory/DragType.java index 72c2bed..e58be4a 100644 --- a/src/main/java/org/bukkit/event/inventory/DragType.java +++ b/src/main/java/org/bukkit/event/inventory/DragType.java @@ -4,6 +4,7 @@ package org.bukkit.event.inventory; * Represents the effect of a drag that will be applied to an Inventory in an * InventoryDragEvent. */ +@Deprecated public enum DragType { /** * One item from the cursor is placed in each selected slot. diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java index 8ca1ff7..b2d14ad 100644 --- a/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java +++ b/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java @@ -9,13 +9,20 @@ import org.bukkit.inventory.ItemStack; /** * Called when an ItemStack is successfully burned as fuel in a furnace. */ +@Deprecated public class FurnaceBurnEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final ItemStack fuel; + @Deprecated private int burnTime; + @Deprecated private boolean cancelled; + @Deprecated private boolean burning; + @Deprecated public FurnaceBurnEvent(final Block furnace, final ItemStack fuel, final int burnTime) { super(furnace); this.fuel = fuel; @@ -40,6 +47,7 @@ public class FurnaceBurnEvent extends BlockEvent implements Cancellable { * * @return the fuel ItemStack */ + @Deprecated public ItemStack getFuel() { return fuel; } @@ -49,6 +57,7 @@ public class FurnaceBurnEvent extends BlockEvent implements Cancellable { * * @return the burn time for this fuel */ + @Deprecated public int getBurnTime() { return burnTime; } @@ -58,6 +67,7 @@ public class FurnaceBurnEvent extends BlockEvent implements Cancellable { * * @param burnTime the burn time for this fuel */ + @Deprecated public void setBurnTime(int burnTime) { this.burnTime = burnTime; } @@ -67,6 +77,7 @@ public class FurnaceBurnEvent extends BlockEvent implements Cancellable { * * @return whether the furnace's fuel is burning or not. */ + @Deprecated public boolean isBurning() { return this.burning; } @@ -76,23 +87,28 @@ public class FurnaceBurnEvent extends BlockEvent implements Cancellable { * * @param burning true if the furnace's fuel is burning */ + @Deprecated public void setBurning(boolean burning) { this.burning = burning; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java index b7381fa..b8591e0 100644 --- a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java +++ b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java @@ -8,11 +8,16 @@ import org.bukkit.event.block.BlockExpEvent; /** * This event is called when a player takes items out of the furnace */ +@Deprecated public class FurnaceExtractEvent extends BlockExpEvent { + @Deprecated private final Player player; + @Deprecated private final Material itemType; + @Deprecated private final int itemAmount; + @Deprecated public FurnaceExtractEvent(Player player, Block block, Material itemType, int itemAmount, int exp) { super(block, exp); this.player = player; @@ -25,6 +30,7 @@ public class FurnaceExtractEvent extends BlockExpEvent { * * @return the relevant player */ + @Deprecated public Player getPlayer() { return player; } @@ -34,6 +40,7 @@ public class FurnaceExtractEvent extends BlockExpEvent { * * @return the material of the item */ + @Deprecated public Material getItemType() { return itemType; } @@ -43,6 +50,7 @@ public class FurnaceExtractEvent extends BlockExpEvent { * * @return the amount of the item */ + @Deprecated public int getItemAmount() { return itemAmount; } diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java index e9d1a54..d68dd54 100644 --- a/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java +++ b/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java @@ -9,12 +9,18 @@ import org.bukkit.inventory.ItemStack; /** * Called when an ItemStack is successfully smelted in a furnace. */ +@Deprecated public class FurnaceSmeltEvent extends BlockEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final ItemStack source; + @Deprecated private ItemStack result; + @Deprecated private boolean cancelled; + @Deprecated public FurnaceSmeltEvent(final Block furnace, final ItemStack source, final ItemStack result) { super(furnace); this.source = source; @@ -38,6 +44,7 @@ public class FurnaceSmeltEvent extends BlockEvent implements Cancellable { * * @return smelting source ItemStack */ + @Deprecated public ItemStack getSource() { return source; } @@ -47,6 +54,7 @@ public class FurnaceSmeltEvent extends BlockEvent implements Cancellable { * * @return smelting result ItemStack */ + @Deprecated public ItemStack getResult() { return result; } @@ -56,23 +64,28 @@ public class FurnaceSmeltEvent extends BlockEvent implements Cancellable { * * @param result new result ItemStack */ + @Deprecated public void setResult(ItemStack result) { this.result = result; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryAction.java b/src/main/java/org/bukkit/event/inventory/InventoryAction.java index a7bc694..3895486 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryAction.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryAction.java @@ -3,6 +3,7 @@ package org.bukkit.event.inventory; /** * An estimation of what the result will be. */ +@Deprecated public enum InventoryAction { /** diff --git a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java index 3313d91..1c57538 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java @@ -43,15 +43,25 @@ import org.bukkit.plugin.Plugin; * Plugin, Runnable)}, which would execute the task on the next tick, would * work as well. */ +@Deprecated public class InventoryClickEvent extends InventoryInteractEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final ClickType click; + @Deprecated private final InventoryAction action; + @Deprecated private final Inventory clickedInventory; + @Deprecated private SlotType slot_type; + @Deprecated private int whichSlot; + @Deprecated private int rawSlot; + @Deprecated private ItemStack current = null; + @Deprecated private int hotbarKey = -1; @Deprecated @@ -59,6 +69,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { this(view, type, slot, right ? (shift ? ClickType.SHIFT_RIGHT : ClickType.RIGHT) : (shift ? ClickType.SHIFT_LEFT : ClickType.LEFT), InventoryAction.SWAP_WITH_CURSOR); } + @Deprecated public InventoryClickEvent(InventoryView view, SlotType type, int slot, ClickType click, InventoryAction action) { super(view); this.slot_type = type; @@ -75,6 +86,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { this.action = action; } + @Deprecated public InventoryClickEvent(InventoryView view, SlotType type, int slot, ClickType click, InventoryAction action, int key) { this(view, type, slot, click, action); this.hotbarKey = key; @@ -84,6 +96,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * Gets the inventory that was clicked, or null if outside of window * @return The clicked inventory */ + @Deprecated public Inventory getClickedInventory() { return clickedInventory; } @@ -93,6 +106,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * * @return the slot type */ + @Deprecated public SlotType getSlotType() { return slot_type; } @@ -102,6 +116,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * * @return the cursor ItemStack */ + @Deprecated public ItemStack getCursor() { return getView().getCursor(); } @@ -111,6 +126,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * * @return the item in the clicked */ + @Deprecated public ItemStack getCurrentItem() { if (slot_type == SlotType.OUTSIDE) { return current; @@ -125,6 +141,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * @return true if the ClickType uses the right mouse button. * @see ClickType#isRightClick() */ + @Deprecated public boolean isRightClick() { return click.isRightClick(); } @@ -136,6 +153,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * @return true if the ClickType uses the left mouse button. * @see ClickType#isLeftClick() */ + @Deprecated public boolean isLeftClick() { return click.isLeftClick(); } @@ -147,6 +165,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * @return true if the ClickType uses Shift or Ctrl. * @see ClickType#isShiftClick() */ + @Deprecated public boolean isShiftClick() { return click.isShiftClick(); } @@ -170,6 +189,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * * @param stack the item to be placed in the current slot */ + @Deprecated public void setCurrentItem(ItemStack stack) { if (slot_type == SlotType.OUTSIDE) { current = stack; @@ -185,6 +205,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * * @return The slot number. */ + @Deprecated public int getSlot() { return whichSlot; } @@ -195,6 +216,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * * @return the slot number */ + @Deprecated public int getRawSlot() { return rawSlot; } @@ -206,6 +228,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * @return the number on the key minus 1 (range 0-8); or -1 if not * a NUMBER_KEY action */ + @Deprecated public int getHotbarButton() { return hotbarKey; } @@ -219,6 +242,7 @@ public class InventoryClickEvent extends InventoryInteractEvent { * * @return the InventoryAction that triggered this event. */ + @Deprecated public InventoryAction getAction() { return action; } @@ -230,15 +254,18 @@ public class InventoryClickEvent extends InventoryInteractEvent { * * @return the type of inventory click */ + @Deprecated public ClickType getClick() { return click; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java index 19889b2..ad01cc6 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java @@ -8,9 +8,12 @@ import org.bukkit.inventory.InventoryView; /** * Represents a player related inventory event */ +@Deprecated public class InventoryCloseEvent extends InventoryEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public InventoryCloseEvent(InventoryView transaction) { super(transaction); } @@ -20,15 +23,18 @@ public class InventoryCloseEvent extends InventoryEvent { * * @return Player who is involved in this event */ + @Deprecated public final HumanEntity getPlayer() { return transaction.getPlayer(); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryCreativeEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryCreativeEvent.java index da7dffc..1a2b87e 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryCreativeEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryCreativeEvent.java @@ -9,18 +9,23 @@ import org.bukkit.inventory.ItemStack; * an item in their inventory / hotbar and when they drop items from their * Inventory while in creative mode. */ +@Deprecated public class InventoryCreativeEvent extends InventoryClickEvent { + @Deprecated private ItemStack item; + @Deprecated public InventoryCreativeEvent(InventoryView what, SlotType type, int slot, ItemStack newItem) { super(what, type, slot, ClickType.CREATIVE, InventoryAction.PLACE_ALL); this.item = newItem; } + @Deprecated public ItemStack getCursor() { return item; } + @Deprecated public void setCursor(ItemStack item) { this.item = item; } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryDragEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryDragEvent.java index e7e54a7..fec3695 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryDragEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryDragEvent.java @@ -54,14 +54,22 @@ import com.google.common.collect.ImmutableSet; * task using {@link BukkitScheduler#runTask(Plugin, Runnable)}, which would * execute the task on the next tick, would work as well. */ +@Deprecated public class InventoryDragEvent extends InventoryInteractEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final DragType type; + @Deprecated private final Map addedItems; + @Deprecated private final Set containerSlots; + @Deprecated private final ItemStack oldCursor; + @Deprecated private ItemStack newCursor; + @Deprecated public InventoryDragEvent(InventoryView what, ItemStack newCursor, ItemStack oldCursor, boolean right, Map slots) { super(what); @@ -84,6 +92,7 @@ public class InventoryDragEvent extends InventoryInteractEvent { * * @return map from raw slot id to new ItemStack */ + @Deprecated public Map getNewItems() { return Collections.unmodifiableMap(addedItems); } @@ -93,6 +102,7 @@ public class InventoryDragEvent extends InventoryInteractEvent { * * @return list of raw slot ids, suitable for getView().getItem(int) */ + @Deprecated public Set getRawSlots() { return addedItems.keySet(); } @@ -103,6 +113,7 @@ public class InventoryDragEvent extends InventoryInteractEvent { * @return list of converted slot ids, suitable for {@link * org.bukkit.inventory.Inventory#getItem(int)}. */ + @Deprecated public Set getInventorySlots() { return containerSlots; } @@ -113,6 +124,7 @@ public class InventoryDragEvent extends InventoryInteractEvent { * * @return the result cursor */ + @Deprecated public ItemStack getCursor() { return newCursor; } @@ -126,6 +138,7 @@ public class InventoryDragEvent extends InventoryInteractEvent { * * @param newCursor the new cursor ItemStack */ + @Deprecated public void setCursor(ItemStack newCursor) { this.newCursor = newCursor; } @@ -136,6 +149,7 @@ public class InventoryDragEvent extends InventoryInteractEvent { * * @return the original cursor */ + @Deprecated public ItemStack getOldCursor() { return oldCursor.clone(); } @@ -149,15 +163,18 @@ public class InventoryDragEvent extends InventoryInteractEvent { * * @return the DragType of this InventoryDragEvent */ + @Deprecated public DragType getType() { return type; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryEvent.java index 973c392..0eeea39 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryEvent.java @@ -12,10 +12,14 @@ import org.bukkit.inventory.InventoryView; /** * Represents a player related inventory event */ +@Deprecated public class InventoryEvent extends Event { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected InventoryView transaction; + @Deprecated public InventoryEvent(InventoryView transaction) { this.transaction = transaction; } @@ -25,6 +29,7 @@ public class InventoryEvent extends Event { * * @return The upper inventory. */ + @Deprecated public Inventory getInventory() { return transaction.getTopInventory(); } @@ -35,6 +40,7 @@ public class InventoryEvent extends Event { * * @return A list of people viewing. */ + @Deprecated public List getViewers() { return transaction.getTopInventory().getViewers(); } @@ -44,15 +50,18 @@ public class InventoryEvent extends Event { * * @return InventoryView */ + @Deprecated public InventoryView getView() { return transaction; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryInteractEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryInteractEvent.java index 8624f8d..82adfeb 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryInteractEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryInteractEvent.java @@ -10,9 +10,12 @@ import org.bukkit.inventory.ItemStack; * An abstract base class for events that describe an interaction between a * HumanEntity and the contents of an Inventory. */ +@Deprecated public abstract class InventoryInteractEvent extends InventoryEvent implements Cancellable { + @Deprecated private Result result = Result.DEFAULT; + @Deprecated public InventoryInteractEvent(InventoryView transaction) { super(transaction); } @@ -22,6 +25,7 @@ public abstract class InventoryInteractEvent extends InventoryEvent implements C * * @return The clicking player. */ + @Deprecated public HumanEntity getWhoClicked() { return getView().getPlayer(); } @@ -33,6 +37,7 @@ public abstract class InventoryInteractEvent extends InventoryEvent implements C * @see #isCancelled() * @param newResult the new {@link Result} for this event */ + @Deprecated public void setResult(Result newResult) { result = newResult; } @@ -44,6 +49,7 @@ public abstract class InventoryInteractEvent extends InventoryEvent implements C * * @return the Result of this event. */ + @Deprecated public Result getResult() { return result; } @@ -58,6 +64,7 @@ public abstract class InventoryInteractEvent extends InventoryEvent implements C * * @return whether the event is cancelled */ + @Deprecated public boolean isCancelled() { return getResult() == Result.DENY; } @@ -71,6 +78,7 @@ public abstract class InventoryInteractEvent extends InventoryEvent implements C * * @param toCancel result becomes DENY if true, ALLOW if false */ + @Deprecated public void setCancelled(boolean toCancel) { setResult(toCancel ? Result.DENY : Result.ALLOW); } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java index 06ec99a..0537333 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java @@ -23,14 +23,22 @@ import org.bukkit.inventory.ItemStack; * has not been modified, the source inventory slot will be restored to its * former state. Otherwise any additional items will be discarded. */ +@Deprecated public class InventoryMoveItemEvent extends Event implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final Inventory sourceInventory; + @Deprecated private final Inventory destinationInventory; + @Deprecated private ItemStack itemStack; + @Deprecated private final boolean didSourceInitiate; + @Deprecated public InventoryMoveItemEvent(final Inventory sourceInventory, final ItemStack itemStack, final Inventory destinationInventory, final boolean didSourceInitiate) { Validate.notNull(itemStack, "ItemStack cannot be null"); this.sourceInventory = sourceInventory; @@ -44,6 +52,7 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { * * @return Inventory that the ItemStack is being taken from */ + @Deprecated public Inventory getSource() { return sourceInventory; } @@ -54,6 +63,7 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { * * @return ItemStack */ + @Deprecated public ItemStack getItem() { return itemStack.clone(); } @@ -65,6 +75,7 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { * * @param itemStack The ItemStack */ + @Deprecated public void setItem(ItemStack itemStack) { Validate.notNull(itemStack, "ItemStack cannot be null. Cancel the event if you want nothing to be transferred."); this.itemStack = itemStack.clone(); @@ -75,6 +86,7 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { * * @return Inventory that the ItemStack is being put into */ + @Deprecated public Inventory getDestination() { return destinationInventory; } @@ -85,23 +97,28 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { * * @return Inventory that initiated the transfer */ + @Deprecated public Inventory getInitiator() { return didSourceInitiate ? sourceInventory : destinationInventory; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java index c3570aa..615913e 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java @@ -8,10 +8,14 @@ import org.bukkit.event.HandlerList; /** * Represents a player related inventory event */ +@Deprecated public class InventoryOpenEvent extends InventoryEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated public InventoryOpenEvent(InventoryView transaction) { super(transaction); this.cancelled = false; @@ -22,6 +26,7 @@ public class InventoryOpenEvent extends InventoryEvent implements Cancellable { * * @return Player who is involved in this event */ + @Deprecated public final HumanEntity getPlayer() { return transaction.getPlayer(); } @@ -35,6 +40,7 @@ public class InventoryOpenEvent extends InventoryEvent implements Cancellable { * * @return true if this event is cancelled */ + @Deprecated public boolean isCancelled() { return cancelled; } @@ -48,15 +54,18 @@ public class InventoryOpenEvent extends InventoryEvent implements Cancellable { * * @param cancel true if you wish to cancel this event */ + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryPickupItemEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryPickupItemEvent.java index af6ad5b..17f2ce4 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryPickupItemEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryPickupItemEvent.java @@ -9,12 +9,18 @@ import org.bukkit.inventory.Inventory; /** * Called when a hopper or hopper minecart picks up a dropped item. */ +@Deprecated public class InventoryPickupItemEvent extends Event implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final Inventory inventory; + @Deprecated private final Item item; + @Deprecated public InventoryPickupItemEvent(final Inventory inventory, final Item item) { super(); this.inventory = inventory; @@ -26,6 +32,7 @@ public class InventoryPickupItemEvent extends Event implements Cancellable { * * @return Inventory */ + @Deprecated public Inventory getInventory() { return inventory; } @@ -35,23 +42,28 @@ public class InventoryPickupItemEvent extends Event implements Cancellable { * * @return Item */ + @Deprecated public Item getItem() { return item; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java index b83580a..05932e1 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryType.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java @@ -1,5 +1,6 @@ package org.bukkit.event.inventory; +@Deprecated public enum InventoryType { /** @@ -71,22 +72,28 @@ public enum InventoryType { HOPPER(5, "Item Hopper"), ; + @Deprecated private final int size; + @Deprecated private final String title; + @Deprecated private InventoryType(int defaultSize, String defaultTitle) { size = defaultSize; title = defaultTitle; } + @Deprecated public int getDefaultSize() { return size; } + @Deprecated public String getDefaultTitle() { return title; } + @Deprecated public enum SlotType { /** * A result slot in a furnace or crafting inventory. diff --git a/src/main/java/org/bukkit/event/inventory/PrepareItemCraftEvent.java b/src/main/java/org/bukkit/event/inventory/PrepareItemCraftEvent.java index 5731190..8caf8d2 100644 --- a/src/main/java/org/bukkit/event/inventory/PrepareItemCraftEvent.java +++ b/src/main/java/org/bukkit/event/inventory/PrepareItemCraftEvent.java @@ -5,11 +5,16 @@ import org.bukkit.inventory.CraftingInventory; import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.Recipe; +@Deprecated public class PrepareItemCraftEvent extends InventoryEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean repair; + @Deprecated private CraftingInventory matrix; + @Deprecated public PrepareItemCraftEvent(CraftingInventory what, InventoryView view, boolean isRepair) { super(view); this.matrix = what; @@ -23,6 +28,7 @@ public class PrepareItemCraftEvent extends InventoryEvent { * * @return The recipe being crafted. */ + @Deprecated public Recipe getRecipe() { return matrix.getRecipe(); } @@ -31,6 +37,7 @@ public class PrepareItemCraftEvent extends InventoryEvent { * @return The crafting inventory on which the recipe was formed. */ @Override + @Deprecated public CraftingInventory getInventory() { return matrix; } @@ -41,15 +48,18 @@ public class PrepareItemCraftEvent extends InventoryEvent { * * @return True if this is a repair. */ + @Deprecated public boolean isRepair() { return repair; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/painting/PaintingBreakByEntityEvent.java b/src/main/java/org/bukkit/event/painting/PaintingBreakByEntityEvent.java index 1dc4987..91b9946 100644 --- a/src/main/java/org/bukkit/event/painting/PaintingBreakByEntityEvent.java +++ b/src/main/java/org/bukkit/event/painting/PaintingBreakByEntityEvent.java @@ -13,8 +13,10 @@ import org.bukkit.entity.Painting; @Deprecated @Warning(reason="This event has been replaced by HangingBreakByEntityEvent") public class PaintingBreakByEntityEvent extends PaintingBreakEvent { + @Deprecated private final Entity remover; + @Deprecated public PaintingBreakByEntityEvent(final Painting painting, final Entity remover) { super(painting, RemoveCause.ENTITY); this.remover = remover; @@ -25,6 +27,7 @@ public class PaintingBreakByEntityEvent extends PaintingBreakEvent { * * @return the entity that removed the painting. */ + @Deprecated public Entity getRemover() { return remover; } diff --git a/src/main/java/org/bukkit/event/painting/PaintingBreakEvent.java b/src/main/java/org/bukkit/event/painting/PaintingBreakEvent.java index 3e27c69..c265238 100644 --- a/src/main/java/org/bukkit/event/painting/PaintingBreakEvent.java +++ b/src/main/java/org/bukkit/event/painting/PaintingBreakEvent.java @@ -13,10 +13,14 @@ import org.bukkit.event.HandlerList; @Deprecated @Warning(reason="This event has been replaced by HangingBreakEvent") public class PaintingBreakEvent extends PaintingEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final RemoveCause cause; + @Deprecated public PaintingBreakEvent(final Painting painting, final RemoveCause cause) { super(painting); this.cause = cause; @@ -27,14 +31,17 @@ public class PaintingBreakEvent extends PaintingEvent implements Cancellable { * * @return the RemoveCause for the painting's removal */ + @Deprecated public RemoveCause getCause() { return cause; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @@ -42,6 +49,7 @@ public class PaintingBreakEvent extends PaintingEvent implements Cancellable { /** * An enum to specify the cause of the removal */ + @Deprecated public enum RemoveCause { /** * Removed by an entity @@ -66,10 +74,12 @@ public class PaintingBreakEvent extends PaintingEvent implements Cancellable { } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/painting/PaintingEvent.java b/src/main/java/org/bukkit/event/painting/PaintingEvent.java index 3a51348..9ff3775 100644 --- a/src/main/java/org/bukkit/event/painting/PaintingEvent.java +++ b/src/main/java/org/bukkit/event/painting/PaintingEvent.java @@ -12,8 +12,10 @@ import org.bukkit.event.Event; @Deprecated @Warning(reason="This event has been replaced by HangingEvent") public abstract class PaintingEvent extends Event { + @Deprecated protected Painting painting; + @Deprecated protected PaintingEvent(final Painting painting) { this.painting = painting; } @@ -23,6 +25,7 @@ public abstract class PaintingEvent extends Event { * * @return the painting */ + @Deprecated public Painting getPainting() { return painting; } diff --git a/src/main/java/org/bukkit/event/painting/PaintingPlaceEvent.java b/src/main/java/org/bukkit/event/painting/PaintingPlaceEvent.java index 3250b29..cfef7dc 100644 --- a/src/main/java/org/bukkit/event/painting/PaintingPlaceEvent.java +++ b/src/main/java/org/bukkit/event/painting/PaintingPlaceEvent.java @@ -16,12 +16,18 @@ import org.bukkit.event.HandlerList; @Deprecated @Warning(reason="This event has been replaced by HangingPlaceEvent") public class PaintingPlaceEvent extends PaintingEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final Player player; + @Deprecated private final Block block; + @Deprecated private final BlockFace blockFace; + @Deprecated public PaintingPlaceEvent(final Painting painting, final Player player, final Block block, final BlockFace blockFace) { super(painting); this.player = player; @@ -34,6 +40,7 @@ public class PaintingPlaceEvent extends PaintingEvent implements Cancellable { * * @return Entity returns the player placing the painting */ + @Deprecated public Player getPlayer() { return player; } @@ -43,6 +50,7 @@ public class PaintingPlaceEvent extends PaintingEvent implements Cancellable { * * @return Block returns the block painting placed on */ + @Deprecated public Block getBlock() { return block; } @@ -53,23 +61,28 @@ public class PaintingPlaceEvent extends PaintingEvent implements Cancellable { * @return BlockFace returns the face of the block the painting was placed * on */ + @Deprecated public BlockFace getBlockFace() { return blockFace; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java index a796292..9759b5d 100644 --- a/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java +++ b/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java @@ -23,11 +23,17 @@ import org.bukkit.event.HandlerList; * Care should be taken to check {@link #isAsynchronous()} and treat the event * appropriately. */ +@Deprecated public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private String message; + @Deprecated private String format = "<%1$s> %2$s"; + @Deprecated private final Set recipients; /** @@ -38,6 +44,7 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable { * @param players the players to receive the message. This may be a lazy * or unmodifiable collection. */ + @Deprecated public AsyncPlayerChatEvent(final boolean async, final Player who, final String message, final Set players) { super(who, async); this.message = message; @@ -50,6 +57,7 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable { * * @return Message the player is attempting to send */ + @Deprecated public String getMessage() { return message; } @@ -60,6 +68,7 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable { * * @param message New message that the player will send */ + @Deprecated public void setMessage(String message) { this.message = message; } @@ -74,6 +83,7 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable { * @return {@link String#format(String, Object...)} compatible format * string */ + @Deprecated public String getFormat() { return format; } @@ -92,6 +102,7 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable { * @throws NullPointerException if format is null * @see String#format(String, Object...) */ + @Deprecated public void setFormat(final String format) throws IllegalFormatException, NullPointerException { // Oh for a better way to do this! try { @@ -117,23 +128,28 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable { * * @return All Players who will see this chat message */ + @Deprecated public Set getRecipients() { return recipients; } + @Deprecated public boolean isCancelled() { return cancel ; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java index 02b373c..18f1335 100644 --- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java @@ -10,13 +10,20 @@ import org.bukkit.event.HandlerList; *

    * This event is asynchronous, and not run using main thread. */ +@Deprecated public class AsyncPlayerPreLoginEvent extends Event { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private Result result; + @Deprecated private String message; + @Deprecated private final String name; + @Deprecated private final InetAddress ipAddress; + @Deprecated public AsyncPlayerPreLoginEvent(final String name, final InetAddress ipAddress) { super(true); this.result = Result.ALLOWED; @@ -30,6 +37,7 @@ public class AsyncPlayerPreLoginEvent extends Event { * * @return Current Result of the login */ + @Deprecated public Result getLoginResult() { return result; } @@ -52,6 +60,7 @@ public class AsyncPlayerPreLoginEvent extends Event { * * @param result New result to set */ + @Deprecated public void setLoginResult(final Result result) { this.result = result; } @@ -75,6 +84,7 @@ public class AsyncPlayerPreLoginEvent extends Event { * * @return Current kick message */ + @Deprecated public String getKickMessage() { return message; } @@ -84,6 +94,7 @@ public class AsyncPlayerPreLoginEvent extends Event { * * @param message New kick message */ + @Deprecated public void setKickMessage(final String message) { this.message = message; } @@ -91,6 +102,7 @@ public class AsyncPlayerPreLoginEvent extends Event { /** * Allows the player to log in */ + @Deprecated public void allow() { result = Result.ALLOWED; message = ""; @@ -102,6 +114,7 @@ public class AsyncPlayerPreLoginEvent extends Event { * @param result New result for disallowing the player * @param message Kick message to display to the user */ + @Deprecated public void disallow(final Result result, final String message) { this.result = result; this.message = message; @@ -127,6 +140,7 @@ public class AsyncPlayerPreLoginEvent extends Event { * * @return the player's name */ + @Deprecated public String getName() { return name; } @@ -136,15 +150,18 @@ public class AsyncPlayerPreLoginEvent extends Event { * * @return The IP address */ + @Deprecated public InetAddress getAddress() { return ipAddress; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } @@ -152,6 +169,7 @@ public class AsyncPlayerPreLoginEvent extends Event { /** * Basic kick reasons for communicating to plugins */ + @Deprecated public enum Result { /** diff --git a/src/main/java/org/bukkit/event/player/PlayerAchievementAwardedEvent.java b/src/main/java/org/bukkit/event/player/PlayerAchievementAwardedEvent.java index e33fade..03818f2 100644 --- a/src/main/java/org/bukkit/event/player/PlayerAchievementAwardedEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerAchievementAwardedEvent.java @@ -8,11 +8,16 @@ import org.bukkit.event.HandlerList; /** * Called when a player earns an achievement. */ +@Deprecated public class PlayerAchievementAwardedEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Achievement achievement; + @Deprecated private boolean isCancelled = false; + @Deprecated public PlayerAchievementAwardedEvent(Player player, Achievement achievement) { super(player); this.achievement = achievement; @@ -23,23 +28,28 @@ public class PlayerAchievementAwardedEvent extends PlayerEvent implements Cancel * * @return the achievement being awarded */ + @Deprecated public Achievement getAchievement() { return achievement; } + @Deprecated public boolean isCancelled() { return isCancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.isCancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java b/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java index cabe77d..682a0fc 100644 --- a/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java @@ -7,9 +7,13 @@ import org.bukkit.event.HandlerList; /** * Represents a player animation event */ +@Deprecated public class PlayerAnimationEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final PlayerAnimationType animationType; + @Deprecated private boolean isCancelled = false; /** @@ -17,6 +21,7 @@ public class PlayerAnimationEvent extends PlayerEvent implements Cancellable { * * @param player The player instance */ + @Deprecated public PlayerAnimationEvent(final Player player) { super(player); @@ -29,23 +34,28 @@ public class PlayerAnimationEvent extends PlayerEvent implements Cancellable { * * @return the animation type */ + @Deprecated public PlayerAnimationType getAnimationType() { return animationType; } + @Deprecated public boolean isCancelled() { return this.isCancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.isCancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerAnimationType.java b/src/main/java/org/bukkit/event/player/PlayerAnimationType.java index ea4bf26..d0669cc 100644 --- a/src/main/java/org/bukkit/event/player/PlayerAnimationType.java +++ b/src/main/java/org/bukkit/event/player/PlayerAnimationType.java @@ -3,6 +3,7 @@ package org.bukkit.event.player; /** * Different types of player animations */ +@Deprecated public enum PlayerAnimationType { ARM_SWING } diff --git a/src/main/java/org/bukkit/event/player/PlayerBedEnterEvent.java b/src/main/java/org/bukkit/event/player/PlayerBedEnterEvent.java index 09f1a66..1bf04af 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBedEnterEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBedEnterEvent.java @@ -8,20 +8,27 @@ import org.bukkit.event.HandlerList; /** * This event is fired when the player is almost about to enter the bed. */ +@Deprecated public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private final Block bed; + @Deprecated public PlayerBedEnterEvent(final Player who, final Block bed) { super(who); this.bed = bed; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -31,15 +38,18 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable { * * @return the bed block involved in this event */ + @Deprecated public Block getBed() { return bed; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java b/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java index 628ab0b..9570216 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java @@ -7,10 +7,14 @@ import org.bukkit.event.HandlerList; /** * This event is fired when the player is leaving a bed. */ +@Deprecated public class PlayerBedLeaveEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Block bed; + @Deprecated public PlayerBedLeaveEvent(final Player who, final Block bed) { super(who); this.bed = bed; @@ -21,15 +25,18 @@ public class PlayerBedLeaveEvent extends PlayerEvent { * * @return the bed block involved in this event */ + @Deprecated public Block getBed() { return bed; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java index 8fb121a..6ff4c44 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java @@ -10,18 +10,23 @@ import org.bukkit.inventory.ItemStack; /** * Called when a player empties a bucket */ +@Deprecated public class PlayerBucketEmptyEvent extends PlayerBucketEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public PlayerBucketEmptyEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand) { super(who, blockClicked, blockFace, bucket, itemInHand); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java index d32c55e..7b7934b 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java @@ -10,13 +10,20 @@ import org.bukkit.inventory.ItemStack; /** * Called when a player interacts with a Bucket */ +@Deprecated public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable { + @Deprecated private ItemStack itemStack; + @Deprecated private boolean cancelled = false; + @Deprecated private final Block blockClicked; + @Deprecated private final BlockFace blockFace; + @Deprecated private final Material bucket; + @Deprecated public PlayerBucketEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand) { super(who); this.blockClicked = blockClicked; @@ -30,6 +37,7 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab * * @return the used bucket */ + @Deprecated public Material getBucket() { return bucket; } @@ -39,6 +47,7 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab * * @return Itemstack hold in hand after the event. */ + @Deprecated public ItemStack getItemStack() { return itemStack; } @@ -48,6 +57,7 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab * * @param itemStack the new held itemstack after the bucket event. */ + @Deprecated public void setItemStack(ItemStack itemStack) { this.itemStack = itemStack; } @@ -57,6 +67,7 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab * * @return the blicked block */ + @Deprecated public Block getBlockClicked() { return blockClicked; } @@ -66,14 +77,17 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab * * @return the clicked face */ + @Deprecated public BlockFace getBlockFace() { return blockFace; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java index 94e042a..8ec6fbc 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java @@ -10,18 +10,23 @@ import org.bukkit.inventory.ItemStack; /** * Called when a player fills a bucket */ +@Deprecated public class PlayerBucketFillEvent extends PlayerBucketEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public PlayerBucketFillEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand) { super(who, blockClicked, blockFace, bucket, itemInHand); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerChangedWorldEvent.java b/src/main/java/org/bukkit/event/player/PlayerChangedWorldEvent.java index 76c9c20..ca9c29f 100644 --- a/src/main/java/org/bukkit/event/player/PlayerChangedWorldEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerChangedWorldEvent.java @@ -7,10 +7,14 @@ import org.bukkit.event.HandlerList; /** * Called when a player switches to another world. */ +@Deprecated public class PlayerChangedWorldEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final World from; + @Deprecated public PlayerChangedWorldEvent(final Player player, final World from) { super(player); this.from = from; @@ -21,15 +25,18 @@ public class PlayerChangedWorldEvent extends PlayerEvent { * * @return player's previous world */ + @Deprecated public World getFrom() { return from; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerChannelEvent.java b/src/main/java/org/bukkit/event/player/PlayerChannelEvent.java index 054efbc..314a6a6 100644 --- a/src/main/java/org/bukkit/event/player/PlayerChannelEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerChannelEvent.java @@ -7,24 +7,31 @@ import org.bukkit.event.HandlerList; * This event is called after a player registers or unregisters a new plugin * channel. */ +@Deprecated public abstract class PlayerChannelEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final String channel; + @Deprecated public PlayerChannelEvent(final Player player, final String channel) { super(player); this.channel = channel; } + @Deprecated public final String getChannel() { return channel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerChatEvent.java b/src/main/java/org/bukkit/event/player/PlayerChatEvent.java index b48ea36..d0a50c9 100644 --- a/src/main/java/org/bukkit/event/player/PlayerChatEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerChatEvent.java @@ -23,12 +23,18 @@ import org.bukkit.event.HandlerList; @Deprecated @Warning(reason="Listening to this event forces chat to wait for the main thread, delaying chat messages.") public class PlayerChatEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private String message; + @Deprecated private String format; + @Deprecated private final Set recipients; + @Deprecated public PlayerChatEvent(final Player player, final String message) { super(player); this.message = message; @@ -36,6 +42,7 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { this.recipients = new HashSet(Arrays.asList(player.getServer().getOnlinePlayers())); } + @Deprecated public PlayerChatEvent(final Player player, final String message, final String format, final Set recipients) { super(player); this.message = message; @@ -43,10 +50,12 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { this.recipients = recipients; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -56,6 +65,7 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { * * @return Message the player is attempting to send */ + @Deprecated public String getMessage() { return message; } @@ -65,6 +75,7 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { * * @param message New message that the player will send */ + @Deprecated public void setMessage(String message) { this.message = message; } @@ -75,6 +86,7 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { * * @param player New player which this event will execute as */ + @Deprecated public void setPlayer(final Player player) { Validate.notNull(player, "Player cannot be null"); this.player = player; @@ -85,6 +97,7 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { * * @return String.Format compatible format string */ + @Deprecated public String getFormat() { return format; } @@ -94,6 +107,7 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { * * @param format String.Format compatible format string */ + @Deprecated public void setFormat(final String format) { // Oh for a better way to do this! try { @@ -111,15 +125,18 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable { * * @return All Players who will see this chat message */ + @Deprecated public Set getRecipients() { return recipients; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java b/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java index 7241a9b..4f0bd2e 100644 --- a/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java @@ -9,12 +9,18 @@ import org.bukkit.event.HandlerList; /** * Called when a player attempts to tab-complete a chat message. */ +@Deprecated public class PlayerChatTabCompleteEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final String message; + @Deprecated private final String lastToken; + @Deprecated private final Collection completions; + @Deprecated public PlayerChatTabCompleteEvent(final Player who, final String message, final Collection completions) { super(who); Validate.notNull(message, "Message cannot be null"); @@ -34,6 +40,7 @@ public class PlayerChatTabCompleteEvent extends PlayerEvent { * * @return the chat message */ + @Deprecated public String getChatMessage() { return message; } @@ -46,6 +53,7 @@ public class PlayerChatTabCompleteEvent extends PlayerEvent { * * @return The last token for the chat message */ + @Deprecated public String getLastToken() { return lastToken; } @@ -55,15 +63,18 @@ public class PlayerChatTabCompleteEvent extends PlayerEvent { * * @return the current completions */ + @Deprecated public Collection getTabCompletions() { return completions; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java b/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java index 7f3cae6..452ae21 100644 --- a/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java @@ -46,29 +46,39 @@ import org.bukkit.event.HandlerList; * beginning of the message should be preserved. If a slash is added or * removed, unexpected behavior may result. */ +@Deprecated public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private String message; + @Deprecated private String format = "<%1$s> %2$s"; + @Deprecated private final Set recipients; + @Deprecated public PlayerCommandPreprocessEvent(final Player player, final String message) { super(player); this.recipients = new HashSet(Arrays.asList(player.getServer().getOnlinePlayers())); this.message = message; } + @Deprecated public PlayerCommandPreprocessEvent(final Player player, final String message, final Set recipients) { super(player); this.recipients = recipients; this.message = message; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -81,6 +91,7 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell * * @return Message the player is attempting to send */ + @Deprecated public String getMessage() { return message; } @@ -94,6 +105,7 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell * @param command New message that the player will send * @throws IllegalArgumentException if command is null or empty */ + @Deprecated public void setMessage(String command) throws IllegalArgumentException { Validate.notNull(command, "Command cannot be null"); Validate.notEmpty(command, "Command cannot be empty"); @@ -106,6 +118,7 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell * @param player New player which this event will execute as * @throws IllegalArgumentException if the player provided is null */ + @Deprecated public void setPlayer(final Player player) throws IllegalArgumentException { Validate.notNull(player, "Player cannot be null"); this.player = player; @@ -163,10 +176,12 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java index 5b41b65..1b65de6 100644 --- a/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java @@ -8,11 +8,16 @@ import org.bukkit.event.HandlerList; /** * Thrown when a player drops an item from their inventory */ +@Deprecated public class PlayerDropItemEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Item drop; + @Deprecated private boolean cancel = false; + @Deprecated public PlayerDropItemEvent(final Player player, final Item drop) { super(player); this.drop = drop; @@ -23,23 +28,28 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable { * * @return ItemDrop created by the player */ + @Deprecated public Item getItemDrop() { return drop; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerEditBookEvent.java b/src/main/java/org/bukkit/event/player/PlayerEditBookEvent.java index ea7ecef..0171677 100644 --- a/src/main/java/org/bukkit/event/player/PlayerEditBookEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerEditBookEvent.java @@ -11,15 +11,23 @@ import org.bukkit.inventory.meta.BookMeta; * Called when a player edits or signs a book and quill item. If the event is * cancelled, no changes are made to the BookMeta */ +@Deprecated public class PlayerEditBookEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final BookMeta previousBookMeta; + @Deprecated private final int slot; + @Deprecated private BookMeta newBookMeta; + @Deprecated private boolean isSigning; + @Deprecated private boolean cancel; + @Deprecated public PlayerEditBookEvent(Player who, int slot, BookMeta previousBookMeta, BookMeta newBookMeta, boolean isSigning) { super(who); @@ -44,6 +52,7 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable { * * @return the book meta currently on the book */ + @Deprecated public BookMeta getPreviousBookMeta() { return previousBookMeta.clone(); } @@ -57,6 +66,7 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable { * * @return the book meta that the player is attempting to add */ + @Deprecated public BookMeta getNewBookMeta() { return newBookMeta.clone(); } @@ -69,6 +79,7 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable { * * @return the inventory slot number that the book item occupies */ + @Deprecated public int getSlot() { return slot; } @@ -79,6 +90,7 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable { * @param newBookMeta new book meta * @throws IllegalArgumentException if the new book meta is null */ + @Deprecated public void setNewBookMeta(BookMeta newBookMeta) throws IllegalArgumentException { Validate.notNull(newBookMeta, "New book meta must not be null"); Bukkit.getItemFactory().equals(newBookMeta, null); @@ -91,6 +103,7 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable { * * @return true if the book is being signed */ + @Deprecated public boolean isSigning() { return isSigning; } @@ -101,23 +114,28 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable { * * @param signing whether or not the book is being signed. */ + @Deprecated public void setSigning(boolean signing) { isSigning = signing; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } diff --git a/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java b/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java index 896347e..8f567c5 100644 --- a/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java @@ -9,13 +9,20 @@ import org.bukkit.event.HandlerList; /** * Called when a player throws an egg and it might hatch */ +@Deprecated public class PlayerEggThrowEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Egg egg; + @Deprecated private boolean hatching; + @Deprecated private EntityType hatchType; + @Deprecated private byte numHatches; + @Deprecated public PlayerEggThrowEvent(final Player player, final Egg egg, final boolean hatching, final byte numHatches, final EntityType hatchingType) { super(player); this.egg = egg; @@ -34,6 +41,7 @@ public class PlayerEggThrowEvent extends PlayerEvent { * * @return the egg involved in this event */ + @Deprecated public Egg getEgg() { return egg; } @@ -44,6 +52,7 @@ public class PlayerEggThrowEvent extends PlayerEvent { * * @return boolean Whether the egg is going to hatch or not */ + @Deprecated public boolean isHatching() { return hatching; } @@ -54,6 +63,7 @@ public class PlayerEggThrowEvent extends PlayerEvent { * @param hatching true if you want the egg to hatch, false if you want it * not to */ + @Deprecated public void setHatching(boolean hatching) { this.hatching = hatching; } @@ -74,6 +84,7 @@ public class PlayerEggThrowEvent extends PlayerEvent { * * @return The type of the mob being hatched by the egg */ + @Deprecated public EntityType getHatchingType() { return hatchType; } @@ -94,6 +105,7 @@ public class PlayerEggThrowEvent extends PlayerEvent { * * @param hatchType The type of the mob being hatched by the egg */ + @Deprecated public void setHatchingType(EntityType hatchType) { if(!hatchType.isSpawnable()) throw new IllegalArgumentException("Can't spawn that entity type from an egg!"); this.hatchType = hatchType; @@ -110,6 +122,7 @@ public class PlayerEggThrowEvent extends PlayerEvent { * * @return The number of mobs going to be hatched by the egg */ + @Deprecated public byte getNumHatches() { return numHatches; } @@ -122,15 +135,18 @@ public class PlayerEggThrowEvent extends PlayerEvent { * * @param numHatches The number of mobs coming out of the egg */ + @Deprecated public void setNumHatches(byte numHatches) { this.numHatches = numHatches; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerEvent.java b/src/main/java/org/bukkit/event/player/PlayerEvent.java index 0d4833f..cf0b9fa 100644 --- a/src/main/java/org/bukkit/event/player/PlayerEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerEvent.java @@ -6,9 +6,12 @@ import org.bukkit.event.Event; /** * Represents a player related event */ +@Deprecated public abstract class PlayerEvent extends Event { + @Deprecated protected Player player; + @Deprecated public PlayerEvent(final Player who) { player = who; } @@ -24,6 +27,7 @@ public abstract class PlayerEvent extends Event { * * @return Player who is involved in this event */ + @Deprecated public final Player getPlayer() { return player; } diff --git a/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java index f37491d..35fff1b 100644 --- a/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java @@ -6,10 +6,14 @@ import org.bukkit.event.HandlerList; /** * Called when a players experience changes naturally */ +@Deprecated public class PlayerExpChangeEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private int exp; + @Deprecated public PlayerExpChangeEvent(final Player player, final int expAmount) { super(player); exp = expAmount; @@ -20,6 +24,7 @@ public class PlayerExpChangeEvent extends PlayerEvent { * * @return The amount of experience */ + @Deprecated public int getAmount() { return exp; } @@ -29,15 +34,18 @@ public class PlayerExpChangeEvent extends PlayerEvent { * * @param amount The amount of experience to set */ + @Deprecated public void setAmount(int amount) { exp = amount; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerFishEvent.java b/src/main/java/org/bukkit/event/player/PlayerFishEvent.java index e92acdf..c3f3678 100644 --- a/src/main/java/org/bukkit/event/player/PlayerFishEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerFishEvent.java @@ -9,12 +9,19 @@ import org.bukkit.event.HandlerList; /** * Thrown when a player is fishing */ +@Deprecated public class PlayerFishEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Entity entity; + @Deprecated private boolean cancel = false; + @Deprecated private int exp; + @Deprecated private final State state; + @Deprecated private final Fish hookEntity; /** @@ -29,6 +36,7 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { this(player, entity, null, state); } + @Deprecated public PlayerFishEvent(final Player player, final Entity entity, final Fish hookEntity, final State state) { super(player); this.entity = entity; @@ -42,6 +50,7 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { * @return Entity caught by the player, null if fishing, bobber has gotten * stuck in the ground or nothing has been caught */ + @Deprecated public Entity getCaught() { return entity; } @@ -51,14 +60,17 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { * * @return Fish the entity representing the fishing hook/bobber. */ + @Deprecated public Fish getHook() { return hookEntity; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -71,6 +83,7 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { * * @return the amount of experience to drop */ + @Deprecated public int getExpToDrop() { return exp; } @@ -83,6 +96,7 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { * * @param amount the amount of experience to drop */ + @Deprecated public void setExpToDrop(int amount) { exp = amount; } @@ -92,15 +106,18 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { * * @return A State detailing the state of the fishing */ + @Deprecated public State getState() { return state; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } @@ -108,6 +125,7 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { /** * An enum to specify the state of the fishing */ + @Deprecated public enum State { /** diff --git a/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java index 8c9afa8..af993c4 100644 --- a/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java @@ -8,20 +8,27 @@ import org.bukkit.event.HandlerList; /** * Called when the GameMode of the player is changed. */ +@Deprecated public class PlayerGameModeChangeEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final GameMode newGameMode; + @Deprecated public PlayerGameModeChangeEvent(final Player player, final GameMode newGameMode) { super(player); this.newGameMode = newGameMode; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @@ -31,15 +38,18 @@ public class PlayerGameModeChangeEvent extends PlayerEvent implements Cancellabl * * @return player's new GameMode */ + @Deprecated public GameMode getNewGameMode() { return newGameMode; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java b/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java index 935211d..d26bcf1 100644 --- a/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java @@ -8,20 +8,26 @@ import org.bukkit.event.HandlerList; /** * Represents an event that is called when a player right clicks an entity. */ +@Deprecated public class PlayerInteractEntityEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected Entity clickedEntity; boolean cancelled = false; + @Deprecated public PlayerInteractEntityEvent(final Player who, final Entity clickedEntity) { super(who); this.clickedEntity = clickedEntity; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @@ -31,15 +37,18 @@ public class PlayerInteractEntityEvent extends PlayerEvent implements Cancellabl * * @return entity right clicked by player */ + @Deprecated public Entity getRightClicked() { return this.clickedEntity; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java b/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java index 59567d9..9da1d55 100644 --- a/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java @@ -12,15 +12,24 @@ import org.bukkit.event.block.Action; /** * Called when a player interacts with an object or air. */ +@Deprecated public class PlayerInteractEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected ItemStack item; + @Deprecated protected Action action; + @Deprecated protected Block blockClicked; + @Deprecated protected BlockFace blockFace; + @Deprecated private Result useClickedBlock; + @Deprecated private Result useItemInHand; + @Deprecated public PlayerInteractEvent(final Player who, final Action action, final ItemStack item, final Block clickedBlock, final BlockFace clickedFace) { super(who); this.action = action; @@ -37,6 +46,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return Action returns the type of interaction */ + @Deprecated public Action getAction() { return action; } @@ -47,6 +57,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return boolean cancellation state */ + @Deprecated public boolean isCancelled() { return useInteractedBlock() == Result.DENY; } @@ -61,6 +72,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @param cancel true if you wish to cancel this event */ + @Deprecated public void setCancelled(boolean cancel) { setUseInteractedBlock(cancel ? Result.DENY : useInteractedBlock() == Result.DENY ? Result.DEFAULT : useInteractedBlock()); setUseItemInHand(cancel ? Result.DENY : useItemInHand() == Result.DENY ? Result.DEFAULT : useItemInHand()); @@ -71,6 +83,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return ItemStack the item used */ + @Deprecated public ItemStack getItem() { return this.item; } @@ -81,6 +94,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return Material the material of the item used */ + @Deprecated public Material getMaterial() { if (!hasItem()) { return Material.AIR; @@ -94,6 +108,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return boolean true if it did */ + @Deprecated public boolean hasBlock() { return this.blockClicked != null; } @@ -103,6 +118,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return boolean true if it did */ + @Deprecated public boolean hasItem() { return this.item != null; } @@ -113,6 +129,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return boolean true if the item in hand was a block */ + @Deprecated public boolean isBlockInHand() { if (!hasItem()) { return false; @@ -126,6 +143,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return Block returns the block clicked with this item. */ + @Deprecated public Block getClickedBlock() { return blockClicked; } @@ -135,6 +153,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return BlockFace returns the face of the block that was clicked */ + @Deprecated public BlockFace getBlockFace() { return blockFace; } @@ -146,6 +165,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return the action to take with the interacted block */ + @Deprecated public Result useInteractedBlock() { return useClickedBlock; } @@ -153,6 +173,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { /** * @param useInteractedBlock the action to take with the interacted block */ + @Deprecated public void setUseInteractedBlock(Result useInteractedBlock) { this.useClickedBlock = useInteractedBlock; } @@ -165,6 +186,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { * * @return the action to take with the item in hand */ + @Deprecated public Result useItemInHand() { return useItemInHand; } @@ -172,15 +194,18 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { /** * @param useItemInHand the action to take with the item in hand */ + @Deprecated public void setUseItemInHand(Result useItemInHand) { this.useItemInHand = useItemInHand; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java b/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java index 2ec69d7..4352661 100644 --- a/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java @@ -16,9 +16,12 @@ import org.bukkit.inventory.Inventory; */ @Deprecated public class PlayerInventoryEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected Inventory inventory; + @Deprecated public PlayerInventoryEvent(final Player player, final Inventory inventory) { super(player); this.inventory = inventory; @@ -29,15 +32,18 @@ public class PlayerInventoryEvent extends PlayerEvent { * * @return Inventory */ + @Deprecated public Inventory getInventory() { return inventory; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerItemBreakEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemBreakEvent.java index 176cd91..3b22585 100644 --- a/src/main/java/org/bukkit/event/player/PlayerItemBreakEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerItemBreakEvent.java @@ -10,10 +10,14 @@ import org.bukkit.inventory.ItemStack; * The item that's breaking will exist in the inventory with a stack size of * 0. After the event, the item's durability will be reset to 0. */ +@Deprecated public class PlayerItemBreakEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final ItemStack brokenItem; + @Deprecated public PlayerItemBreakEvent(final Player player, final ItemStack brokenItem) { super(player); this.brokenItem = brokenItem; @@ -24,15 +28,18 @@ public class PlayerItemBreakEvent extends PlayerEvent { * * @return The broken item */ + @Deprecated public ItemStack getBrokenItem() { return brokenItem; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java index 8ab76b1..971ef55 100644 --- a/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java @@ -16,15 +16,20 @@ import org.bukkit.inventory.ItemStack; * If the event is cancelled the effect will not be applied and the item will * not be removed from the player's inventory. */ +@Deprecated public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean isCancelled = false; + @Deprecated private ItemStack item; /** * @param player the player consuming * @param item the ItemStack being consumed */ + @Deprecated public PlayerItemConsumeEvent(final Player player, final ItemStack item) { super(player); @@ -38,6 +43,7 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable { * * @return an ItemStack for the item being consumed */ + @Deprecated public ItemStack getItem() { return item.clone(); } @@ -47,6 +53,7 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable { * * @param item the item being consumed */ + @Deprecated public void setItem(ItemStack item) { if (item == null) { this.item = new ItemStack(Material.AIR); @@ -55,19 +62,23 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable { } } + @Deprecated public boolean isCancelled() { return this.isCancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.isCancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerItemDamageEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemDamageEvent.java index 38a72ab..cb544ab 100644 --- a/src/main/java/org/bukkit/event/player/PlayerItemDamageEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerItemDamageEvent.java @@ -5,19 +5,26 @@ import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; import org.bukkit.inventory.ItemStack; +@Deprecated public class PlayerItemDamageEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final ItemStack item; + @Deprecated private int damage; + @Deprecated private boolean cancelled = false; + @Deprecated public PlayerItemDamageEvent(Player player, ItemStack what, int damage) { super(player); this.item = what; this.damage = damage; } + @Deprecated public ItemStack getItem() { return item; } @@ -27,27 +34,33 @@ public class PlayerItemDamageEvent extends PlayerEvent implements Cancellable { * * @return durability change */ + @Deprecated public int getDamage() { return damage; } + @Deprecated public void setDamage(int damage) { this.damage = damage; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java index f0d055a..55f09a5 100644 --- a/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java @@ -7,12 +7,18 @@ import org.bukkit.event.HandlerList; /** * Fired when a player changes their currently held item */ +@Deprecated public class PlayerItemHeldEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private final int previous; + @Deprecated private final int current; + @Deprecated public PlayerItemHeldEvent(final Player player, final int previous, final int current) { super(player); this.previous = previous; @@ -24,6 +30,7 @@ public class PlayerItemHeldEvent extends PlayerEvent implements Cancellable { * * @return Previous slot index */ + @Deprecated public int getPreviousSlot() { return previous; } @@ -33,23 +40,28 @@ public class PlayerItemHeldEvent extends PlayerEvent implements Cancellable { * * @return New slot index */ + @Deprecated public int getNewSlot() { return current; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java index e7481f9..98d5c71 100644 --- a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java @@ -6,10 +6,14 @@ import org.bukkit.event.HandlerList; /** * Called when a player joins a server */ +@Deprecated public class PlayerJoinEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private String joinMessage; + @Deprecated public PlayerJoinEvent(final Player playerJoined, final String joinMessage) { super(playerJoined); this.joinMessage = joinMessage; @@ -20,6 +24,7 @@ public class PlayerJoinEvent extends PlayerEvent { * * @return string join message */ + @Deprecated public String getJoinMessage() { return joinMessage; } @@ -29,15 +34,18 @@ public class PlayerJoinEvent extends PlayerEvent { * * @param joinMessage join message */ + @Deprecated public void setJoinMessage(String joinMessage) { this.joinMessage = joinMessage; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java index 39e81b6..406c17c 100644 --- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java @@ -7,12 +7,18 @@ import org.bukkit.event.HandlerList; /** * Called when a player gets kicked from the server */ +@Deprecated public class PlayerKickEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private String leaveMessage; + @Deprecated private String kickReason; + @Deprecated private Boolean cancel; + @Deprecated public PlayerKickEvent(final Player playerKicked, final String kickReason, final String leaveMessage) { super(playerKicked); this.kickReason = kickReason; @@ -25,6 +31,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { * * @return string kick reason */ + @Deprecated public String getReason() { return kickReason; } @@ -34,14 +41,17 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { * * @return string kick reason */ + @Deprecated public String getLeaveMessage() { return leaveMessage; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -51,6 +61,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { * * @param kickReason kick reason */ + @Deprecated public void setReason(String kickReason) { this.kickReason = kickReason; } @@ -60,15 +71,18 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { * * @param leaveMessage leave message */ + @Deprecated public void setLeaveMessage(String leaveMessage) { this.leaveMessage = leaveMessage; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerLevelChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerLevelChangeEvent.java index 730a776..26cba4c 100644 --- a/src/main/java/org/bukkit/event/player/PlayerLevelChangeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerLevelChangeEvent.java @@ -6,11 +6,16 @@ import org.bukkit.event.HandlerList; /** * Called when a players level changes */ +@Deprecated public class PlayerLevelChangeEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final int oldLevel; + @Deprecated private final int newLevel; + @Deprecated public PlayerLevelChangeEvent(final Player player, final int oldLevel, final int newLevel) { super(player); this.oldLevel = oldLevel; @@ -22,6 +27,7 @@ public class PlayerLevelChangeEvent extends PlayerEvent { * * @return The old level of the player */ + @Deprecated public int getOldLevel() { return oldLevel; } @@ -31,15 +37,18 @@ public class PlayerLevelChangeEvent extends PlayerEvent { * * @return The new (current) level of the player */ + @Deprecated public int getNewLevel() { return newLevel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java index 081e994..e32bed3 100644 --- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java @@ -8,12 +8,19 @@ import org.bukkit.event.HandlerList; /** * Stores details for players attempting to log in */ +@Deprecated public class PlayerLoginEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final InetAddress address; + @Deprecated private final String hostname; + @Deprecated private Result result = Result.ALLOWED; + @Deprecated private String message = ""; + @Deprecated private final InetAddress realAddress; // Spigot /** @@ -41,6 +48,7 @@ public class PlayerLoginEvent extends PlayerEvent { * @param address The address the player used to connect, provided for * timing issues */ + @Deprecated public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address, final InetAddress realAddress) { // Spigot super(player); this.hostname = hostname; @@ -49,6 +57,7 @@ public class PlayerLoginEvent extends PlayerEvent { this.realAddress = realAddress; } + @Deprecated public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address) { this(player, hostname, address, address); // Spigot end @@ -73,6 +82,7 @@ public class PlayerLoginEvent extends PlayerEvent { * @param result The result status for this event * @param message The message to be displayed if result denies login */ + @Deprecated public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message, final InetAddress realAddress) { // Spigot this(player, hostname, address, realAddress); // Spigot this.result = result; @@ -85,6 +95,7 @@ public class PlayerLoginEvent extends PlayerEvent { * * @return the player's connection address */ + @Deprecated public InetAddress getRealAddress() { return realAddress; } @@ -95,6 +106,7 @@ public class PlayerLoginEvent extends PlayerEvent { * * @return Current Result of the login */ + @Deprecated public Result getResult() { return result; } @@ -104,6 +116,7 @@ public class PlayerLoginEvent extends PlayerEvent { * * @param result New result to set */ + @Deprecated public void setResult(final Result result) { this.result = result; } @@ -114,6 +127,7 @@ public class PlayerLoginEvent extends PlayerEvent { * * @return Current kick message */ + @Deprecated public String getKickMessage() { return message; } @@ -123,6 +137,7 @@ public class PlayerLoginEvent extends PlayerEvent { * * @param message New kick message */ + @Deprecated public void setKickMessage(final String message) { this.message = message; } @@ -133,6 +148,7 @@ public class PlayerLoginEvent extends PlayerEvent { * * @return The hostname */ + @Deprecated public String getHostname() { return hostname; } @@ -140,6 +156,7 @@ public class PlayerLoginEvent extends PlayerEvent { /** * Allows the player to log in */ + @Deprecated public void allow() { result = Result.ALLOWED; message = ""; @@ -151,6 +168,7 @@ public class PlayerLoginEvent extends PlayerEvent { * @param result New result for disallowing the player * @param message Kick message to display to the user */ + @Deprecated public void disallow(final Result result, final String message) { this.result = result; this.message = message; @@ -164,15 +182,18 @@ public class PlayerLoginEvent extends PlayerEvent { * @return The address for this player. For legacy compatibility, this may * be null. */ + @Deprecated public InetAddress getAddress() { return address; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } @@ -180,6 +201,7 @@ public class PlayerLoginEvent extends PlayerEvent { /** * Basic kick reasons for communicating to plugins */ + @Deprecated public enum Result { /** diff --git a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java index fa3b340..9aad52f 100644 --- a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java @@ -8,12 +8,18 @@ import org.bukkit.event.HandlerList; /** * Holds information for player movement events */ +@Deprecated public class PlayerMoveEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private Location from; + @Deprecated private Location to; + @Deprecated public PlayerMoveEvent(final Player player, final Location from, final Location to) { super(player); this.from = from; @@ -30,6 +36,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable { * * @return true if this event is cancelled */ + @Deprecated public boolean isCancelled() { return cancel; } @@ -44,6 +51,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable { * * @param cancel true if you wish to cancel this event */ + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -53,6 +61,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable { * * @return Location the player moved from */ + @Deprecated public Location getFrom() { return from; } @@ -62,6 +71,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable { * * @param from New location to mark as the players previous location */ + @Deprecated public void setFrom(Location from) { this.from = from; } @@ -71,6 +81,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable { * * @return Location the player moved to */ + @Deprecated public Location getTo() { return to; } @@ -80,15 +91,18 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable { * * @param to New Location this player will move to */ + @Deprecated public void setTo(Location to) { this.to = to; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java index dfba816..5e39806 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java @@ -8,12 +8,18 @@ import org.bukkit.event.HandlerList; /** * Thrown when a player picks an item up from the ground */ +@Deprecated public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Item item; + @Deprecated private boolean cancel = false; + @Deprecated private final int remaining; + @Deprecated public PlayerPickupItemEvent(final Player player, final Item item, final int remaining) { super(player); this.item = item; @@ -25,6 +31,7 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable { * * @return Item */ + @Deprecated public Item getItem() { return item; } @@ -34,23 +41,28 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable { * * @return amount remaining on the ground */ + @Deprecated public int getRemaining() { return remaining; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java b/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java index 93752f7..baa4927 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java @@ -11,16 +11,22 @@ import org.bukkit.event.HandlerList; *

    * For other entities see {@link org.bukkit.event.entity.EntityPortalEvent} */ +@Deprecated public class PlayerPortalEvent extends PlayerTeleportEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected boolean useTravelAgent = true; + @Deprecated protected TravelAgent travelAgent; + @Deprecated public PlayerPortalEvent(final Player player, final Location from, final Location to, final TravelAgent pta) { super(player, from, to); this.travelAgent = pta; } + @Deprecated public PlayerPortalEvent(Player player, Location from, Location to, TravelAgent pta, TeleportCause cause) { super(player, from, to, cause); this.travelAgent = pta; @@ -38,6 +44,7 @@ public class PlayerPortalEvent extends PlayerTeleportEvent { * * @param useTravelAgent whether to use the Travel Agent */ + @Deprecated public void useTravelAgent(boolean useTravelAgent) { this.useTravelAgent = useTravelAgent; } @@ -54,6 +61,7 @@ public class PlayerPortalEvent extends PlayerTeleportEvent { * * @return whether to use the Travel Agent */ + @Deprecated public boolean useTravelAgent() { return useTravelAgent && travelAgent != null; } @@ -63,6 +71,7 @@ public class PlayerPortalEvent extends PlayerTeleportEvent { * * @return the Travel Agent used (or not) in this event */ + @Deprecated public TravelAgent getPortalTravelAgent() { return this.travelAgent; } @@ -72,15 +81,18 @@ public class PlayerPortalEvent extends PlayerTeleportEvent { * * @param travelAgent the Travel Agent used (or not) in this event */ + @Deprecated public void setPortalTravelAgent(TravelAgent travelAgent) { this.travelAgent = travelAgent; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java index b86ba5d..f314390 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java @@ -16,12 +16,18 @@ import org.bukkit.event.HandlerList; @Deprecated @Warning(reason="This event causes a login thread to synchronize with the main thread") public class PlayerPreLoginEvent extends Event { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private Result result; + @Deprecated private String message; + @Deprecated private final String name; + @Deprecated private final InetAddress ipAddress; + @Deprecated public PlayerPreLoginEvent(final String name, final InetAddress ipAddress) { this.result = Result.ALLOWED; this.message = ""; @@ -34,6 +40,7 @@ public class PlayerPreLoginEvent extends Event { * * @return Current Result of the login */ + @Deprecated public Result getResult() { return result; } @@ -43,6 +50,7 @@ public class PlayerPreLoginEvent extends Event { * * @param result New result to set */ + @Deprecated public void setResult(final Result result) { this.result = result; } @@ -53,6 +61,7 @@ public class PlayerPreLoginEvent extends Event { * * @return Current kick message */ + @Deprecated public String getKickMessage() { return message; } @@ -62,6 +71,7 @@ public class PlayerPreLoginEvent extends Event { * * @param message New kick message */ + @Deprecated public void setKickMessage(final String message) { this.message = message; } @@ -69,6 +79,7 @@ public class PlayerPreLoginEvent extends Event { /** * Allows the player to log in */ + @Deprecated public void allow() { result = Result.ALLOWED; message = ""; @@ -80,6 +91,7 @@ public class PlayerPreLoginEvent extends Event { * @param result New result for disallowing the player * @param message Kick message to display to the user */ + @Deprecated public void disallow(final Result result, final String message) { this.result = result; this.message = message; @@ -90,6 +102,7 @@ public class PlayerPreLoginEvent extends Event { * * @return the player's name */ + @Deprecated public String getName() { return name; } @@ -99,15 +112,18 @@ public class PlayerPreLoginEvent extends Event { * * @return The IP address */ + @Deprecated public InetAddress getAddress() { return ipAddress; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } @@ -115,6 +131,7 @@ public class PlayerPreLoginEvent extends Event { /** * Basic kick reasons for communicating to plugins */ + @Deprecated public enum Result { /** diff --git a/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java b/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java index 5c8dc1b..1c23cf1 100644 --- a/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java @@ -6,10 +6,14 @@ import org.bukkit.event.HandlerList; /** * Called when a player leaves a server */ +@Deprecated public class PlayerQuitEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private String quitMessage; + @Deprecated public PlayerQuitEvent(final Player who, final String quitMessage) { super(who); this.quitMessage = quitMessage; @@ -20,6 +24,7 @@ public class PlayerQuitEvent extends PlayerEvent { * * @return string quit message */ + @Deprecated public String getQuitMessage() { return quitMessage; } @@ -29,15 +34,18 @@ public class PlayerQuitEvent extends PlayerEvent { * * @param quitMessage quit message */ + @Deprecated public void setQuitMessage(String quitMessage) { this.quitMessage = quitMessage; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerRegisterChannelEvent.java b/src/main/java/org/bukkit/event/player/PlayerRegisterChannelEvent.java index 442ac7f..3802233 100644 --- a/src/main/java/org/bukkit/event/player/PlayerRegisterChannelEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerRegisterChannelEvent.java @@ -5,8 +5,10 @@ import org.bukkit.entity.Player; /** * This is called immediately after a player registers for a plugin channel. */ +@Deprecated public class PlayerRegisterChannelEvent extends PlayerChannelEvent { + @Deprecated public PlayerRegisterChannelEvent(final Player player, final String channel) { super(player, channel); } diff --git a/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java b/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java index 35900dd..bc2427c 100644 --- a/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java @@ -8,11 +8,16 @@ import org.bukkit.event.HandlerList; /** * Called when a player respawns. */ +@Deprecated public class PlayerRespawnEvent extends PlayerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private Location respawnLocation; + @Deprecated private final boolean isBedSpawn; + @Deprecated public PlayerRespawnEvent(final Player respawnPlayer, final Location respawnLocation, final boolean isBedSpawn) { super(respawnPlayer); this.respawnLocation = respawnLocation; @@ -24,6 +29,7 @@ public class PlayerRespawnEvent extends PlayerEvent { * * @return Location current respawn location */ + @Deprecated public Location getRespawnLocation() { return this.respawnLocation; } @@ -33,6 +39,7 @@ public class PlayerRespawnEvent extends PlayerEvent { * * @param respawnLocation new location for the respawn */ + @Deprecated public void setRespawnLocation(Location respawnLocation) { Validate.notNull(respawnLocation, "Respawn location can not be null"); Validate.notNull(respawnLocation.getWorld(), "Respawn world can not be null"); @@ -45,15 +52,18 @@ public class PlayerRespawnEvent extends PlayerEvent { * * @return true if the respawn location is the player's bed. */ + @Deprecated public boolean isBedSpawn() { return this.isBedSpawn; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerShearEntityEvent.java b/src/main/java/org/bukkit/event/player/PlayerShearEntityEvent.java index 38afb3c..ef6a9d6 100644 --- a/src/main/java/org/bukkit/event/player/PlayerShearEntityEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerShearEntityEvent.java @@ -8,21 +8,28 @@ import org.bukkit.event.HandlerList; /** * Called when a player shears an entity */ +@Deprecated public class PlayerShearEntityEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel; + @Deprecated private final Entity what; + @Deprecated public PlayerShearEntityEvent(final Player who, final Entity what) { super(who); this.cancel = false; this.what = what; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -32,15 +39,18 @@ public class PlayerShearEntityEvent extends PlayerEvent implements Cancellable { * * @return the entity the player is shearing */ + @Deprecated public Entity getEntity() { return what; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerStatisticIncrementEvent.java b/src/main/java/org/bukkit/event/player/PlayerStatisticIncrementEvent.java index 3b64d70..3455544 100644 --- a/src/main/java/org/bukkit/event/player/PlayerStatisticIncrementEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerStatisticIncrementEvent.java @@ -14,15 +14,24 @@ import org.bukkit.event.HandlerList; * movement based statistics. * */ +@Deprecated public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated protected final Statistic statistic; + @Deprecated private final int initialValue; + @Deprecated private final int newValue; + @Deprecated private boolean isCancelled = false; + @Deprecated private final EntityType entityType; + @Deprecated private final Material material; + @Deprecated public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue) { super (player); this.statistic = statistic; @@ -32,6 +41,7 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel this.material = null; } + @Deprecated public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue, EntityType entityType) { super (player); this.statistic = statistic; @@ -41,6 +51,7 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel this.material = null; } + @Deprecated public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue, Material material) { super (player); this.statistic = statistic; @@ -55,6 +66,7 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel * * @return the incremented statistic */ + @Deprecated public Statistic getStatistic() { return statistic; } @@ -64,6 +76,7 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel * * @return the previous value of the statistic */ + @Deprecated public int getPreviousValue() { return initialValue; } @@ -73,6 +86,7 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel * * @return the new value of the statistic */ + @Deprecated public int getNewValue() { return newValue; } @@ -83,6 +97,7 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel * * @return the EntityType of the statistic */ + @Deprecated public EntityType getEntityType() { return entityType; } @@ -93,23 +108,28 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel * * @return the Material of the statistic */ + @Deprecated public Material getMaterial() { return material; } + @Deprecated public boolean isCancelled() { return isCancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.isCancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java b/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java index 7e2e128..b3e49e4 100644 --- a/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java @@ -7,14 +7,19 @@ import org.bukkit.event.HandlerList; /** * Holds information for player teleport events */ +@Deprecated public class PlayerTeleportEvent extends PlayerMoveEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private TeleportCause cause = TeleportCause.UNKNOWN; + @Deprecated public PlayerTeleportEvent(final Player player, final Location from, final Location to) { super(player, from, to); } + @Deprecated public PlayerTeleportEvent(final Player player, final Location from, final Location to, final TeleportCause cause) { this(player, from, to); @@ -26,10 +31,12 @@ public class PlayerTeleportEvent extends PlayerMoveEvent { * * @return Cause of the event */ + @Deprecated public TeleportCause getCause() { return cause; } + @Deprecated public enum TeleportCause { /** * Indicates the teleporation was caused by a player throwing an Ender @@ -63,10 +70,12 @@ public class PlayerTeleportEvent extends PlayerMoveEvent { } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerToggleFlightEvent.java b/src/main/java/org/bukkit/event/player/PlayerToggleFlightEvent.java index 1c5ec37..556bad2 100644 --- a/src/main/java/org/bukkit/event/player/PlayerToggleFlightEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerToggleFlightEvent.java @@ -7,11 +7,16 @@ import org.bukkit.event.HandlerList; /** * Called when a player toggles their flying state */ +@Deprecated public class PlayerToggleFlightEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final boolean isFlying; + @Deprecated private boolean cancel = false; + @Deprecated public PlayerToggleFlightEvent(final Player player, final boolean isFlying) { super(player); this.isFlying = isFlying; @@ -22,23 +27,28 @@ public class PlayerToggleFlightEvent extends PlayerEvent implements Cancellable * * @return flying state */ + @Deprecated public boolean isFlying() { return isFlying; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java b/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java index 667acad..42a5e9c 100644 --- a/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java @@ -7,11 +7,16 @@ import org.bukkit.event.HandlerList; /** * Called when a player toggles their sneaking state */ +@Deprecated public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final boolean isSneaking; + @Deprecated private boolean cancel = false; + @Deprecated public PlayerToggleSneakEvent(final Player player, final boolean isSneaking) { super(player); this.isSneaking = isSneaking; @@ -22,23 +27,28 @@ public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable { * * @return sneaking state */ + @Deprecated public boolean isSneaking() { return isSneaking; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java b/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java index cf065e1..36340d3 100644 --- a/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java @@ -7,11 +7,16 @@ import org.bukkit.event.HandlerList; /** * Called when a player toggles their sprinting state */ +@Deprecated public class PlayerToggleSprintEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final boolean isSprinting; + @Deprecated private boolean cancel = false; + @Deprecated public PlayerToggleSprintEvent(final Player player, final boolean isSprinting) { super(player); this.isSprinting = isSprinting; @@ -22,23 +27,28 @@ public class PlayerToggleSprintEvent extends PlayerEvent implements Cancellable * * @return sprinting state */ + @Deprecated public boolean isSprinting() { return isSprinting; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/player/PlayerUnleashEntityEvent.java b/src/main/java/org/bukkit/event/player/PlayerUnleashEntityEvent.java index f6aebef..8515ddb 100644 --- a/src/main/java/org/bukkit/event/player/PlayerUnleashEntityEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerUnleashEntityEvent.java @@ -8,10 +8,14 @@ import org.bukkit.event.entity.EntityUnleashEvent; /** * Called prior to an entity being unleashed due to a player's action. */ +@Deprecated public class PlayerUnleashEntityEvent extends EntityUnleashEvent implements Cancellable { + @Deprecated private final Player player; + @Deprecated private boolean cancelled = false; + @Deprecated public PlayerUnleashEntityEvent(Entity entity, Player player) { super(entity, UnleashReason.PLAYER_UNLEASH); this.player = player; @@ -22,14 +26,17 @@ public class PlayerUnleashEntityEvent extends EntityUnleashEvent implements Canc * * @return The player */ + @Deprecated public Player getPlayer() { return player; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } diff --git a/src/main/java/org/bukkit/event/player/PlayerUnregisterChannelEvent.java b/src/main/java/org/bukkit/event/player/PlayerUnregisterChannelEvent.java index 11c77e3..f66efae 100644 --- a/src/main/java/org/bukkit/event/player/PlayerUnregisterChannelEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerUnregisterChannelEvent.java @@ -5,8 +5,10 @@ import org.bukkit.entity.Player; /** * This is called immediately after a player unregisters for a plugin channel. */ +@Deprecated public class PlayerUnregisterChannelEvent extends PlayerChannelEvent { + @Deprecated public PlayerUnregisterChannelEvent(final Player player, final String channel) { super(player, channel); } diff --git a/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java b/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java index 69d2fce..1fd03bf 100644 --- a/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java @@ -8,20 +8,27 @@ import org.bukkit.util.Vector; /** * Called when the velocity of a player changes. */ +@Deprecated public class PlayerVelocityEvent extends PlayerEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private Vector velocity; + @Deprecated public PlayerVelocityEvent(final Player player, final Vector velocity) { super(player); this.velocity = velocity; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -31,6 +38,7 @@ public class PlayerVelocityEvent extends PlayerEvent implements Cancellable { * * @return Vector the player will get */ + @Deprecated public Vector getVelocity() { return velocity; } @@ -40,15 +48,18 @@ public class PlayerVelocityEvent extends PlayerEvent implements Cancellable { * * @param velocity The velocity vector that will be sent to the player */ + @Deprecated public void setVelocity(Vector velocity) { this.velocity = velocity; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/server/MapInitializeEvent.java b/src/main/java/org/bukkit/event/server/MapInitializeEvent.java index 8834489..9543836 100644 --- a/src/main/java/org/bukkit/event/server/MapInitializeEvent.java +++ b/src/main/java/org/bukkit/event/server/MapInitializeEvent.java @@ -6,10 +6,14 @@ import org.bukkit.map.MapView; /** * Called when a map is initialized. */ +@Deprecated public class MapInitializeEvent extends ServerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final MapView mapView; + @Deprecated public MapInitializeEvent(final MapView mapView) { this.mapView = mapView; } @@ -19,15 +23,18 @@ public class MapInitializeEvent extends ServerEvent { * * @return Map for this event */ + @Deprecated public MapView getMap() { return mapView; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/server/PluginDisableEvent.java b/src/main/java/org/bukkit/event/server/PluginDisableEvent.java index 932c4fd..cabad1c 100644 --- a/src/main/java/org/bukkit/event/server/PluginDisableEvent.java +++ b/src/main/java/org/bukkit/event/server/PluginDisableEvent.java @@ -6,18 +6,23 @@ import org.bukkit.plugin.Plugin; /** * Called when a plugin is disabled. */ +@Deprecated public class PluginDisableEvent extends PluginEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public PluginDisableEvent(final Plugin plugin) { super(plugin); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/server/PluginEnableEvent.java b/src/main/java/org/bukkit/event/server/PluginEnableEvent.java index 865316d..823933e 100644 --- a/src/main/java/org/bukkit/event/server/PluginEnableEvent.java +++ b/src/main/java/org/bukkit/event/server/PluginEnableEvent.java @@ -6,18 +6,23 @@ import org.bukkit.plugin.Plugin; /** * Called when a plugin is enabled. */ +@Deprecated public class PluginEnableEvent extends PluginEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public PluginEnableEvent(final Plugin plugin) { super(plugin); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/server/PluginEvent.java b/src/main/java/org/bukkit/event/server/PluginEvent.java index 1ad656d..dd23aa3 100644 --- a/src/main/java/org/bukkit/event/server/PluginEvent.java +++ b/src/main/java/org/bukkit/event/server/PluginEvent.java @@ -5,9 +5,12 @@ import org.bukkit.plugin.Plugin; /** * Used for plugin enable and disable events */ +@Deprecated public abstract class PluginEvent extends ServerEvent { + @Deprecated private final Plugin plugin; + @Deprecated public PluginEvent(final Plugin plugin) { this.plugin = plugin; } @@ -17,6 +20,7 @@ public abstract class PluginEvent extends ServerEvent { * * @return Plugin for this event */ + @Deprecated public Plugin getPlugin() { return plugin; } diff --git a/src/main/java/org/bukkit/event/server/RemoteServerCommandEvent.java b/src/main/java/org/bukkit/event/server/RemoteServerCommandEvent.java index 2a49237..7819893 100644 --- a/src/main/java/org/bukkit/event/server/RemoteServerCommandEvent.java +++ b/src/main/java/org/bukkit/event/server/RemoteServerCommandEvent.java @@ -7,18 +7,23 @@ import org.bukkit.event.HandlerList; * This event is called when a command is recieved over RCON. See the javadocs * of {@link ServerCommandEvent} for more information. */ +@Deprecated public class RemoteServerCommandEvent extends ServerCommandEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public RemoteServerCommandEvent(final CommandSender sender, final String command) { super(sender, command); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/server/ServerCommandEvent.java b/src/main/java/org/bukkit/event/server/ServerCommandEvent.java index 8a5972a..aa505dd 100644 --- a/src/main/java/org/bukkit/event/server/ServerCommandEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerCommandEvent.java @@ -37,11 +37,16 @@ import org.bukkit.event.HandlerList; * beginning of the message should be preserved. If a slash is added or * removed, unexpected behavior may result. */ +@Deprecated public class ServerCommandEvent extends ServerEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private String command; + @Deprecated private final CommandSender sender; + @Deprecated public ServerCommandEvent(final CommandSender sender, final String command) { this.command = command; this.sender = sender; @@ -53,6 +58,7 @@ public class ServerCommandEvent extends ServerEvent { * * @return Command the user is attempting to execute */ + @Deprecated public String getCommand() { return command; } @@ -62,6 +68,7 @@ public class ServerCommandEvent extends ServerEvent { * * @param message New message that the server will execute */ + @Deprecated public void setCommand(String message) { this.command = message; } @@ -71,15 +78,18 @@ public class ServerCommandEvent extends ServerEvent { * * @return The sender */ + @Deprecated public CommandSender getSender() { return sender; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/server/ServerEvent.java b/src/main/java/org/bukkit/event/server/ServerEvent.java index eb00d6a..2f2da65 100644 --- a/src/main/java/org/bukkit/event/server/ServerEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerEvent.java @@ -5,5 +5,6 @@ import org.bukkit.event.Event; /** * Miscellaneous server events */ +@Deprecated public abstract class ServerEvent extends Event { } diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java index c61afdf..6d1fa8e 100644 --- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java @@ -12,14 +12,22 @@ import org.bukkit.util.CachedServerIcon; * Called when a server list ping is coming in. Displayed players can be * checked and removed by {@link #iterator() iterating} over this event. */ +@Deprecated public class ServerListPingEvent extends ServerEvent implements Iterable { + @Deprecated private static final int MAGIC_PLAYER_COUNT = Integer.MIN_VALUE; + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final InetAddress address; + @Deprecated private String motd; + @Deprecated private final int numPlayers; + @Deprecated private int maxPlayers; + @Deprecated public ServerListPingEvent(final InetAddress address, final String motd, final int numPlayers, final int maxPlayers) { Validate.isTrue(numPlayers >= 0, "Cannot have negative number of players online", numPlayers); this.address = address; @@ -33,6 +41,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * {@link #iterator()} method, thus provided the {@link #getNumPlayers()} * count. */ + @Deprecated protected ServerListPingEvent(final InetAddress address, final String motd, final int maxPlayers) { this.numPlayers = MAGIC_PLAYER_COUNT; this.address = address; @@ -45,6 +54,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * * @return the address */ + @Deprecated public InetAddress getAddress() { return address; } @@ -54,6 +64,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * * @return the message of the day */ + @Deprecated public String getMotd() { return motd; } @@ -63,6 +74,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * * @param motd the message of the day */ + @Deprecated public void setMotd(String motd) { this.motd = motd; } @@ -72,6 +84,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * * @return the number of players */ + @Deprecated public int getNumPlayers() { int numPlayers = this.numPlayers; if (numPlayers == MAGIC_PLAYER_COUNT) { @@ -88,6 +101,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * * @return the maximum number of players */ + @Deprecated public int getMaxPlayers() { return maxPlayers; } @@ -97,6 +111,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * * @param maxPlayers the maximum number of player */ + @Deprecated public void setMaxPlayers(int maxPlayers) { this.maxPlayers = maxPlayers; } @@ -111,15 +126,18 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * @throws UnsupportedOperationException if the caller of this event does * not support setting the server icon */ + @Deprecated public void setServerIcon(CachedServerIcon icon) throws IllegalArgumentException, UnsupportedOperationException { throw new UnsupportedOperationException(); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } @@ -136,6 +154,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * not support removing players */ @Override + @Deprecated public Iterator iterator() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } diff --git a/src/main/java/org/bukkit/event/server/ServiceEvent.java b/src/main/java/org/bukkit/event/server/ServiceEvent.java index 69bf872..b3c4f96 100644 --- a/src/main/java/org/bukkit/event/server/ServiceEvent.java +++ b/src/main/java/org/bukkit/event/server/ServiceEvent.java @@ -6,13 +6,17 @@ import org.bukkit.plugin.RegisteredServiceProvider; * An event relating to a registered service. This is called in a {@link * org.bukkit.plugin.ServicesManager} */ +@Deprecated public abstract class ServiceEvent extends ServerEvent { + @Deprecated private final RegisteredServiceProvider provider; + @Deprecated public ServiceEvent(final RegisteredServiceProvider provider) { this.provider = provider; } + @Deprecated public RegisteredServiceProvider getProvider() { return provider; } diff --git a/src/main/java/org/bukkit/event/server/ServiceRegisterEvent.java b/src/main/java/org/bukkit/event/server/ServiceRegisterEvent.java index 7dfadde..1662468 100644 --- a/src/main/java/org/bukkit/event/server/ServiceRegisterEvent.java +++ b/src/main/java/org/bukkit/event/server/ServiceRegisterEvent.java @@ -9,18 +9,23 @@ import org.bukkit.plugin.RegisteredServiceProvider; * Warning: The order in which register and unregister events are called * should not be relied upon. */ +@Deprecated public class ServiceRegisterEvent extends ServiceEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public ServiceRegisterEvent(RegisteredServiceProvider registeredProvider) { super(registeredProvider); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/server/ServiceUnregisterEvent.java b/src/main/java/org/bukkit/event/server/ServiceUnregisterEvent.java index db61d23..067e718 100644 --- a/src/main/java/org/bukkit/event/server/ServiceUnregisterEvent.java +++ b/src/main/java/org/bukkit/event/server/ServiceUnregisterEvent.java @@ -9,18 +9,23 @@ import org.bukkit.plugin.RegisteredServiceProvider; * Warning: The order in which register and unregister events are called * should not be relied upon. */ +@Deprecated public class ServiceUnregisterEvent extends ServiceEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public ServiceUnregisterEvent(RegisteredServiceProvider serviceProvider) { super(serviceProvider); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java index b643b57..66ee4d0 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java @@ -7,10 +7,14 @@ import org.bukkit.event.HandlerList; /** * Raised when a vehicle collides with a block. */ +@Deprecated public class VehicleBlockCollisionEvent extends VehicleCollisionEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Block block; + @Deprecated public VehicleBlockCollisionEvent(final Vehicle vehicle, final Block block) { super(vehicle); this.block = block; @@ -21,15 +25,18 @@ public class VehicleBlockCollisionEvent extends VehicleCollisionEvent { * * @return the block the vehicle collided with */ + @Deprecated public Block getBlock() { return block; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java index 9dd0579..70d2128 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java @@ -5,7 +5,9 @@ import org.bukkit.entity.Vehicle; /** * Raised when a vehicle collides. */ +@Deprecated public abstract class VehicleCollisionEvent extends VehicleEvent { + @Deprecated public VehicleCollisionEvent(final Vehicle vehicle) { super(vehicle); } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleCreateEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleCreateEvent.java index 22eda72..0ae23a5 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleCreateEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleCreateEvent.java @@ -6,18 +6,23 @@ import org.bukkit.event.HandlerList; /** * Raised when a vehicle is created. */ +@Deprecated public class VehicleCreateEvent extends VehicleEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public VehicleCreateEvent(final Vehicle vehicle) { super(vehicle); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java index 304ee2c..6e5363e 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java @@ -9,10 +9,15 @@ import org.bukkit.util.NumberConversions; /** * Raised when a vehicle receives damage. */ +@Deprecated public class VehicleDamageEvent extends VehicleEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Entity attacker; + @Deprecated private double damage; + @Deprecated private boolean cancelled; @Deprecated @@ -20,6 +25,7 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable { this(vehicle, attacker, (double) damage); } + @Deprecated public VehicleDamageEvent(final Vehicle vehicle, final Entity attacker, final double damage) { super(vehicle); this.attacker = attacker; @@ -31,6 +37,7 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable { * * @return the Entity that is attacking the vehicle */ + @Deprecated public Entity getAttacker() { return attacker; } @@ -40,6 +47,7 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable { * * @return the damage done to the vehicle */ + @Deprecated public double getDamage() { return damage; } @@ -59,6 +67,7 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable { * * @param damage The damage */ + @Deprecated public void setDamage(double damage) { this.damage = damage; } @@ -73,19 +82,23 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable { setDamage(damage); } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java index f1176fd..55072cc 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java @@ -10,11 +10,16 @@ import org.bukkit.event.HandlerList; * player or the environment. This is not raised if the boat is simply * 'removed' due to other means. */ +@Deprecated public class VehicleDestroyEvent extends VehicleEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Entity attacker; + @Deprecated private boolean cancelled; + @Deprecated public VehicleDestroyEvent(final Vehicle vehicle, final Entity attacker) { super(vehicle); this.attacker = attacker; @@ -25,23 +30,28 @@ public class VehicleDestroyEvent extends VehicleEvent implements Cancellable { * * @return the Entity that has destroyed the vehicle, potentially null */ + @Deprecated public Entity getAttacker() { return attacker; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java index 85c9b21..0fbab53 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java @@ -8,11 +8,16 @@ import org.bukkit.event.HandlerList; /** * Raised when an entity enters a vehicle. */ +@Deprecated public class VehicleEnterEvent extends VehicleEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final Entity entered; + @Deprecated public VehicleEnterEvent(final Vehicle vehicle, final Entity entered) { super(vehicle); this.entered = entered; @@ -23,23 +28,28 @@ public class VehicleEnterEvent extends VehicleEvent implements Cancellable { * * @return the Entity that entered the vehicle */ + @Deprecated public Entity getEntered() { return entered; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java index 4d4d0e2..f7f177b 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java @@ -8,51 +8,67 @@ import org.bukkit.event.HandlerList; /** * Raised when a vehicle collides with an entity. */ +@Deprecated public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Entity entity; + @Deprecated private boolean cancelled = false; + @Deprecated private boolean cancelledPickup = false; + @Deprecated private boolean cancelledCollision = false; + @Deprecated public VehicleEntityCollisionEvent(final Vehicle vehicle, final Entity entity) { super(vehicle); this.entity = entity; } + @Deprecated public Entity getEntity() { return entity; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } + @Deprecated public boolean isPickupCancelled() { return cancelledPickup; } + @Deprecated public void setPickupCancelled(boolean cancel) { cancelledPickup = cancel; } + @Deprecated public boolean isCollisionCancelled() { return cancelledCollision; } + @Deprecated public void setCollisionCancelled(boolean cancel) { cancelledCollision = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java index b8255c0..dd6fd0a 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java @@ -6,9 +6,12 @@ import org.bukkit.event.Event; /** * Represents a vehicle-related event. */ +@Deprecated public abstract class VehicleEvent extends Event { + @Deprecated protected Vehicle vehicle; + @Deprecated public VehicleEvent(final Vehicle vehicle) { this.vehicle = vehicle; } @@ -18,6 +21,7 @@ public abstract class VehicleEvent extends Event { * * @return the vehicle */ + @Deprecated public final Vehicle getVehicle() { return vehicle; } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java index 364451b..29b5465 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java @@ -8,11 +8,16 @@ import org.bukkit.event.HandlerList; /** * Raised when a living entity exits a vehicle. */ +@Deprecated public class VehicleExitEvent extends VehicleEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final LivingEntity exited; + @Deprecated public VehicleExitEvent(final Vehicle vehicle, final LivingEntity exited) { super(vehicle); this.exited = exited; @@ -23,23 +28,28 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable { * * @return The entity. */ + @Deprecated public LivingEntity getExited() { return exited; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleMoveEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleMoveEvent.java index 9a13e29..7cf927a 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleMoveEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleMoveEvent.java @@ -7,11 +7,16 @@ import org.bukkit.event.HandlerList; /** * Raised when a vehicle moves. */ +@Deprecated public class VehicleMoveEvent extends VehicleEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Location from; + @Deprecated private final Location to; + @Deprecated public VehicleMoveEvent(final Vehicle vehicle, final Location from, final Location to) { super(vehicle); @@ -24,6 +29,7 @@ public class VehicleMoveEvent extends VehicleEvent { * * @return Old position. */ + @Deprecated public Location getFrom() { return from; } @@ -33,16 +39,19 @@ public class VehicleMoveEvent extends VehicleEvent { * * @return New position. */ + @Deprecated public Location getTo() { return to; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleUpdateEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleUpdateEvent.java index eebfdb1..77aab3a 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleUpdateEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleUpdateEvent.java @@ -6,18 +6,23 @@ import org.bukkit.event.HandlerList; /** * Called when a vehicle updates */ +@Deprecated public class VehicleUpdateEvent extends VehicleEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public VehicleUpdateEvent(final Vehicle vehicle) { super(vehicle); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java b/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java index 66fd763..71d98df 100644 --- a/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java +++ b/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java @@ -8,20 +8,27 @@ import org.bukkit.event.HandlerList; /** * Stores data for lightning striking */ +@Deprecated public class LightningStrikeEvent extends WeatherEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean canceled; + @Deprecated private final LightningStrike bolt; + @Deprecated public LightningStrikeEvent(final World world, final LightningStrike bolt) { super(world); this.bolt = bolt; } + @Deprecated public boolean isCancelled() { return canceled; } + @Deprecated public void setCancelled(boolean cancel) { canceled = cancel; } @@ -31,15 +38,18 @@ public class LightningStrikeEvent extends WeatherEvent implements Cancellable { * * @return lightning entity */ + @Deprecated public LightningStrike getLightning() { return bolt; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java b/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java index 5e3716e..38a899d 100644 --- a/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java +++ b/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java @@ -7,20 +7,27 @@ import org.bukkit.event.HandlerList; /** * Stores data for thunder state changing in a world */ +@Deprecated public class ThunderChangeEvent extends WeatherEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean canceled; + @Deprecated private final boolean to; + @Deprecated public ThunderChangeEvent(final World world, final boolean to) { super(world); this.to = to; } + @Deprecated public boolean isCancelled() { return canceled; } + @Deprecated public void setCancelled(boolean cancel) { canceled = cancel; } @@ -30,15 +37,18 @@ public class ThunderChangeEvent extends WeatherEvent implements Cancellable { * * @return true if the weather is being set to thundering, false otherwise */ + @Deprecated public boolean toThunderState() { return to; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java b/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java index 5d1234e..d720a23 100644 --- a/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java +++ b/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java @@ -7,20 +7,27 @@ import org.bukkit.event.HandlerList; /** * Stores data for weather changing in a world */ +@Deprecated public class WeatherChangeEvent extends WeatherEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean canceled; + @Deprecated private final boolean to; + @Deprecated public WeatherChangeEvent(final World world, final boolean to) { super(world); this.to = to; } + @Deprecated public boolean isCancelled() { return canceled; } + @Deprecated public void setCancelled(boolean cancel) { canceled = cancel; } @@ -30,15 +37,18 @@ public class WeatherChangeEvent extends WeatherEvent implements Cancellable { * * @return true if the weather is being set to raining, false otherwise */ + @Deprecated public boolean toWeatherState() { return to; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/weather/WeatherEvent.java b/src/main/java/org/bukkit/event/weather/WeatherEvent.java index 0cae9bc..ee19f32 100644 --- a/src/main/java/org/bukkit/event/weather/WeatherEvent.java +++ b/src/main/java/org/bukkit/event/weather/WeatherEvent.java @@ -6,9 +6,12 @@ import org.bukkit.event.Event; /** * Represents a Weather-related event */ +@Deprecated public abstract class WeatherEvent extends Event { + @Deprecated protected World world; + @Deprecated public WeatherEvent(final World where) { world = where; } @@ -18,6 +21,7 @@ public abstract class WeatherEvent extends Event { * * @return World this event is occurring in */ + @Deprecated public final World getWorld() { return world; } diff --git a/src/main/java/org/bukkit/event/world/ChunkEvent.java b/src/main/java/org/bukkit/event/world/ChunkEvent.java index 4710d40..93a2cb2 100644 --- a/src/main/java/org/bukkit/event/world/ChunkEvent.java +++ b/src/main/java/org/bukkit/event/world/ChunkEvent.java @@ -5,9 +5,12 @@ import org.bukkit.Chunk; /** * Represents a Chunk related event */ +@Deprecated public abstract class ChunkEvent extends WorldEvent { + @Deprecated protected Chunk chunk; + @Deprecated protected ChunkEvent(final Chunk chunk) { super(chunk.getWorld()); this.chunk = chunk; @@ -18,6 +21,7 @@ public abstract class ChunkEvent extends WorldEvent { * * @return Chunk that triggered this event */ + @Deprecated public Chunk getChunk() { return chunk; } diff --git a/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java b/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java index a45b1cd..d881733 100644 --- a/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java +++ b/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java @@ -6,10 +6,14 @@ import org.bukkit.event.HandlerList; /** * Called when a chunk is loaded */ +@Deprecated public class ChunkLoadEvent extends ChunkEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final boolean newChunk; + @Deprecated public ChunkLoadEvent(final Chunk chunk, final boolean newChunk) { super(chunk); this.newChunk = newChunk; @@ -22,15 +26,18 @@ public class ChunkLoadEvent extends ChunkEvent { * * @return true if the chunk is new, otherwise false */ + @Deprecated public boolean isNewChunk() { return newChunk; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/world/ChunkPopulateEvent.java b/src/main/java/org/bukkit/event/world/ChunkPopulateEvent.java index 705d955..a449cb5 100644 --- a/src/main/java/org/bukkit/event/world/ChunkPopulateEvent.java +++ b/src/main/java/org/bukkit/event/world/ChunkPopulateEvent.java @@ -10,18 +10,23 @@ import org.bukkit.generator.BlockPopulator; * If your intent is to populate the chunk using this event, please see {@link * BlockPopulator} */ +@Deprecated public class ChunkPopulateEvent extends ChunkEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public ChunkPopulateEvent(final Chunk chunk) { super(chunk); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java b/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java index f59d091..5045aca 100644 --- a/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java +++ b/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java @@ -7,27 +7,35 @@ import org.bukkit.event.HandlerList; /** * Called when a chunk is unloaded */ +@Deprecated public class ChunkUnloadEvent extends ChunkEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated public ChunkUnloadEvent(final Chunk chunk) { super(chunk); } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/world/PortalCreateEvent.java b/src/main/java/org/bukkit/event/world/PortalCreateEvent.java index d83d7a9..9510e98 100644 --- a/src/main/java/org/bukkit/event/world/PortalCreateEvent.java +++ b/src/main/java/org/bukkit/event/world/PortalCreateEvent.java @@ -11,12 +11,18 @@ import java.util.Collection; /** * Called when a portal is created */ +@Deprecated public class PortalCreateEvent extends WorldEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancel = false; + @Deprecated private final ArrayList blocks = new ArrayList(); + @Deprecated private CreateReason reason = CreateReason.FIRE; + @Deprecated public PortalCreateEvent(final Collection blocks, final World world, CreateReason reason) { super(world); @@ -29,14 +35,17 @@ public class PortalCreateEvent extends WorldEvent implements Cancellable { * * @return array list of all the blocks associated with the created portal */ + @Deprecated public ArrayList getBlocks() { return this.blocks; } + @Deprecated public boolean isCancelled() { return cancel; } + @Deprecated public void setCancelled(boolean cancel) { this.cancel = cancel; } @@ -46,15 +55,18 @@ public class PortalCreateEvent extends WorldEvent implements Cancellable { * * @return CreateReason for the portal's creation */ + @Deprecated public CreateReason getReason() { return reason; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } @@ -62,6 +74,7 @@ public class PortalCreateEvent extends WorldEvent implements Cancellable { /** * An enum to specify the various reasons for a portal's creation */ + @Deprecated public enum CreateReason { /** * When a portal is created 'traditionally' due to a portal frame diff --git a/src/main/java/org/bukkit/event/world/SpawnChangeEvent.java b/src/main/java/org/bukkit/event/world/SpawnChangeEvent.java index e99c3c0..cfd89b0 100644 --- a/src/main/java/org/bukkit/event/world/SpawnChangeEvent.java +++ b/src/main/java/org/bukkit/event/world/SpawnChangeEvent.java @@ -8,10 +8,14 @@ import org.bukkit.event.HandlerList; * An event that is called when a world's spawn changes. The world's previous * spawn location is included. */ +@Deprecated public class SpawnChangeEvent extends WorldEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private final Location previousLocation; + @Deprecated public SpawnChangeEvent(final World world, final Location previousLocation) { super(world); this.previousLocation = previousLocation; @@ -22,15 +26,18 @@ public class SpawnChangeEvent extends WorldEvent { * * @return Location that used to be spawn */ + @Deprecated public Location getPreviousLocation() { return previousLocation; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java index d1c9822..4909fd7 100644 --- a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java +++ b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java @@ -12,15 +12,24 @@ import org.bukkit.event.HandlerList; * Event that is called when an organic structure attempts to grow (Sapling -> * Tree), (Mushroom -> Huge Mushroom), naturally or using bonemeal. */ +@Deprecated public class StructureGrowEvent extends WorldEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled = false; + @Deprecated private final Location location; + @Deprecated private final TreeType species; + @Deprecated private final boolean bonemeal; + @Deprecated private final Player player; + @Deprecated private final List blocks; + @Deprecated public StructureGrowEvent(final Location location, final TreeType species, final boolean bonemeal, final Player player, final List blocks) { super(location.getWorld()); this.location = location; @@ -35,6 +44,7 @@ public class StructureGrowEvent extends WorldEvent implements Cancellable { * * @return Location of the structure */ + @Deprecated public Location getLocation() { return location; } @@ -45,6 +55,7 @@ public class StructureGrowEvent extends WorldEvent implements Cancellable { * * @return Structure species */ + @Deprecated public TreeType getSpecies() { return species; } @@ -54,6 +65,7 @@ public class StructureGrowEvent extends WorldEvent implements Cancellable { * * @return True if the structure was grown using bonemeal. */ + @Deprecated public boolean isFromBonemeal() { return bonemeal; } @@ -64,6 +76,7 @@ public class StructureGrowEvent extends WorldEvent implements Cancellable { * @return Player that created the structure, null if was not created * manually */ + @Deprecated public Player getPlayer() { return player; } @@ -73,23 +86,28 @@ public class StructureGrowEvent extends WorldEvent implements Cancellable { * * @return ArrayList of all blocks associated with the structure. */ + @Deprecated public List getBlocks() { return blocks; } + @Deprecated public boolean isCancelled() { return cancelled; } + @Deprecated public void setCancelled(boolean cancel) { cancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/world/WorldEvent.java b/src/main/java/org/bukkit/event/world/WorldEvent.java index bd89b81..604203d 100644 --- a/src/main/java/org/bukkit/event/world/WorldEvent.java +++ b/src/main/java/org/bukkit/event/world/WorldEvent.java @@ -6,9 +6,12 @@ import org.bukkit.event.Event; /** * Represents events within a world */ +@Deprecated public abstract class WorldEvent extends Event { + @Deprecated private final World world; + @Deprecated public WorldEvent(final World world) { this.world = world; } @@ -18,6 +21,7 @@ public abstract class WorldEvent extends Event { * * @return World which caused this event */ + @Deprecated public World getWorld() { return world; } diff --git a/src/main/java/org/bukkit/event/world/WorldInitEvent.java b/src/main/java/org/bukkit/event/world/WorldInitEvent.java index 6bf13e0..5658870 100644 --- a/src/main/java/org/bukkit/event/world/WorldInitEvent.java +++ b/src/main/java/org/bukkit/event/world/WorldInitEvent.java @@ -6,18 +6,23 @@ import org.bukkit.event.HandlerList; /** * Called when a World is initializing */ +@Deprecated public class WorldInitEvent extends WorldEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public WorldInitEvent(final World world) { super(world); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/world/WorldLoadEvent.java b/src/main/java/org/bukkit/event/world/WorldLoadEvent.java index c5545aa..4db0f33 100644 --- a/src/main/java/org/bukkit/event/world/WorldLoadEvent.java +++ b/src/main/java/org/bukkit/event/world/WorldLoadEvent.java @@ -6,18 +6,23 @@ import org.bukkit.event.HandlerList; /** * Called when a World is loaded */ +@Deprecated public class WorldLoadEvent extends WorldEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public WorldLoadEvent(final World world) { super(world); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/world/WorldSaveEvent.java b/src/main/java/org/bukkit/event/world/WorldSaveEvent.java index d46b413..72285eb 100644 --- a/src/main/java/org/bukkit/event/world/WorldSaveEvent.java +++ b/src/main/java/org/bukkit/event/world/WorldSaveEvent.java @@ -6,18 +6,23 @@ import org.bukkit.event.HandlerList; /** * Called when a World is saved. */ +@Deprecated public class WorldSaveEvent extends WorldEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated public WorldSaveEvent(final World world) { super(world); } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java b/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java index 110544b..13c6af4 100644 --- a/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java +++ b/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java @@ -7,27 +7,35 @@ import org.bukkit.event.HandlerList; /** * Called when a World is unloaded */ +@Deprecated public class WorldUnloadEvent extends WorldEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean isCancelled; + @Deprecated public WorldUnloadEvent(final World world) { super(world); } + @Deprecated public boolean isCancelled() { return this.isCancelled; } + @Deprecated public void setCancelled(boolean cancel) { this.isCancelled = cancel; } @Override + @Deprecated public HandlerList getHandlers() { return handlers; } + @Deprecated public static HandlerList getHandlerList() { return handlers; } diff --git a/src/main/java/org/bukkit/generator/BlockPopulator.java b/src/main/java/org/bukkit/generator/BlockPopulator.java index 6a70bdb..48b0dc9 100644 --- a/src/main/java/org/bukkit/generator/BlockPopulator.java +++ b/src/main/java/org/bukkit/generator/BlockPopulator.java @@ -10,6 +10,7 @@ import org.bukkit.World; * For example, generating glowstone inside the nether or generating dungeons * full of treasure */ +@Deprecated public abstract class BlockPopulator { /** @@ -25,5 +26,6 @@ public abstract class BlockPopulator { * @param random The random generator to use * @param source The chunk to generate for */ + @Deprecated public abstract void populate(World world, Random random, Chunk source); } diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java index 8e08bdc..f5b3406 100644 --- a/src/main/java/org/bukkit/generator/ChunkGenerator.java +++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java @@ -14,6 +14,7 @@ import org.bukkit.block.Block; * chunk. For example, the nether chunk generator should shape netherrack and * soulsand */ +@Deprecated public abstract class ChunkGenerator { /** @@ -23,6 +24,7 @@ public abstract class ChunkGenerator { * Custom generator is free to access and tailor values during * generateBlockSections() or generateExtBlockSections(). */ + @Deprecated public interface BiomeGrid { /** @@ -227,6 +229,7 @@ public abstract class ChunkGenerator { * @param z Z-coordinate of the block to test * @return true if the location is valid, otherwise false */ + @Deprecated public boolean canSpawn(World world, int x, int z) { Block highest = world.getBlockAt(x, world.getHighestBlockYAt(x, z), z); @@ -248,6 +251,7 @@ public abstract class ChunkGenerator { * @param world World to apply to * @return List containing any amount of BlockPopulators */ + @Deprecated public List getDefaultPopulators(World world) { return new ArrayList(); } @@ -262,6 +266,7 @@ public abstract class ChunkGenerator { * @param random Random generator to use in the calculation * @return Location containing a new spawn point, otherwise null */ + @Deprecated public Location getFixedSpawnLocation(World world, Random random) { return null; } diff --git a/src/main/java/org/bukkit/help/GenericCommandHelpTopic.java b/src/main/java/org/bukkit/help/GenericCommandHelpTopic.java index 3e85e77..f9bb5ca 100644 --- a/src/main/java/org/bukkit/help/GenericCommandHelpTopic.java +++ b/src/main/java/org/bukkit/help/GenericCommandHelpTopic.java @@ -15,10 +15,13 @@ import org.bukkit.help.HelpTopic; * can use this class as a base class for custom help topics, or as an example * for how to write your own. */ +@Deprecated public class GenericCommandHelpTopic extends HelpTopic { + @Deprecated protected Command command; + @Deprecated public GenericCommandHelpTopic(Command command) { this.command = command; @@ -61,6 +64,7 @@ public class GenericCommandHelpTopic extends HelpTopic { fullText = sb.toString(); } + @Deprecated public boolean canSee(CommandSender sender) { if (!command.isRegistered() && !(command instanceof VanillaCommand)) { // Unregistered commands should not show up in the help (ignore VanillaCommands) diff --git a/src/main/java/org/bukkit/help/HelpMap.java b/src/main/java/org/bukkit/help/HelpMap.java index 9c1b51b..32c5e1e 100644 --- a/src/main/java/org/bukkit/help/HelpMap.java +++ b/src/main/java/org/bukkit/help/HelpMap.java @@ -16,6 +16,7 @@ import java.util.List; *

  • Topic contents are amended as directed in help.yml * */ +@Deprecated public interface HelpMap { /** * Returns a help topic for a given topic name. @@ -24,6 +25,7 @@ public interface HelpMap { * @return A {@link HelpTopic} object matching the topic name or null if * none can be found. */ + @Deprecated public HelpTopic getHelpTopic(String topicName); /** @@ -31,6 +33,7 @@ public interface HelpMap { * * @return All the registered help topics. */ + @Deprecated public Collection getHelpTopics(); /** @@ -38,12 +41,14 @@ public interface HelpMap { * * @param topic The new help topic to add. */ + @Deprecated public void addTopic(HelpTopic topic); /** * Clears out the contents of the help index. Normally called during * server reload. */ + @Deprecated public void clear(); /** @@ -63,6 +68,7 @@ public interface HelpMap { * @throws IllegalArgumentException Thrown if {@code commandClass} does * not derive from a legal base class. */ + @Deprecated public void registerHelpTopicFactory(Class commandClass, HelpTopicFactory factory); /** @@ -75,5 +81,6 @@ public interface HelpMap { * * @return A list of plugins that should be excluded from the help index. */ + @Deprecated public List getIgnoredPlugins(); } diff --git a/src/main/java/org/bukkit/help/HelpTopic.java b/src/main/java/org/bukkit/help/HelpTopic.java index a2ba5f5..d107ecd 100644 --- a/src/main/java/org/bukkit/help/HelpTopic.java +++ b/src/main/java/org/bukkit/help/HelpTopic.java @@ -15,10 +15,15 @@ import org.bukkit.entity.Player; * Complex implementations can be created by overriding the behavior of all * the methods in this class. */ +@Deprecated public abstract class HelpTopic { + @Deprecated protected String name; + @Deprecated protected String shortText; + @Deprecated protected String fullText; + @Deprecated protected String amendedPermission; /** @@ -30,6 +35,7 @@ public abstract class HelpTopic { * @param player The Player in question. * @return True of the Player can see this help topic, false otherwise. */ + @Deprecated public abstract boolean canSee(CommandSender player); /** @@ -43,6 +49,7 @@ public abstract class HelpTopic { * @param amendedPermission The permission node the server administrator * wishes to apply to this topic. */ + @Deprecated public void amendCanSee(String amendedPermission) { this.amendedPermission = amendedPermission; } @@ -52,6 +59,7 @@ public abstract class HelpTopic { * * @return The topic name. */ + @Deprecated public String getName() { return name; } @@ -61,6 +69,7 @@ public abstract class HelpTopic { * * @return A brief topic description. */ + @Deprecated public String getShortText() { return shortText; } @@ -77,6 +86,7 @@ public abstract class HelpTopic { * * @return A full topic description. */ + @Deprecated public String getFullText(CommandSender forWho) { return fullText; } @@ -95,6 +105,7 @@ public abstract class HelpTopic { * @param amendedFullText The new topic full text to use, or null to leave * alone. */ + @Deprecated public void amendTopic(String amendedShortText, String amendedFullText) { shortText = applyAmendment(shortText, amendedShortText); fullText = applyAmendment(fullText, amendedFullText); @@ -111,6 +122,7 @@ public abstract class HelpTopic { * @return The application of the amending text to the existing text, * according to the expected rules of amendTopic(). */ + @Deprecated protected String applyAmendment(String baseText, String amendment) { if (amendment == null) { return baseText; diff --git a/src/main/java/org/bukkit/help/HelpTopicComparator.java b/src/main/java/org/bukkit/help/HelpTopicComparator.java index 3e43eb3..39f9f57 100644 --- a/src/main/java/org/bukkit/help/HelpTopicComparator.java +++ b/src/main/java/org/bukkit/help/HelpTopicComparator.java @@ -10,28 +10,38 @@ import java.util.Comparator; * All topics are listed in alphabetic order, but topics that start with a * slash come after topics that don't. */ +@Deprecated public class HelpTopicComparator implements Comparator { // Singleton implementations + @Deprecated private static final TopicNameComparator tnc = new TopicNameComparator(); + @Deprecated public static TopicNameComparator topicNameComparatorInstance() { return tnc; } + @Deprecated private static final HelpTopicComparator htc = new HelpTopicComparator(); + @Deprecated public static HelpTopicComparator helpTopicComparatorInstance() { return htc; } + @Deprecated private HelpTopicComparator() {} + @Deprecated public int compare(HelpTopic lhs, HelpTopic rhs) { return tnc.compare(lhs.getName(), rhs.getName()); } + @Deprecated public static class TopicNameComparator implements Comparator { + @Deprecated private TopicNameComparator(){} + @Deprecated public int compare(String lhs, String rhs) { boolean lhsStartSlash = lhs.startsWith("/"); boolean rhsStartSlash = rhs.startsWith("/"); diff --git a/src/main/java/org/bukkit/help/HelpTopicFactory.java b/src/main/java/org/bukkit/help/HelpTopicFactory.java index 87d3697..849a36f 100644 --- a/src/main/java/org/bukkit/help/HelpTopicFactory.java +++ b/src/main/java/org/bukkit/help/HelpTopicFactory.java @@ -29,6 +29,7 @@ import org.bukkit.command.Command; * * @param The base class for your custom commands. */ +@Deprecated public interface HelpTopicFactory { /** * This method accepts a command deriving from a custom command base class @@ -38,5 +39,6 @@ public interface HelpTopicFactory { * @return A new custom help topic or {@code null} to intentionally NOT * create a topic. */ + @Deprecated public HelpTopic createTopic(TCommand command); } diff --git a/src/main/java/org/bukkit/help/IndexHelpTopic.java b/src/main/java/org/bukkit/help/IndexHelpTopic.java index c474031..0288e27 100644 --- a/src/main/java/org/bukkit/help/IndexHelpTopic.java +++ b/src/main/java/org/bukkit/help/IndexHelpTopic.java @@ -16,16 +16,22 @@ import java.util.Collection; * If a preamble is provided to the constructor, that text will be displayed * before the first item in the index. */ +@Deprecated public class IndexHelpTopic extends HelpTopic { + @Deprecated protected String permission; + @Deprecated protected String preamble; + @Deprecated protected Collection allTopics; + @Deprecated public IndexHelpTopic(String name, String shortText, String permission, Collection topics) { this(name, shortText, permission, topics, null); } + @Deprecated public IndexHelpTopic(String name, String shortText, String permission, Collection topics, String preamble) { this.name = name; this.shortText = shortText; @@ -39,10 +45,12 @@ public class IndexHelpTopic extends HelpTopic { * * @param topics The topics to set. */ + @Deprecated protected void setTopicsCollection(Collection topics) { this.allTopics = topics; } + @Deprecated public boolean canSee(CommandSender sender) { if (sender instanceof ConsoleCommandSender) { return true; @@ -54,10 +62,12 @@ public class IndexHelpTopic extends HelpTopic { } @Override + @Deprecated public void amendCanSee(String amendedPermission) { permission = amendedPermission; } + @Deprecated public String getFullText(CommandSender sender) { StringBuilder sb = new StringBuilder(); @@ -88,6 +98,7 @@ public class IndexHelpTopic extends HelpTopic { * @param sender The command sender requesting the preamble. * @return The topic preamble. */ + @Deprecated protected String buildPreamble(CommandSender sender) { return ChatColor.GRAY + preamble; } @@ -100,6 +111,7 @@ public class IndexHelpTopic extends HelpTopic { * @param topic The topic to render into an index line. * @return The rendered index line. */ + @Deprecated protected String buildIndexLine(CommandSender sender, HelpTopic topic) { StringBuilder line = new StringBuilder(); line.append(ChatColor.GOLD); diff --git a/src/main/java/org/bukkit/inventory/AnvilInventory.java b/src/main/java/org/bukkit/inventory/AnvilInventory.java index 70fae71..2134596 100644 --- a/src/main/java/org/bukkit/inventory/AnvilInventory.java +++ b/src/main/java/org/bukkit/inventory/AnvilInventory.java @@ -3,5 +3,6 @@ package org.bukkit.inventory; /** * Interface to the inventory of an Anvil. */ +@Deprecated public interface AnvilInventory extends Inventory { } diff --git a/src/main/java/org/bukkit/inventory/BeaconInventory.java b/src/main/java/org/bukkit/inventory/BeaconInventory.java index 2f8769e..5f1debe 100644 --- a/src/main/java/org/bukkit/inventory/BeaconInventory.java +++ b/src/main/java/org/bukkit/inventory/BeaconInventory.java @@ -3,6 +3,7 @@ package org.bukkit.inventory; /** * Interface to the inventory of a Beacon. */ +@Deprecated public interface BeaconInventory extends Inventory { /** diff --git a/src/main/java/org/bukkit/inventory/BrewerInventory.java b/src/main/java/org/bukkit/inventory/BrewerInventory.java index 9cc31c9..5c98009 100644 --- a/src/main/java/org/bukkit/inventory/BrewerInventory.java +++ b/src/main/java/org/bukkit/inventory/BrewerInventory.java @@ -5,6 +5,7 @@ import org.bukkit.block.BrewingStand; /** * Interface to the inventory of a Brewing Stand. */ +@Deprecated public interface BrewerInventory extends Inventory { /** diff --git a/src/main/java/org/bukkit/inventory/CraftingInventory.java b/src/main/java/org/bukkit/inventory/CraftingInventory.java index f71533c..1776361 100644 --- a/src/main/java/org/bukkit/inventory/CraftingInventory.java +++ b/src/main/java/org/bukkit/inventory/CraftingInventory.java @@ -3,6 +3,7 @@ package org.bukkit.inventory; /** * Interface to the crafting inventories */ +@Deprecated public interface CraftingInventory extends Inventory { /** diff --git a/src/main/java/org/bukkit/inventory/DoubleChestInventory.java b/src/main/java/org/bukkit/inventory/DoubleChestInventory.java index c03ad53..2dbba71 100644 --- a/src/main/java/org/bukkit/inventory/DoubleChestInventory.java +++ b/src/main/java/org/bukkit/inventory/DoubleChestInventory.java @@ -5,6 +5,7 @@ import org.bukkit.block.DoubleChest; /** * Interface to the inventory of a Double Chest. */ +@Deprecated public interface DoubleChestInventory extends Inventory { /** diff --git a/src/main/java/org/bukkit/inventory/EnchantingInventory.java b/src/main/java/org/bukkit/inventory/EnchantingInventory.java index 74a863e..55892d3 100644 --- a/src/main/java/org/bukkit/inventory/EnchantingInventory.java +++ b/src/main/java/org/bukkit/inventory/EnchantingInventory.java @@ -3,6 +3,7 @@ package org.bukkit.inventory; /** * Interface to the inventory of an Enchantment Table. */ +@Deprecated public interface EnchantingInventory extends Inventory { /** diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java index 9e71235..5f15f69 100644 --- a/src/main/java/org/bukkit/inventory/EntityEquipment.java +++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java @@ -5,6 +5,7 @@ import org.bukkit.entity.Entity; /** * An interface to a creatures inventory */ +@Deprecated public interface EntityEquipment { /** diff --git a/src/main/java/org/bukkit/inventory/FurnaceInventory.java b/src/main/java/org/bukkit/inventory/FurnaceInventory.java index 93b41d3..c7668eb 100644 --- a/src/main/java/org/bukkit/inventory/FurnaceInventory.java +++ b/src/main/java/org/bukkit/inventory/FurnaceInventory.java @@ -5,6 +5,7 @@ import org.bukkit.block.Furnace; /** * Interface to the inventory of a Furnace. */ +@Deprecated public interface FurnaceInventory extends Inventory { /** diff --git a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java index 8075323..d5b72e1 100644 --- a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java +++ b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java @@ -6,8 +6,11 @@ import org.bukkit.material.MaterialData; /** * Represents a smelting recipe. */ +@Deprecated public class FurnaceRecipe implements Recipe { + @Deprecated private ItemStack output; + @Deprecated private ItemStack ingredient; /** @@ -16,6 +19,7 @@ public class FurnaceRecipe implements Recipe { * @param result The item you want the recipe to create. * @param source The input material. */ + @Deprecated public FurnaceRecipe(ItemStack result, Material source) { this(result, source, 0); } @@ -26,6 +30,7 @@ public class FurnaceRecipe implements Recipe { * @param result The item you want the recipe to create. * @param source The input material. */ + @Deprecated public FurnaceRecipe(ItemStack result, MaterialData source) { this(result, source.getItemType(), source.getData()); } @@ -51,6 +56,7 @@ public class FurnaceRecipe implements Recipe { * @param input The input material. * @return The changed recipe, so you can chain calls. */ + @Deprecated public FurnaceRecipe setInput(MaterialData input) { return setInput(input.getItemType(), input.getData()); } @@ -61,6 +67,7 @@ public class FurnaceRecipe implements Recipe { * @param input The input material. * @return The changed recipe, so you can chain calls. */ + @Deprecated public FurnaceRecipe setInput(Material input) { return setInput(input, 0); } @@ -85,6 +92,7 @@ public class FurnaceRecipe implements Recipe { * * @return The input material. */ + @Deprecated public ItemStack getInput() { return this.ingredient.clone(); } @@ -94,6 +102,7 @@ public class FurnaceRecipe implements Recipe { * * @return The resulting stack. */ + @Deprecated public ItemStack getResult() { return output.clone(); } diff --git a/src/main/java/org/bukkit/inventory/HorseInventory.java b/src/main/java/org/bukkit/inventory/HorseInventory.java index a71efb8..27c39f0 100644 --- a/src/main/java/org/bukkit/inventory/HorseInventory.java +++ b/src/main/java/org/bukkit/inventory/HorseInventory.java @@ -3,6 +3,7 @@ package org.bukkit.inventory; /** * An interface to the inventory of a Horse. */ +@Deprecated public interface HorseInventory extends Inventory { /** diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java index da5d83e..2a7fc8c 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java @@ -12,6 +12,7 @@ import org.bukkit.event.inventory.InventoryType; * Interface to the various inventories. Behavior relating to {@link * Material#AIR} is unspecified. */ +@Deprecated public interface Inventory extends Iterable { /** @@ -19,6 +20,7 @@ public interface Inventory extends Iterable { * * @return The size of the inventory */ + @Deprecated public int getSize(); /** @@ -26,6 +28,7 @@ public interface Inventory extends Iterable { * * @return The maximum size for an ItemStack in this inventory. */ + @Deprecated public int getMaxStackSize(); /** @@ -44,6 +47,7 @@ public interface Inventory extends Iterable { * * @param size The new maximum stack size for items in this inventory. */ + @Deprecated public void setMaxStackSize(int size); /** @@ -51,6 +55,7 @@ public interface Inventory extends Iterable { * * @return The String with the name of the inventory */ + @Deprecated public String getName(); /** @@ -59,6 +64,7 @@ public interface Inventory extends Iterable { * @param index The index of the Slot's ItemStack to return * @return The ItemStack in the slot */ + @Deprecated public ItemStack getItem(int index); /** @@ -67,6 +73,7 @@ public interface Inventory extends Iterable { * @param index The index where to put the ItemStack * @param item The ItemStack to set */ + @Deprecated public void setItem(int index, ItemStack item); /** @@ -89,6 +96,7 @@ public interface Inventory extends Iterable { * @return A HashMap containing items that didn't fit. * @throws IllegalArgumentException if items or any element in it is null */ + @Deprecated public HashMap addItem(ItemStack... items) throws IllegalArgumentException; /** @@ -106,6 +114,7 @@ public interface Inventory extends Iterable { * @return A HashMap containing items that couldn't be removed. * @throws IllegalArgumentException if items is null */ + @Deprecated public HashMap removeItem(ItemStack... items) throws IllegalArgumentException; /** @@ -113,6 +122,7 @@ public interface Inventory extends Iterable { * * @return An array of ItemStacks from the inventory. */ + @Deprecated public ItemStack[] getContents(); /** @@ -124,6 +134,7 @@ public interface Inventory extends Iterable { * @throws IllegalArgumentException If the array has more items than the * inventory. */ + @Deprecated public void setContents(ItemStack[] items) throws IllegalArgumentException; /** @@ -145,6 +156,7 @@ public interface Inventory extends Iterable { * @return true if an ItemStack is found with the given Material * @throws IllegalArgumentException if material is null */ + @Deprecated public boolean contains(Material material) throws IllegalArgumentException; /** @@ -158,6 +170,7 @@ public interface Inventory extends Iterable { * @return false if item is null, true if any exactly matching ItemStacks * were found */ + @Deprecated public boolean contains(ItemStack item); /** @@ -183,6 +196,7 @@ public interface Inventory extends Iterable { * found to add to the given amount * @throws IllegalArgumentException if material is null */ + @Deprecated public boolean contains(Material material, int amount) throws IllegalArgumentException; /** @@ -198,6 +212,7 @@ public interface Inventory extends Iterable { * amount of exactly matching ItemStacks were found * @see #containsAtLeast(ItemStack, int) */ + @Deprecated public boolean contains(ItemStack item, int amount); /** @@ -209,6 +224,7 @@ public interface Inventory extends Iterable { * @return false if item is null, true if amount less than 1, true if * enough ItemStacks were found to add to the given amount */ + @Deprecated public boolean containsAtLeast(ItemStack item, int amount); /** @@ -238,6 +254,7 @@ public interface Inventory extends Iterable { * @return A HashMap containing the slot index, ItemStack pairs * @throws IllegalArgumentException if material is null */ + @Deprecated public HashMap all(Material material) throws IllegalArgumentException; /** @@ -252,6 +269,7 @@ public interface Inventory extends Iterable { * @param item The ItemStack to match against * @return A map from slot indexes to item at index */ + @Deprecated public HashMap all(ItemStack item); /** @@ -273,6 +291,7 @@ public interface Inventory extends Iterable { * @return The slot index of the given Material or -1 if not found * @throws IllegalArgumentException if material is null */ + @Deprecated public int first(Material material) throws IllegalArgumentException; /** @@ -283,6 +302,7 @@ public interface Inventory extends Iterable { * @param item The ItemStack to match against * @return The slot index of the given ItemStack or -1 if not found */ + @Deprecated public int first(ItemStack item); /** @@ -290,6 +310,7 @@ public interface Inventory extends Iterable { * * @return The first empty Slot found, or -1 if no empty slots. */ + @Deprecated public int firstEmpty(); /** @@ -307,6 +328,7 @@ public interface Inventory extends Iterable { * @param material The material to remove * @throws IllegalArgumentException if material is null */ + @Deprecated public void remove(Material material) throws IllegalArgumentException; /** @@ -317,6 +339,7 @@ public interface Inventory extends Iterable { * * @param item The ItemStack to match against */ + @Deprecated public void remove(ItemStack item); /** @@ -324,11 +347,13 @@ public interface Inventory extends Iterable { * * @param index The index to empty. */ + @Deprecated public void clear(int index); /** * Clears out the whole Inventory. */ + @Deprecated public void clear(); /** @@ -342,6 +367,7 @@ public interface Inventory extends Iterable { * * @return A list of HumanEntities who are viewing this Inventory. */ + @Deprecated public List getViewers(); /** @@ -349,6 +375,7 @@ public interface Inventory extends Iterable { * * @return A String with the title. */ + @Deprecated public String getTitle(); /** @@ -356,6 +383,7 @@ public interface Inventory extends Iterable { * * @return The InventoryType representing the type of inventory. */ + @Deprecated public InventoryType getType(); /** @@ -363,9 +391,11 @@ public interface Inventory extends Iterable { * * @return The holder of the inventory; null if it has no holder. */ + @Deprecated public InventoryHolder getHolder(); @Override + @Deprecated public ListIterator iterator(); /** @@ -377,5 +407,6 @@ public interface Inventory extends Iterable { * @param index The index. * @return An iterator. */ + @Deprecated public ListIterator iterator(int index); } diff --git a/src/main/java/org/bukkit/inventory/InventoryHolder.java b/src/main/java/org/bukkit/inventory/InventoryHolder.java index 9c06a3d..60c1ec9 100644 --- a/src/main/java/org/bukkit/inventory/InventoryHolder.java +++ b/src/main/java/org/bukkit/inventory/InventoryHolder.java @@ -1,5 +1,6 @@ package org.bukkit.inventory; +@Deprecated public interface InventoryHolder { /** @@ -7,5 +8,6 @@ public interface InventoryHolder { * * @return The inventory. */ + @Deprecated public Inventory getInventory(); } diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java index 7e98d52..ad73ed6 100644 --- a/src/main/java/org/bukkit/inventory/InventoryView.java +++ b/src/main/java/org/bukkit/inventory/InventoryView.java @@ -12,11 +12,14 @@ import org.bukkit.event.inventory.InventoryType; * contracts of certain methods, there's no guarantee that the game will work * as it should. */ +@Deprecated public abstract class InventoryView { + @Deprecated public final static int OUTSIDE = -999; /** * Represents various extra properties of certain inventory windows. */ + @Deprecated public enum Property { /** * The progress of the down-pointing arrow in a brewing inventory. @@ -51,11 +54,13 @@ public abstract class InventoryView { ENCHANT_BUTTON3(2, InventoryType.ENCHANTING); int id; InventoryType style; + @Deprecated private Property(int id, InventoryType appliesTo) { this.id = id; style = appliesTo; } + @Deprecated public InventoryType getType() { return style; } @@ -74,6 +79,7 @@ public abstract class InventoryView { * * @return the inventory */ + @Deprecated public abstract Inventory getTopInventory(); /** @@ -81,6 +87,7 @@ public abstract class InventoryView { * * @return the inventory */ + @Deprecated public abstract Inventory getBottomInventory(); /** @@ -88,6 +95,7 @@ public abstract class InventoryView { * * @return the player */ + @Deprecated public abstract HumanEntity getPlayer(); /** @@ -97,6 +105,7 @@ public abstract class InventoryView { * * @return the inventory type */ + @Deprecated public abstract InventoryType getType(); /** @@ -108,6 +117,7 @@ public abstract class InventoryView { * @param slot The ID as returned by InventoryClickEvent.getRawSlot() * @param item The new item to put in the slot, or null to clear it. */ + @Deprecated public void setItem(int slot, ItemStack item) { if (slot != OUTSIDE) { if (slot < getTopInventory().getSize()) { @@ -126,6 +136,7 @@ public abstract class InventoryView { * @param slot The ID as returned by InventoryClickEvent.getRawSlot() * @return The item currently in the slot. */ + @Deprecated public ItemStack getItem(int slot) { if (slot == OUTSIDE) { return null; @@ -143,6 +154,7 @@ public abstract class InventoryView { * @param item The item to put on the cursor, or null to remove the item * on their cursor. */ + @Deprecated public final void setCursor(ItemStack item) { getPlayer().setItemOnCursor(item); } @@ -153,6 +165,7 @@ public abstract class InventoryView { * @return The item on the player's cursor, or null if they aren't holding * one. */ + @Deprecated public final ItemStack getCursor() { return getPlayer().getItemOnCursor(); } @@ -169,6 +182,7 @@ public abstract class InventoryView { * @param rawSlot The raw slot ID. * @return The converted slot ID. */ + @Deprecated public final int convertSlot(int rawSlot) { int numInTop = getTopInventory().getSize(); if (rawSlot < numInTop) { @@ -190,6 +204,7 @@ public abstract class InventoryView { /** * Closes the inventory view. */ + @Deprecated public final void close() { getPlayer().closeInventory(); } @@ -203,6 +218,7 @@ public abstract class InventoryView { * * @return The total size */ + @Deprecated public final int countSlots() { return getTopInventory().getSize() + getBottomInventory().getSize(); } @@ -216,6 +232,7 @@ public abstract class InventoryView { * @return true if the property was updated successfully, false if the * property is not supported by that inventory */ + @Deprecated public final boolean setProperty(Property prop, int value) { return getPlayer().setWindowProperty(prop, value); } @@ -225,6 +242,7 @@ public abstract class InventoryView { * * @return The title. */ + @Deprecated public final String getTitle() { return getTopInventory().getTitle(); } diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java index 52a8d4d..a74e660 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java @@ -14,6 +14,7 @@ import org.bukkit.inventory.meta.SkullMeta; * The ItemFactory is solely responsible for creating item meta containers to * apply on item stacks. */ +@Deprecated public interface ItemFactory { /** diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java index 6137c99..3781706 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -16,14 +16,21 @@ import org.bukkit.material.MaterialData; /** * Represents a stack of items */ +@Deprecated public class ItemStack implements Cloneable, ConfigurationSerializable { + @Deprecated private int type = 0; + @Deprecated private int amount = 0; + @Deprecated private MaterialData data = null; + @Deprecated private short durability = 0; + @Deprecated private ItemMeta meta; @Utility + @Deprecated protected ItemStack() {} /** @@ -42,6 +49,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @param type item material */ + @Deprecated public ItemStack(final Material type) { this(type, 1); } @@ -64,6 +72,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @param type item material * @param amount stack size */ + @Deprecated public ItemStack(final Material type, final int amount) { this(type.getId(), amount); } @@ -90,6 +99,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @param amount stack size * @param damage durability / damage */ + @Deprecated public ItemStack(final Material type, final int amount, final short damage) { this(type.getId(), amount, damage); } @@ -123,6 +133,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @throws IllegalArgumentException if the specified stack is null or * returns an item meta not created by the item factory */ + @Deprecated public ItemStack(final ItemStack stack) throws IllegalArgumentException { Validate.notNull(stack, "Cannot copy null stack"); this.type = stack.getTypeId(); @@ -140,14 +151,17 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @return Type of the items in this stack */ @Utility + @Deprecated public Material getType() { return getType0(getTypeId()); } + @Deprecated private Material getType0() { return getType0(this.type); } + @Deprecated private static Material getType0(int id) { Material material = Material.getMaterial(id); return material == null ? Material.AIR : material; @@ -161,6 +175,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @param type New type to set the items in this stack to */ @Utility + @Deprecated public void setType(Material type) { Validate.notNull(type, "Material cannot be null"); setTypeId(type.getId()); @@ -199,6 +214,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @return Amount of items in this stick */ + @Deprecated public int getAmount() { return amount; } @@ -208,6 +224,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @param amount New amount of items in this stack */ + @Deprecated public void setAmount(int amount) { this.amount = amount; } @@ -217,6 +234,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @return MaterialData for this item */ + @Deprecated public MaterialData getData() { Material mat = getType(); if (data == null && mat != null && mat.getData() != null) { @@ -231,6 +249,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @param data New MaterialData for this item */ + @Deprecated public void setData(MaterialData data) { Material mat = getType(); @@ -250,6 +269,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @param durability Durability of this item */ + @Deprecated public void setDurability(final short durability) { this.durability = durability; } @@ -259,6 +279,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @return Durability of this item */ + @Deprecated public short getDurability() { return durability; } @@ -270,6 +291,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @return The maximum you can stack this material to. */ @Utility + @Deprecated public int getMaxStackSize() { Material material = getType(); if (material != null) { @@ -278,6 +300,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { return -1; } + @Deprecated private void createData(final byte data) { Material mat = Material.getMaterial(type); @@ -290,6 +313,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { @Override @Utility + @Deprecated public String toString() { StringBuilder toString = new StringBuilder("ItemStack{").append(getType().name()).append(" x ").append(getAmount()); if (hasItemMeta()) { @@ -300,6 +324,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { @Override @Utility + @Deprecated public boolean equals(Object obj) { if (this == obj) { return true; @@ -320,6 +345,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @return true if the two stacks are equal, ignoring the amount */ @Utility + @Deprecated public boolean isSimilar(ItemStack stack) { if (stack == null) { return false; @@ -331,6 +357,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { } @Override + @Deprecated public ItemStack clone() { try { ItemStack itemStack = (ItemStack) super.clone(); @@ -351,6 +378,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { @Override @Utility + @Deprecated public final int hashCode() { int hash = 1; @@ -368,6 +396,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @param ench Enchantment to test * @return True if this has the given enchantment */ + @Deprecated public boolean containsEnchantment(Enchantment ench) { return meta == null ? false : meta.hasEnchant(ench); } @@ -378,6 +407,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @param ench Enchantment to check * @return Level of the enchantment, or 0 */ + @Deprecated public int getEnchantmentLevel(Enchantment ench) { return meta == null ? 0 : meta.getEnchantLevel(ench); } @@ -387,6 +417,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @return Map of enchantments. */ + @Deprecated public Map getEnchantments() { return meta == null ? ImmutableMap.of() : meta.getEnchants(); } @@ -405,6 +436,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * exception is thrown. */ @Utility + @Deprecated public void addEnchantments(Map enchantments) { Validate.notNull(enchantments, "Enchantments cannot be null"); for (Map.Entry entry : enchantments.entrySet()) { @@ -424,6 +456,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * not applicable */ @Utility + @Deprecated public void addEnchantment(Enchantment ench, int level) { Validate.notNull(ench, "Enchantment cannot be null"); if ((level < ench.getStartLevel()) || (level > ench.getMaxLevel())) { @@ -445,6 +478,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @param enchantments Enchantments to add */ @Utility + @Deprecated public void addUnsafeEnchantments(Map enchantments) { for (Map.Entry entry : enchantments.entrySet()) { addUnsafeEnchantment(entry.getKey(), entry.getValue()); @@ -463,6 +497,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @param ench Enchantment to add * @param level Level of the enchantment */ + @Deprecated public void addUnsafeEnchantment(Enchantment ench, int level) { (meta == null ? meta = Bukkit.getItemFactory().getItemMeta(getType0()) : meta).addEnchant(ench, level, true); } @@ -474,6 +509,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @param ench Enchantment to remove * @return Previous level, or 0 */ + @Deprecated public int removeEnchantment(Enchantment ench) { int level = getEnchantmentLevel(ench); if (level == 0 || meta == null) { @@ -484,6 +520,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { } @Utility + @Deprecated public Map serialize() { Map result = new LinkedHashMap(); @@ -512,6 +549,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @return deserialized item stack * @see ConfigurationSerializable */ + @Deprecated public static ItemStack deserialize(Map args) { Material type = Material.getMaterial((String) args.get("type")); short damage = 0; @@ -556,6 +594,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @return a copy of the current ItemStack's ItemData */ + @Deprecated public ItemMeta getItemMeta() { return this.meta == null ? Bukkit.getItemFactory().getItemMeta(getType0()) : this.meta.clone(); } @@ -565,6 +604,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * * @return Returns true if some meta data has been set for this item */ + @Deprecated public boolean hasItemMeta() { return !Bukkit.getItemFactory().equals(meta, null); } @@ -578,6 +618,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { * @throws IllegalArgumentException if the item meta was not created by * the {@link ItemFactory} */ + @Deprecated public boolean setItemMeta(ItemMeta itemMeta) { return setItemMeta0(itemMeta, getType0()); } @@ -585,6 +626,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { /* * Cannot be overridden, so it's safe for constructor call */ + @Deprecated private boolean setItemMeta0(ItemMeta itemMeta, Material material) { if (itemMeta == null) { this.meta = null; diff --git a/src/main/java/org/bukkit/inventory/MerchantInventory.java b/src/main/java/org/bukkit/inventory/MerchantInventory.java index 163f459..85ef35b 100644 --- a/src/main/java/org/bukkit/inventory/MerchantInventory.java +++ b/src/main/java/org/bukkit/inventory/MerchantInventory.java @@ -1,4 +1,5 @@ package org.bukkit.inventory; +@Deprecated public interface MerchantInventory extends Inventory { } diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java index d18c9f4..58584ab 100644 --- a/src/main/java/org/bukkit/inventory/PlayerInventory.java +++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java @@ -5,6 +5,7 @@ import org.bukkit.entity.HumanEntity; /** * Interface to the inventory of a Player, including the four armor slots. */ +@Deprecated public interface PlayerInventory extends Inventory { /** @@ -12,6 +13,7 @@ public interface PlayerInventory extends Inventory { * * @return All the ItemStacks from the armor slots */ + @Deprecated public ItemStack[] getArmorContents(); /** @@ -19,6 +21,7 @@ public interface PlayerInventory extends Inventory { * * @return The ItemStack in the helmet slot */ + @Deprecated public ItemStack getHelmet(); /** @@ -26,6 +29,7 @@ public interface PlayerInventory extends Inventory { * * @return The ItemStack in the chestplate slot */ + @Deprecated public ItemStack getChestplate(); /** @@ -33,6 +37,7 @@ public interface PlayerInventory extends Inventory { * * @return The ItemStack in the leg slot */ + @Deprecated public ItemStack getLeggings(); /** @@ -40,6 +45,7 @@ public interface PlayerInventory extends Inventory { * * @return The ItemStack in the boots slot */ + @Deprecated public ItemStack getBoots(); /** @@ -47,6 +53,7 @@ public interface PlayerInventory extends Inventory { * * @param items The ItemStacks to use as armour */ + @Deprecated public void setArmorContents(ItemStack[] items); /** @@ -55,6 +62,7 @@ public interface PlayerInventory extends Inventory { * * @param helmet The ItemStack to use as helmet */ + @Deprecated public void setHelmet(ItemStack helmet); /** @@ -63,6 +71,7 @@ public interface PlayerInventory extends Inventory { * * @param chestplate The ItemStack to use as chestplate */ + @Deprecated public void setChestplate(ItemStack chestplate); /** @@ -71,6 +80,7 @@ public interface PlayerInventory extends Inventory { * * @param leggings The ItemStack to use as leggings */ + @Deprecated public void setLeggings(ItemStack leggings); /** @@ -79,6 +89,7 @@ public interface PlayerInventory extends Inventory { * * @param boots The ItemStack to use as boots */ + @Deprecated public void setBoots(ItemStack boots); /** @@ -86,6 +97,7 @@ public interface PlayerInventory extends Inventory { * * @return The currently held ItemStack */ + @Deprecated public ItemStack getItemInHand(); /** @@ -93,6 +105,7 @@ public interface PlayerInventory extends Inventory { * * @param stack Stack to set */ + @Deprecated public void setItemInHand(ItemStack stack); /** @@ -100,6 +113,7 @@ public interface PlayerInventory extends Inventory { * * @return Held item slot number */ + @Deprecated public int getHeldItemSlot(); /** @@ -111,6 +125,7 @@ public interface PlayerInventory extends Inventory { * @throws IllegalArgumentException Thrown if slot is not between 0 and 8 * inclusive */ + @Deprecated public void setHeldItemSlot(int slot); /** @@ -126,5 +141,6 @@ public interface PlayerInventory extends Inventory { @Deprecated public int clear(int id, int data); + @Deprecated public HumanEntity getHolder(); } diff --git a/src/main/java/org/bukkit/inventory/Recipe.java b/src/main/java/org/bukkit/inventory/Recipe.java index 7977ce2..2f73b28 100644 --- a/src/main/java/org/bukkit/inventory/Recipe.java +++ b/src/main/java/org/bukkit/inventory/Recipe.java @@ -3,6 +3,7 @@ package org.bukkit.inventory; /** * Represents some type of crafting recipe. */ +@Deprecated public interface Recipe { /** diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java index 2796473..4dafc91 100644 --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java @@ -11,9 +11,13 @@ import org.bukkit.material.MaterialData; /** * Represents a shaped (ie normal) crafting recipe. */ +@Deprecated public class ShapedRecipe implements Recipe { + @Deprecated private ItemStack output; + @Deprecated private String[] rows; + @Deprecated private Map ingredients = new HashMap(); /** @@ -27,6 +31,7 @@ public class ShapedRecipe implements Recipe { * @see ShapedRecipe#setIngredient(char, Material, int) * @see ShapedRecipe#setIngredient(char, MaterialData) */ + @Deprecated public ShapedRecipe(ItemStack result) { this.output = new ItemStack(result); } @@ -42,6 +47,7 @@ public class ShapedRecipe implements Recipe { * @param shape The rows of the recipe (up to 3 rows). * @return The changed recipe, so you can chain calls. */ + @Deprecated public ShapedRecipe shape(final String... shape) { Validate.notNull(shape, "Must provide a shape"); Validate.isTrue(shape.length > 0 && shape.length < 4, "Crafting recipes should be 1, 2, 3 rows, not ", shape.length); @@ -74,6 +80,7 @@ public class ShapedRecipe implements Recipe { * @param ingredient The ingredient. * @return The changed recipe, so you can chain calls. */ + @Deprecated public ShapedRecipe setIngredient(char key, MaterialData ingredient) { return setIngredient(key, ingredient.getItemType(), ingredient.getData()); } @@ -85,6 +92,7 @@ public class ShapedRecipe implements Recipe { * @param ingredient The ingredient. * @return The changed recipe, so you can chain calls. */ + @Deprecated public ShapedRecipe setIngredient(char key, Material ingredient) { return setIngredient(key, ingredient, 0); } @@ -116,6 +124,7 @@ public class ShapedRecipe implements Recipe { * * @return The mapping of character to ingredients. */ + @Deprecated public Map getIngredientMap() { HashMap result = new HashMap(); for (Map.Entry ingredient : ingredients.entrySet()) { @@ -133,6 +142,7 @@ public class ShapedRecipe implements Recipe { * * @return The recipe's shape. */ + @Deprecated public String[] getShape() { return rows.clone(); } @@ -142,6 +152,7 @@ public class ShapedRecipe implements Recipe { * * @return The result stack. */ + @Deprecated public ItemStack getResult() { return output.clone(); } diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java index a718086..fff4b92 100644 --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java @@ -13,8 +13,11 @@ import org.bukkit.material.MaterialData; * Represents a shapeless recipe, where the arrangement of the ingredients on * the crafting grid does not matter. */ +@Deprecated public class ShapelessRecipe implements Recipe { + @Deprecated private ItemStack output; + @Deprecated private List ingredients = new ArrayList(); /** @@ -30,6 +33,7 @@ public class ShapelessRecipe implements Recipe { * @see ShapelessRecipe#addIngredient(int,MaterialData) * @see ShapelessRecipe#addIngredient(int,Material,int) */ + @Deprecated public ShapelessRecipe(ItemStack result) { this.output = new ItemStack(result); } @@ -40,6 +44,7 @@ public class ShapelessRecipe implements Recipe { * @param ingredient The ingredient to add. * @return The changed recipe, so you can chain calls. */ + @Deprecated public ShapelessRecipe addIngredient(MaterialData ingredient) { return addIngredient(1, ingredient); } @@ -50,6 +55,7 @@ public class ShapelessRecipe implements Recipe { * @param ingredient The ingredient to add. * @return The changed recipe, so you can chain calls. */ + @Deprecated public ShapelessRecipe addIngredient(Material ingredient) { return addIngredient(1, ingredient, 0); } @@ -74,6 +80,7 @@ public class ShapelessRecipe implements Recipe { * @param ingredient The ingredient to add. * @return The changed recipe, so you can chain calls. */ + @Deprecated public ShapelessRecipe addIngredient(int count, MaterialData ingredient) { return addIngredient(count, ingredient.getItemType(), ingredient.getData()); } @@ -85,6 +92,7 @@ public class ShapelessRecipe implements Recipe { * @param ingredient The ingredient to add. * @return The changed recipe, so you can chain calls. */ + @Deprecated public ShapelessRecipe addIngredient(int count, Material ingredient) { return addIngredient(count, ingredient, 0); } @@ -121,6 +129,7 @@ public class ShapelessRecipe implements Recipe { * @param ingredient The ingredient to remove * @return The changed recipe. */ + @Deprecated public ShapelessRecipe removeIngredient(Material ingredient) { return removeIngredient(ingredient, 0); } @@ -133,6 +142,7 @@ public class ShapelessRecipe implements Recipe { * @param ingredient The ingredient to remove * @return The changed recipe. */ + @Deprecated public ShapelessRecipe removeIngredient(MaterialData ingredient) { return removeIngredient(ingredient.getItemType(), ingredient.getData()); } @@ -146,6 +156,7 @@ public class ShapelessRecipe implements Recipe { * @param ingredient The ingredient to remove * @return The changed recipe. */ + @Deprecated public ShapelessRecipe removeIngredient(int count, Material ingredient) { return removeIngredient(count, ingredient, 0); } @@ -159,6 +170,7 @@ public class ShapelessRecipe implements Recipe { * @param ingredient The ingredient to remove. * @return The changed recipe. */ + @Deprecated public ShapelessRecipe removeIngredient(int count, MaterialData ingredient) { return removeIngredient(count, ingredient.getItemType(), ingredient.getData()); } @@ -207,6 +219,7 @@ public class ShapelessRecipe implements Recipe { * * @return The result stack. */ + @Deprecated public ItemStack getResult() { return output.clone(); } @@ -216,6 +229,7 @@ public class ShapelessRecipe implements Recipe { * * @return The input list */ + @Deprecated public List getIngredientList() { ArrayList result = new ArrayList(ingredients.size()); for (ItemStack ingredient : ingredients) { diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java index 0017596..71cb9f1 100644 --- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java @@ -8,6 +8,7 @@ import org.bukkit.Material; * Represents a book ({@link Material#BOOK_AND_QUILL} or {@link * Material#WRITTEN_BOOK}) that can have a title, an author, and pages. */ +@Deprecated public interface BookMeta extends ItemMeta { /** diff --git a/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java b/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java index fb93d03..a4378f7 100644 --- a/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java @@ -10,6 +10,7 @@ import org.bukkit.enchantments.Enchantment; * opposed to being enchanted. {@link Material#ENCHANTED_BOOK} is an example * of an item with enchantment storage. */ +@Deprecated public interface EnchantmentStorageMeta extends ItemMeta { /** diff --git a/src/main/java/org/bukkit/inventory/meta/FireworkEffectMeta.java b/src/main/java/org/bukkit/inventory/meta/FireworkEffectMeta.java index 47046f1..15942b8 100644 --- a/src/main/java/org/bukkit/inventory/meta/FireworkEffectMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/FireworkEffectMeta.java @@ -7,6 +7,7 @@ import org.bukkit.Material; * Represents a meta that can store a single FireworkEffect. An example * includes {@link Material#FIREWORK_CHARGE}. */ +@Deprecated public interface FireworkEffectMeta extends ItemMeta { /** diff --git a/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java b/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java index 3e06ee0..81b92f8 100644 --- a/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java @@ -8,6 +8,7 @@ import org.bukkit.Material; /** * Represents a {@link Material#FIREWORK} and its effects. */ +@Deprecated public interface FireworkMeta extends ItemMeta { /** diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java index 397ba11..a56bb5f 100644 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java @@ -12,6 +12,7 @@ import org.bukkit.enchantments.Enchantment; * An implementation will handle the creation and application for ItemMeta. * This class should not be implemented by a plugin in a live environment. */ +@Deprecated public interface ItemMeta extends Cloneable, ConfigurationSerializable { /** diff --git a/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java b/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java index 2dc2420..b5fccb8 100644 --- a/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java @@ -9,6 +9,7 @@ import org.bukkit.inventory.ItemFactory; * Material#LEATHER_CHESTPLATE}, {@link Material#LEATHER_HELMET}, or {@link * Material#LEATHER_LEGGINGS}) that can be colored. */ +@Deprecated public interface LeatherArmorMeta extends ItemMeta { /** diff --git a/src/main/java/org/bukkit/inventory/meta/MapMeta.java b/src/main/java/org/bukkit/inventory/meta/MapMeta.java index fb5c297..9f34211 100644 --- a/src/main/java/org/bukkit/inventory/meta/MapMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/MapMeta.java @@ -3,6 +3,7 @@ package org.bukkit.inventory.meta; /** * Represents a map that can be scalable. */ +@Deprecated public interface MapMeta extends ItemMeta { /** diff --git a/src/main/java/org/bukkit/inventory/meta/PotionMeta.java b/src/main/java/org/bukkit/inventory/meta/PotionMeta.java index 8dca983..356d25a 100644 --- a/src/main/java/org/bukkit/inventory/meta/PotionMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/PotionMeta.java @@ -9,6 +9,7 @@ import java.util.List; /** * Represents a potion ({@link Material#POTION}) that can have custom effects. */ +@Deprecated public interface PotionMeta extends ItemMeta { /** diff --git a/src/main/java/org/bukkit/inventory/meta/Repairable.java b/src/main/java/org/bukkit/inventory/meta/Repairable.java index c49844e..aa60cea 100644 --- a/src/main/java/org/bukkit/inventory/meta/Repairable.java +++ b/src/main/java/org/bukkit/inventory/meta/Repairable.java @@ -3,6 +3,7 @@ package org.bukkit.inventory.meta; /** * Represents an item that can be repaired at an anvil. */ +@Deprecated public interface Repairable { /** diff --git a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java index fab3119..275b52f 100644 --- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java @@ -5,6 +5,7 @@ import org.bukkit.Material; /** * Represents a skull ({@link Material#SKULL_ITEM}) that can have an owner. */ +@Deprecated public interface SkullMeta extends ItemMeta { /** diff --git a/src/main/java/org/bukkit/map/MapCanvas.java b/src/main/java/org/bukkit/map/MapCanvas.java index d68bb17..33cfe0e 100644 --- a/src/main/java/org/bukkit/map/MapCanvas.java +++ b/src/main/java/org/bukkit/map/MapCanvas.java @@ -7,6 +7,7 @@ import java.awt.Image; * specific {@link MapRenderer} and represents that renderer's layer on the * map. */ +@Deprecated public interface MapCanvas { /** @@ -14,6 +15,7 @@ public interface MapCanvas { * * @return The MapView this canvas is attached to. */ + @Deprecated public MapView getMapView(); /** @@ -21,6 +23,7 @@ public interface MapCanvas { * * @return The MapCursorCollection associated with this canvas. */ + @Deprecated public MapCursorCollection getCursors(); /** @@ -30,6 +33,7 @@ public interface MapCanvas { * * @param cursors The MapCursorCollection to associate with this canvas. */ + @Deprecated public void setCursors(MapCursorCollection cursors); /** @@ -39,6 +43,7 @@ public interface MapCanvas { * @param y The y coordinate, from 0 to 127. * @param color The color. See {@link MapPalette}. */ + @Deprecated public void setPixel(int x, int y, byte color); /** @@ -48,6 +53,7 @@ public interface MapCanvas { * @param y The y coordinate, from 0 to 127. * @return The color. See {@link MapPalette}. */ + @Deprecated public byte getPixel(int x, int y); /** @@ -57,6 +63,7 @@ public interface MapCanvas { * @param y The y coordinate, from 0 to 127. * @return The color. See {@link MapPalette}. */ + @Deprecated public byte getBasePixel(int x, int y); /** @@ -66,6 +73,7 @@ public interface MapCanvas { * @param y The y coordinate of the image. * @param image The Image to draw. */ + @Deprecated public void drawImage(int x, int y, Image image); /** @@ -79,6 +87,7 @@ public interface MapCanvas { * @param font The font to use. * @param text The formatted text to render. */ + @Deprecated public void drawText(int x, int y, MapFont font, String text); } diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java index d3698a6..85bfdfc 100644 --- a/src/main/java/org/bukkit/map/MapCursor.java +++ b/src/main/java/org/bukkit/map/MapCursor.java @@ -3,9 +3,13 @@ package org.bukkit.map; /** * Represents a cursor on a map. */ +@Deprecated public final class MapCursor { + @Deprecated private byte x, y; + @Deprecated private byte direction, type; + @Deprecated private boolean visible; /** @@ -32,6 +36,7 @@ public final class MapCursor { * * @return The X coordinate. */ + @Deprecated public byte getX() { return x; } @@ -41,6 +46,7 @@ public final class MapCursor { * * @return The Y coordinate. */ + @Deprecated public byte getY() { return y; } @@ -50,6 +56,7 @@ public final class MapCursor { * * @return The facing of the cursor, from 0 to 15. */ + @Deprecated public byte getDirection() { return direction; } @@ -59,6 +66,7 @@ public final class MapCursor { * * @return The type (color/style) of the map cursor. */ + @Deprecated public Type getType() { return Type.byValue(type); } @@ -79,6 +87,7 @@ public final class MapCursor { * * @return True if visible, false otherwise. */ + @Deprecated public boolean isVisible() { return visible; } @@ -88,6 +97,7 @@ public final class MapCursor { * * @param x The X coordinate. */ + @Deprecated public void setX(byte x) { this.x = x; } @@ -97,6 +107,7 @@ public final class MapCursor { * * @param y The Y coordinate. */ + @Deprecated public void setY(byte y) { this.y = y; } @@ -106,6 +117,7 @@ public final class MapCursor { * * @param direction The facing of the cursor, from 0 to 15. */ + @Deprecated public void setDirection(byte direction) { if (direction < 0 || direction > 15) { throw new IllegalArgumentException("Direction must be in the range 0-15"); @@ -118,6 +130,7 @@ public final class MapCursor { * * @param type The type (color/style) of the map cursor. */ + @Deprecated public void setType(Type type) { setRawType(type.value); } @@ -141,6 +154,7 @@ public final class MapCursor { * * @param visible True if visible. */ + @Deprecated public void setVisible(boolean visible) { this.visible = visible; } @@ -151,6 +165,7 @@ public final class MapCursor { * index in the file './misc/mapicons.png' from minecraft.jar or from a * texture pack. */ + @Deprecated public enum Type { WHITE_POINTER(0), GREEN_POINTER(1), @@ -158,8 +173,10 @@ public final class MapCursor { BLUE_POINTER(3), WHITE_CROSS(4); + @Deprecated private byte value; + @Deprecated private Type(int value) { this.value = (byte) value; } diff --git a/src/main/java/org/bukkit/map/MapCursorCollection.java b/src/main/java/org/bukkit/map/MapCursorCollection.java index 1dc9025..88744dd 100644 --- a/src/main/java/org/bukkit/map/MapCursorCollection.java +++ b/src/main/java/org/bukkit/map/MapCursorCollection.java @@ -7,7 +7,9 @@ import java.util.List; * Represents all the map cursors on a {@link MapCanvas}. Like MapCanvas, a * MapCursorCollection is linked to a specific {@link MapRenderer}. */ +@Deprecated public final class MapCursorCollection { + @Deprecated private List cursors = new ArrayList(); /** @@ -15,6 +17,7 @@ public final class MapCursorCollection { * * @return The size of this collection. */ + @Deprecated public int size() { return cursors.size(); } @@ -25,6 +28,7 @@ public final class MapCursorCollection { * @param index The index of the cursor. * @return The MapCursor. */ + @Deprecated public MapCursor getCursor(int index) { return cursors.get(index); } @@ -35,6 +39,7 @@ public final class MapCursorCollection { * @param cursor The MapCursor to remove. * @return Whether the cursor was removed successfully. */ + @Deprecated public boolean removeCursor(MapCursor cursor) { return cursors.remove(cursor); } @@ -45,6 +50,7 @@ public final class MapCursorCollection { * @param cursor The MapCursor to add. * @return The MapCursor that was passed. */ + @Deprecated public MapCursor addCursor(MapCursor cursor) { cursors.add(cursor); return cursor; @@ -58,6 +64,7 @@ public final class MapCursorCollection { * @param direction The facing of the cursor, from 0 to 15. * @return The newly added MapCursor. */ + @Deprecated public MapCursor addCursor(int x, int y, byte direction) { return addCursor(x, y, direction, (byte) 0, true); } diff --git a/src/main/java/org/bukkit/map/MapFont.java b/src/main/java/org/bukkit/map/MapFont.java index 84c809f..c3ace2b 100644 --- a/src/main/java/org/bukkit/map/MapFont.java +++ b/src/main/java/org/bukkit/map/MapFont.java @@ -5,10 +5,14 @@ import java.util.HashMap; /** * Represents a bitmap font drawable to a map. */ +@Deprecated public class MapFont { + @Deprecated private final HashMap chars = new HashMap(); + @Deprecated private int height = 0; + @Deprecated protected boolean malleable = true; /** @@ -18,6 +22,7 @@ public class MapFont { * @param sprite The CharacterSprite to set. * @throws IllegalStateException if this font is static. */ + @Deprecated public void setChar(char ch, CharacterSprite sprite) { if (!malleable) { throw new IllegalStateException("this font is not malleable"); @@ -36,6 +41,7 @@ public class MapFont { * @return The CharacterSprite associated with the character, or null if * there is none. */ + @Deprecated public CharacterSprite getChar(char ch) { return chars.get(ch); } @@ -47,6 +53,7 @@ public class MapFont { * @param text The text. * @return The width in pixels. */ + @Deprecated public int getWidth(String text) { if (!isValid(text)) { throw new IllegalArgumentException("text contains invalid characters"); @@ -64,6 +71,7 @@ public class MapFont { * * @return The height of the font. */ + @Deprecated public int getHeight() { return height; } @@ -75,6 +83,7 @@ public class MapFont { * @return True if the string contains only defined characters, false * otherwise. */ + @Deprecated public boolean isValid(String text) { for (int i = 0; i < text.length(); ++i) { char ch = text.charAt(i); @@ -87,12 +96,17 @@ public class MapFont { /** * Represents the graphics for a single character in a MapFont. */ + @Deprecated public static class CharacterSprite { + @Deprecated private final int width; + @Deprecated private final int height; + @Deprecated private final boolean[] data; + @Deprecated public CharacterSprite(int width, int height, boolean[] data) { this.width = width; this.height = height; @@ -110,6 +124,7 @@ public class MapFont { * @param col The column, in the range [0,8). * @return True if the pixel is solid, false if transparent. */ + @Deprecated public boolean get(int row, int col) { if (row < 0 || col < 0 || row >= height || col >= width) return false; return data[row * width + col]; @@ -120,6 +135,7 @@ public class MapFont { * * @return The width of the character. */ + @Deprecated public int getWidth() { return width; } @@ -129,6 +145,7 @@ public class MapFont { * * @return The height of the character. */ + @Deprecated public int getHeight() { return height; } diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java index 35f3e19..17b56b5 100644 --- a/src/main/java/org/bukkit/map/MapPalette.java +++ b/src/main/java/org/bukkit/map/MapPalette.java @@ -11,14 +11,18 @@ import java.awt.image.BufferedImage; * These fields are hee base color ranges. Each entry corresponds to four * colors of varying shades with values entry to entry + 3. */ +@Deprecated public final class MapPalette { // Internal mechanisms + @Deprecated private MapPalette() {} + @Deprecated private static Color c(int r, int g, int b) { return new Color(r, g, b); } + @Deprecated private static double getDistance(Color c1, Color c2) { double rmean = (c1.getRed() + c2.getRed()) / 2.0; double r = c1.getRed() - c2.getRed(); @@ -30,6 +34,7 @@ public final class MapPalette { return weightR * r * r + weightG * g * g + weightB * b * b; } + @Deprecated private static final Color[] colors = { new Color(0, 0, 0, 0), new Color(0, 0, 0, 0), new Color(0, 0, 0, 0), new Color(0, 0, 0, 0), @@ -148,6 +153,7 @@ public final class MapPalette { * @param image The image to resize. * @return The resized image. */ + @Deprecated public static BufferedImage resizeImage(Image image) { BufferedImage result = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB); Graphics2D graphics = result.createGraphics(); diff --git a/src/main/java/org/bukkit/map/MapRenderer.java b/src/main/java/org/bukkit/map/MapRenderer.java index 322d0ce..ecd2d3a 100644 --- a/src/main/java/org/bukkit/map/MapRenderer.java +++ b/src/main/java/org/bukkit/map/MapRenderer.java @@ -5,14 +5,17 @@ import org.bukkit.entity.Player; /** * Represents a renderer for a map. */ +@Deprecated public abstract class MapRenderer { + @Deprecated private boolean contextual; /** * Initialize the map renderer base to be non-contextual. See {@link * #isContextual()}. */ + @Deprecated public MapRenderer() { this(false); } @@ -23,6 +26,7 @@ public abstract class MapRenderer { * @param contextual Whether the renderer is contextual. See {@link * #isContextual()}. */ + @Deprecated public MapRenderer(boolean contextual) { this.contextual = contextual; } @@ -33,6 +37,7 @@ public abstract class MapRenderer { * * @return True if contextual, false otherwise. */ + @Deprecated final public boolean isContextual() { return contextual; } @@ -42,6 +47,7 @@ public abstract class MapRenderer { * * @param map The MapView being initialized. */ + @Deprecated public void initialize(MapView map) {} /** @@ -51,6 +57,7 @@ public abstract class MapRenderer { * @param canvas The canvas to use for rendering. * @param player The player who triggered the rendering. */ + @Deprecated abstract public void render(MapView map, MapCanvas canvas, Player player); } diff --git a/src/main/java/org/bukkit/map/MapView.java b/src/main/java/org/bukkit/map/MapView.java index ff370f4..0d5d434 100644 --- a/src/main/java/org/bukkit/map/MapView.java +++ b/src/main/java/org/bukkit/map/MapView.java @@ -6,11 +6,13 @@ import org.bukkit.World; /** * Represents a map item. */ +@Deprecated public interface MapView { /** * An enum representing all possible scales a map can be set to. */ + @Deprecated public static enum Scale { CLOSEST(0), CLOSE(1), @@ -18,8 +20,10 @@ public interface MapView { FAR(3), FARTHEST(4); + @Deprecated private byte value; + @Deprecated private Scale(int value) { this.value = (byte) value; } @@ -71,6 +75,7 @@ public interface MapView { * * @return Whether the map is virtual. */ + @Deprecated public boolean isVirtual(); /** @@ -78,6 +83,7 @@ public interface MapView { * * @return The scale of the map. */ + @Deprecated public Scale getScale(); /** @@ -85,6 +91,7 @@ public interface MapView { * * @param scale The scale to set. */ + @Deprecated public void setScale(Scale scale); /** @@ -92,6 +99,7 @@ public interface MapView { * * @return The center X position. */ + @Deprecated public int getCenterX(); /** @@ -99,6 +107,7 @@ public interface MapView { * * @return The center Z position. */ + @Deprecated public int getCenterZ(); /** @@ -106,6 +115,7 @@ public interface MapView { * * @param x The center X position. */ + @Deprecated public void setCenterX(int x); /** @@ -113,6 +123,7 @@ public interface MapView { * * @param z The center Z position. */ + @Deprecated public void setCenterZ(int z); /** @@ -122,6 +133,7 @@ public interface MapView { * * @return The World this map is associated with. */ + @Deprecated public World getWorld(); /** @@ -130,6 +142,7 @@ public interface MapView { * * @param world The World to associate this map with. */ + @Deprecated public void setWorld(World world); /** @@ -137,6 +150,7 @@ public interface MapView { * * @return A List containing each map renderer. */ + @Deprecated public List getRenderers(); /** @@ -144,6 +158,7 @@ public interface MapView { * * @param renderer The MapRenderer to add. */ + @Deprecated public void addRenderer(MapRenderer renderer); /** @@ -152,6 +167,7 @@ public interface MapView { * @param renderer The MapRenderer to remove. * @return True if the renderer was successfully removed. */ + @Deprecated public boolean removeRenderer(MapRenderer renderer); } diff --git a/src/main/java/org/bukkit/map/MinecraftFont.java b/src/main/java/org/bukkit/map/MinecraftFont.java index 9ec8d10..ddd747e 100644 --- a/src/main/java/org/bukkit/map/MinecraftFont.java +++ b/src/main/java/org/bukkit/map/MinecraftFont.java @@ -3,10 +3,13 @@ package org.bukkit.map; /** * Represents the built-in Minecraft font. */ +@Deprecated public class MinecraftFont extends MapFont { + @Deprecated private static final int spaceSize = 2; + @Deprecated private static final String fontChars = " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + @@ -18,6 +21,7 @@ public class MinecraftFont extends MapFont { "\u00E1\u00ED\u00F3\u00FA\u00F1\u00D1\u00AA\u00BA" + // áíóúñѪº "\u00BF\u00AE\u00AC\u00BD\u00BC\u00A1\u00AB\u00BB"; // ¿®¬½¼¡«» + @Deprecated private static final int[][] fontData = new int[][] { /* null */ {0,0,0,0,0,0,0,0}, /* 1 */ {126,129,165,129,189,153,129,126}, @@ -280,15 +284,18 @@ public class MinecraftFont extends MapFont { /** * A static non-malleable MinecraftFont. */ + @Deprecated public static final MinecraftFont Font = new MinecraftFont(false); /** * Initialize a new MinecraftFont. */ + @Deprecated public MinecraftFont() { this(true); } + @Deprecated private MinecraftFont(boolean malleable) { for (int i = 1; i < fontData.length; ++i) { char ch = (char) i; diff --git a/src/main/java/org/bukkit/material/Attachable.java b/src/main/java/org/bukkit/material/Attachable.java index 1d3f107..9342c36 100644 --- a/src/main/java/org/bukkit/material/Attachable.java +++ b/src/main/java/org/bukkit/material/Attachable.java @@ -5,6 +5,7 @@ import org.bukkit.block.BlockFace; /** * Indicates that a block can be attached to another block */ +@Deprecated public interface Attachable extends Directional { /** @@ -12,5 +13,6 @@ public interface Attachable extends Directional { * * @return BlockFace attached to */ + @Deprecated public BlockFace getAttachedFace(); } diff --git a/src/main/java/org/bukkit/material/Bed.java b/src/main/java/org/bukkit/material/Bed.java index a1c087a..70e7836 100644 --- a/src/main/java/org/bukkit/material/Bed.java +++ b/src/main/java/org/bukkit/material/Bed.java @@ -6,11 +6,13 @@ import org.bukkit.block.BlockFace; /** * Represents a bed. */ +@Deprecated public class Bed extends MaterialData implements Directional { /** * Default constructor for a bed. */ + @Deprecated public Bed() { super(Material.BED_BLOCK); } @@ -20,6 +22,7 @@ public class Bed extends MaterialData implements Directional { * * @param direction the direction the bed's head is facing */ + @Deprecated public Bed(BlockFace direction) { this(); setFacingDirection(direction); @@ -34,6 +37,7 @@ public class Bed extends MaterialData implements Directional { super(type); } + @Deprecated public Bed(final Material type) { super(type); } @@ -61,6 +65,7 @@ public class Bed extends MaterialData implements Directional { * * @return true if this is the head of the bed, false if it is the foot */ + @Deprecated public boolean isHeadOfBed() { return (getData() & 0x8) == 0x8; } @@ -70,6 +75,7 @@ public class Bed extends MaterialData implements Directional { * * @param isHeadOfBed True to make it the head. */ + @Deprecated public void setHeadOfBed(boolean isHeadOfBed) { setData((byte) (isHeadOfBed ? (getData() | 0x8) : (getData() & ~0x8))); } @@ -78,6 +84,7 @@ public class Bed extends MaterialData implements Directional { * Set which direction the head of the bed is facing. Note that this will * only affect one of the two blocks the bed is made of. */ + @Deprecated public void setFacingDirection(BlockFace face) { byte data; @@ -111,6 +118,7 @@ public class Bed extends MaterialData implements Directional { * * @return the direction the head of the bed is facing */ + @Deprecated public BlockFace getFacing() { byte data = (byte) (getData() & 0x7); @@ -131,11 +139,13 @@ public class Bed extends MaterialData implements Directional { } @Override + @Deprecated public String toString() { return (isHeadOfBed() ? "HEAD" : "FOOT") + " of " + super.toString() + " facing " + getFacing(); } @Override + @Deprecated public Bed clone() { return (Bed) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Button.java b/src/main/java/org/bukkit/material/Button.java index 2eeeaa6..ea6c29c 100644 --- a/src/main/java/org/bukkit/material/Button.java +++ b/src/main/java/org/bukkit/material/Button.java @@ -6,7 +6,9 @@ import org.bukkit.Material; /** * Represents a button */ +@Deprecated public class Button extends SimpleAttachableMaterialData implements Redstone { + @Deprecated public Button() { super(Material.STONE_BUTTON); } @@ -20,6 +22,7 @@ public class Button extends SimpleAttachableMaterialData implements Redstone { super(type); } + @Deprecated public Button(final Material type) { super(type); } @@ -48,6 +51,7 @@ public class Button extends SimpleAttachableMaterialData implements Redstone { * * @return true if powered, otherwise false */ + @Deprecated public boolean isPowered() { return (getData() & 0x8) == 0x8; } @@ -58,6 +62,7 @@ public class Button extends SimpleAttachableMaterialData implements Redstone { * @param bool * whether or not the button is powered */ + @Deprecated public void setPowered(boolean bool) { setData((byte) (bool ? (getData() | 0x8) : (getData() & ~0x8))); } @@ -67,6 +72,7 @@ public class Button extends SimpleAttachableMaterialData implements Redstone { * * @return BlockFace attached to */ + @Deprecated public BlockFace getAttachedFace() { byte data = (byte) (getData() & 0x7); @@ -90,6 +96,7 @@ public class Button extends SimpleAttachableMaterialData implements Redstone { /** * Sets the direction this button is pointing toward */ + @Deprecated public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0x8); @@ -115,11 +122,13 @@ public class Button extends SimpleAttachableMaterialData implements Redstone { } @Override + @Deprecated public String toString() { return super.toString() + " " + (isPowered() ? "" : "NOT ") + "POWERED"; } @Override + @Deprecated public Button clone() { return (Button) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Cake.java b/src/main/java/org/bukkit/material/Cake.java index 360ae58..fa184d7 100644 --- a/src/main/java/org/bukkit/material/Cake.java +++ b/src/main/java/org/bukkit/material/Cake.java @@ -2,7 +2,9 @@ package org.bukkit.material; import org.bukkit.Material; +@Deprecated public class Cake extends MaterialData { + @Deprecated public Cake() { super(Material.CAKE_BLOCK); } @@ -16,6 +18,7 @@ public class Cake extends MaterialData { super(type); } + @Deprecated public Cake(Material type) { super(type); } @@ -43,6 +46,7 @@ public class Cake extends MaterialData { * * @return The number of slices eaten */ + @Deprecated public int getSlicesEaten() { return getData(); } @@ -52,6 +56,7 @@ public class Cake extends MaterialData { * * @return The number of slices remaining */ + @Deprecated public int getSlicesRemaining() { return 6 - getData(); } @@ -61,6 +66,7 @@ public class Cake extends MaterialData { * * @param n The number of slices eaten */ + @Deprecated public void setSlicesEaten(int n) { if (n < 6) { setData((byte) n); @@ -72,6 +78,7 @@ public class Cake extends MaterialData { * * @param n The number of slices remaining */ + @Deprecated public void setSlicesRemaining(int n) { if (n > 6) { n = 6; @@ -80,11 +87,13 @@ public class Cake extends MaterialData { } @Override + @Deprecated public String toString() { return super.toString() + " " + getSlicesEaten() + "/" + getSlicesRemaining() + " slices eaten/remaining"; } @Override + @Deprecated public Cake clone() { return (Cake) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Cauldron.java b/src/main/java/org/bukkit/material/Cauldron.java index b464bbd..299affe 100644 --- a/src/main/java/org/bukkit/material/Cauldron.java +++ b/src/main/java/org/bukkit/material/Cauldron.java @@ -5,10 +5,14 @@ import org.bukkit.Material; /** * Represents a cauldron */ +@Deprecated public class Cauldron extends MaterialData { + @Deprecated private static final int CAULDRON_FULL = 3; + @Deprecated private static final int CAULDRON_EMPTY = 0; + @Deprecated public Cauldron() { super(Material.CAULDRON); } @@ -36,6 +40,7 @@ public class Cauldron extends MaterialData { * * @return True if it is full. */ + @Deprecated public boolean isFull() { return getData() >= CAULDRON_FULL; } @@ -45,16 +50,19 @@ public class Cauldron extends MaterialData { * * @return True if it is empty. */ + @Deprecated public boolean isEmpty() { return getData() <= CAULDRON_EMPTY; } @Override + @Deprecated public String toString() { return (isEmpty() ? "EMPTY" : (isFull() ? "FULL" : getData() + "/3 FULL")) + " CAULDRON"; } @Override + @Deprecated public Cauldron clone() { return (Cauldron) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Chest.java b/src/main/java/org/bukkit/material/Chest.java index b9f6988..551da1b 100644 --- a/src/main/java/org/bukkit/material/Chest.java +++ b/src/main/java/org/bukkit/material/Chest.java @@ -6,8 +6,10 @@ import org.bukkit.block.BlockFace; /** * Represents a chest */ +@Deprecated public class Chest extends DirectionalContainer { + @Deprecated public Chest() { super(Material.CHEST); } @@ -17,6 +19,7 @@ public class Chest extends DirectionalContainer { * * @param direction the direction the chest's lit opens towards */ + @Deprecated public Chest(BlockFace direction) { this(); setFacingDirection(direction); @@ -31,6 +34,7 @@ public class Chest extends DirectionalContainer { super(type); } + @Deprecated public Chest(final Material type) { super(type); } @@ -54,6 +58,7 @@ public class Chest extends DirectionalContainer { } @Override + @Deprecated public Chest clone() { return (Chest) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Coal.java b/src/main/java/org/bukkit/material/Coal.java index 3a4f7c3..c6e388c 100644 --- a/src/main/java/org/bukkit/material/Coal.java +++ b/src/main/java/org/bukkit/material/Coal.java @@ -6,11 +6,14 @@ import org.bukkit.Material; /** * Represents the different types of coals. */ +@Deprecated public class Coal extends MaterialData { + @Deprecated public Coal() { super(Material.COAL); } + @Deprecated public Coal(CoalType type) { this(); setType(type); @@ -25,6 +28,7 @@ public class Coal extends MaterialData { super(type); } + @Deprecated public Coal(final Material type) { super(type); } @@ -52,6 +56,7 @@ public class Coal extends MaterialData { * * @return CoalType of this coal */ + @Deprecated public CoalType getType() { return CoalType.getByData(getData()); } @@ -61,16 +66,19 @@ public class Coal extends MaterialData { * * @param type New type of this coal */ + @Deprecated public void setType(CoalType type) { setData(type.getData()); } @Override + @Deprecated public String toString() { return getType() + " " + super.toString(); } @Override + @Deprecated public Coal clone() { return (Coal) super.clone(); } diff --git a/src/main/java/org/bukkit/material/CocoaPlant.java b/src/main/java/org/bukkit/material/CocoaPlant.java index b8280b5..08098ae 100644 --- a/src/main/java/org/bukkit/material/CocoaPlant.java +++ b/src/main/java/org/bukkit/material/CocoaPlant.java @@ -6,14 +6,17 @@ import org.bukkit.block.BlockFace; /** * Represents the cocoa plant */ +@Deprecated public class CocoaPlant extends MaterialData implements Directional, Attachable { + @Deprecated public enum CocoaPlantSize { SMALL, MEDIUM, LARGE } + @Deprecated public CocoaPlant() { super(Material.COCOA); } @@ -36,11 +39,13 @@ public class CocoaPlant extends MaterialData implements Directional, Attachable super(type, data); } + @Deprecated public CocoaPlant(CocoaPlantSize sz) { this(); setSize(sz); } + @Deprecated public CocoaPlant(CocoaPlantSize sz, BlockFace dir) { this(); setSize(sz); @@ -52,6 +57,7 @@ public class CocoaPlant extends MaterialData implements Directional, Attachable * * @return size */ + @Deprecated public CocoaPlantSize getSize() { switch (getData() & 0xC) { case 0: @@ -68,6 +74,7 @@ public class CocoaPlant extends MaterialData implements Directional, Attachable * * @param sz - size of plant */ + @Deprecated public void setSize(CocoaPlantSize sz) { int dat = getData() & 0x3; switch (sz) { @@ -83,10 +90,12 @@ public class CocoaPlant extends MaterialData implements Directional, Attachable setData((byte) dat); } + @Deprecated public BlockFace getAttachedFace() { return getFacing().getOppositeFace(); } + @Deprecated public void setFacingDirection(BlockFace face) { int dat = getData() & 0xC; switch (face) { @@ -106,6 +115,7 @@ public class CocoaPlant extends MaterialData implements Directional, Attachable setData((byte) dat); } + @Deprecated public BlockFace getFacing() { switch (getData() & 0x3) { case 0: @@ -121,11 +131,13 @@ public class CocoaPlant extends MaterialData implements Directional, Attachable } @Override + @Deprecated public CocoaPlant clone() { return (CocoaPlant) super.clone(); } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getFacing() + " " + getSize(); } diff --git a/src/main/java/org/bukkit/material/Colorable.java b/src/main/java/org/bukkit/material/Colorable.java index 3b91b24..ef6d6dd 100644 --- a/src/main/java/org/bukkit/material/Colorable.java +++ b/src/main/java/org/bukkit/material/Colorable.java @@ -5,6 +5,7 @@ import org.bukkit.DyeColor; /** * An object that can be colored. */ +@Deprecated public interface Colorable { /** @@ -12,6 +13,7 @@ public interface Colorable { * * @return The DyeColor of this object. */ + @Deprecated public DyeColor getColor(); /** @@ -19,6 +21,7 @@ public interface Colorable { * * @param color The color of the object, as a DyeColor. */ + @Deprecated public void setColor(DyeColor color); } diff --git a/src/main/java/org/bukkit/material/Command.java b/src/main/java/org/bukkit/material/Command.java index 174e1ff..1dcfcfe 100644 --- a/src/main/java/org/bukkit/material/Command.java +++ b/src/main/java/org/bukkit/material/Command.java @@ -5,7 +5,9 @@ import org.bukkit.Material; /** * Represents a command block */ +@Deprecated public class Command extends MaterialData implements Redstone { + @Deprecated public Command() { super(Material.COMMAND); } @@ -19,6 +21,7 @@ public class Command extends MaterialData implements Redstone { super(type); } + @Deprecated public Command(final Material type) { super(type); } @@ -47,6 +50,7 @@ public class Command extends MaterialData implements Redstone { * * @return true if powered, otherwise false */ + @Deprecated public boolean isPowered() { return (getData() & 1) != 0; } @@ -57,16 +61,19 @@ public class Command extends MaterialData implements Redstone { * @param bool * whether or not the command block is powered */ + @Deprecated public void setPowered(boolean bool) { setData((byte) (bool ? (getData() | 1) : (getData() & -2))); } @Override + @Deprecated public String toString() { return super.toString() + " " + (isPowered() ? "" : "NOT ") + "POWERED"; } @Override + @Deprecated public Command clone() { return (Command) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Crops.java b/src/main/java/org/bukkit/material/Crops.java index 2791998..c437610 100644 --- a/src/main/java/org/bukkit/material/Crops.java +++ b/src/main/java/org/bukkit/material/Crops.java @@ -6,11 +6,14 @@ import org.bukkit.Material; /** * Represents the different types of crops. */ +@Deprecated public class Crops extends MaterialData { + @Deprecated public Crops() { super(Material.CROPS); } + @Deprecated public Crops(CropState state) { this(); setState(state); @@ -25,6 +28,7 @@ public class Crops extends MaterialData { super(type); } + @Deprecated public Crops(final Material type) { super(type); } @@ -52,6 +56,7 @@ public class Crops extends MaterialData { * * @return CropState of this crop */ + @Deprecated public CropState getState() { return CropState.getByData(getData()); } @@ -61,16 +66,19 @@ public class Crops extends MaterialData { * * @param state New growth state of this crop */ + @Deprecated public void setState(CropState state) { setData(state.getData()); } @Override + @Deprecated public String toString() { return getState() + " " + super.toString(); } @Override + @Deprecated public Crops clone() { return (Crops) super.clone(); } diff --git a/src/main/java/org/bukkit/material/DetectorRail.java b/src/main/java/org/bukkit/material/DetectorRail.java index b1d3073..45c544c 100644 --- a/src/main/java/org/bukkit/material/DetectorRail.java +++ b/src/main/java/org/bukkit/material/DetectorRail.java @@ -5,7 +5,9 @@ import org.bukkit.Material; /** * Represents a detector rail */ +@Deprecated public class DetectorRail extends ExtendedRails implements PressureSensor { + @Deprecated public DetectorRail() { super(Material.DETECTOR_RAIL); } @@ -19,6 +21,7 @@ public class DetectorRail extends ExtendedRails implements PressureSensor { super(type); } + @Deprecated public DetectorRail(final Material type) { super(type); } @@ -41,15 +44,18 @@ public class DetectorRail extends ExtendedRails implements PressureSensor { super(type, data); } + @Deprecated public boolean isPressed() { return (getData() & 0x8) == 0x8; } + @Deprecated public void setPressed(boolean isPressed) { setData((byte) (isPressed ? (getData() | 0x8) : (getData() & ~0x8))); } @Override + @Deprecated public DetectorRail clone() { return (DetectorRail) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Diode.java b/src/main/java/org/bukkit/material/Diode.java index 04210b7..5587217 100644 --- a/src/main/java/org/bukkit/material/Diode.java +++ b/src/main/java/org/bukkit/material/Diode.java @@ -3,7 +3,9 @@ package org.bukkit.material; import org.bukkit.Material; import org.bukkit.block.BlockFace; +@Deprecated public class Diode extends MaterialData implements Directional { + @Deprecated public Diode() { super(Material.DIODE_BLOCK_ON); } @@ -17,6 +19,7 @@ public class Diode extends MaterialData implements Directional { super(type); } + @Deprecated public Diode(Material type) { super(type); } @@ -45,6 +48,7 @@ public class Diode extends MaterialData implements Directional { * @param delay * The new delay (1-4) */ + @Deprecated public void setDelay(int delay) { if (delay > 4) { delay = 4; @@ -62,10 +66,12 @@ public class Diode extends MaterialData implements Directional { * * @return The delay (1-4) */ + @Deprecated public int getDelay() { return (getData() >> 2) + 1; } + @Deprecated public void setFacingDirection(BlockFace face) { int delay = getDelay(); byte data; @@ -92,6 +98,7 @@ public class Diode extends MaterialData implements Directional { setDelay(delay); } + @Deprecated public BlockFace getFacing() { byte data = (byte) (getData() & 0x3); @@ -112,11 +119,13 @@ public class Diode extends MaterialData implements Directional { } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getFacing() + " with " + getDelay() + " ticks delay"; } @Override + @Deprecated public Diode clone() { return (Diode) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Directional.java b/src/main/java/org/bukkit/material/Directional.java index 25624d2..ad692d6 100644 --- a/src/main/java/org/bukkit/material/Directional.java +++ b/src/main/java/org/bukkit/material/Directional.java @@ -2,6 +2,7 @@ package org.bukkit.material; import org.bukkit.block.BlockFace; +@Deprecated public interface Directional { /** @@ -9,6 +10,7 @@ public interface Directional { * * @param face The facing direction */ + @Deprecated public void setFacingDirection(BlockFace face); /** @@ -16,5 +18,6 @@ public interface Directional { * * @return the direction this block is facing */ + @Deprecated public BlockFace getFacing(); } diff --git a/src/main/java/org/bukkit/material/DirectionalContainer.java b/src/main/java/org/bukkit/material/DirectionalContainer.java index 9b0a047..a3b5e0e 100644 --- a/src/main/java/org/bukkit/material/DirectionalContainer.java +++ b/src/main/java/org/bukkit/material/DirectionalContainer.java @@ -6,6 +6,7 @@ import org.bukkit.block.BlockFace; /** * Represents a furnace or a dispenser. */ +@Deprecated public class DirectionalContainer extends MaterialData implements Directional { /** * @@ -16,6 +17,7 @@ public class DirectionalContainer extends MaterialData implements Directional { super(type); } + @Deprecated public DirectionalContainer(final Material type) { super(type); } @@ -38,6 +40,7 @@ public class DirectionalContainer extends MaterialData implements Directional { super(type, data); } + @Deprecated public void setFacingDirection(BlockFace face) { byte data; @@ -62,6 +65,7 @@ public class DirectionalContainer extends MaterialData implements Directional { setData(data); } + @Deprecated public BlockFace getFacing() { byte data = getData(); @@ -82,11 +86,13 @@ public class DirectionalContainer extends MaterialData implements Directional { } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getFacing(); } @Override + @Deprecated public DirectionalContainer clone() { return (DirectionalContainer) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Dispenser.java b/src/main/java/org/bukkit/material/Dispenser.java index b62f8c9..afeed27 100644 --- a/src/main/java/org/bukkit/material/Dispenser.java +++ b/src/main/java/org/bukkit/material/Dispenser.java @@ -6,12 +6,15 @@ import org.bukkit.block.BlockFace; /** * Represents a dispenser. */ +@Deprecated public class Dispenser extends FurnaceAndDispenser { + @Deprecated public Dispenser() { super(Material.DISPENSER); } + @Deprecated public Dispenser(BlockFace direction) { this(); setFacingDirection(direction); @@ -26,6 +29,7 @@ public class Dispenser extends FurnaceAndDispenser { super(type); } + @Deprecated public Dispenser(final Material type) { super(type); } @@ -48,6 +52,7 @@ public class Dispenser extends FurnaceAndDispenser { super(type, data); } + @Deprecated public void setFacingDirection(BlockFace face) { byte data; @@ -80,6 +85,7 @@ public class Dispenser extends FurnaceAndDispenser { setData(data); } + @Deprecated public BlockFace getFacing() { int data = getData() & 0x7; @@ -106,6 +112,7 @@ public class Dispenser extends FurnaceAndDispenser { } @Override + @Deprecated public Dispenser clone() { return (Dispenser) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Door.java b/src/main/java/org/bukkit/material/Door.java index 65fa32c..d75e35a 100644 --- a/src/main/java/org/bukkit/material/Door.java +++ b/src/main/java/org/bukkit/material/Door.java @@ -10,6 +10,7 @@ import org.bukkit.block.BlockFace; */ @Deprecated public class Door extends MaterialData implements Directional, Openable { + @Deprecated public Door() { super(Material.WOODEN_DOOR); } @@ -23,6 +24,7 @@ public class Door extends MaterialData implements Directional, Openable { super(type); } + @Deprecated public Door(final Material type) { super(type); } @@ -64,6 +66,7 @@ public class Door extends MaterialData implements Directional, Openable { /** * @return whether this is the top half of the door */ + @Deprecated public boolean isTopHalf() { return ((getData() & 0x8) == 0x8); } @@ -99,6 +102,7 @@ public class Door extends MaterialData implements Directional, Openable { } @Override + @Deprecated public String toString() { return (isTopHalf() ? "TOP" : "BOTTOM") + " half of " + super.toString(); } @@ -154,6 +158,7 @@ public class Door extends MaterialData implements Directional, Openable { } @Override + @Deprecated public Door clone() { return (Door) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Dye.java b/src/main/java/org/bukkit/material/Dye.java index 4412c1f..13aa8c6 100644 --- a/src/main/java/org/bukkit/material/Dye.java +++ b/src/main/java/org/bukkit/material/Dye.java @@ -6,7 +6,9 @@ import org.bukkit.Material; /** * Represents dye */ +@Deprecated public class Dye extends MaterialData implements Colorable { + @Deprecated public Dye() { super(Material.INK_SACK); } @@ -20,6 +22,7 @@ public class Dye extends MaterialData implements Colorable { super(type); } + @Deprecated public Dye(final Material type) { super(type); } @@ -47,6 +50,7 @@ public class Dye extends MaterialData implements Colorable { * * @return DyeColor of this dye */ + @Deprecated public DyeColor getColor() { return DyeColor.getByDyeData(getData()); } @@ -56,16 +60,19 @@ public class Dye extends MaterialData implements Colorable { * * @param color New color of this dye */ + @Deprecated public void setColor(DyeColor color) { setData(color.getDyeData()); } @Override + @Deprecated public String toString() { return getColor() + " DYE(" + getData() + ")"; } @Override + @Deprecated public Dye clone() { return (Dye) super.clone(); } diff --git a/src/main/java/org/bukkit/material/EnderChest.java b/src/main/java/org/bukkit/material/EnderChest.java index 696dc65..96cd847 100644 --- a/src/main/java/org/bukkit/material/EnderChest.java +++ b/src/main/java/org/bukkit/material/EnderChest.java @@ -6,8 +6,10 @@ import org.bukkit.block.BlockFace; /** * Represents an ender chest */ +@Deprecated public class EnderChest extends DirectionalContainer { + @Deprecated public EnderChest() { super(Material.ENDER_CHEST); } @@ -17,6 +19,7 @@ public class EnderChest extends DirectionalContainer { * * @param direction the direction the ender chest's lid opens towards */ + @Deprecated public EnderChest(BlockFace direction) { this(); setFacingDirection(direction); @@ -31,6 +34,7 @@ public class EnderChest extends DirectionalContainer { super(type); } + @Deprecated public EnderChest(final Material type) { super(type); } @@ -54,6 +58,7 @@ public class EnderChest extends DirectionalContainer { } @Override + @Deprecated public EnderChest clone() { return (EnderChest) super.clone(); } diff --git a/src/main/java/org/bukkit/material/ExtendedRails.java b/src/main/java/org/bukkit/material/ExtendedRails.java index 0dbbf7c..4185a7b 100644 --- a/src/main/java/org/bukkit/material/ExtendedRails.java +++ b/src/main/java/org/bukkit/material/ExtendedRails.java @@ -7,6 +7,7 @@ import org.bukkit.block.BlockFace; * This is the superclass for the {@link DetectorRail} and {@link PoweredRail} * classes */ +@Deprecated public class ExtendedRails extends Rails { /** * @@ -17,6 +18,7 @@ public class ExtendedRails extends Rails { super(type); } + @Deprecated public ExtendedRails(final Material type) { super(type); } @@ -40,6 +42,7 @@ public class ExtendedRails extends Rails { } @Override + @Deprecated public boolean isCurve() { return false; } @@ -55,6 +58,7 @@ public class ExtendedRails extends Rails { } @Override + @Deprecated public void setDirection(BlockFace face, boolean isOnSlope) { boolean extraBitSet = (getData() & 0x8) == 0x8; @@ -67,6 +71,7 @@ public class ExtendedRails extends Rails { } @Override + @Deprecated public ExtendedRails clone() { return (ExtendedRails) super.clone(); } diff --git a/src/main/java/org/bukkit/material/FlowerPot.java b/src/main/java/org/bukkit/material/FlowerPot.java index 787c58d..9b29104 100644 --- a/src/main/java/org/bukkit/material/FlowerPot.java +++ b/src/main/java/org/bukkit/material/FlowerPot.java @@ -7,11 +7,13 @@ import org.bukkit.TreeSpecies; /** * Represents a flower pot. */ +@Deprecated public class FlowerPot extends MaterialData { /** * Default constructor for a flower pot. */ + @Deprecated public FlowerPot() { super(Material.FLOWER_POT); } @@ -25,6 +27,7 @@ public class FlowerPot extends MaterialData { super(type); } + @Deprecated public FlowerPot(final Material type) { super(type); } @@ -53,6 +56,7 @@ public class FlowerPot extends MaterialData { * @return material MaterialData for the block currently in the flower pot * or null if empty */ + @Deprecated public MaterialData getContents() { switch (getData()) { case 1: @@ -87,6 +91,7 @@ public class FlowerPot extends MaterialData { * * @param materialData MaterialData of the block to put in the flower pot. */ + @Deprecated public void setContents(MaterialData materialData) { Material mat = materialData.getItemType(); @@ -124,11 +129,13 @@ public class FlowerPot extends MaterialData { } @Override + @Deprecated public String toString() { return super.toString() + " containing " + getContents(); } @Override + @Deprecated public FlowerPot clone() { return (FlowerPot) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Furnace.java b/src/main/java/org/bukkit/material/Furnace.java index 49645aa..b4f37b3 100644 --- a/src/main/java/org/bukkit/material/Furnace.java +++ b/src/main/java/org/bukkit/material/Furnace.java @@ -6,8 +6,10 @@ import org.bukkit.block.BlockFace; /** * Represents a furnace. */ +@Deprecated public class Furnace extends FurnaceAndDispenser { + @Deprecated public Furnace() { super(Material.FURNACE); } @@ -17,6 +19,7 @@ public class Furnace extends FurnaceAndDispenser { * * @param direction the direction the furnace's "opening" is facing */ + @Deprecated public Furnace(BlockFace direction) { this(); setFacingDirection(direction); @@ -31,6 +34,7 @@ public class Furnace extends FurnaceAndDispenser { super(type); } + @Deprecated public Furnace(final Material type) { super(type); } @@ -54,6 +58,7 @@ public class Furnace extends FurnaceAndDispenser { } @Override + @Deprecated public Furnace clone() { return (Furnace) super.clone(); } diff --git a/src/main/java/org/bukkit/material/FurnaceAndDispenser.java b/src/main/java/org/bukkit/material/FurnaceAndDispenser.java index 3665479..7d83c57 100644 --- a/src/main/java/org/bukkit/material/FurnaceAndDispenser.java +++ b/src/main/java/org/bukkit/material/FurnaceAndDispenser.java @@ -5,6 +5,7 @@ import org.bukkit.Material; /** * Represents a furnace or dispenser, two types of directional containers */ +@Deprecated public class FurnaceAndDispenser extends DirectionalContainer { /** @@ -16,6 +17,7 @@ public class FurnaceAndDispenser extends DirectionalContainer { super(type); } + @Deprecated public FurnaceAndDispenser(final Material type) { super(type); } @@ -39,6 +41,7 @@ public class FurnaceAndDispenser extends DirectionalContainer { } @Override + @Deprecated public FurnaceAndDispenser clone() { return (FurnaceAndDispenser) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Gate.java b/src/main/java/org/bukkit/material/Gate.java index 8adc1cf..03d1491 100644 --- a/src/main/java/org/bukkit/material/Gate.java +++ b/src/main/java/org/bukkit/material/Gate.java @@ -7,11 +7,17 @@ import org.bukkit.block.BlockFace; * Represents a fence gate */ public class Gate extends MaterialData implements Directional, Openable { + @Deprecated private static final byte OPEN_BIT = 0x4; + @Deprecated private static final byte DIR_BIT = 0x3; + @Deprecated private static final byte GATE_SOUTH = 0x0; + @Deprecated private static final byte GATE_WEST = 0x1; + @Deprecated private static final byte GATE_NORTH = 0x2; + @Deprecated private static final byte GATE_EAST = 0x3; public Gate() { diff --git a/src/main/java/org/bukkit/material/Ladder.java b/src/main/java/org/bukkit/material/Ladder.java index 09862bf..6347a47 100644 --- a/src/main/java/org/bukkit/material/Ladder.java +++ b/src/main/java/org/bukkit/material/Ladder.java @@ -6,7 +6,9 @@ import org.bukkit.Material; /** * Represents Ladder data */ +@Deprecated public class Ladder extends SimpleAttachableMaterialData { + @Deprecated public Ladder() { super(Material.LADDER); } @@ -20,6 +22,7 @@ public class Ladder extends SimpleAttachableMaterialData { super(type); } + @Deprecated public Ladder(final Material type) { super(type); } @@ -47,6 +50,7 @@ public class Ladder extends SimpleAttachableMaterialData { * * @return BlockFace attached to */ + @Deprecated public BlockFace getAttachedFace() { byte data = getData(); @@ -70,6 +74,7 @@ public class Ladder extends SimpleAttachableMaterialData { /** * Sets the direction this ladder is facing */ + @Deprecated public void setFacingDirection(BlockFace face) { byte data = (byte) 0x0; @@ -96,6 +101,7 @@ public class Ladder extends SimpleAttachableMaterialData { } @Override + @Deprecated public Ladder clone() { return (Ladder) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Leaves.java b/src/main/java/org/bukkit/material/Leaves.java index 97ba382..dfd7f53 100644 --- a/src/main/java/org/bukkit/material/Leaves.java +++ b/src/main/java/org/bukkit/material/Leaves.java @@ -6,11 +6,14 @@ import org.bukkit.TreeSpecies; /** * Represents the different types of leaves. */ +@Deprecated public class Leaves extends MaterialData { + @Deprecated public Leaves() { super(Material.LEAVES); } + @Deprecated public Leaves(TreeSpecies species) { this(); setSpecies(species); @@ -25,6 +28,7 @@ public class Leaves extends MaterialData { super(type); } + @Deprecated public Leaves(final Material type) { super(type); } @@ -52,6 +56,7 @@ public class Leaves extends MaterialData { * * @return TreeSpecies of this leave */ + @Deprecated public TreeSpecies getSpecies() { return TreeSpecies.getByData((byte) (getData() & 3)); } @@ -61,16 +66,19 @@ public class Leaves extends MaterialData { * * @param species New species of this leave */ + @Deprecated public void setSpecies(TreeSpecies species) { setData(species.getData()); } @Override + @Deprecated public String toString() { return getSpecies() + " " + super.toString(); } @Override + @Deprecated public Leaves clone() { return (Leaves) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Lever.java b/src/main/java/org/bukkit/material/Lever.java index b88c536..41552e9 100644 --- a/src/main/java/org/bukkit/material/Lever.java +++ b/src/main/java/org/bukkit/material/Lever.java @@ -6,7 +6,9 @@ import org.bukkit.Material; /** * Represents a lever */ +@Deprecated public class Lever extends SimpleAttachableMaterialData implements Redstone { + @Deprecated public Lever() { super(Material.LEVER); } @@ -20,6 +22,7 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone { super(type); } + @Deprecated public Lever(final Material type) { super(type); } @@ -48,6 +51,7 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone { * * @return true if powered, otherwise false */ + @Deprecated public boolean isPowered() { return (getData() & 0x8) == 0x8; } @@ -57,6 +61,7 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone { * * @param isPowered whether the lever should be powered or not */ + @Deprecated public void setPowered(boolean isPowered) { setData((byte) (isPowered ? (getData() | 0x8) : (getData() & ~0x8))); } @@ -66,6 +71,7 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone { * * @return BlockFace attached to */ + @Deprecated public BlockFace getAttachedFace() { byte data = (byte) (getData() & 0x7); @@ -98,6 +104,7 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone { /** * Sets the direction this lever is pointing in */ + @Deprecated public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0x8); BlockFace attach = getAttachedFace(); @@ -149,11 +156,13 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone { } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getFacing() + " " + (isPowered() ? "" : "NOT ") + "POWERED"; } @Override + @Deprecated public Lever clone() { return (Lever) super.clone(); } diff --git a/src/main/java/org/bukkit/material/LongGrass.java b/src/main/java/org/bukkit/material/LongGrass.java index e8d1f38..e758c84 100644 --- a/src/main/java/org/bukkit/material/LongGrass.java +++ b/src/main/java/org/bukkit/material/LongGrass.java @@ -6,11 +6,14 @@ import org.bukkit.Material; /** * Represents the different types of long grasses. */ +@Deprecated public class LongGrass extends MaterialData { + @Deprecated public LongGrass() { super(Material.LONG_GRASS); } + @Deprecated public LongGrass(GrassSpecies species) { this(); setSpecies(species); @@ -25,6 +28,7 @@ public class LongGrass extends MaterialData { super(type); } + @Deprecated public LongGrass(final Material type) { super(type); } @@ -52,6 +56,7 @@ public class LongGrass extends MaterialData { * * @return GrassSpecies of this grass */ + @Deprecated public GrassSpecies getSpecies() { return GrassSpecies.getByData(getData()); } @@ -61,16 +66,19 @@ public class LongGrass extends MaterialData { * * @param species New species of this grass */ + @Deprecated public void setSpecies(GrassSpecies species) { setData(species.getData()); } @Override + @Deprecated public String toString() { return getSpecies() + " " + super.toString(); } @Override + @Deprecated public LongGrass clone() { return (LongGrass) super.clone(); } diff --git a/src/main/java/org/bukkit/material/MaterialData.java b/src/main/java/org/bukkit/material/MaterialData.java index ad7675f..e1042a4 100644 --- a/src/main/java/org/bukkit/material/MaterialData.java +++ b/src/main/java/org/bukkit/material/MaterialData.java @@ -7,7 +7,9 @@ import org.bukkit.Material; * Handles specific metadata for certain items or blocks */ public class MaterialData implements Cloneable { + @Deprecated private final int type; + @Deprecated private byte data = 0; /** diff --git a/src/main/java/org/bukkit/material/MonsterEggs.java b/src/main/java/org/bukkit/material/MonsterEggs.java index d8b627b..ed4a09a 100644 --- a/src/main/java/org/bukkit/material/MonsterEggs.java +++ b/src/main/java/org/bukkit/material/MonsterEggs.java @@ -10,6 +10,7 @@ import org.bukkit.Material; */ public class MonsterEggs extends TexturedMaterial { + @Deprecated private static final List textures = new ArrayList(); static { textures.add(Material.STONE); diff --git a/src/main/java/org/bukkit/material/Mushroom.java b/src/main/java/org/bukkit/material/Mushroom.java index 716d378..3fe54e3 100644 --- a/src/main/java/org/bukkit/material/Mushroom.java +++ b/src/main/java/org/bukkit/material/Mushroom.java @@ -11,14 +11,23 @@ import org.bukkit.block.BlockFace; * Represents a huge mushroom block */ public class Mushroom extends MaterialData { + @Deprecated private static final byte SHROOM_NONE = 0; + @Deprecated private static final byte SHROOM_STEM = 10; + @Deprecated private static final byte NORTH_LIMIT = 4; + @Deprecated private static final byte SOUTH_LIMIT = 6; + @Deprecated private static final byte EAST_WEST_LIMIT = 3; + @Deprecated private static final byte EAST_REMAINDER = 0; + @Deprecated private static final byte WEST_REMAINDER = 1; + @Deprecated private static final byte NORTH_SOUTH_MOD = 3; + @Deprecated private static final byte EAST_WEST_MOD = 1; public Mushroom(Material shroom) { diff --git a/src/main/java/org/bukkit/material/NetherWarts.java b/src/main/java/org/bukkit/material/NetherWarts.java index 99ea3f0..1f1fb16 100644 --- a/src/main/java/org/bukkit/material/NetherWarts.java +++ b/src/main/java/org/bukkit/material/NetherWarts.java @@ -6,11 +6,14 @@ import org.bukkit.NetherWartsState; /** * Represents nether wart */ +@Deprecated public class NetherWarts extends MaterialData { + @Deprecated public NetherWarts() { super(Material.NETHER_WARTS); } + @Deprecated public NetherWarts(NetherWartsState state) { this(); setState(state); @@ -25,6 +28,7 @@ public class NetherWarts extends MaterialData { super(type); } + @Deprecated public NetherWarts(final Material type) { super (type); } @@ -52,6 +56,7 @@ public class NetherWarts extends MaterialData { * * @return NetherWartsState of this nether wart */ + @Deprecated public NetherWartsState getState() { switch (getData()) { case 0: @@ -70,6 +75,7 @@ public class NetherWarts extends MaterialData { * * @param state New growth state of this nether wart */ + @Deprecated public void setState(NetherWartsState state) { switch (state) { case SEEDED: @@ -88,11 +94,13 @@ public class NetherWarts extends MaterialData { } @Override + @Deprecated public String toString() { return getState() + " " + super.toString(); } @Override + @Deprecated public NetherWarts clone() { return (NetherWarts) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Openable.java b/src/main/java/org/bukkit/material/Openable.java index 0ae54f9..3e2f724 100644 --- a/src/main/java/org/bukkit/material/Openable.java +++ b/src/main/java/org/bukkit/material/Openable.java @@ -1,5 +1,6 @@ package org.bukkit.material; +@Deprecated public interface Openable { /** diff --git a/src/main/java/org/bukkit/material/PistonBaseMaterial.java b/src/main/java/org/bukkit/material/PistonBaseMaterial.java index f3586dc..1c42645 100644 --- a/src/main/java/org/bukkit/material/PistonBaseMaterial.java +++ b/src/main/java/org/bukkit/material/PistonBaseMaterial.java @@ -6,6 +6,7 @@ import org.bukkit.block.BlockFace; /** * Material data for the piston base block */ +@Deprecated public class PistonBaseMaterial extends MaterialData implements Directional, Redstone { /** * @@ -16,6 +17,7 @@ public class PistonBaseMaterial extends MaterialData implements Directional, Red super(type); } + @Deprecated public PistonBaseMaterial(final Material type) { super(type); } @@ -38,6 +40,7 @@ public class PistonBaseMaterial extends MaterialData implements Directional, Red super(type, data); } + @Deprecated public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0x8); @@ -61,6 +64,7 @@ public class PistonBaseMaterial extends MaterialData implements Directional, Red setData(data); } + @Deprecated public BlockFace getFacing() { byte dir = (byte) (getData() & 7); @@ -82,6 +86,7 @@ public class PistonBaseMaterial extends MaterialData implements Directional, Red } } + @Deprecated public boolean isPowered() { return (getData() & 0x8) == 0x8; } @@ -91,6 +96,7 @@ public class PistonBaseMaterial extends MaterialData implements Directional, Red * * @param powered true if the piston is extended & powered, or false */ + @Deprecated public void setPowered(boolean powered) { setData((byte) (powered ? (getData() | 0x8) : (getData() & ~0x8))); } @@ -100,11 +106,13 @@ public class PistonBaseMaterial extends MaterialData implements Directional, Red * * @return true if this piston is "sticky", or false */ + @Deprecated public boolean isSticky() { return this.getItemType() == Material.PISTON_STICKY_BASE; } @Override + @Deprecated public PistonBaseMaterial clone() { return (PistonBaseMaterial) super.clone(); } diff --git a/src/main/java/org/bukkit/material/PistonExtensionMaterial.java b/src/main/java/org/bukkit/material/PistonExtensionMaterial.java index 85dee84..c1dd192 100644 --- a/src/main/java/org/bukkit/material/PistonExtensionMaterial.java +++ b/src/main/java/org/bukkit/material/PistonExtensionMaterial.java @@ -6,6 +6,7 @@ import org.bukkit.block.BlockFace; /** * Material data for the piston extension block */ +@Deprecated public class PistonExtensionMaterial extends MaterialData implements Attachable { /** * @@ -16,6 +17,7 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable super(type); } + @Deprecated public PistonExtensionMaterial(final Material type) { super(type); } @@ -38,6 +40,7 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable super(type, data); } + @Deprecated public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0x8); @@ -61,6 +64,7 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable setData(data); } + @Deprecated public BlockFace getFacing() { byte dir = (byte) (getData() & 7); @@ -87,6 +91,7 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable * * @return true if this piston is "sticky", or false */ + @Deprecated public boolean isSticky() { return (getData() & 8) == 8; } @@ -96,15 +101,18 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable * * @param sticky true if sticky, otherwise false */ + @Deprecated public void setSticky(boolean sticky) { setData((byte) (sticky ? (getData() | 0x8) : (getData() & ~0x8))); } + @Deprecated public BlockFace getAttachedFace() { return getFacing().getOppositeFace(); } @Override + @Deprecated public PistonExtensionMaterial clone() { return (PistonExtensionMaterial) super.clone(); } diff --git a/src/main/java/org/bukkit/material/PoweredRail.java b/src/main/java/org/bukkit/material/PoweredRail.java index 444e53b..6d68f8d 100644 --- a/src/main/java/org/bukkit/material/PoweredRail.java +++ b/src/main/java/org/bukkit/material/PoweredRail.java @@ -5,7 +5,9 @@ import org.bukkit.Material; /** * Represents a powered rail */ +@Deprecated public class PoweredRail extends ExtendedRails implements Redstone { + @Deprecated public PoweredRail() { super(Material.POWERED_RAIL); } @@ -19,6 +21,7 @@ public class PoweredRail extends ExtendedRails implements Redstone { super(type); } + @Deprecated public PoweredRail(final Material type) { super(type); } @@ -41,6 +44,7 @@ public class PoweredRail extends ExtendedRails implements Redstone { super(type, data); } + @Deprecated public boolean isPowered() { return (getData() & 0x8) == 0x8; } @@ -50,11 +54,13 @@ public class PoweredRail extends ExtendedRails implements Redstone { * * @param isPowered whether or not the rail is powered */ + @Deprecated public void setPowered(boolean isPowered) { setData((byte) (isPowered ? (getData() | 0x8) : (getData() & ~0x8))); } @Override + @Deprecated public PoweredRail clone() { return (PoweredRail) super.clone(); } diff --git a/src/main/java/org/bukkit/material/PressurePlate.java b/src/main/java/org/bukkit/material/PressurePlate.java index 8c3bc75..48b2796 100644 --- a/src/main/java/org/bukkit/material/PressurePlate.java +++ b/src/main/java/org/bukkit/material/PressurePlate.java @@ -5,7 +5,9 @@ import org.bukkit.Material; /** * Represents a pressure plate */ +@Deprecated public class PressurePlate extends MaterialData implements PressureSensor { + @Deprecated public PressurePlate() { super(Material.WOOD_PLATE); } @@ -19,6 +21,7 @@ public class PressurePlate extends MaterialData implements PressureSensor { super(type); } + @Deprecated public PressurePlate(Material type) { super(type); } @@ -41,16 +44,19 @@ public class PressurePlate extends MaterialData implements PressureSensor { super(type, data); } + @Deprecated public boolean isPressed() { return getData() == 0x1; } @Override + @Deprecated public String toString() { return super.toString() + (isPressed() ? " PRESSED" : ""); } @Override + @Deprecated public PressurePlate clone() { return (PressurePlate) super.clone(); } diff --git a/src/main/java/org/bukkit/material/PressureSensor.java b/src/main/java/org/bukkit/material/PressureSensor.java index de20bd3..0b67298 100644 --- a/src/main/java/org/bukkit/material/PressureSensor.java +++ b/src/main/java/org/bukkit/material/PressureSensor.java @@ -1,5 +1,7 @@ package org.bukkit.material; +@Deprecated public interface PressureSensor { + @Deprecated public boolean isPressed(); } diff --git a/src/main/java/org/bukkit/material/Pumpkin.java b/src/main/java/org/bukkit/material/Pumpkin.java index d6ca83c..99e8a37 100644 --- a/src/main/java/org/bukkit/material/Pumpkin.java +++ b/src/main/java/org/bukkit/material/Pumpkin.java @@ -6,8 +6,10 @@ import org.bukkit.block.BlockFace; /** * Represents a pumpkin. */ +@Deprecated public class Pumpkin extends MaterialData implements Directional { + @Deprecated public Pumpkin() { super(Material.PUMPKIN); } @@ -17,6 +19,7 @@ public class Pumpkin extends MaterialData implements Directional { * * @param direction the direction the pumkin's face is facing */ + @Deprecated public Pumpkin(BlockFace direction) { this(); setFacingDirection(direction); @@ -31,6 +34,7 @@ public class Pumpkin extends MaterialData implements Directional { super(type); } + @Deprecated public Pumpkin(final Material type) { super(type); } @@ -53,10 +57,12 @@ public class Pumpkin extends MaterialData implements Directional { super(type, data); } + @Deprecated public boolean isLit() { return getItemType() == Material.JACK_O_LANTERN; } + @Deprecated public void setFacingDirection(BlockFace face) { byte data; @@ -81,6 +87,7 @@ public class Pumpkin extends MaterialData implements Directional { setData(data); } + @Deprecated public BlockFace getFacing() { byte data = getData(); @@ -101,11 +108,13 @@ public class Pumpkin extends MaterialData implements Directional { } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getFacing() + " " + (isLit() ? "" : "NOT ") + "LIT"; } @Override + @Deprecated public Pumpkin clone() { return (Pumpkin) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Rails.java b/src/main/java/org/bukkit/material/Rails.java index 74fd95a..6d8c385 100644 --- a/src/main/java/org/bukkit/material/Rails.java +++ b/src/main/java/org/bukkit/material/Rails.java @@ -6,8 +6,10 @@ import org.bukkit.block.BlockFace; /** * Represents minecart rails. */ +@Deprecated public class Rails extends MaterialData { + @Deprecated public Rails() { super(Material.RAILS); } @@ -21,6 +23,7 @@ public class Rails extends MaterialData { super(type); } + @Deprecated public Rails(final Material type) { super(type); } @@ -46,6 +49,7 @@ public class Rails extends MaterialData { /** * @return the whether this track is set on a slope */ + @Deprecated public boolean isOnSlope() { byte d = getConvertedData(); @@ -55,6 +59,7 @@ public class Rails extends MaterialData { /** * @return the whether this track is set as a curve */ + @Deprecated public boolean isCurve() { byte d = getConvertedData(); @@ -68,6 +73,7 @@ public class Rails extends MaterialData { * is the ascending direction if the track is set on a slope. If it is * set as a curve, the corner of the track is returned. */ + @Deprecated public BlockFace getDirection() { byte d = getConvertedData(); @@ -106,6 +112,7 @@ public class Rails extends MaterialData { } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getDirection() + (isCurve() ? " on a curve" : (isOnSlope() ? " on a slope" : "")); } @@ -133,6 +140,7 @@ public class Rails extends MaterialData { * @param face the direction the track should be facing * @param isOnSlope whether or not the track should be on a slope */ + @Deprecated public void setDirection(BlockFace face, boolean isOnSlope) { switch (face) { case EAST: @@ -170,6 +178,7 @@ public class Rails extends MaterialData { } @Override + @Deprecated public Rails clone() { return (Rails) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Redstone.java b/src/main/java/org/bukkit/material/Redstone.java index 3e46603..623c9fd 100644 --- a/src/main/java/org/bukkit/material/Redstone.java +++ b/src/main/java/org/bukkit/material/Redstone.java @@ -3,6 +3,7 @@ package org.bukkit.material; /** * Indicated a Material that may carry or create a Redstone current */ +@Deprecated public interface Redstone { /** @@ -11,5 +12,6 @@ public interface Redstone { * * @return true if powered, otherwise false */ + @Deprecated public boolean isPowered(); } diff --git a/src/main/java/org/bukkit/material/RedstoneTorch.java b/src/main/java/org/bukkit/material/RedstoneTorch.java index 76a3ddd..b1650f0 100644 --- a/src/main/java/org/bukkit/material/RedstoneTorch.java +++ b/src/main/java/org/bukkit/material/RedstoneTorch.java @@ -5,7 +5,9 @@ import org.bukkit.Material; /** * Represents a redstone torch */ +@Deprecated public class RedstoneTorch extends Torch implements Redstone { + @Deprecated public RedstoneTorch() { super(Material.REDSTONE_TORCH_ON); } @@ -19,6 +21,7 @@ public class RedstoneTorch extends Torch implements Redstone { super(type); } + @Deprecated public RedstoneTorch(final Material type) { super(type); } @@ -47,16 +50,19 @@ public class RedstoneTorch extends Torch implements Redstone { * * @return true if powered, otherwise false */ + @Deprecated public boolean isPowered() { return getItemType() == Material.REDSTONE_TORCH_ON; } @Override + @Deprecated public String toString() { return super.toString() + " " + (isPowered() ? "" : "NOT ") + "POWERED"; } @Override + @Deprecated public RedstoneTorch clone() { return (RedstoneTorch) super.clone(); } diff --git a/src/main/java/org/bukkit/material/RedstoneWire.java b/src/main/java/org/bukkit/material/RedstoneWire.java index b429af0..1fcbba4 100644 --- a/src/main/java/org/bukkit/material/RedstoneWire.java +++ b/src/main/java/org/bukkit/material/RedstoneWire.java @@ -5,7 +5,9 @@ import org.bukkit.Material; /** * Represents redstone wire */ +@Deprecated public class RedstoneWire extends MaterialData implements Redstone { + @Deprecated public RedstoneWire() { super(Material.REDSTONE_WIRE); } @@ -19,6 +21,7 @@ public class RedstoneWire extends MaterialData implements Redstone { super(type); } + @Deprecated public RedstoneWire(final Material type) { super(type); } @@ -47,16 +50,19 @@ public class RedstoneWire extends MaterialData implements Redstone { * * @return true if powered, otherwise false */ + @Deprecated public boolean isPowered() { return getData() > 0; } @Override + @Deprecated public String toString() { return super.toString() + " " + (isPowered() ? "" : "NOT ") + "POWERED"; } @Override + @Deprecated public RedstoneWire clone() { return (RedstoneWire) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Sandstone.java b/src/main/java/org/bukkit/material/Sandstone.java index 26cbbb5..21db3c3 100644 --- a/src/main/java/org/bukkit/material/Sandstone.java +++ b/src/main/java/org/bukkit/material/Sandstone.java @@ -6,11 +6,14 @@ import org.bukkit.SandstoneType; /** * Represents the different types of sandstone. */ +@Deprecated public class Sandstone extends MaterialData { + @Deprecated public Sandstone() { super(Material.SANDSTONE); } + @Deprecated public Sandstone(SandstoneType type) { this(); setType(type); @@ -25,6 +28,7 @@ public class Sandstone extends MaterialData { super(type); } + @Deprecated public Sandstone(final Material type) { super(type); } @@ -52,6 +56,7 @@ public class Sandstone extends MaterialData { * * @return SandstoneType of this sandstone */ + @Deprecated public SandstoneType getType() { return SandstoneType.getByData(getData()); } @@ -61,16 +66,19 @@ public class Sandstone extends MaterialData { * * @param type New type of this sandstone */ + @Deprecated public void setType(SandstoneType type) { setData(type.getData()); } @Override + @Deprecated public String toString() { return getType() + " " + super.toString(); } @Override + @Deprecated public Sandstone clone() { return (Sandstone) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Sign.java b/src/main/java/org/bukkit/material/Sign.java index e8da7aa..3565d16 100644 --- a/src/main/java/org/bukkit/material/Sign.java +++ b/src/main/java/org/bukkit/material/Sign.java @@ -6,7 +6,9 @@ import org.bukkit.Material; /** * MaterialData for signs */ +@Deprecated public class Sign extends MaterialData implements Attachable { + @Deprecated public Sign() { super(Material.SIGN_POST); } @@ -20,6 +22,7 @@ public class Sign extends MaterialData implements Attachable { super(type); } + @Deprecated public Sign(final Material type) { super(type); } @@ -48,6 +51,7 @@ public class Sign extends MaterialData implements Attachable { * @return true if this sign is attached to a wall, false if set on top of * a block */ + @Deprecated public boolean isWallSign() { return getItemType() == Material.WALL_SIGN; } @@ -57,6 +61,7 @@ public class Sign extends MaterialData implements Attachable { * * @return BlockFace attached to */ + @Deprecated public BlockFace getAttachedFace() { if (isWallSign()) { byte data = getData(); @@ -86,6 +91,7 @@ public class Sign extends MaterialData implements Attachable { * * @return BlockFace indicating where this sign is facing */ + @Deprecated public BlockFace getFacing() { byte data = getData(); @@ -146,6 +152,7 @@ public class Sign extends MaterialData implements Attachable { } } + @Deprecated public void setFacingDirection(BlockFace face) { byte data; @@ -239,11 +246,13 @@ public class Sign extends MaterialData implements Attachable { } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getFacing(); } @Override + @Deprecated public Sign clone() { return (Sign) super.clone(); } diff --git a/src/main/java/org/bukkit/material/SimpleAttachableMaterialData.java b/src/main/java/org/bukkit/material/SimpleAttachableMaterialData.java index b5703c6..abf1b7f 100644 --- a/src/main/java/org/bukkit/material/SimpleAttachableMaterialData.java +++ b/src/main/java/org/bukkit/material/SimpleAttachableMaterialData.java @@ -6,6 +6,7 @@ import org.bukkit.block.BlockFace; /** * Simple utility class for attachable MaterialData subclasses */ +@Deprecated public abstract class SimpleAttachableMaterialData extends MaterialData implements Attachable { /** @@ -17,16 +18,19 @@ public abstract class SimpleAttachableMaterialData extends MaterialData implemen super(type); } + @Deprecated public SimpleAttachableMaterialData(int type, BlockFace direction) { this(type); setFacingDirection(direction); } + @Deprecated public SimpleAttachableMaterialData(Material type, BlockFace direction) { this(type); setFacingDirection(direction); } + @Deprecated public SimpleAttachableMaterialData(Material type) { super(type); } @@ -49,17 +53,20 @@ public abstract class SimpleAttachableMaterialData extends MaterialData implemen super(type, data); } + @Deprecated public BlockFace getFacing() { BlockFace attachedFace = getAttachedFace(); return attachedFace == null ? null : attachedFace.getOppositeFace(); } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getFacing(); } @Override + @Deprecated public SimpleAttachableMaterialData clone() { return (SimpleAttachableMaterialData) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Skull.java b/src/main/java/org/bukkit/material/Skull.java index 6e0d71f..aa2a3bf 100644 --- a/src/main/java/org/bukkit/material/Skull.java +++ b/src/main/java/org/bukkit/material/Skull.java @@ -6,7 +6,9 @@ import org.bukkit.block.BlockFace; /** * Represents a skull. */ +@Deprecated public class Skull extends MaterialData implements Directional { + @Deprecated public Skull() { super(Material.SKULL); } @@ -16,6 +18,7 @@ public class Skull extends MaterialData implements Directional { * * @param direction the direction the skull's face is facing */ + @Deprecated public Skull(BlockFace direction) { this(); setFacingDirection(direction); @@ -30,6 +33,7 @@ public class Skull extends MaterialData implements Directional { super(type); } + @Deprecated public Skull(final Material type) { super(type); } @@ -52,6 +56,7 @@ public class Skull extends MaterialData implements Directional { super(type, data); } + @Deprecated public void setFacingDirection(BlockFace face) { int data; @@ -80,6 +85,7 @@ public class Skull extends MaterialData implements Directional { setData((byte) data); } + @Deprecated public BlockFace getFacing() { int data = getData(); @@ -103,11 +109,13 @@ public class Skull extends MaterialData implements Directional { } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getFacing(); } @Override + @Deprecated public Skull clone() { return (Skull) super.clone(); } diff --git a/src/main/java/org/bukkit/material/SmoothBrick.java b/src/main/java/org/bukkit/material/SmoothBrick.java index b7ab607..5c027b6 100644 --- a/src/main/java/org/bukkit/material/SmoothBrick.java +++ b/src/main/java/org/bukkit/material/SmoothBrick.java @@ -10,6 +10,7 @@ import org.bukkit.Material; */ public class SmoothBrick extends TexturedMaterial { + @Deprecated private static final List textures = new ArrayList(); static { textures.add(Material.STONE); diff --git a/src/main/java/org/bukkit/material/SpawnEgg.java b/src/main/java/org/bukkit/material/SpawnEgg.java index ed973c5..0895457 100644 --- a/src/main/java/org/bukkit/material/SpawnEgg.java +++ b/src/main/java/org/bukkit/material/SpawnEgg.java @@ -6,8 +6,10 @@ import org.bukkit.entity.EntityType; /** * Represents a spawn egg that can be used to spawn mobs */ +@Deprecated public class SpawnEgg extends MaterialData { + @Deprecated public SpawnEgg() { super(Material.MONSTER_EGG); } @@ -30,6 +32,7 @@ public class SpawnEgg extends MaterialData { super(Material.MONSTER_EGG, data); } + @Deprecated public SpawnEgg(EntityType type) { this(); setSpawnedType(type); @@ -40,6 +43,7 @@ public class SpawnEgg extends MaterialData { * * @return The entity type. */ + @Deprecated public EntityType getSpawnedType() { return EntityType.fromId(getData()); } @@ -49,16 +53,19 @@ public class SpawnEgg extends MaterialData { * * @param type The entity type. */ + @Deprecated public void setSpawnedType(EntityType type) { setData((byte) type.getTypeId()); } @Override + @Deprecated public String toString() { return "SPAWN EGG{" + getSpawnedType() + "}"; } @Override + @Deprecated public SpawnEgg clone() { return (SpawnEgg) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Stairs.java b/src/main/java/org/bukkit/material/Stairs.java index 1f73c77..1984b72 100644 --- a/src/main/java/org/bukkit/material/Stairs.java +++ b/src/main/java/org/bukkit/material/Stairs.java @@ -6,6 +6,7 @@ import org.bukkit.block.BlockFace; /** * Represents stairs. */ +@Deprecated public class Stairs extends MaterialData implements Directional { /** @@ -17,6 +18,7 @@ public class Stairs extends MaterialData implements Directional { super(type); } + @Deprecated public Stairs(final Material type) { super(type); } @@ -42,6 +44,7 @@ public class Stairs extends MaterialData implements Directional { /** * @return the direction the stairs ascend towards */ + @Deprecated public BlockFace getAscendingDirection() { byte data = getData(); @@ -64,6 +67,7 @@ public class Stairs extends MaterialData implements Directional { /** * @return the direction the stairs descend towards */ + @Deprecated public BlockFace getDescendingDirection() { return getAscendingDirection().getOppositeFace(); } @@ -71,6 +75,7 @@ public class Stairs extends MaterialData implements Directional { /** * Set the direction the stair part of the block is facing */ + @Deprecated public void setFacingDirection(BlockFace face) { byte data; @@ -99,6 +104,7 @@ public class Stairs extends MaterialData implements Directional { /** * @return the direction the stair part of the block is facing */ + @Deprecated public BlockFace getFacing() { return getDescendingDirection(); } @@ -108,6 +114,7 @@ public class Stairs extends MaterialData implements Directional { * * @return true if inverted (top half), false if normal (bottom half) */ + @Deprecated public boolean isInverted() { return ((getData() & 0x4) != 0); } @@ -118,6 +125,7 @@ public class Stairs extends MaterialData implements Directional { * @param inv - true if step is inverted (top half), false if step is * normal (bottom half) */ + @Deprecated public void setInverted(boolean inv) { int dat = getData() & 0x3; if (inv) { @@ -127,11 +135,13 @@ public class Stairs extends MaterialData implements Directional { } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getFacing() + (isInverted()?" inverted":""); } @Override + @Deprecated public Stairs clone() { return (Stairs) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Step.java b/src/main/java/org/bukkit/material/Step.java index 605f817..882293a 100644 --- a/src/main/java/org/bukkit/material/Step.java +++ b/src/main/java/org/bukkit/material/Step.java @@ -9,6 +9,7 @@ import org.bukkit.Material; * Represents the different types of steps. */ public class Step extends TexturedMaterial { + @Deprecated private static final List textures = new ArrayList(); static { textures.add(Material.STONE); diff --git a/src/main/java/org/bukkit/material/TexturedMaterial.java b/src/main/java/org/bukkit/material/TexturedMaterial.java index cfd971b..1399f9e 100644 --- a/src/main/java/org/bukkit/material/TexturedMaterial.java +++ b/src/main/java/org/bukkit/material/TexturedMaterial.java @@ -7,8 +7,10 @@ import org.bukkit.Material; /** * Represents textured materials like steps and smooth bricks */ +@Deprecated public abstract class TexturedMaterial extends MaterialData { + @Deprecated public TexturedMaterial(Material m) { super(m); } @@ -46,6 +48,7 @@ public abstract class TexturedMaterial extends MaterialData { * * @return a list of possible textures for this block */ + @Deprecated public abstract List getTextures(); /** @@ -53,6 +56,7 @@ public abstract class TexturedMaterial extends MaterialData { * * @return Material of this block */ + @Deprecated public Material getMaterial() { int n = getTextureIndex(); if (n > getTextures().size() - 1) { @@ -68,6 +72,7 @@ public abstract class TexturedMaterial extends MaterialData { * @param material * New material of this block */ + @Deprecated public void setMaterial(Material material) { if (getTextures().contains(material)) { setTextureIndex(getTextures().indexOf(material)); @@ -99,11 +104,13 @@ public abstract class TexturedMaterial extends MaterialData { } @Override + @Deprecated public String toString() { return getMaterial() + " " + super.toString(); } @Override + @Deprecated public TexturedMaterial clone() { return (TexturedMaterial) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Torch.java b/src/main/java/org/bukkit/material/Torch.java index f03b3cf..3fc3b73 100644 --- a/src/main/java/org/bukkit/material/Torch.java +++ b/src/main/java/org/bukkit/material/Torch.java @@ -6,7 +6,9 @@ import org.bukkit.Material; /** * MaterialData for torches */ +@Deprecated public class Torch extends SimpleAttachableMaterialData { + @Deprecated public Torch() { super(Material.TORCH); } @@ -20,6 +22,7 @@ public class Torch extends SimpleAttachableMaterialData { super(type); } + @Deprecated public Torch(final Material type) { super(type); } @@ -47,6 +50,7 @@ public class Torch extends SimpleAttachableMaterialData { * * @return BlockFace attached to */ + @Deprecated public BlockFace getAttachedFace() { byte data = getData(); @@ -69,6 +73,7 @@ public class Torch extends SimpleAttachableMaterialData { } } + @Deprecated public void setFacingDirection(BlockFace face) { byte data; @@ -98,6 +103,7 @@ public class Torch extends SimpleAttachableMaterialData { } @Override + @Deprecated public Torch clone() { return (Torch) super.clone(); } diff --git a/src/main/java/org/bukkit/material/TrapDoor.java b/src/main/java/org/bukkit/material/TrapDoor.java index bd4bcc2..6bb9807 100644 --- a/src/main/java/org/bukkit/material/TrapDoor.java +++ b/src/main/java/org/bukkit/material/TrapDoor.java @@ -6,7 +6,9 @@ import org.bukkit.block.BlockFace; /** * Represents a trap door */ +@Deprecated public class TrapDoor extends SimpleAttachableMaterialData implements Openable { + @Deprecated public TrapDoor() { super(Material.TRAP_DOOR); } @@ -20,6 +22,7 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable { super(type); } + @Deprecated public TrapDoor(final Material type) { super(type); } @@ -42,10 +45,12 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable { super(type, data); } + @Deprecated public boolean isOpen() { return ((getData() & 0x4) == 0x4); } + @Deprecated public void setOpen(boolean isOpen) { byte data = getData(); @@ -63,6 +68,7 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable { * * @return true if inverted (top half), false if normal (bottom half) */ + @Deprecated public boolean isInverted() { return ((getData() & 0x8) != 0); } @@ -72,6 +78,7 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable { * * @param inv - true if inverted (top half), false if normal (bottom half) */ + @Deprecated public void setInverted(boolean inv) { int dat = getData() & 0x7; if (inv) { @@ -80,6 +87,7 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable { setData((byte) dat); } + @Deprecated public BlockFace getAttachedFace() { byte data = (byte) (getData() & 0x3); @@ -101,6 +109,7 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable { } + @Deprecated public void setFacingDirection(BlockFace face) { byte data = (byte) (getData() & 0xC); @@ -120,11 +129,13 @@ public class TrapDoor extends SimpleAttachableMaterialData implements Openable { } @Override + @Deprecated public String toString() { return (isOpen() ? "OPEN " : "CLOSED ") + super.toString() + " with hinges set " + getAttachedFace() + (isInverted() ? " inverted" : ""); } @Override + @Deprecated public TrapDoor clone() { return (TrapDoor) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Tree.java b/src/main/java/org/bukkit/material/Tree.java index fe56872..c6f78a4 100644 --- a/src/main/java/org/bukkit/material/Tree.java +++ b/src/main/java/org/bukkit/material/Tree.java @@ -7,16 +7,20 @@ import org.bukkit.block.BlockFace; /** * Represents the different types of Trees. */ +@Deprecated public class Tree extends MaterialData { + @Deprecated public Tree() { super(Material.LOG); } + @Deprecated public Tree(TreeSpecies species) { this(); setSpecies(species); } + @Deprecated public Tree(TreeSpecies species, BlockFace dir) { this(); setSpecies(species); @@ -32,6 +36,7 @@ public class Tree extends MaterialData { super(type); } + @Deprecated public Tree(final Material type) { super(type); } @@ -59,6 +64,7 @@ public class Tree extends MaterialData { * * @return TreeSpecies of this tree */ + @Deprecated public TreeSpecies getSpecies() { return TreeSpecies.getByData((byte) (getData() & 0x3)); } @@ -68,6 +74,7 @@ public class Tree extends MaterialData { * * @param species New species of this tree */ + @Deprecated public void setSpecies(TreeSpecies species) { setData((byte) ((getData() & 0xC) | species.getData())); } @@ -83,6 +90,7 @@ public class Tree extends MaterialData { *
  • BlockFace.SELF (directionless) * */ + @Deprecated public BlockFace getDirection() { switch ((getData() >> 2) & 0x3) { case 0: // Up-down @@ -101,6 +109,7 @@ public class Tree extends MaterialData { * * @param dir - direction of end of log (BlockFace.SELF for no direction) */ + @Deprecated public void setDirection(BlockFace dir) { int dat; switch (dir) { @@ -125,11 +134,13 @@ public class Tree extends MaterialData { } @Override + @Deprecated public String toString() { return getSpecies() + " " + getDirection() + " " + super.toString(); } @Override + @Deprecated public Tree clone() { return (Tree) super.clone(); } diff --git a/src/main/java/org/bukkit/material/Tripwire.java b/src/main/java/org/bukkit/material/Tripwire.java index 583860b..c509eec 100644 --- a/src/main/java/org/bukkit/material/Tripwire.java +++ b/src/main/java/org/bukkit/material/Tripwire.java @@ -5,8 +5,10 @@ import org.bukkit.Material; /** * Represents the tripwire */ +@Deprecated public class Tripwire extends MaterialData { + @Deprecated public Tripwire() { super(Material.TRIPWIRE); } @@ -34,6 +36,7 @@ public class Tripwire extends MaterialData { * * @return true if activated, false if not */ + @Deprecated public boolean isActivated() { return (getData() & 0x4) != 0; } @@ -43,6 +46,7 @@ public class Tripwire extends MaterialData { * * @param act - true if activated, false if not */ + @Deprecated public void setActivated(boolean act) { int dat = getData() & (0x8 | 0x3); if (act) { @@ -56,6 +60,7 @@ public class Tripwire extends MaterialData { * * @return true if object activating tripwire, false if not */ + @Deprecated public boolean isObjectTriggering() { return (getData() & 0x1) != 0; } @@ -65,6 +70,7 @@ public class Tripwire extends MaterialData { * * @param trig - true if object activating tripwire, false if not */ + @Deprecated public void setObjectTriggering(boolean trig) { int dat = getData() & 0xE; if (trig) { @@ -74,11 +80,13 @@ public class Tripwire extends MaterialData { } @Override + @Deprecated public Tripwire clone() { return (Tripwire) super.clone(); } @Override + @Deprecated public String toString() { return super.toString() + (isActivated()?" Activated":"") + (isObjectTriggering()?" Triggered":""); } diff --git a/src/main/java/org/bukkit/material/TripwireHook.java b/src/main/java/org/bukkit/material/TripwireHook.java index 7ad2d2a..4590bff 100644 --- a/src/main/java/org/bukkit/material/TripwireHook.java +++ b/src/main/java/org/bukkit/material/TripwireHook.java @@ -6,8 +6,10 @@ import org.bukkit.block.BlockFace; /** * Represents the tripwire hook */ +@Deprecated public class TripwireHook extends SimpleAttachableMaterialData implements Redstone { + @Deprecated public TripwireHook() { super(Material.TRIPWIRE_HOOK); } @@ -30,6 +32,7 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto super(type, data); } + @Deprecated public TripwireHook(BlockFace dir) { this(); setFacingDirection(dir); @@ -40,6 +43,7 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto * * @return true if connected, false if not */ + @Deprecated public boolean isConnected() { return (getData() & 0x4) != 0; } @@ -49,6 +53,7 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto * * @param connected - true if connected, false if not */ + @Deprecated public void setConnected(boolean connected) { int dat = getData() & (0x8 | 0x3); if (connected) { @@ -62,6 +67,7 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto * * @return true if activated, false if not */ + @Deprecated public boolean isActivated() { return (getData() & 0x8) != 0; } @@ -71,6 +77,7 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto * * @param act - true if activated, false if not */ + @Deprecated public void setActivated(boolean act) { int dat = getData() & (0x4 | 0x3); if (act) { @@ -79,6 +86,7 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto setData((byte) dat); } + @Deprecated public void setFacingDirection(BlockFace face) { int dat = getData() & 0xC; switch (face) { @@ -98,6 +106,7 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto setData((byte) dat); } + @Deprecated public BlockFace getAttachedFace() { switch (getData() & 0x3) { case 0: @@ -112,16 +121,19 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto return null; } + @Deprecated public boolean isPowered() { return isActivated(); } @Override + @Deprecated public TripwireHook clone() { return (TripwireHook) super.clone(); } @Override + @Deprecated public String toString() { return super.toString() + " facing " + getFacing() + (isActivated()?" Activated":"") + (isConnected()?" Connected":""); } diff --git a/src/main/java/org/bukkit/material/Vine.java b/src/main/java/org/bukkit/material/Vine.java index a4f7ad5..84331ae 100644 --- a/src/main/java/org/bukkit/material/Vine.java +++ b/src/main/java/org/bukkit/material/Vine.java @@ -10,9 +10,13 @@ import org.bukkit.block.BlockFace; * Represents a vine */ public class Vine extends MaterialData { + @Deprecated private static final int VINE_NORTH = 0x4; + @Deprecated private static final int VINE_EAST = 0x8; + @Deprecated private static final int VINE_WEST = 0x2; + @Deprecated private static final int VINE_SOUTH = 0x1; EnumSet possibleFaces = EnumSet.of(BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST); diff --git a/src/main/java/org/bukkit/material/WoodenStep.java b/src/main/java/org/bukkit/material/WoodenStep.java index 9584e25..962f812 100644 --- a/src/main/java/org/bukkit/material/WoodenStep.java +++ b/src/main/java/org/bukkit/material/WoodenStep.java @@ -6,8 +6,10 @@ import org.bukkit.TreeSpecies; /** * Represents the different types of wooden steps. */ +@Deprecated public class WoodenStep extends MaterialData { + @Deprecated public WoodenStep() { super(Material.WOOD_STEP); } @@ -21,11 +23,13 @@ public class WoodenStep extends MaterialData { super(type); } + @Deprecated public WoodenStep(TreeSpecies species) { this(); setSpecies(species); } + @Deprecated public WoodenStep(TreeSpecies species, boolean inv) { this(); setSpecies(species); @@ -55,6 +59,7 @@ public class WoodenStep extends MaterialData { * * @return TreeSpecies of this tree */ + @Deprecated public TreeSpecies getSpecies() { return TreeSpecies.getByData((byte) (getData() & 0x3)); } @@ -64,6 +69,7 @@ public class WoodenStep extends MaterialData { * * @param species New species of this tree */ + @Deprecated public void setSpecies(TreeSpecies species) { setData((byte) ((getData() & 0xC) | species.getData())); } @@ -73,6 +79,7 @@ public class WoodenStep extends MaterialData { * * @return true if inverted (top half), false if normal (bottom half) */ + @Deprecated public boolean isInverted() { return ((getData() & 0x8) != 0); } @@ -83,6 +90,7 @@ public class WoodenStep extends MaterialData { * @param inv - true if step is inverted (top half), false if step is * normal (bottom half) */ + @Deprecated public void setInverted(boolean inv) { int dat = getData() & 0x7; if (inv) { @@ -92,11 +100,13 @@ public class WoodenStep extends MaterialData { } @Override + @Deprecated public WoodenStep clone() { return (WoodenStep) super.clone(); } @Override + @Deprecated public String toString() { return super.toString() + " " + getSpecies() + (isInverted()?" inverted":""); } diff --git a/src/main/java/org/bukkit/material/Wool.java b/src/main/java/org/bukkit/material/Wool.java index 8115bdc..e5d319a 100644 --- a/src/main/java/org/bukkit/material/Wool.java +++ b/src/main/java/org/bukkit/material/Wool.java @@ -6,11 +6,14 @@ import org.bukkit.Material; /** * Represents a Wool/Cloth block */ +@Deprecated public class Wool extends MaterialData implements Colorable { + @Deprecated public Wool() { super(Material.WOOL); } + @Deprecated public Wool(DyeColor color) { this(); setColor(color); @@ -25,6 +28,7 @@ public class Wool extends MaterialData implements Colorable { super(type); } + @Deprecated public Wool(final Material type) { super(type); } @@ -52,6 +56,7 @@ public class Wool extends MaterialData implements Colorable { * * @return DyeColor of this dye */ + @Deprecated public DyeColor getColor() { return DyeColor.getByWoolData(getData()); } @@ -61,16 +66,19 @@ public class Wool extends MaterialData implements Colorable { * * @param color New color of this dye */ + @Deprecated public void setColor(DyeColor color) { setData(color.getWoolData()); } @Override + @Deprecated public String toString() { return getColor() + " " + super.toString(); } @Override + @Deprecated public Wool clone() { return (Wool) super.clone(); } diff --git a/src/main/java/org/bukkit/metadata/FixedMetadataValue.java b/src/main/java/org/bukkit/metadata/FixedMetadataValue.java index bce6f00..744c472 100644 --- a/src/main/java/org/bukkit/metadata/FixedMetadataValue.java +++ b/src/main/java/org/bukkit/metadata/FixedMetadataValue.java @@ -13,11 +13,13 @@ import java.util.concurrent.Callable; * overrides all the implementation methods. it is possible that in the future * that the inheritance hierarchy may change. */ +@Deprecated public class FixedMetadataValue extends LazyMetadataValue { /** * Store the internal value that is represented by this fixed value. */ + @Deprecated private final Object internalValue; /** @@ -26,17 +28,20 @@ public class FixedMetadataValue extends LazyMetadataValue { * @param owningPlugin the {@link Plugin} that created this metadata value * @param value the value assigned to this metadata value */ + @Deprecated public FixedMetadataValue(Plugin owningPlugin, final Object value) { super(owningPlugin); this.internalValue = value; } @Override + @Deprecated public void invalidate() { } @Override + @Deprecated public Object value() { return internalValue; } diff --git a/src/main/java/org/bukkit/metadata/LazyMetadataValue.java b/src/main/java/org/bukkit/metadata/LazyMetadataValue.java index a9546e5..40327fb 100644 --- a/src/main/java/org/bukkit/metadata/LazyMetadataValue.java +++ b/src/main/java/org/bukkit/metadata/LazyMetadataValue.java @@ -17,10 +17,15 @@ import org.bukkit.plugin.Plugin; * level. Once invalidated, the LazyMetadataValue will recompute its value * when asked. */ +@Deprecated public class LazyMetadataValue extends MetadataValueAdapter implements MetadataValue { + @Deprecated private Callable lazyValue; + @Deprecated private CacheStrategy cacheStrategy; + @Deprecated private SoftReference internalValue; + @Deprecated private static final Object ACTUALLY_NULL = new Object(); /** @@ -31,6 +36,7 @@ public class LazyMetadataValue extends MetadataValueAdapter implements MetadataV * value. * @param lazyValue the lazy value assigned to this metadata value. */ + @Deprecated public LazyMetadataValue(Plugin owningPlugin, Callable lazyValue) { this(owningPlugin, CacheStrategy.CACHE_AFTER_FIRST_EVAL, lazyValue); } @@ -44,6 +50,7 @@ public class LazyMetadataValue extends MetadataValueAdapter implements MetadataV * value. * @param lazyValue the lazy value assigned to this metadata value. */ + @Deprecated public LazyMetadataValue(Plugin owningPlugin, CacheStrategy cacheStrategy, Callable lazyValue) { super(owningPlugin); Validate.notNull(cacheStrategy, "cacheStrategy cannot be null"); @@ -54,13 +61,16 @@ public class LazyMetadataValue extends MetadataValueAdapter implements MetadataV } /** - * Protected special constructor used by FixedMetadataValue to bypass + * @Deprecated + * protected special constructor used by FixedMetadataValue to bypass * standard setup. */ + @Deprecated protected LazyMetadataValue(Plugin owningPlugin) { super(owningPlugin); } + @Deprecated public Object value() { eval(); Object value = internalValue.get(); @@ -76,6 +86,7 @@ public class LazyMetadataValue extends MetadataValueAdapter implements MetadataV * @throws MetadataEvaluationException if computing the metadata value * fails. */ + @Deprecated private synchronized void eval() throws MetadataEvaluationException { if (cacheStrategy == CacheStrategy.NEVER_CACHE || internalValue.get() == null) { try { @@ -90,6 +101,7 @@ public class LazyMetadataValue extends MetadataValueAdapter implements MetadataV } } + @Deprecated public synchronized void invalidate() { if (cacheStrategy != CacheStrategy.CACHE_ETERNALLY) { internalValue.clear(); @@ -99,6 +111,7 @@ public class LazyMetadataValue extends MetadataValueAdapter implements MetadataV /** * Describes possible caching strategies for metadata. */ + @Deprecated public enum CacheStrategy { /** * Once the metadata value has been evaluated, do not re-evaluate the diff --git a/src/main/java/org/bukkit/metadata/MetadataConversionException.java b/src/main/java/org/bukkit/metadata/MetadataConversionException.java index a3def46..556194f 100644 --- a/src/main/java/org/bukkit/metadata/MetadataConversionException.java +++ b/src/main/java/org/bukkit/metadata/MetadataConversionException.java @@ -6,6 +6,7 @@ package org.bukkit.metadata; * data type. */ @SuppressWarnings("serial") +@Deprecated public class MetadataConversionException extends RuntimeException { MetadataConversionException(String message) { super(message); diff --git a/src/main/java/org/bukkit/metadata/MetadataEvaluationException.java b/src/main/java/org/bukkit/metadata/MetadataEvaluationException.java index 918e7c8..84a37a8 100644 --- a/src/main/java/org/bukkit/metadata/MetadataEvaluationException.java +++ b/src/main/java/org/bukkit/metadata/MetadataEvaluationException.java @@ -6,6 +6,7 @@ package org.bukkit.metadata; * originating exception will be included as this exception's cause. */ @SuppressWarnings("serial") +@Deprecated public class MetadataEvaluationException extends RuntimeException { MetadataEvaluationException(Throwable cause) { super(cause); diff --git a/src/main/java/org/bukkit/metadata/MetadataStore.java b/src/main/java/org/bukkit/metadata/MetadataStore.java index 700d0bf..ea5ede5 100644 --- a/src/main/java/org/bukkit/metadata/MetadataStore.java +++ b/src/main/java/org/bukkit/metadata/MetadataStore.java @@ -4,6 +4,7 @@ import org.bukkit.plugin.Plugin; import java.util.List; +@Deprecated public interface MetadataStore { /** * Adds a metadata value to an object. @@ -14,6 +15,7 @@ public interface MetadataStore { * @throws IllegalArgumentException If value is null, or the owning plugin * is null */ + @Deprecated public void setMetadata(T subject, String metadataKey, MetadataValue newMetadataValue); /** @@ -25,6 +27,7 @@ public interface MetadataStore { * @return A list of values, one for each plugin that has set the * requested value. */ + @Deprecated public List getMetadata(T subject, String metadataKey); /** @@ -35,6 +38,7 @@ public interface MetadataStore { * @param metadataKey the unique metadata key being queried. * @return the existence of the metadataKey within subject. */ + @Deprecated public boolean hasMetadata(T subject, String metadataKey); /** @@ -46,6 +50,7 @@ public interface MetadataStore { * @param owningPlugin the plugin attempting to remove a metadata item. * @throws IllegalArgumentException If plugin is null */ + @Deprecated public void removeMetadata(T subject, String metadataKey, Plugin owningPlugin); /** @@ -56,5 +61,6 @@ public interface MetadataStore { * @param owningPlugin the plugin requesting the invalidation. * @throws IllegalArgumentException If plugin is null */ + @Deprecated public void invalidateAll(Plugin owningPlugin); } diff --git a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java index 093c144..13fedf0 100644 --- a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +++ b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java @@ -5,7 +5,9 @@ import org.bukkit.plugin.Plugin; import java.util.*; +@Deprecated public abstract class MetadataStoreBase { + @Deprecated private Map> metadataMap = new HashMap>(); /** @@ -30,6 +32,7 @@ public abstract class MetadataStoreBase { * @throws IllegalArgumentException If value is null, or the owning plugin * is null */ + @Deprecated public synchronized void setMetadata(T subject, String metadataKey, MetadataValue newMetadataValue) { Validate.notNull(newMetadataValue, "Value cannot be null"); Plugin owningPlugin = newMetadataValue.getOwningPlugin(); @@ -53,6 +56,7 @@ public abstract class MetadataStoreBase { * requested value. * @see MetadataStore#getMetadata(Object, String) */ + @Deprecated public synchronized List getMetadata(T subject, String metadataKey) { String key = disambiguate(subject, metadataKey); if (metadataMap.containsKey(key)) { @@ -71,6 +75,7 @@ public abstract class MetadataStoreBase { * @param metadataKey the unique metadata key being queried. * @return the existence of the metadataKey within subject. */ + @Deprecated public synchronized boolean hasMetadata(T subject, String metadataKey) { String key = disambiguate(subject, metadataKey); return metadataMap.containsKey(key); @@ -87,6 +92,7 @@ public abstract class MetadataStoreBase { * org.bukkit.plugin.Plugin) * @throws IllegalArgumentException If plugin is null */ + @Deprecated public synchronized void removeMetadata(T subject, String metadataKey, Plugin owningPlugin) { Validate.notNull(owningPlugin, "Plugin cannot be null"); String key = disambiguate(subject, metadataKey); @@ -110,6 +116,7 @@ public abstract class MetadataStoreBase { * @see MetadataStore#invalidateAll(org.bukkit.plugin.Plugin) * @throws IllegalArgumentException If plugin is null */ + @Deprecated public synchronized void invalidateAll(Plugin owningPlugin) { Validate.notNull(owningPlugin, "Plugin cannot be null"); for (Map values : metadataMap.values()) { @@ -132,5 +139,6 @@ public abstract class MetadataStoreBase { * @param metadataKey The name identifying the metadata value. * @return a unique metadata key for the given subject. */ + @Deprecated protected abstract String disambiguate(T subject, String metadataKey); } diff --git a/src/main/java/org/bukkit/metadata/MetadataValue.java b/src/main/java/org/bukkit/metadata/MetadataValue.java index eded8c0..a4de0e0 100644 --- a/src/main/java/org/bukkit/metadata/MetadataValue.java +++ b/src/main/java/org/bukkit/metadata/MetadataValue.java @@ -2,6 +2,7 @@ package org.bukkit.metadata; import org.bukkit.plugin.Plugin; +@Deprecated public interface MetadataValue { /** @@ -9,6 +10,7 @@ public interface MetadataValue { * * @return the metadata value. */ + @Deprecated public Object value(); /** @@ -16,6 +18,7 @@ public interface MetadataValue { * * @return the value as an int. */ + @Deprecated public int asInt(); /** @@ -23,6 +26,7 @@ public interface MetadataValue { * * @return the value as a float. */ + @Deprecated public float asFloat(); /** @@ -30,6 +34,7 @@ public interface MetadataValue { * * @return the value as a double. */ + @Deprecated public double asDouble(); /** @@ -37,6 +42,7 @@ public interface MetadataValue { * * @return the value as a long. */ + @Deprecated public long asLong(); /** @@ -44,6 +50,7 @@ public interface MetadataValue { * * @return the value as a short. */ + @Deprecated public short asShort(); /** @@ -51,6 +58,7 @@ public interface MetadataValue { * * @return the value as a byte. */ + @Deprecated public byte asByte(); /** @@ -58,6 +66,7 @@ public interface MetadataValue { * * @return the value as a boolean. */ + @Deprecated public boolean asBoolean(); /** @@ -65,6 +74,7 @@ public interface MetadataValue { * * @return the value as a string. */ + @Deprecated public String asString(); /** @@ -73,11 +83,13 @@ public interface MetadataValue { * @return the plugin that owns this metadata value. This should never be * null. */ + @Deprecated public Plugin getOwningPlugin(); /** * Invalidates this metadata item, forcing it to recompute when next * accessed. */ + @Deprecated public void invalidate(); } diff --git a/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java b/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java index bbc3da8..aae0f61 100644 --- a/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java +++ b/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java @@ -13,42 +13,53 @@ import org.bukkit.util.NumberConversions; * writing an implementation of MetadataValue is as simple as implementing * value() and invalidate(). */ +@Deprecated public abstract class MetadataValueAdapter implements MetadataValue { + @Deprecated protected final WeakReference owningPlugin; + @Deprecated protected MetadataValueAdapter(Plugin owningPlugin) { Validate.notNull(owningPlugin, "owningPlugin cannot be null"); this.owningPlugin = new WeakReference(owningPlugin); } + @Deprecated public Plugin getOwningPlugin() { return owningPlugin.get(); } + @Deprecated public int asInt() { return NumberConversions.toInt(value()); } + @Deprecated public float asFloat() { return NumberConversions.toFloat(value()); } + @Deprecated public double asDouble() { return NumberConversions.toDouble(value()); } + @Deprecated public long asLong() { return NumberConversions.toLong(value()); } + @Deprecated public short asShort() { return NumberConversions.toShort(value()); } + @Deprecated public byte asByte() { return NumberConversions.toByte(value()); } + @Deprecated public boolean asBoolean() { Object value = value(); if (value instanceof Boolean) { @@ -66,6 +77,7 @@ public abstract class MetadataValueAdapter implements MetadataValue { return value != null; } + @Deprecated public String asString() { Object value = value(); diff --git a/src/main/java/org/bukkit/metadata/Metadatable.java b/src/main/java/org/bukkit/metadata/Metadatable.java index b47cf2b..ad10888 100644 --- a/src/main/java/org/bukkit/metadata/Metadatable.java +++ b/src/main/java/org/bukkit/metadata/Metadatable.java @@ -8,6 +8,7 @@ import java.util.List; * This interface is implemented by all objects that can provide metadata * about themselves. */ +@Deprecated public interface Metadatable { /** * Sets a metadata value in the implementing object's metadata store. @@ -17,6 +18,7 @@ public interface Metadatable { * @throws IllegalArgumentException If value is null, or the owning plugin * is null */ + @Deprecated public void setMetadata(String metadataKey, MetadataValue newMetadataValue); /** @@ -27,6 +29,7 @@ public interface Metadatable { * @return A list of values, one for each plugin that has set the * requested value. */ + @Deprecated public List getMetadata(String metadataKey); /** @@ -36,6 +39,7 @@ public interface Metadatable { * @param metadataKey the unique metadata key being queried. * @return the existence of the metadataKey within subject. */ + @Deprecated public boolean hasMetadata(String metadataKey); /** @@ -48,5 +52,6 @@ public interface Metadatable { * other values will be left untouched. * @throws IllegalArgumentException If plugin is null */ + @Deprecated public void removeMetadata(String metadataKey, Plugin owningPlugin); } diff --git a/src/main/java/org/bukkit/permissions/Permissible.java b/src/main/java/org/bukkit/permissions/Permissible.java index 5cd3cff..9337333 100644 --- a/src/main/java/org/bukkit/permissions/Permissible.java +++ b/src/main/java/org/bukkit/permissions/Permissible.java @@ -6,6 +6,7 @@ import org.bukkit.plugin.Plugin; /** * Represents an object that may be assigned permissions */ +@Deprecated public interface Permissible extends ServerOperator { /** @@ -15,6 +16,7 @@ public interface Permissible extends ServerOperator { * @param name Name of the permission * @return true if the permission is set, otherwise false */ + @Deprecated public boolean isPermissionSet(String name); /** @@ -24,6 +26,7 @@ public interface Permissible extends ServerOperator { * @param perm Permission to check * @return true if the permission is set, otherwise false */ + @Deprecated public boolean isPermissionSet(Permission perm); /** @@ -35,6 +38,7 @@ public interface Permissible extends ServerOperator { * @param name Name of the permission * @return Value of the permission */ + @Deprecated public boolean hasPermission(String name); /** @@ -46,6 +50,7 @@ public interface Permissible extends ServerOperator { * @param perm Permission to get * @return Value of the permission */ + @Deprecated public boolean hasPermission(Permission perm); /** @@ -58,6 +63,7 @@ public interface Permissible extends ServerOperator { * @param value Value of the permission * @return The PermissionAttachment that was just created */ + @Deprecated public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value); /** @@ -67,6 +73,7 @@ public interface Permissible extends ServerOperator { * or disabled * @return The PermissionAttachment that was just created */ + @Deprecated public PermissionAttachment addAttachment(Plugin plugin); /** @@ -81,6 +88,7 @@ public interface Permissible extends ServerOperator { * after * @return The PermissionAttachment that was just created */ + @Deprecated public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks); /** @@ -93,6 +101,7 @@ public interface Permissible extends ServerOperator { * after * @return The PermissionAttachment that was just created */ + @Deprecated public PermissionAttachment addAttachment(Plugin plugin, int ticks); /** @@ -102,6 +111,7 @@ public interface Permissible extends ServerOperator { * @throws IllegalArgumentException Thrown when the specified attachment * isn't part of this object */ + @Deprecated public void removeAttachment(PermissionAttachment attachment); /** @@ -110,6 +120,7 @@ public interface Permissible extends ServerOperator { *

    * This should very rarely need to be called from a plugin. */ + @Deprecated public void recalculatePermissions(); /** @@ -118,5 +129,6 @@ public interface Permissible extends ServerOperator { * * @return Set of currently effective permissions */ + @Deprecated public Set getEffectivePermissions(); } diff --git a/src/main/java/org/bukkit/permissions/PermissibleBase.java b/src/main/java/org/bukkit/permissions/PermissibleBase.java index 3b95061..b1f90e4 100644 --- a/src/main/java/org/bukkit/permissions/PermissibleBase.java +++ b/src/main/java/org/bukkit/permissions/PermissibleBase.java @@ -13,12 +13,18 @@ import org.bukkit.plugin.Plugin; /** * Base Permissible for use in any Permissible object via proxy or extension */ +@Deprecated public class PermissibleBase implements Permissible { + @Deprecated private ServerOperator opable = null; + @Deprecated private Permissible parent = this; + @Deprecated private final List attachments = new LinkedList(); + @Deprecated private final Map permissions = new HashMap(); + @Deprecated public PermissibleBase(ServerOperator opable) { this.opable = opable; @@ -29,6 +35,7 @@ public class PermissibleBase implements Permissible { recalculatePermissions(); } + @Deprecated public boolean isOp() { if (opable == null) { return false; @@ -37,6 +44,7 @@ public class PermissibleBase implements Permissible { } } + @Deprecated public void setOp(boolean value) { if (opable == null) { throw new UnsupportedOperationException("Cannot change op value as no ServerOperator is set"); @@ -45,6 +53,7 @@ public class PermissibleBase implements Permissible { } } + @Deprecated public boolean isPermissionSet(String name) { if (name == null) { throw new IllegalArgumentException("Permission name cannot be null"); @@ -53,6 +62,7 @@ public class PermissibleBase implements Permissible { return permissions.containsKey(name.toLowerCase()); } + @Deprecated public boolean isPermissionSet(Permission perm) { if (perm == null) { throw new IllegalArgumentException("Permission cannot be null"); @@ -61,6 +71,7 @@ public class PermissibleBase implements Permissible { return isPermissionSet(perm.getName()); } + @Deprecated public boolean hasPermission(String inName) { if (inName == null) { throw new IllegalArgumentException("Permission name cannot be null"); @@ -81,6 +92,7 @@ public class PermissibleBase implements Permissible { } } + @Deprecated public boolean hasPermission(Permission perm) { if (perm == null) { throw new IllegalArgumentException("Permission cannot be null"); @@ -94,6 +106,7 @@ public class PermissibleBase implements Permissible { return perm.getDefault().getValue(isOp()); } + @Deprecated public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { if (name == null) { throw new IllegalArgumentException("Permission name cannot be null"); @@ -111,6 +124,7 @@ public class PermissibleBase implements Permissible { return result; } + @Deprecated public PermissionAttachment addAttachment(Plugin plugin) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -126,6 +140,7 @@ public class PermissibleBase implements Permissible { return result; } + @Deprecated public void removeAttachment(PermissionAttachment attachment) { if (attachment == null) { throw new IllegalArgumentException("Attachment cannot be null"); @@ -145,6 +160,7 @@ public class PermissibleBase implements Permissible { } } + @Deprecated public void recalculatePermissions() { clearPermissions(); Set defaults = Bukkit.getServer().getPluginManager().getDefaultPermissions(isOp()); @@ -162,6 +178,7 @@ public class PermissibleBase implements Permissible { } } + @Deprecated public synchronized void clearPermissions() { Set perms = permissions.keySet(); @@ -175,6 +192,7 @@ public class PermissibleBase implements Permissible { permissions.clear(); } + @Deprecated private void calculateChildPermissions(Map children, boolean invert, PermissionAttachment attachment) { Set keys = children.keySet(); @@ -192,6 +210,7 @@ public class PermissibleBase implements Permissible { } } + @Deprecated public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) { if (name == null) { throw new IllegalArgumentException("Permission name cannot be null"); @@ -210,6 +229,7 @@ public class PermissibleBase implements Permissible { return result; } + @Deprecated public PermissionAttachment addAttachment(Plugin plugin, int ticks) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -228,17 +248,22 @@ public class PermissibleBase implements Permissible { } } + @Deprecated public Set getEffectivePermissions() { return new HashSet(permissions.values()); } + @Deprecated private class RemoveAttachmentRunnable implements Runnable { + @Deprecated private PermissionAttachment attachment; + @Deprecated public RemoveAttachmentRunnable(PermissionAttachment attachment) { this.attachment = attachment; } + @Deprecated public void run() { attachment.remove(); } diff --git a/src/main/java/org/bukkit/permissions/Permission.java b/src/main/java/org/bukkit/permissions/Permission.java index 26f6f2b..820644d 100644 --- a/src/main/java/org/bukkit/permissions/Permission.java +++ b/src/main/java/org/bukkit/permissions/Permission.java @@ -15,42 +15,56 @@ import org.bukkit.plugin.PluginManager; * Represents a unique permission that may be attached to a {@link * Permissible} */ +@Deprecated public class Permission { + @Deprecated public static final PermissionDefault DEFAULT_PERMISSION = PermissionDefault.OP; + @Deprecated private final String name; + @Deprecated private final Map children = new LinkedHashMap(); + @Deprecated private PermissionDefault defaultValue = DEFAULT_PERMISSION; + @Deprecated private String description; + @Deprecated public Permission(String name) { this(name, null, null, null); } + @Deprecated public Permission(String name, String description) { this(name, description, null, null); } + @Deprecated public Permission(String name, PermissionDefault defaultValue) { this(name, null, defaultValue, null); } + @Deprecated public Permission(String name, String description, PermissionDefault defaultValue) { this(name, description, defaultValue, null); } + @Deprecated public Permission(String name, Map children) { this(name, null, null, children); } + @Deprecated public Permission(String name, String description, Map children) { this(name, description, null, children); } + @Deprecated public Permission(String name, PermissionDefault defaultValue, Map children) { this(name, null, defaultValue, children); } + @Deprecated public Permission(String name, String description, PermissionDefault defaultValue, Map children) { this.name = name; this.description = (description == null) ? "" : description; @@ -71,6 +85,7 @@ public class Permission { * * @return Fully qualified name */ + @Deprecated public String getName() { return name; } @@ -83,6 +98,7 @@ public class Permission { * * @return Permission children */ + @Deprecated public Map getChildren() { return children; } @@ -92,6 +108,7 @@ public class Permission { * * @return Default value of this permission. */ + @Deprecated public PermissionDefault getDefault() { return defaultValue; } @@ -106,6 +123,7 @@ public class Permission { * * @param value The new default to set */ + @Deprecated public void setDefault(PermissionDefault value) { if (defaultValue == null) { throw new IllegalArgumentException("Default value cannot be null"); @@ -120,6 +138,7 @@ public class Permission { * * @return Brief description of this permission */ + @Deprecated public String getDescription() { return description; } @@ -132,6 +151,7 @@ public class Permission { * * @param value The new description to set */ + @Deprecated public void setDescription(String value) { if (value == null) { description = ""; @@ -148,6 +168,7 @@ public class Permission { * * @return Set containing permissibles with this permission */ + @Deprecated public Set getPermissibles() { return Bukkit.getServer().getPluginManager().getPermissionSubscriptions(name); } @@ -158,6 +179,7 @@ public class Permission { * This should be called after modifying the children, and is * automatically called after modifying the default value */ + @Deprecated public void recalculatePermissibles() { Set perms = getPermissibles(); @@ -178,6 +200,7 @@ public class Permission { * @param value The value to set this permission to * @return Parent permission it created or loaded */ + @Deprecated public Permission addParent(String name, boolean value) { PluginManager pm = Bukkit.getServer().getPluginManager(); String lname = name.toLowerCase(); @@ -200,6 +223,7 @@ public class Permission { * @param perm Parent permission to register with * @param value The value to set this permission to */ + @Deprecated public void addParent(Permission perm, boolean value) { perm.getChildren().put(getName(), value); perm.recalculatePermissibles(); @@ -224,6 +248,7 @@ public class Permission { * @param def Default permission value to use if missing * @return Permission object */ + @Deprecated public static List loadPermissions(Map data, String error, PermissionDefault def) { List result = new ArrayList(); @@ -254,6 +279,7 @@ public class Permission { * @param data Map of keys * @return Permission object */ + @Deprecated public static Permission loadPermission(String name, Map data) { return loadPermission(name, data, DEFAULT_PERMISSION, null); } @@ -277,6 +303,7 @@ public class Permission { * @param output A list to append any created child-Permissions to, may be null * @return Permission object */ + @Deprecated public static Permission loadPermission(String name, Map data, PermissionDefault def, List output) { Validate.notNull(name, "Name cannot be null"); Validate.notNull(data, "Data cannot be null"); @@ -316,6 +343,7 @@ public class Permission { return new Permission(name, desc, def, children); } + @Deprecated private static Map extractChildren(Map input, String name, PermissionDefault def, List output) { Map children = new LinkedHashMap(); diff --git a/src/main/java/org/bukkit/permissions/PermissionAttachment.java b/src/main/java/org/bukkit/permissions/PermissionAttachment.java index b2a44d5..f34a7ff 100644 --- a/src/main/java/org/bukkit/permissions/PermissionAttachment.java +++ b/src/main/java/org/bukkit/permissions/PermissionAttachment.java @@ -8,12 +8,18 @@ import org.bukkit.plugin.Plugin; * Holds information about a permission attachment on a {@link Permissible} * object */ +@Deprecated public class PermissionAttachment { + @Deprecated private PermissionRemovedExecutor removed; + @Deprecated private final Map permissions = new LinkedHashMap(); + @Deprecated private final Permissible permissible; + @Deprecated private final Plugin plugin; + @Deprecated public PermissionAttachment(Plugin plugin, Permissible Permissible) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -30,6 +36,7 @@ public class PermissionAttachment { * * @return Plugin responsible for this permission attachment */ + @Deprecated public Plugin getPlugin() { return plugin; } @@ -40,6 +47,7 @@ public class PermissionAttachment { * * @param ex Object to be called when this is removed */ + @Deprecated public void setRemovalCallback(PermissionRemovedExecutor ex) { removed = ex; } @@ -50,6 +58,7 @@ public class PermissionAttachment { * * @return Object to be called when this is removed */ + @Deprecated public PermissionRemovedExecutor getRemovalCallback() { return removed; } @@ -59,6 +68,7 @@ public class PermissionAttachment { * * @return Permissible containing this attachment */ + @Deprecated public Permissible getPermissible() { return permissible; } @@ -72,6 +82,7 @@ public class PermissionAttachment { * * @return Copy of all permissions and values expressed by this attachment */ + @Deprecated public Map getPermissions() { return new LinkedHashMap(permissions); } @@ -82,6 +93,7 @@ public class PermissionAttachment { * @param name Name of the permission * @param value New value of the permission */ + @Deprecated public void setPermission(String name, boolean value) { permissions.put(name.toLowerCase(), value); permissible.recalculatePermissions(); @@ -93,6 +105,7 @@ public class PermissionAttachment { * @param perm Permission to set * @param value New value of the permission */ + @Deprecated public void setPermission(Permission perm, boolean value) { setPermission(perm.getName(), value); } @@ -105,6 +118,7 @@ public class PermissionAttachment { * * @param name Name of the permission to remove */ + @Deprecated public void unsetPermission(String name) { permissions.remove(name.toLowerCase()); permissible.recalculatePermissions(); @@ -118,6 +132,7 @@ public class PermissionAttachment { * * @param perm Permission to remove */ + @Deprecated public void unsetPermission(Permission perm) { unsetPermission(perm.getName()); } @@ -128,6 +143,7 @@ public class PermissionAttachment { * @return true if the permissible was removed successfully, false if it * did not exist */ + @Deprecated public boolean remove() { try { permissible.removeAttachment(this); diff --git a/src/main/java/org/bukkit/permissions/PermissionAttachmentInfo.java b/src/main/java/org/bukkit/permissions/PermissionAttachmentInfo.java index 8e8e335..ca672a2 100644 --- a/src/main/java/org/bukkit/permissions/PermissionAttachmentInfo.java +++ b/src/main/java/org/bukkit/permissions/PermissionAttachmentInfo.java @@ -4,12 +4,18 @@ package org.bukkit.permissions; * Holds information on a permission and which {@link PermissionAttachment} * provides it */ +@Deprecated public class PermissionAttachmentInfo { + @Deprecated private final Permissible permissible; + @Deprecated private final String permission; + @Deprecated private final PermissionAttachment attachment; + @Deprecated private final boolean value; + @Deprecated public PermissionAttachmentInfo(Permissible permissible, String permission, PermissionAttachment attachment, boolean value) { if (permissible == null) { throw new IllegalArgumentException("Permissible may not be null"); @@ -28,6 +34,7 @@ public class PermissionAttachmentInfo { * * @return Permissible this permission is for */ + @Deprecated public Permissible getPermissible() { return permissible; } @@ -37,6 +44,7 @@ public class PermissionAttachmentInfo { * * @return Name of the permission */ + @Deprecated public String getPermission() { return permission; } @@ -47,6 +55,7 @@ public class PermissionAttachmentInfo { * * @return Attachment */ + @Deprecated public PermissionAttachment getAttachment() { return attachment; } @@ -56,6 +65,7 @@ public class PermissionAttachmentInfo { * * @return Value of the permission */ + @Deprecated public boolean getValue() { return value; } diff --git a/src/main/java/org/bukkit/permissions/PermissionDefault.java b/src/main/java/org/bukkit/permissions/PermissionDefault.java index 045e733..a304cf4 100644 --- a/src/main/java/org/bukkit/permissions/PermissionDefault.java +++ b/src/main/java/org/bukkit/permissions/PermissionDefault.java @@ -6,15 +6,19 @@ import java.util.Map; /** * Represents the possible default values for permissions */ +@Deprecated public enum PermissionDefault { TRUE("true"), FALSE("false"), OP("op", "isop", "operator", "isoperator", "admin", "isadmin"), NOT_OP("!op", "notop", "!operator", "notoperator", "!admin", "notadmin"); + @Deprecated private final String[] names; + @Deprecated private final static Map lookup = new HashMap(); + @Deprecated private PermissionDefault(String... names) { this.names = names; } @@ -26,6 +30,7 @@ public enum PermissionDefault { * @param op If the target is op * @return True if the default should be true, or false */ + @Deprecated public boolean getValue(boolean op) { switch (this) { case TRUE: @@ -47,11 +52,13 @@ public enum PermissionDefault { * @param name Name of the default * @return Specified value, or null if not found */ + @Deprecated public static PermissionDefault getByName(String name) { return lookup.get(name.toLowerCase().replaceAll("[^a-z!]", "")); } @Override + @Deprecated public String toString() { return names[0]; } diff --git a/src/main/java/org/bukkit/permissions/PermissionRemovedExecutor.java b/src/main/java/org/bukkit/permissions/PermissionRemovedExecutor.java index b13d008..6d96198 100644 --- a/src/main/java/org/bukkit/permissions/PermissionRemovedExecutor.java +++ b/src/main/java/org/bukkit/permissions/PermissionRemovedExecutor.java @@ -4,6 +4,7 @@ package org.bukkit.permissions; * Represents a class which is to be notified when a {@link * PermissionAttachment} is removed from a {@link Permissible} */ +@Deprecated public interface PermissionRemovedExecutor { /** @@ -12,5 +13,6 @@ public interface PermissionRemovedExecutor { * * @param attachment Attachment which was removed */ + @Deprecated public void attachmentRemoved(PermissionAttachment attachment); } diff --git a/src/main/java/org/bukkit/permissions/ServerOperator.java b/src/main/java/org/bukkit/permissions/ServerOperator.java index 26ed243..53086fb 100644 --- a/src/main/java/org/bukkit/permissions/ServerOperator.java +++ b/src/main/java/org/bukkit/permissions/ServerOperator.java @@ -6,6 +6,7 @@ import org.bukkit.entity.Player; * Represents an object that may become a server operator, such as a {@link * Player} */ +@Deprecated public interface ServerOperator { /** @@ -13,6 +14,7 @@ public interface ServerOperator { * * @return true if this is an operator, otherwise false */ + @Deprecated public boolean isOp(); /** @@ -20,5 +22,6 @@ public interface ServerOperator { * * @param value New operator value */ + @Deprecated public void setOp(boolean value); } diff --git a/src/main/java/org/bukkit/plugin/AuthorNagException.java b/src/main/java/org/bukkit/plugin/AuthorNagException.java index 6565a44..e859239 100644 --- a/src/main/java/org/bukkit/plugin/AuthorNagException.java +++ b/src/main/java/org/bukkit/plugin/AuthorNagException.java @@ -1,7 +1,9 @@ package org.bukkit.plugin; @SuppressWarnings("serial") +@Deprecated public class AuthorNagException extends RuntimeException { + @Deprecated private final String message; /** @@ -9,11 +11,13 @@ public class AuthorNagException extends RuntimeException { * * @param message Brief message explaining the cause of the exception */ + @Deprecated public AuthorNagException(final String message) { this.message = message; } @Override + @Deprecated public String getMessage() { return message; } diff --git a/src/main/java/org/bukkit/plugin/EventExecutor.java b/src/main/java/org/bukkit/plugin/EventExecutor.java index 3b2c99e..ac1180a 100644 --- a/src/main/java/org/bukkit/plugin/EventExecutor.java +++ b/src/main/java/org/bukkit/plugin/EventExecutor.java @@ -7,6 +7,8 @@ import org.bukkit.event.Listener; /** * Interface which defines the class for event call backs to plugins */ +@Deprecated public interface EventExecutor { + @Deprecated public void execute(Listener listener, Event event) throws EventException; } diff --git a/src/main/java/org/bukkit/plugin/IllegalPluginAccessException.java b/src/main/java/org/bukkit/plugin/IllegalPluginAccessException.java index b25447d..f12128c 100644 --- a/src/main/java/org/bukkit/plugin/IllegalPluginAccessException.java +++ b/src/main/java/org/bukkit/plugin/IllegalPluginAccessException.java @@ -5,12 +5,14 @@ package org.bukkit.plugin; * enabled */ @SuppressWarnings("serial") +@Deprecated public class IllegalPluginAccessException extends RuntimeException { /** * Creates a new instance of IllegalPluginAccessException * without detail message. */ + @Deprecated public IllegalPluginAccessException() {} /** @@ -19,6 +21,7 @@ public class IllegalPluginAccessException extends RuntimeException { * * @param msg the detail message. */ + @Deprecated public IllegalPluginAccessException(String msg) { super(msg); } diff --git a/src/main/java/org/bukkit/plugin/InvalidDescriptionException.java b/src/main/java/org/bukkit/plugin/InvalidDescriptionException.java index 0a77c2e..5e39243 100644 --- a/src/main/java/org/bukkit/plugin/InvalidDescriptionException.java +++ b/src/main/java/org/bukkit/plugin/InvalidDescriptionException.java @@ -3,7 +3,9 @@ package org.bukkit.plugin; /** * Thrown when attempting to load an invalid PluginDescriptionFile */ +@Deprecated public class InvalidDescriptionException extends Exception { + @Deprecated private static final long serialVersionUID = 5721389122281775896L; /** @@ -13,6 +15,7 @@ public class InvalidDescriptionException extends Exception { * @param message Brief message explaining the cause of the exception * @param cause Exception that triggered this Exception */ + @Deprecated public InvalidDescriptionException(final Throwable cause, final String message) { super(message, cause); } @@ -23,6 +26,7 @@ public class InvalidDescriptionException extends Exception { * * @param cause Exception that triggered this Exception */ + @Deprecated public InvalidDescriptionException(final Throwable cause) { super("Invalid plugin.yml", cause); } @@ -32,6 +36,7 @@ public class InvalidDescriptionException extends Exception { * * @param message Brief message explaining the cause of the exception */ + @Deprecated public InvalidDescriptionException(final String message) { super(message); } @@ -39,6 +44,7 @@ public class InvalidDescriptionException extends Exception { /** * Constructs a new InvalidDescriptionException */ + @Deprecated public InvalidDescriptionException() { super("Invalid plugin.yml"); } diff --git a/src/main/java/org/bukkit/plugin/InvalidPluginException.java b/src/main/java/org/bukkit/plugin/InvalidPluginException.java index 7ddf7b6..595dba1 100644 --- a/src/main/java/org/bukkit/plugin/InvalidPluginException.java +++ b/src/main/java/org/bukkit/plugin/InvalidPluginException.java @@ -3,7 +3,9 @@ package org.bukkit.plugin; /** * Thrown when attempting to load an invalid Plugin file */ +@Deprecated public class InvalidPluginException extends Exception { + @Deprecated private static final long serialVersionUID = -8242141640709409544L; /** @@ -11,6 +13,7 @@ public class InvalidPluginException extends Exception { * * @param cause Exception that triggered this Exception */ + @Deprecated public InvalidPluginException(final Throwable cause) { super(cause); } @@ -18,6 +21,7 @@ public class InvalidPluginException extends Exception { /** * Constructs a new InvalidPluginException */ + @Deprecated public InvalidPluginException() { } @@ -32,6 +36,7 @@ public class InvalidPluginException extends Exception { * getCause() method). (A null value is permitted, and indicates that * the cause is nonexistent or unknown.) */ + @Deprecated public InvalidPluginException(final String message, final Throwable cause) { super(message, cause); } @@ -43,6 +48,7 @@ public class InvalidPluginException extends Exception { * @param message TThe detail message is saved for later retrieval by the * getMessage() method. */ + @Deprecated public InvalidPluginException(final String message) { super(message); } diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java index 7bdc809..b3a9ae8 100644 --- a/src/main/java/org/bukkit/plugin/Plugin.java +++ b/src/main/java/org/bukkit/plugin/Plugin.java @@ -16,6 +16,7 @@ import com.avaje.ebean.EbeanServer; *

    * The use of {@link PluginBase} is recommended for actual Implementation */ +@Deprecated public interface Plugin extends TabExecutor { /** * Returns the folder that the plugin data's files are located in. The @@ -23,6 +24,7 @@ public interface Plugin extends TabExecutor { * * @return The folder */ + @Deprecated public File getDataFolder(); /** @@ -30,6 +32,7 @@ public interface Plugin extends TabExecutor { * * @return Contents of the plugin.yaml file */ + @Deprecated public PluginDescriptionFile getDescription(); /** @@ -41,6 +44,7 @@ public interface Plugin extends TabExecutor { * * @return Plugin configuration */ + @Deprecated public FileConfiguration getConfig(); /** @@ -49,11 +53,13 @@ public interface Plugin extends TabExecutor { * @param filename Filename of the resource * @return File if found, otherwise null */ + @Deprecated public InputStream getResource(String filename); /** * Saves the {@link FileConfiguration} retrievable by {@link #getConfig()}. */ + @Deprecated public void saveConfig(); /** @@ -62,6 +68,7 @@ public interface Plugin extends TabExecutor { * embedded in the plugin, an empty config.yml file is saved. This should * fail silently if the config.yml already exists. */ + @Deprecated public void saveDefaultConfig(); /** @@ -78,11 +85,13 @@ public interface Plugin extends TabExecutor { * @throws IllegalArgumentException if the resource path is null, empty, * or points to a nonexistent resource. */ + @Deprecated public void saveResource(String resourcePath, boolean replace); /** * Discards any data in {@link #getConfig()} and reloads from disk. */ + @Deprecated public void reloadConfig(); /** @@ -90,6 +99,7 @@ public interface Plugin extends TabExecutor { * * @return PluginLoader that controls this plugin */ + @Deprecated public PluginLoader getPluginLoader(); /** @@ -97,6 +107,7 @@ public interface Plugin extends TabExecutor { * * @return Server running this plugin */ + @Deprecated public Server getServer(); /** @@ -105,11 +116,13 @@ public interface Plugin extends TabExecutor { * * @return true if this plugin is enabled, otherwise false */ + @Deprecated public boolean isEnabled(); /** * Called when this plugin is disabled */ + @Deprecated public void onDisable(); /** @@ -118,11 +131,13 @@ public interface Plugin extends TabExecutor { * When mulitple plugins are loaded, the onLoad() for all plugins is * called before any onEnable() is called. */ + @Deprecated public void onLoad(); /** * Called when this plugin is enabled */ + @Deprecated public void onEnable(); /** @@ -130,6 +145,7 @@ public interface Plugin extends TabExecutor { * * @return boolean whether we can nag */ + @Deprecated public boolean isNaggable(); /** @@ -137,6 +153,7 @@ public interface Plugin extends TabExecutor { * * @param canNag is this plugin still naggable? */ + @Deprecated public void setNaggable(boolean canNag); /** @@ -155,6 +172,7 @@ public interface Plugin extends TabExecutor { * * @return ebean server instance or null if not enabled */ + @Deprecated public EbeanServer getDatabase(); /** @@ -166,6 +184,7 @@ public interface Plugin extends TabExecutor { * generator was requested * @return ChunkGenerator for use in the default world generation */ + @Deprecated public ChunkGenerator getDefaultWorldGenerator(String worldName, String id); /** @@ -175,6 +194,7 @@ public interface Plugin extends TabExecutor { * * @return Logger associated with this plugin */ + @Deprecated public Logger getLogger(); /** @@ -185,5 +205,6 @@ public interface Plugin extends TabExecutor { * * @return name of the plugin */ + @Deprecated public String getName(); } diff --git a/src/main/java/org/bukkit/plugin/PluginBase.java b/src/main/java/org/bukkit/plugin/PluginBase.java index 6031af1..8611fc3 100644 --- a/src/main/java/org/bukkit/plugin/PluginBase.java +++ b/src/main/java/org/bukkit/plugin/PluginBase.java @@ -6,13 +6,16 @@ package org.bukkit.plugin; * Extend this class if your plugin is not a {@link * org.bukkit.plugin.java.JavaPlugin} */ +@Deprecated public abstract class PluginBase implements Plugin { @Override + @Deprecated public final int hashCode() { return getName().hashCode(); } @Override + @Deprecated public final boolean equals(Object obj) { if (this == obj) { return true; @@ -26,6 +29,7 @@ public abstract class PluginBase implements Plugin { return getName().equals(((Plugin) obj).getName()); } + @Deprecated public final String getName() { return getDescription().getName(); } diff --git a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java index cfd4b71..92e614a 100644 --- a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java +++ b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java @@ -164,27 +164,47 @@ import com.google.common.collect.ImmutableMap; * inferno.burningdeaths: true * */ +@Deprecated public final class PluginDescriptionFile { + @Deprecated private static final Yaml yaml = new Yaml(new SafeConstructor()); String rawName = null; + @Deprecated private String name = null; + @Deprecated private String main = null; + @Deprecated private String classLoaderOf = null; + @Deprecated private List depend = ImmutableList.of(); + @Deprecated private List softDepend = ImmutableList.of(); + @Deprecated private List loadBefore = ImmutableList.of(); + @Deprecated private String version = null; + @Deprecated private Map> commands = null; + @Deprecated private String description = null; + @Deprecated private List authors = null; + @Deprecated private String website = null; + @Deprecated private String prefix = null; + @Deprecated private boolean database = false; + @Deprecated private PluginLoadOrder order = PluginLoadOrder.POSTWORLD; + @Deprecated private List permissions = null; + @Deprecated private Map lazyPermissions = null; + @Deprecated private PermissionDefault defaultPerm = PermissionDefault.OP; + @Deprecated public PluginDescriptionFile(final InputStream stream) throws InvalidDescriptionException { loadMap(asMap(yaml.load(stream))); } @@ -196,6 +216,7 @@ public final class PluginDescriptionFile { * @throws InvalidDescriptionException If the PluginDescriptionFile is * invalid */ + @Deprecated public PluginDescriptionFile(final Reader reader) throws InvalidDescriptionException { loadMap(asMap(yaml.load(reader))); } @@ -207,6 +228,7 @@ public final class PluginDescriptionFile { * @param pluginVersion Version of this plugin * @param mainClass Full location of the main class of this plugin */ + @Deprecated public PluginDescriptionFile(final String pluginName, final String pluginVersion, final String mainClass) { name = pluginName.replace(' ', '_'); version = pluginVersion; @@ -238,6 +260,7 @@ public final class PluginDescriptionFile { * * @return the name of the plugin */ + @Deprecated public String getName() { return name; } @@ -258,6 +281,7 @@ public final class PluginDescriptionFile { * * @return the version of the plugin */ + @Deprecated public String getVersion() { return version; } @@ -284,6 +308,7 @@ public final class PluginDescriptionFile { * * @return the fully qualified main class for the plugin */ + @Deprecated public String getMain() { return main; } @@ -303,6 +328,7 @@ public final class PluginDescriptionFile { * * @return description of this plugin, or null if not specified */ + @Deprecated public String getDescription() { return description; } @@ -326,6 +352,7 @@ public final class PluginDescriptionFile { * * @return the phase when the plugin should be loaded */ + @Deprecated public PluginLoadOrder getLoad() { return order; } @@ -361,6 +388,7 @@ public final class PluginDescriptionFile { * * @return an immutable list of the plugin's authors */ + @Deprecated public List getAuthors() { return authors; } @@ -380,6 +408,7 @@ public final class PluginDescriptionFile { * * @return description of this plugin, or null if not specified */ + @Deprecated public String getWebsite() { return website; } @@ -399,6 +428,7 @@ public final class PluginDescriptionFile { * @return if this plugin requires a database * @see Plugin#getDatabase() */ + @Deprecated public boolean isDatabaseEnabled() { return database; } @@ -429,6 +459,7 @@ public final class PluginDescriptionFile { * * @return immutable list of the plugin's dependencies */ + @Deprecated public List getDepend() { return depend; } @@ -458,6 +489,7 @@ public final class PluginDescriptionFile { * * @return immutable list of the plugin's preferred dependencies */ + @Deprecated public List getSoftDepend() { return softDepend; } @@ -487,6 +519,7 @@ public final class PluginDescriptionFile { * @return immutable list of plugins that should consider this plugin a * soft-dependency */ + @Deprecated public List getLoadBefore() { return loadBefore; } @@ -506,6 +539,7 @@ public final class PluginDescriptionFile { * * @return the prefixed logging token, or null if not specified */ + @Deprecated public String getPrefix() { return prefix; } @@ -625,6 +659,7 @@ public final class PluginDescriptionFile { * * @return the commands this plugin will register */ + @Deprecated public Map> getCommands() { return commands; } @@ -734,6 +769,7 @@ public final class PluginDescriptionFile { * Another example, with nested definitions, can be found here. */ + @Deprecated public List getPermissions() { if (permissions == null) { if (lazyPermissions == null) { @@ -763,6 +799,7 @@ public final class PluginDescriptionFile { * * @return the default value for the plugin's permissions */ + @Deprecated public PermissionDefault getPermissionDefault() { return defaultPerm; } @@ -774,6 +811,7 @@ public final class PluginDescriptionFile { * * @return a descriptive name of the plugin and respective version */ + @Deprecated public String getFullName() { return name + " v" + version; } @@ -786,6 +824,7 @@ public final class PluginDescriptionFile { return classLoaderOf; } + @Deprecated public void setDatabaseEnabled(boolean database) { this.database = database; } @@ -795,10 +834,12 @@ public final class PluginDescriptionFile { * * @param writer Writer to output this file to */ + @Deprecated public void save(Writer writer) { yaml.dump(saveMap(), writer); } + @Deprecated private void loadMap(Map map) throws InvalidDescriptionException { try { name = rawName = map.get("name").toString(); @@ -937,6 +978,7 @@ public final class PluginDescriptionFile { } } + @Deprecated private static List makePluginNameList(final Map map, final String key) throws InvalidDescriptionException { final Object value = map.get(key); if (value == null) { @@ -956,6 +998,7 @@ public final class PluginDescriptionFile { return builder.build(); } + @Deprecated private Map saveMap() { Map map = new HashMap(); @@ -999,6 +1042,7 @@ public final class PluginDescriptionFile { return map; } + @Deprecated private Map asMap(Object object) throws InvalidDescriptionException { if (object instanceof Map) { return (Map) object; diff --git a/src/main/java/org/bukkit/plugin/PluginLoadOrder.java b/src/main/java/org/bukkit/plugin/PluginLoadOrder.java index b77436f..e93803f 100644 --- a/src/main/java/org/bukkit/plugin/PluginLoadOrder.java +++ b/src/main/java/org/bukkit/plugin/PluginLoadOrder.java @@ -3,6 +3,7 @@ package org.bukkit.plugin; /** * Represents the order in which a plugin should be initialized and enabled */ +@Deprecated public enum PluginLoadOrder { /** diff --git a/src/main/java/org/bukkit/plugin/PluginLoader.java b/src/main/java/org/bukkit/plugin/PluginLoader.java index e7981a1..9d3ba46 100644 --- a/src/main/java/org/bukkit/plugin/PluginLoader.java +++ b/src/main/java/org/bukkit/plugin/PluginLoader.java @@ -12,6 +12,7 @@ import org.bukkit.event.Listener; * Represents a plugin loader, which handles direct access to specific types * of plugins */ +@Deprecated public interface PluginLoader { /** @@ -25,6 +26,7 @@ public interface PluginLoader { * @throws UnknownDependencyException If a required dependency could not * be found */ + @Deprecated public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException; /** @@ -36,6 +38,7 @@ public interface PluginLoader { * @throws InvalidDescriptionException If the plugin description file * could not be created */ + @Deprecated public PluginDescriptionFile getPluginDescription(File file) throws InvalidDescriptionException; /** @@ -43,6 +46,7 @@ public interface PluginLoader { * * @return The filters */ + @Deprecated public Pattern[] getPluginFileFilters(); /** @@ -53,6 +57,7 @@ public interface PluginLoader { * @param plugin The plugin to use when creating registered listeners * @return The registered listeners. */ + @Deprecated public Map, Set> createRegisteredListeners(Listener listener, Plugin plugin); /** @@ -63,6 +68,7 @@ public interface PluginLoader { * * @param plugin Plugin to enable */ + @Deprecated public void enablePlugin(Plugin plugin); /** @@ -72,5 +78,6 @@ public interface PluginLoader { * * @param plugin Plugin to disable */ + @Deprecated public void disablePlugin(Plugin plugin); } diff --git a/src/main/java/org/bukkit/plugin/PluginLogger.java b/src/main/java/org/bukkit/plugin/PluginLogger.java index f43c10b..a2c0275 100644 --- a/src/main/java/org/bukkit/plugin/PluginLogger.java +++ b/src/main/java/org/bukkit/plugin/PluginLogger.java @@ -11,7 +11,9 @@ import java.util.logging.Logger; * * @see Logger */ +@Deprecated public class PluginLogger extends Logger { + @Deprecated private String pluginName; /** @@ -19,6 +21,7 @@ public class PluginLogger extends Logger { * * @param context A reference to the plugin */ + @Deprecated public PluginLogger(Plugin context) { super(context.getClass().getCanonicalName(), null); String prefix = context.getDescription().getPrefix(); @@ -28,6 +31,7 @@ public class PluginLogger extends Logger { } @Override + @Deprecated public void log(LogRecord logRecord) { logRecord.setMessage(pluginName + logRecord.getMessage()); super.log(logRecord); diff --git a/src/main/java/org/bukkit/plugin/PluginManager.java b/src/main/java/org/bukkit/plugin/PluginManager.java index e5638d5..751dcfb 100644 --- a/src/main/java/org/bukkit/plugin/PluginManager.java +++ b/src/main/java/org/bukkit/plugin/PluginManager.java @@ -12,6 +12,7 @@ import org.bukkit.permissions.Permission; /** * Handles all plugin management from the Server */ +@Deprecated public interface PluginManager { /** @@ -21,6 +22,7 @@ public interface PluginManager { * @throws IllegalArgumentException Thrown when the given Class is not a * valid PluginLoader */ + @Deprecated public void registerInterface(Class loader) throws IllegalArgumentException; /** @@ -31,6 +33,7 @@ public interface PluginManager { * @param name Name of the plugin to check * @return Plugin if it exists, otherwise null */ + @Deprecated public Plugin getPlugin(String name); /** @@ -38,6 +41,7 @@ public interface PluginManager { * * @return Array of Plugins */ + @Deprecated public Plugin[] getPlugins(); /** @@ -48,6 +52,7 @@ public interface PluginManager { * @param name Name of the plugin to check * @return true if the plugin is enabled, otherwise false */ + @Deprecated public boolean isPluginEnabled(String name); /** @@ -56,6 +61,7 @@ public interface PluginManager { * @param plugin Plugin to check * @return true if the plugin is enabled, otherwise false */ + @Deprecated public boolean isPluginEnabled(Plugin plugin); /** @@ -72,6 +78,7 @@ public interface PluginManager { * @throws UnknownDependencyException If a required dependency could not * be resolved */ + @Deprecated public Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException; /** @@ -80,16 +87,19 @@ public interface PluginManager { * @param directory Directory to check for plugins * @return A list of all plugins loaded */ + @Deprecated public Plugin[] loadPlugins(File directory); /** * Disables all the loaded plugins */ + @Deprecated public void disablePlugins(); /** * Disables and removes all plugins */ + @Deprecated public void clearPlugins(); /** @@ -102,6 +112,7 @@ public interface PluginManager { * Note: This is best-effort basis, and should not be used to test * synchronized state. This is an indicator for flawed flow logic. */ + @Deprecated public void callEvent(Event event) throws IllegalStateException; /** @@ -110,6 +121,7 @@ public interface PluginManager { * @param listener Listener to register * @param plugin Plugin to register */ + @Deprecated public void registerEvents(Listener listener, Plugin plugin); /** @@ -121,6 +133,7 @@ public interface PluginManager { * @param executor EventExecutor to register * @param plugin Plugin to register */ + @Deprecated public void registerEvent(Class event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin); /** @@ -133,6 +146,7 @@ public interface PluginManager { * @param plugin Plugin to register * @param ignoreCancelled Whether to pass cancelled events or not */ + @Deprecated public void registerEvent(Class event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin, boolean ignoreCancelled); /** @@ -143,6 +157,7 @@ public interface PluginManager { * * @param plugin Plugin to enable */ + @Deprecated public void enablePlugin(Plugin plugin); /** @@ -152,6 +167,7 @@ public interface PluginManager { * * @param plugin Plugin to disable */ + @Deprecated public void disablePlugin(Plugin plugin); /** @@ -160,6 +176,7 @@ public interface PluginManager { * @param name Name of the permission * @return Permission, or null if none */ + @Deprecated public Permission getPermission(String name); /** @@ -172,6 +189,7 @@ public interface PluginManager { * @throws IllegalArgumentException Thrown when a permission with the same * name already exists */ + @Deprecated public void addPermission(Permission perm); /** @@ -185,6 +203,7 @@ public interface PluginManager { * * @param perm Permission to remove */ + @Deprecated public void removePermission(Permission perm); /** @@ -198,6 +217,7 @@ public interface PluginManager { * * @param name Permission to remove */ + @Deprecated public void removePermission(String name); /** @@ -206,6 +226,7 @@ public interface PluginManager { * @param op Which set of default permissions to get * @return The default permissions */ + @Deprecated public Set getDefaultPermissions(boolean op); /** @@ -216,6 +237,7 @@ public interface PluginManager { * * @param perm Permission to recalculate */ + @Deprecated public void recalculatePermissionDefaults(Permission perm); /** @@ -228,6 +250,7 @@ public interface PluginManager { * @param permission Permission to subscribe to * @param permissible Permissible subscribing */ + @Deprecated public void subscribeToPermission(String permission, Permissible permissible); /** @@ -237,6 +260,7 @@ public interface PluginManager { * @param permission Permission to unsubscribe from * @param permissible Permissible subscribing */ + @Deprecated public void unsubscribeFromPermission(String permission, Permissible permissible); /** @@ -246,6 +270,7 @@ public interface PluginManager { * @param permission Permission to query for * @return Set containing all subscribed permissions */ + @Deprecated public Set getPermissionSubscriptions(String permission); /** @@ -257,6 +282,7 @@ public interface PluginManager { * @param op Default list to subscribe to * @param permissible Permissible subscribing */ + @Deprecated public void subscribeToDefaultPerms(boolean op, Permissible permissible); /** @@ -265,6 +291,7 @@ public interface PluginManager { * @param op Default list to unsubscribe from * @param permissible Permissible subscribing */ + @Deprecated public void unsubscribeFromDefaultPerms(boolean op, Permissible permissible); /** @@ -274,6 +301,7 @@ public interface PluginManager { * @param op Default list to query for * @return Set containing all subscribed permissions */ + @Deprecated public Set getDefaultPermSubscriptions(boolean op); /** @@ -283,6 +311,7 @@ public interface PluginManager { * * @return Set containing all current registered permissions */ + @Deprecated public Set getPermissions(); /** @@ -290,5 +319,6 @@ public interface PluginManager { * * @return True if event timings are to be used */ + @Deprecated public boolean useTimings(); } diff --git a/src/main/java/org/bukkit/plugin/RegisteredListener.java b/src/main/java/org/bukkit/plugin/RegisteredListener.java index 9dd0b7a..0780eb8 100644 --- a/src/main/java/org/bukkit/plugin/RegisteredListener.java +++ b/src/main/java/org/bukkit/plugin/RegisteredListener.java @@ -5,13 +5,20 @@ import org.bukkit.event.*; /** * Stores relevant information for plugin listeners */ +@Deprecated public class RegisteredListener { + @Deprecated private final Listener listener; + @Deprecated private final EventPriority priority; + @Deprecated private final Plugin plugin; + @Deprecated private final EventExecutor executor; + @Deprecated private final boolean ignoreCancelled; + @Deprecated public RegisteredListener(final Listener listener, final EventExecutor executor, final EventPriority priority, final Plugin plugin, final boolean ignoreCancelled) { this.listener = listener; this.priority = priority; @@ -25,6 +32,7 @@ public class RegisteredListener { * * @return Registered Listener */ + @Deprecated public Listener getListener() { return listener; } @@ -34,6 +42,7 @@ public class RegisteredListener { * * @return Registered Plugin */ + @Deprecated public Plugin getPlugin() { return plugin; } @@ -43,6 +52,7 @@ public class RegisteredListener { * * @return Registered Priority */ + @Deprecated public EventPriority getPriority() { return priority; } @@ -53,6 +63,7 @@ public class RegisteredListener { * @param event The event * @throws EventException If an event handler throws an exception. */ + @Deprecated public void callEvent(final Event event) throws EventException { if (event instanceof Cancellable){ if (((Cancellable) event).isCancelled() && isIgnoringCancelled()){ @@ -67,6 +78,7 @@ public class RegisteredListener { * * @return True when ignoring cancelled events */ + @Deprecated public boolean isIgnoringCancelled() { return ignoreCancelled; } diff --git a/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java b/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java index ba3ff15..fa1053e 100644 --- a/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java +++ b/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java @@ -5,13 +5,19 @@ package org.bukkit.plugin; * * @param Service */ +@Deprecated public class RegisteredServiceProvider implements Comparable> { + @Deprecated private Class service; + @Deprecated private Plugin plugin; + @Deprecated private T provider; + @Deprecated private ServicePriority priority; + @Deprecated public RegisteredServiceProvider(Class service, T provider, ServicePriority priority, Plugin plugin) { this.service = service; @@ -20,22 +26,27 @@ public class RegisteredServiceProvider implements Comparable getService() { return service; } + @Deprecated public Plugin getPlugin() { return plugin; } + @Deprecated public T getProvider() { return provider; } + @Deprecated public ServicePriority getPriority() { return priority; } + @Deprecated public int compareTo(RegisteredServiceProvider other) { if (priority.ordinal() == other.getPriority().ordinal()) { return 0; diff --git a/src/main/java/org/bukkit/plugin/ServicePriority.java b/src/main/java/org/bukkit/plugin/ServicePriority.java index 4afe0fb..01e26f0 100644 --- a/src/main/java/org/bukkit/plugin/ServicePriority.java +++ b/src/main/java/org/bukkit/plugin/ServicePriority.java @@ -3,6 +3,7 @@ package org.bukkit.plugin; /** * Represents various priorities of a provider. */ +@Deprecated public enum ServicePriority { Lowest, Low, diff --git a/src/main/java/org/bukkit/plugin/ServicesManager.java b/src/main/java/org/bukkit/plugin/ServicesManager.java index 5d45ffb..539a5e2 100644 --- a/src/main/java/org/bukkit/plugin/ServicesManager.java +++ b/src/main/java/org/bukkit/plugin/ServicesManager.java @@ -11,6 +11,7 @@ import java.util.List; * multiple plugins register a service, then the service with the highest * priority takes precedence. */ +@Deprecated public interface ServicesManager { /** @@ -22,6 +23,7 @@ public interface ServicesManager { * @param plugin plugin with the provider * @param priority priority of the provider */ + @Deprecated public void register(Class service, T provider, Plugin plugin, ServicePriority priority); /** @@ -29,6 +31,7 @@ public interface ServicesManager { * * @param plugin The plugin */ + @Deprecated public void unregisterAll(Plugin plugin); /** @@ -37,6 +40,7 @@ public interface ServicesManager { * @param service The service interface * @param provider The service provider implementation */ + @Deprecated public void unregister(Class service, Object provider); /** @@ -44,6 +48,7 @@ public interface ServicesManager { * * @param provider The service provider implementation */ + @Deprecated public void unregister(Object provider); /** @@ -54,6 +59,7 @@ public interface ServicesManager { * @param service The service interface * @return provider or null */ + @Deprecated public T load(Class service); /** @@ -64,6 +70,7 @@ public interface ServicesManager { * @param service The service interface * @return provider registration or null */ + @Deprecated public RegisteredServiceProvider getRegistration(Class service); /** @@ -72,6 +79,7 @@ public interface ServicesManager { * @param plugin The plugin * @return provider registration or null */ + @Deprecated public List> getRegistrations(Plugin plugin); /** @@ -82,6 +90,7 @@ public interface ServicesManager { * @param service The service interface * @return list of registrations */ + @Deprecated public Collection> getRegistrations(Class service); /** @@ -90,6 +99,7 @@ public interface ServicesManager { * * @return list of known services */ + @Deprecated public Collection> getKnownServices(); /** @@ -101,6 +111,7 @@ public interface ServicesManager { * @param service service to check * @return whether there has been a registered provider */ + @Deprecated public boolean isProvidedFor(Class service); } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java index 1d51908..8b2aab1 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -37,19 +37,32 @@ import com.google.common.collect.ImmutableSet; /** * Handles all plugin management from the Server */ +@Deprecated public final class SimplePluginManager implements PluginManager { + @Deprecated private final Server server; + @Deprecated private final Map fileAssociations = new HashMap(); + @Deprecated private final List plugins = new ArrayList(); + @Deprecated private final Map lookupNames = new HashMap(); + @Deprecated private static File updateDirectory = null; + @Deprecated private final SimpleCommandMap commandMap; + @Deprecated private final Map permissions = new HashMap(); + @Deprecated private final Map> defaultPerms = new LinkedHashMap>(); + @Deprecated private final Map> permSubs = new HashMap>(); + @Deprecated private final Map> defSubs = new HashMap>(); + @Deprecated private boolean useTimings = false; + @Deprecated public SimplePluginManager(Server instance, SimpleCommandMap commandMap) { server = instance; this.commandMap = commandMap; @@ -65,6 +78,7 @@ public final class SimplePluginManager implements PluginManager { * @throws IllegalArgumentException Thrown when the given Class is not a * valid PluginLoader */ + @Deprecated public void registerInterface(Class loader) throws IllegalArgumentException { PluginLoader instance; @@ -100,6 +114,7 @@ public final class SimplePluginManager implements PluginManager { * @param directory Directory to check for plugins * @return A list of all plugins loaded */ + @Deprecated public Plugin[] loadPlugins(File directory) { Validate.notNull(directory, "Directory cannot be null"); Validate.isTrue(directory.isDirectory(), "Directory must be a directory"); @@ -311,6 +326,7 @@ public final class SimplePluginManager implements PluginManager { * @throws UnknownDependencyException If a required dependency could not * be found */ + @Deprecated public synchronized Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException { Validate.notNull(file, "File cannot be null"); @@ -338,6 +354,7 @@ public final class SimplePluginManager implements PluginManager { return result; } + @Deprecated private void checkUpdate(File file) { if (updateDirectory == null || !updateDirectory.isDirectory()) { return; @@ -357,10 +374,12 @@ public final class SimplePluginManager implements PluginManager { * @param name Name of the plugin to check * @return Plugin if it exists, otherwise null */ + @Deprecated public synchronized Plugin getPlugin(String name) { return lookupNames.get(name.replace(' ', '_')); } + @Deprecated public synchronized Plugin[] getPlugins() { return plugins.toArray(new Plugin[0]); } @@ -373,6 +392,7 @@ public final class SimplePluginManager implements PluginManager { * @param name Name of the plugin to check * @return true if the plugin is enabled, otherwise false */ + @Deprecated public boolean isPluginEnabled(String name) { Plugin plugin = getPlugin(name); @@ -385,6 +405,7 @@ public final class SimplePluginManager implements PluginManager { * @param plugin Plugin to check * @return true if the plugin is enabled, otherwise false */ + @Deprecated public boolean isPluginEnabled(Plugin plugin) { if ((plugin != null) && (plugins.contains(plugin))) { return plugin.isEnabled(); @@ -393,6 +414,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public void enablePlugin(final Plugin plugin) { if (!plugin.isEnabled()) { List pluginCommands = PluginCommandYamlParser.parse(plugin); @@ -411,6 +433,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public void disablePlugins() { Plugin[] plugins = getPlugins(); for (int i = plugins.length - 1; i >= 0; i--) { @@ -418,6 +441,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public void disablePlugin(final Plugin plugin) { if (plugin.isEnabled()) { try { @@ -453,6 +477,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public void clearPlugins() { synchronized (this) { disablePlugins(); @@ -473,6 +498,7 @@ public final class SimplePluginManager implements PluginManager { * * @param event Event details */ + @Deprecated public void callEvent(Event event) { if (event.isAsynchronous()) { if (Thread.holdsLock(this)) { @@ -489,6 +515,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated private void fireEvent(Event event) { HandlerList handlers = event.getHandlers(); RegisteredListener[] listeners = handlers.getRegisteredListeners(); @@ -519,6 +546,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public void registerEvents(Listener listener, Plugin plugin) { if (!plugin.isEnabled()) { throw new IllegalPluginAccessException("Plugin attempted to register " + listener + " while not enabled"); @@ -530,6 +558,7 @@ public final class SimplePluginManager implements PluginManager { } + @Deprecated public void registerEvent(Class event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin) { registerEvent(event, listener, priority, executor, plugin, false); } @@ -546,6 +575,7 @@ public final class SimplePluginManager implements PluginManager { * @param ignoreCancelled Do not call executor if event was already * cancelled */ + @Deprecated public void registerEvent(Class event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin, boolean ignoreCancelled) { Validate.notNull(listener, "Listener cannot be null"); Validate.notNull(priority, "Priority cannot be null"); @@ -563,6 +593,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated private HandlerList getEventListeners(Class type) { try { Method method = getRegistrationClass(type).getDeclaredMethod("getHandlerList"); @@ -573,6 +604,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated private Class getRegistrationClass(Class clazz) { try { clazz.getDeclaredMethod("getHandlerList"); @@ -588,10 +620,12 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public Permission getPermission(String name) { return permissions.get(name.toLowerCase()); } + @Deprecated public void addPermission(Permission perm) { String name = perm.getName().toLowerCase(); @@ -603,18 +637,22 @@ public final class SimplePluginManager implements PluginManager { calculatePermissionDefault(perm); } + @Deprecated public Set getDefaultPermissions(boolean op) { return ImmutableSet.copyOf(defaultPerms.get(op)); } + @Deprecated public void removePermission(Permission perm) { removePermission(perm.getName()); } + @Deprecated public void removePermission(String name) { permissions.remove(name.toLowerCase()); } + @Deprecated public void recalculatePermissionDefaults(Permission perm) { if (permissions.containsValue(perm)) { defaultPerms.get(true).remove(perm); @@ -624,6 +662,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated private void calculatePermissionDefault(Permission perm) { if ((perm.getDefault() == PermissionDefault.OP) || (perm.getDefault() == PermissionDefault.TRUE)) { defaultPerms.get(true).add(perm); @@ -635,6 +674,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated private void dirtyPermissibles(boolean op) { Set permissibles = getDefaultPermSubscriptions(op); @@ -643,6 +683,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public void subscribeToPermission(String permission, Permissible permissible) { String name = permission.toLowerCase(); Map map = permSubs.get(name); @@ -655,6 +696,7 @@ public final class SimplePluginManager implements PluginManager { map.put(permissible, true); } + @Deprecated public void unsubscribeFromPermission(String permission, Permissible permissible) { String name = permission.toLowerCase(); Map map = permSubs.get(name); @@ -668,6 +710,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public Set getPermissionSubscriptions(String permission) { String name = permission.toLowerCase(); Map map = permSubs.get(name); @@ -679,6 +722,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public void subscribeToDefaultPerms(boolean op, Permissible permissible) { Map map = defSubs.get(op); @@ -690,6 +734,7 @@ public final class SimplePluginManager implements PluginManager { map.put(permissible, true); } + @Deprecated public void unsubscribeFromDefaultPerms(boolean op, Permissible permissible) { Map map = defSubs.get(op); @@ -702,6 +747,7 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public Set getDefaultPermSubscriptions(boolean op) { Map map = defSubs.get(op); @@ -712,10 +758,12 @@ public final class SimplePluginManager implements PluginManager { } } + @Deprecated public Set getPermissions() { return new HashSet(permissions.values()); } + @Deprecated public boolean useTimings() { return useTimings; } @@ -725,6 +773,7 @@ public final class SimplePluginManager implements PluginManager { * * @param use True if per event timing code should be used */ + @Deprecated public void useTimings(boolean use) { useTimings = use; } diff --git a/src/main/java/org/bukkit/plugin/SimpleServicesManager.java b/src/main/java/org/bukkit/plugin/SimpleServicesManager.java index 4e17711..d05d54d 100644 --- a/src/main/java/org/bukkit/plugin/SimpleServicesManager.java +++ b/src/main/java/org/bukkit/plugin/SimpleServicesManager.java @@ -19,11 +19,13 @@ import java.util.Set; /** * A simple services manager. */ +@Deprecated public class SimpleServicesManager implements ServicesManager { /** * Map of providers. */ + @Deprecated private final Map, List>> providers = new HashMap, List>>(); /** @@ -35,6 +37,7 @@ public class SimpleServicesManager implements ServicesManager { * @param plugin plugin with the provider * @param priority priority of the provider */ + @Deprecated public void register(Class service, T provider, Plugin plugin, ServicePriority priority) { RegisteredServiceProvider registeredProvider = null; synchronized (providers) { @@ -63,6 +66,7 @@ public class SimpleServicesManager implements ServicesManager { * * @param plugin The plugin */ + @Deprecated public void unregisterAll(Plugin plugin) { ArrayList unregisteredEvents = new ArrayList(); synchronized (providers) { @@ -105,6 +109,7 @@ public class SimpleServicesManager implements ServicesManager { * @param service The service interface * @param provider The service provider implementation */ + @Deprecated public void unregister(Class service, Object provider) { ArrayList unregisteredEvents = new ArrayList(); synchronized (providers) { @@ -152,6 +157,7 @@ public class SimpleServicesManager implements ServicesManager { * * @param provider The service provider implementation */ + @Deprecated public void unregister(Object provider) { ArrayList unregisteredEvents = new ArrayList(); synchronized (providers) { @@ -196,6 +202,7 @@ public class SimpleServicesManager implements ServicesManager { * @param service The service interface * @return provider or null */ + @Deprecated public T load(Class service) { synchronized (providers) { List> registered = providers.get(service); @@ -218,6 +225,7 @@ public class SimpleServicesManager implements ServicesManager { * @return provider registration or null */ @SuppressWarnings("unchecked") + @Deprecated public RegisteredServiceProvider getRegistration(Class service) { synchronized (providers) { List> registered = providers.get(service); @@ -237,6 +245,7 @@ public class SimpleServicesManager implements ServicesManager { * @param plugin The plugin * @return provider registration or null */ + @Deprecated public List> getRegistrations(Plugin plugin) { ImmutableList.Builder> ret = ImmutableList.>builder(); synchronized (providers) { @@ -260,6 +269,7 @@ public class SimpleServicesManager implements ServicesManager { * @return a copy of the list of registrations */ @SuppressWarnings("unchecked") + @Deprecated public List> getRegistrations(Class service) { ImmutableList.Builder> ret; synchronized (providers) { @@ -285,6 +295,7 @@ public class SimpleServicesManager implements ServicesManager { * * @return a copy of the set of known services */ + @Deprecated public Set> getKnownServices() { synchronized (providers) { return ImmutableSet.>copyOf(providers.keySet()); @@ -298,6 +309,7 @@ public class SimpleServicesManager implements ServicesManager { * @param service service to check * @return true if and only if there are registered providers */ + @Deprecated public boolean isProvidedFor(Class service) { synchronized (providers) { return providers.containsKey(service); diff --git a/src/main/java/org/bukkit/plugin/TimedRegisteredListener.java b/src/main/java/org/bukkit/plugin/TimedRegisteredListener.java index ab2c65e..881c3c5 100644 --- a/src/main/java/org/bukkit/plugin/TimedRegisteredListener.java +++ b/src/main/java/org/bukkit/plugin/TimedRegisteredListener.java @@ -8,21 +8,30 @@ import org.bukkit.event.Listener; /** * Extends RegisteredListener to include timing information */ +@Deprecated public class TimedRegisteredListener extends RegisteredListener { + @Deprecated private int count; + @Deprecated private long totalTime; // Spigot start + @Deprecated public long curTickTotal = 0; + @Deprecated public long violations = 0; // Spigot end + @Deprecated private Class eventClass; + @Deprecated private boolean multiple = false; + @Deprecated public TimedRegisteredListener(final Listener pluginListener, final EventExecutor eventExecutor, final EventPriority eventPriority, final Plugin registeredPlugin, final boolean listenCancelled) { super(pluginListener, eventExecutor, eventPriority, registeredPlugin, listenCancelled); } @Override + @Deprecated public void callEvent(Event event) throws EventException { // Spigot start if ( org.bukkit.Bukkit.getServer() != null && !org.bukkit.Bukkit.getServer().getPluginManager().useTimings() ) @@ -52,6 +61,7 @@ public class TimedRegisteredListener extends RegisteredListener { // Spigot end } + @Deprecated private static Class getCommonSuperclass(Class class1, Class class2) { while (!class1.isAssignableFrom(class2)) { class1 = class1.getSuperclass(); @@ -62,6 +72,7 @@ public class TimedRegisteredListener extends RegisteredListener { /** * Resets the call count and total time for this listener */ + @Deprecated public void reset() { count = 0; totalTime = 0; @@ -76,6 +87,7 @@ public class TimedRegisteredListener extends RegisteredListener { * * @return Times this listener has been called */ + @Deprecated public int getCount() { return count; } @@ -85,6 +97,7 @@ public class TimedRegisteredListener extends RegisteredListener { * * @return Total time for all calls of this listener */ + @Deprecated public long getTotalTime() { return totalTime; } @@ -100,6 +113,7 @@ public class TimedRegisteredListener extends RegisteredListener { * * @return the event class handled by this RegisteredListener */ + @Deprecated public Class getEventClass() { return eventClass; } @@ -110,6 +124,7 @@ public class TimedRegisteredListener extends RegisteredListener { * * @return true if this listener has handled multiple events */ + @Deprecated public boolean hasMultiple() { return multiple; } diff --git a/src/main/java/org/bukkit/plugin/UnknownDependencyException.java b/src/main/java/org/bukkit/plugin/UnknownDependencyException.java index a80251e..58146dd 100644 --- a/src/main/java/org/bukkit/plugin/UnknownDependencyException.java +++ b/src/main/java/org/bukkit/plugin/UnknownDependencyException.java @@ -3,8 +3,10 @@ package org.bukkit.plugin; /** * Thrown when attempting to load an invalid Plugin file */ +@Deprecated public class UnknownDependencyException extends RuntimeException { + @Deprecated private static final long serialVersionUID = 5721389371901775895L; /** @@ -13,6 +15,7 @@ public class UnknownDependencyException extends RuntimeException { * * @param throwable Exception that triggered this Exception */ + @Deprecated public UnknownDependencyException(final Throwable throwable) { super(throwable); } @@ -22,6 +25,7 @@ public class UnknownDependencyException extends RuntimeException { * * @param message Brief message explaining the cause of the exception */ + @Deprecated public UnknownDependencyException(final String message) { super(message); } @@ -33,6 +37,7 @@ public class UnknownDependencyException extends RuntimeException { * @param message Brief message explaining the cause of the exception * @param throwable Exception that triggered this Exception */ + @Deprecated public UnknownDependencyException(final Throwable throwable, final String message) { super(message, throwable); } @@ -40,6 +45,7 @@ public class UnknownDependencyException extends RuntimeException { /** * Constructs a new UnknownDependencyException */ + @Deprecated public UnknownDependencyException() { } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java index a0b609f..206a535 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java @@ -37,20 +37,34 @@ import com.avaje.ebeaninternal.server.ddl.DdlGenerator; /** * Represents a Java plugin */ +@Deprecated public abstract class JavaPlugin extends PluginBase { + @Deprecated private boolean isEnabled = false; + @Deprecated private PluginLoader loader = null; + @Deprecated private Server server = null; + @Deprecated private File file = null; + @Deprecated private PluginDescriptionFile description = null; + @Deprecated private File dataFolder = null; + @Deprecated private ClassLoader classLoader = null; + @Deprecated private boolean naggable = true; + @Deprecated private EbeanServer ebean = null; + @Deprecated private FileConfiguration newConfig = null; + @Deprecated private File configFile = null; + @Deprecated private PluginLogger logger = null; + @Deprecated public JavaPlugin() { final ClassLoader classLoader = this.getClass().getClassLoader(); if (!(classLoader instanceof PluginClassLoader)) { @@ -75,6 +89,7 @@ public abstract class JavaPlugin extends PluginBase { init(loader, server, description, dataFolder, file, classLoader); } + @Deprecated protected JavaPlugin(final JavaPluginLoader loader, final PluginDescriptionFile description, final File dataFolder, final File file) { final ClassLoader classLoader = this.getClass().getClassLoader(); if (classLoader instanceof PluginClassLoader) { @@ -89,6 +104,7 @@ public abstract class JavaPlugin extends PluginBase { * * @return The folder. */ + @Deprecated public final File getDataFolder() { return dataFolder; } @@ -98,6 +114,7 @@ public abstract class JavaPlugin extends PluginBase { * * @return PluginLoader that controls this plugin */ + @Deprecated public final PluginLoader getPluginLoader() { return loader; } @@ -107,6 +124,7 @@ public abstract class JavaPlugin extends PluginBase { * * @return Server running this plugin */ + @Deprecated public final Server getServer() { return server; } @@ -117,6 +135,7 @@ public abstract class JavaPlugin extends PluginBase { * * @return true if this plugin is enabled, otherwise false */ + @Deprecated public final boolean isEnabled() { return isEnabled; } @@ -126,6 +145,7 @@ public abstract class JavaPlugin extends PluginBase { * * @return File containing this plugin */ + @Deprecated protected File getFile() { return file; } @@ -135,10 +155,12 @@ public abstract class JavaPlugin extends PluginBase { * * @return Contents of the plugin.yaml file */ + @Deprecated public final PluginDescriptionFile getDescription() { return description; } + @Deprecated public FileConfiguration getConfig() { if (newConfig == null) { reloadConfig(); @@ -146,6 +168,7 @@ public abstract class JavaPlugin extends PluginBase { return newConfig; } + @Deprecated public void reloadConfig() { newConfig = YamlConfiguration.loadConfiguration(configFile); @@ -157,6 +180,7 @@ public abstract class JavaPlugin extends PluginBase { } } + @Deprecated public void saveConfig() { try { getConfig().save(configFile); @@ -165,12 +189,14 @@ public abstract class JavaPlugin extends PluginBase { } } + @Deprecated public void saveDefaultConfig() { if (!configFile.exists()) { saveResource("config.yml", false); } } + @Deprecated public void saveResource(String resourcePath, boolean replace) { if (resourcePath == null || resourcePath.equals("")) { throw new IllegalArgumentException("ResourcePath cannot be null or empty"); @@ -208,6 +234,7 @@ public abstract class JavaPlugin extends PluginBase { } } + @Deprecated public InputStream getResource(String filename) { if (filename == null) { throw new IllegalArgumentException("Filename cannot be null"); @@ -233,6 +260,7 @@ public abstract class JavaPlugin extends PluginBase { * * @return ClassLoader holding this plugin */ + @Deprecated protected final ClassLoader getClassLoader() { return classLoader; } @@ -242,6 +270,7 @@ public abstract class JavaPlugin extends PluginBase { * * @param enabled true if enabled, otherwise false */ + @Deprecated protected final void setEnabled(final boolean enabled) { if (isEnabled != enabled) { isEnabled = enabled; @@ -303,10 +332,12 @@ public abstract class JavaPlugin extends PluginBase { * * @return List of Classes that are Ebeans */ + @Deprecated public List> getDatabaseClasses() { return new ArrayList>(); } + @Deprecated private String replaceDatabaseString(String input) { input = input.replaceAll("\\{DIR\\}", dataFolder.getPath().replaceAll("\\\\", "/") + "/"); input = input.replaceAll("\\{NAME\\}", description.getName().replaceAll("[^\\w_-]", "")); @@ -328,6 +359,7 @@ public abstract class JavaPlugin extends PluginBase { /** * {@inheritDoc} */ + @Deprecated public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { return false; } @@ -335,6 +367,7 @@ public abstract class JavaPlugin extends PluginBase { /** * {@inheritDoc} */ + @Deprecated public List onTabComplete(CommandSender sender, Command command, String alias, String[] args) { return null; } @@ -347,6 +380,7 @@ public abstract class JavaPlugin extends PluginBase { * @param name name or alias of the command * @return the plugin command if found, otherwise null */ + @Deprecated public PluginCommand getCommand(String name) { String alias = name.toLowerCase(); PluginCommand command = getServer().getPluginCommand(alias); @@ -362,28 +396,36 @@ public abstract class JavaPlugin extends PluginBase { } } + @Deprecated public void onLoad() {} + @Deprecated public void onDisable() {} + @Deprecated public void onEnable() {} + @Deprecated public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) { return null; } + @Deprecated public final boolean isNaggable() { return naggable; } + @Deprecated public final void setNaggable(boolean canNag) { this.naggable = canNag; } + @Deprecated public EbeanServer getDatabase() { return ebean; } + @Deprecated protected void installDDL() { SpiEbeanServer serv = (SpiEbeanServer) getDatabase(); DdlGenerator gen = serv.getDdlGenerator(); @@ -391,6 +433,7 @@ public abstract class JavaPlugin extends PluginBase { gen.runScript(false, gen.generateCreateDdl()); } + @Deprecated protected void removeDDL() { SpiEbeanServer serv = (SpiEbeanServer) getDatabase(); DdlGenerator gen = serv.getDdlGenerator(); @@ -398,11 +441,13 @@ public abstract class JavaPlugin extends PluginBase { gen.runScript(true, gen.generateDropDdl()); } + @Deprecated public final Logger getLogger() { return logger; } @Override + @Deprecated public String toString() { return description.getFullName(); } @@ -429,6 +474,7 @@ public abstract class JavaPlugin extends PluginBase { * @throws ClassCastException if plugin that provided the class does not * extend the class */ + @Deprecated public static T getPlugin(Class clazz) { Validate.notNull(clazz, "Null class cannot have a plugin"); if (!JavaPlugin.class.isAssignableFrom(clazz)) { @@ -455,6 +501,7 @@ public abstract class JavaPlugin extends PluginBase { * @throws IllegalStateException if called from the static initializer for * given JavaPlugin */ + @Deprecated public static JavaPlugin getProvidingPlugin(Class clazz) { Validate.notNull(clazz, "Null class cannot have a plugin"); final ClassLoader cl = clazz.getClassLoader(); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java index a1639f8..c6a0463 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -44,10 +44,14 @@ import org.yaml.snakeyaml.error.YAMLException; /** * Represents a Java plugin loader, allowing plugins in the form of .jar */ +@Deprecated public final class JavaPluginLoader implements PluginLoader { final Server server; + @Deprecated private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), }; + @Deprecated private final Map> classes = new HashMap>(); + @Deprecated private final Map loaders = new LinkedHashMap(); /** @@ -59,6 +63,7 @@ public final class JavaPluginLoader implements PluginLoader { server = instance; } + @Deprecated public Plugin loadPlugin(final File file) throws InvalidPluginException { Validate.notNull(file, "File cannot be null"); @@ -136,6 +141,7 @@ public final class JavaPluginLoader implements PluginLoader { return loader.plugin; } + @Deprecated public PluginDescriptionFile getPluginDescription(File file) throws InvalidDescriptionException { Validate.notNull(file, "File cannot be null"); @@ -174,6 +180,7 @@ public final class JavaPluginLoader implements PluginLoader { } } + @Deprecated public Pattern[] getPluginFileFilters() { return fileFilters.clone(); } @@ -209,6 +216,7 @@ public final class JavaPluginLoader implements PluginLoader { } } + @Deprecated private void removeClass(String name) { Class clazz = classes.remove(name); @@ -223,6 +231,7 @@ public final class JavaPluginLoader implements PluginLoader { } } + @Deprecated public Map, Set> createRegisteredListeners(Listener listener, final Plugin plugin) { Validate.notNull(plugin, "Plugin can not be null"); Validate.notNull(listener, "Listener can not be null"); @@ -265,7 +274,7 @@ public final class JavaPluginLoader implements PluginLoader { if (clazz.getAnnotation(Deprecated.class) != null) { Warning warning = clazz.getAnnotation(Warning.class); WarningState warningState = server.getWarningState(); - if (!warningState.printFor(warning)) { + if (true) { // Can't scare everything break; } plugin.getLogger().log( @@ -284,6 +293,7 @@ public final class JavaPluginLoader implements PluginLoader { } EventExecutor executor = new EventExecutor() { + @Deprecated public void execute(Listener listener, Event event) throws EventException { try { if (!eventClass.isAssignableFrom(event.getClass())) { @@ -306,6 +316,7 @@ public final class JavaPluginLoader implements PluginLoader { return ret; } + @Deprecated public void enablePlugin(final Plugin plugin) { Validate.isTrue(plugin instanceof JavaPlugin, "Plugin is not associated with this PluginLoader"); @@ -332,6 +343,7 @@ public final class JavaPluginLoader implements PluginLoader { } } + @Deprecated public void disablePlugin(Plugin plugin) { Validate.isTrue(plugin instanceof JavaPlugin, "Plugin is not associated with this PluginLoader"); diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java index 13f8633..b321740 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -16,13 +16,20 @@ import org.bukkit.plugin.PluginDescriptionFile; * A ClassLoader for plugins, to allow shared classes across multiple plugins */ final class PluginClassLoader extends URLClassLoader { + @Deprecated private final JavaPluginLoader loader; + @Deprecated private final Map> classes = new HashMap>(); + @Deprecated private final PluginDescriptionFile description; + @Deprecated private final File dataFolder; + @Deprecated private final File file; final JavaPlugin plugin; + @Deprecated private JavaPlugin pluginInit; + @Deprecated private IllegalStateException pluginState; PluginClassLoader(final JavaPluginLoader loader, final ClassLoader parent, final PluginDescriptionFile description, final File dataFolder, final File file) throws InvalidPluginException, MalformedURLException { @@ -58,6 +65,7 @@ final class PluginClassLoader extends URLClassLoader { } @Override + @Deprecated protected Class findClass(String name) throws ClassNotFoundException { return findClass(name, true); } diff --git a/src/main/java/org/bukkit/plugin/messaging/ChannelNameTooLongException.java b/src/main/java/org/bukkit/plugin/messaging/ChannelNameTooLongException.java index 80ef8a2..96e03f9 100644 --- a/src/main/java/org/bukkit/plugin/messaging/ChannelNameTooLongException.java +++ b/src/main/java/org/bukkit/plugin/messaging/ChannelNameTooLongException.java @@ -4,11 +4,14 @@ package org.bukkit.plugin.messaging; * Thrown if a Plugin Channel is too long. */ @SuppressWarnings("serial") +@Deprecated public class ChannelNameTooLongException extends RuntimeException { + @Deprecated public ChannelNameTooLongException() { super("Attempted to send a Plugin Message to a channel that was too large. The maximum length a channel may be is " + Messenger.MAX_CHANNEL_SIZE + " chars."); } + @Deprecated public ChannelNameTooLongException(String channel) { super("Attempted to send a Plugin Message to a channel that was too large. The maximum length a channel may be is " + Messenger.MAX_CHANNEL_SIZE + " chars (attempted " + channel.length() + " - '" + channel + "."); } diff --git a/src/main/java/org/bukkit/plugin/messaging/ChannelNotRegisteredException.java b/src/main/java/org/bukkit/plugin/messaging/ChannelNotRegisteredException.java index 2266f17..6a32ab1 100644 --- a/src/main/java/org/bukkit/plugin/messaging/ChannelNotRegisteredException.java +++ b/src/main/java/org/bukkit/plugin/messaging/ChannelNotRegisteredException.java @@ -4,11 +4,14 @@ package org.bukkit.plugin.messaging; * Thrown if a Plugin attempts to send a message on an unregistered channel. */ @SuppressWarnings("serial") +@Deprecated public class ChannelNotRegisteredException extends RuntimeException { + @Deprecated public ChannelNotRegisteredException() { this("Attempted to send a plugin message through an unregistered channel."); } + @Deprecated public ChannelNotRegisteredException(String channel) { super("Attempted to send a plugin message through the unregistered channel `" + channel + "'."); } diff --git a/src/main/java/org/bukkit/plugin/messaging/MessageTooLargeException.java b/src/main/java/org/bukkit/plugin/messaging/MessageTooLargeException.java index 61af8c4..7d89d35 100644 --- a/src/main/java/org/bukkit/plugin/messaging/MessageTooLargeException.java +++ b/src/main/java/org/bukkit/plugin/messaging/MessageTooLargeException.java @@ -4,19 +4,24 @@ package org.bukkit.plugin.messaging; * Thrown if a Plugin Message is sent that is too large to be sent. */ @SuppressWarnings("serial") +@Deprecated public class MessageTooLargeException extends RuntimeException { + @Deprecated public MessageTooLargeException() { this("Attempted to send a plugin message that was too large. The maximum length a plugin message may be is " + Messenger.MAX_MESSAGE_SIZE + " bytes."); } + @Deprecated public MessageTooLargeException(byte[] message) { this(message.length); } + @Deprecated public MessageTooLargeException(int length) { this("Attempted to send a plugin message that was too large. The maximum length a plugin message may be is " + Messenger.MAX_MESSAGE_SIZE + " bytes (tried to send one that is " + length + " bytes long)."); } + @Deprecated public MessageTooLargeException(String msg) { super(msg); } diff --git a/src/main/java/org/bukkit/plugin/messaging/Messenger.java b/src/main/java/org/bukkit/plugin/messaging/Messenger.java index aa009fe..b002fa5 100644 --- a/src/main/java/org/bukkit/plugin/messaging/Messenger.java +++ b/src/main/java/org/bukkit/plugin/messaging/Messenger.java @@ -8,16 +8,19 @@ import org.bukkit.plugin.Plugin; * A class responsible for managing the registrations of plugin channels and * their listeners. */ +@Deprecated public interface Messenger { /** * Represents the largest size that an individual Plugin Message may be. */ + @Deprecated public static final int MAX_MESSAGE_SIZE = 32766; /** * Represents the largest size that a Plugin Channel may be. */ + @Deprecated public static final int MAX_CHANNEL_SIZE = 16; /** @@ -27,6 +30,7 @@ public interface Messenger { * @return True if the channel is reserved, otherwise false. * @throws IllegalArgumentException Thrown if channel is null. */ + @Deprecated public boolean isReservedChannel(String channel); /** @@ -37,6 +41,7 @@ public interface Messenger { * @param channel Channel to register. * @throws IllegalArgumentException Thrown if plugin or channel is null. */ + @Deprecated public void registerOutgoingPluginChannel(Plugin plugin, String channel); /** @@ -49,6 +54,7 @@ public interface Messenger { * @param channel Channel to unregister. * @throws IllegalArgumentException Thrown if plugin or channel is null. */ + @Deprecated public void unregisterOutgoingPluginChannel(Plugin plugin, String channel); /** @@ -58,6 +64,7 @@ public interface Messenger { * @param plugin Plugin that no longer wishes to send plugin messages. * @throws IllegalArgumentException Thrown if plugin is null. */ + @Deprecated public void unregisterOutgoingPluginChannel(Plugin plugin); /** @@ -72,6 +79,7 @@ public interface Messenger { * @throws IllegalArgumentException Thrown if plugin, channel or listener * is null, or the listener is already registered for this channel. */ + @Deprecated public PluginMessageListenerRegistration registerIncomingPluginChannel(Plugin plugin, String channel, PluginMessageListener listener); /** @@ -85,6 +93,7 @@ public interface Messenger { * @throws IllegalArgumentException Thrown if plugin, channel or listener * is null. */ + @Deprecated public void unregisterIncomingPluginChannel(Plugin plugin, String channel, PluginMessageListener listener); /** @@ -96,6 +105,7 @@ public interface Messenger { * @param channel Channel to unregister. * @throws IllegalArgumentException Thrown if plugin or channel is null. */ + @Deprecated public void unregisterIncomingPluginChannel(Plugin plugin, String channel); /** @@ -105,6 +115,7 @@ public interface Messenger { * @param plugin Plugin that wishes to unregister from this channel. * @throws IllegalArgumentException Thrown if plugin is null. */ + @Deprecated public void unregisterIncomingPluginChannel(Plugin plugin); /** @@ -112,6 +123,7 @@ public interface Messenger { * * @return List of all registered outgoing plugin channels. */ + @Deprecated public Set getOutgoingChannels(); /** @@ -123,6 +135,7 @@ public interface Messenger { * is registered to. * @throws IllegalArgumentException Thrown if plugin is null. */ + @Deprecated public Set getOutgoingChannels(Plugin plugin); /** @@ -130,6 +143,7 @@ public interface Messenger { * * @return List of all registered incoming plugin channels. */ + @Deprecated public Set getIncomingChannels(); /** @@ -141,6 +155,7 @@ public interface Messenger { * is registered for. * @throws IllegalArgumentException Thrown if plugin is null. */ + @Deprecated public Set getIncomingChannels(Plugin plugin); /** @@ -151,6 +166,7 @@ public interface Messenger { * @return List of all registrations that the plugin has. * @throws IllegalArgumentException Thrown if plugin is null. */ + @Deprecated public Set getIncomingChannelRegistrations(Plugin plugin); /** @@ -161,6 +177,7 @@ public interface Messenger { * @return List of all registrations that are on the channel. * @throws IllegalArgumentException Thrown if channel is null. */ + @Deprecated public Set getIncomingChannelRegistrations(String channel); /** @@ -172,6 +189,7 @@ public interface Messenger { * @return List of all registrations that the plugin has. * @throws IllegalArgumentException Thrown if plugin or channel is null. */ + @Deprecated public Set getIncomingChannelRegistrations(Plugin plugin, String channel); /** @@ -183,6 +201,7 @@ public interface Messenger { * @param registration Registration to check. * @return True if the registration is valid, otherwise false. */ + @Deprecated public boolean isRegistrationValid(PluginMessageListenerRegistration registration); /** @@ -193,6 +212,7 @@ public interface Messenger { * @param channel Channel to test for. * @return True if the channel is registered, else false. */ + @Deprecated public boolean isIncomingChannelRegistered(Plugin plugin, String channel); /** @@ -203,6 +223,7 @@ public interface Messenger { * @param channel Channel to test for. * @return True if the channel is registered, else false. */ + @Deprecated public boolean isOutgoingChannelRegistered(Plugin plugin, String channel); /** @@ -212,5 +233,6 @@ public interface Messenger { * @param channel Channel that the message was sent by. * @param message Raw payload of the message. */ + @Deprecated public void dispatchIncomingMessage(Player source, String channel, byte[] message); } diff --git a/src/main/java/org/bukkit/plugin/messaging/PluginChannelDirection.java b/src/main/java/org/bukkit/plugin/messaging/PluginChannelDirection.java index 3d7ec2e..713a4f5 100644 --- a/src/main/java/org/bukkit/plugin/messaging/PluginChannelDirection.java +++ b/src/main/java/org/bukkit/plugin/messaging/PluginChannelDirection.java @@ -3,6 +3,7 @@ package org.bukkit.plugin.messaging; /** * Represents the different directions a plugin channel may go. */ +@Deprecated public enum PluginChannelDirection { /** diff --git a/src/main/java/org/bukkit/plugin/messaging/PluginMessageListener.java b/src/main/java/org/bukkit/plugin/messaging/PluginMessageListener.java index f1aa080..ccb4640 100644 --- a/src/main/java/org/bukkit/plugin/messaging/PluginMessageListener.java +++ b/src/main/java/org/bukkit/plugin/messaging/PluginMessageListener.java @@ -6,6 +6,7 @@ import org.bukkit.entity.Player; * A listener for a specific Plugin Channel, which will receive notifications * of messages sent from a client. */ +@Deprecated public interface PluginMessageListener { /** @@ -16,5 +17,6 @@ public interface PluginMessageListener { * @param player Source of the message. * @param message The raw message that was sent. */ + @Deprecated public void onPluginMessageReceived(String channel, Player player, byte[] message); } diff --git a/src/main/java/org/bukkit/plugin/messaging/PluginMessageListenerRegistration.java b/src/main/java/org/bukkit/plugin/messaging/PluginMessageListenerRegistration.java index 29929bf..7c46b53 100644 --- a/src/main/java/org/bukkit/plugin/messaging/PluginMessageListenerRegistration.java +++ b/src/main/java/org/bukkit/plugin/messaging/PluginMessageListenerRegistration.java @@ -6,12 +6,18 @@ import org.bukkit.plugin.Plugin; * Contains information about a {@link Plugin}s registration to a plugin * channel. */ +@Deprecated public final class PluginMessageListenerRegistration { + @Deprecated private final Messenger messenger; + @Deprecated private final Plugin plugin; + @Deprecated private final String channel; + @Deprecated private final PluginMessageListener listener; + @Deprecated public PluginMessageListenerRegistration(Messenger messenger, Plugin plugin, String channel, PluginMessageListener listener) { if (messenger == null) { throw new IllegalArgumentException("Messenger cannot be null!"); @@ -37,6 +43,7 @@ public final class PluginMessageListenerRegistration { * * @return Plugin channel. */ + @Deprecated public String getChannel() { return channel; } @@ -46,6 +53,7 @@ public final class PluginMessageListenerRegistration { * * @return Registered listener. */ + @Deprecated public PluginMessageListener getListener() { return listener; } @@ -55,6 +63,7 @@ public final class PluginMessageListenerRegistration { * * @return Registered plugin. */ + @Deprecated public Plugin getPlugin() { return plugin; } @@ -64,11 +73,13 @@ public final class PluginMessageListenerRegistration { * * @return True if this registration is still valid, otherwise false. */ + @Deprecated public boolean isValid() { return messenger.isRegistrationValid(this); } @Override + @Deprecated public boolean equals(Object obj) { if (obj == null) { return false; @@ -93,6 +104,7 @@ public final class PluginMessageListenerRegistration { } @Override + @Deprecated public int hashCode() { int hash = 7; hash = 53 * hash + (this.messenger != null ? this.messenger.hashCode() : 0); diff --git a/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java b/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java index e5c5916..ee7d305 100644 --- a/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java +++ b/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java @@ -6,6 +6,7 @@ import org.bukkit.plugin.Plugin; /** * Represents a possible recipient for a Plugin Message. */ +@Deprecated public interface PluginMessageRecipient { /** * Sends this recipient a Plugin Message on the specified outgoing @@ -26,6 +27,7 @@ public interface PluginMessageRecipient { * @throws ChannelNotRegisteredException Thrown if the channel is not * registered for this plugin. */ + @Deprecated public void sendPluginMessage(Plugin source, String channel, byte[] message); /** @@ -34,5 +36,6 @@ public interface PluginMessageRecipient { * * @return Set containing all the channels that this client may accept. */ + @Deprecated public Set getListeningPluginChannels(); } diff --git a/src/main/java/org/bukkit/plugin/messaging/ReservedChannelException.java b/src/main/java/org/bukkit/plugin/messaging/ReservedChannelException.java index 0221f04..016156a 100644 --- a/src/main/java/org/bukkit/plugin/messaging/ReservedChannelException.java +++ b/src/main/java/org/bukkit/plugin/messaging/ReservedChannelException.java @@ -5,11 +5,14 @@ package org.bukkit.plugin.messaging; * "REGISTER") */ @SuppressWarnings("serial") +@Deprecated public class ReservedChannelException extends RuntimeException { + @Deprecated public ReservedChannelException() { this("Attempted to register for a reserved channel name."); } + @Deprecated public ReservedChannelException(String name) { super("Attempted to register for a reserved channel name ('" + name + "')"); } diff --git a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java index 4c171e8..33e388f 100644 --- a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java +++ b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java @@ -12,14 +12,22 @@ import org.bukkit.plugin.Plugin; /** * Standard implementation to {@link Messenger} */ +@Deprecated public class StandardMessenger implements Messenger { + @Deprecated private final Map> incomingByChannel = new HashMap>(); + @Deprecated private final Map> incomingByPlugin = new HashMap>(); + @Deprecated private final Map> outgoingByChannel = new HashMap>(); + @Deprecated private final Map> outgoingByPlugin = new HashMap>(); + @Deprecated private final Object incomingLock = new Object(); + @Deprecated private final Object outgoingLock = new Object(); + @Deprecated private void addToOutgoing(Plugin plugin, String channel) { synchronized (outgoingLock) { Set plugins = outgoingByChannel.get(channel); @@ -40,6 +48,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated private void removeFromOutgoing(Plugin plugin, String channel) { synchronized (outgoingLock) { Set plugins = outgoingByChannel.get(channel); @@ -63,6 +72,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated private void removeFromOutgoing(Plugin plugin) { synchronized (outgoingLock) { Set channels = outgoingByPlugin.get(plugin); @@ -79,6 +89,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated private void addToIncoming(PluginMessageListenerRegistration registration) { synchronized (incomingLock) { Set registrations = incomingByChannel.get(registration.getChannel()); @@ -109,6 +120,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated private void removeFromIncoming(PluginMessageListenerRegistration registration) { synchronized (incomingLock) { Set registrations = incomingByChannel.get(registration.getChannel()); @@ -133,6 +145,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated private void removeFromIncoming(Plugin plugin, String channel) { synchronized (incomingLock) { Set registrations = incomingByPlugin.get(plugin); @@ -149,6 +162,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated private void removeFromIncoming(Plugin plugin) { synchronized (incomingLock) { Set registrations = incomingByPlugin.get(plugin); @@ -165,12 +179,14 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public boolean isReservedChannel(String channel) { validateChannel(channel); return channel.equals("REGISTER") || channel.equals("UNREGISTER"); } + @Deprecated public void registerOutgoingPluginChannel(Plugin plugin, String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -183,6 +199,7 @@ public class StandardMessenger implements Messenger { addToOutgoing(plugin, channel); } + @Deprecated public void unregisterOutgoingPluginChannel(Plugin plugin, String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -192,6 +209,7 @@ public class StandardMessenger implements Messenger { removeFromOutgoing(plugin, channel); } + @Deprecated public void unregisterOutgoingPluginChannel(Plugin plugin) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -200,6 +218,7 @@ public class StandardMessenger implements Messenger { removeFromOutgoing(plugin); } + @Deprecated public PluginMessageListenerRegistration registerIncomingPluginChannel(Plugin plugin, String channel, PluginMessageListener listener) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -219,6 +238,7 @@ public class StandardMessenger implements Messenger { return result; } + @Deprecated public void unregisterIncomingPluginChannel(Plugin plugin, String channel, PluginMessageListener listener) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -231,6 +251,7 @@ public class StandardMessenger implements Messenger { removeFromIncoming(new PluginMessageListenerRegistration(this, plugin, channel, listener)); } + @Deprecated public void unregisterIncomingPluginChannel(Plugin plugin, String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -240,6 +261,7 @@ public class StandardMessenger implements Messenger { removeFromIncoming(plugin, channel); } + @Deprecated public void unregisterIncomingPluginChannel(Plugin plugin) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -248,6 +270,7 @@ public class StandardMessenger implements Messenger { removeFromIncoming(plugin); } + @Deprecated public Set getOutgoingChannels() { synchronized (outgoingLock) { Set keys = outgoingByChannel.keySet(); @@ -255,6 +278,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public Set getOutgoingChannels(Plugin plugin) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -271,6 +295,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public Set getIncomingChannels() { synchronized (incomingLock) { Set keys = incomingByChannel.keySet(); @@ -278,6 +303,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public Set getIncomingChannels(Plugin plugin) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -300,6 +326,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public Set getIncomingChannelRegistrations(Plugin plugin) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -316,6 +343,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public Set getIncomingChannelRegistrations(String channel) { validateChannel(channel); @@ -330,6 +358,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public Set getIncomingChannelRegistrations(Plugin plugin, String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -355,6 +384,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public boolean isRegistrationValid(PluginMessageListenerRegistration registration) { if (registration == null) { throw new IllegalArgumentException("Registration cannot be null"); @@ -371,6 +401,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public boolean isIncomingChannelRegistered(Plugin plugin, String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -392,6 +423,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public boolean isOutgoingChannelRegistered(Plugin plugin, String channel) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); @@ -409,6 +441,7 @@ public class StandardMessenger implements Messenger { } } + @Deprecated public void dispatchIncomingMessage(Player source, String channel, byte[] message) { if (source == null) { throw new IllegalArgumentException("Player source cannot be null"); @@ -438,6 +471,7 @@ public class StandardMessenger implements Messenger { * * @param channel Channel name to validate. */ + @Deprecated public static void validateChannel(String channel) { if (channel == null) { throw new IllegalArgumentException("Channel cannot be null"); @@ -465,6 +499,7 @@ public class StandardMessenger implements Messenger { * @throws ChannelNotRegisteredException Thrown if the channel is not * registered for this plugin. */ + @Deprecated public static void validatePluginMessage(Messenger messenger, Plugin source, String channel, byte[] message) { if (messenger == null) { throw new IllegalArgumentException("Messenger cannot be null"); diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java index a358c29..7b90729 100644 --- a/src/main/java/org/bukkit/potion/Potion.java +++ b/src/main/java/org/bukkit/potion/Potion.java @@ -13,10 +13,15 @@ import com.google.common.collect.ImmutableList; * Represents a minecraft potion */ public class Potion { + @Deprecated private boolean extended = false; + @Deprecated private boolean splash = false; + @Deprecated private int level = 1; + @Deprecated private int name = -1; + @Deprecated private PotionType type; /** @@ -351,6 +356,7 @@ public class Potion { ONE(0), TWO(0x20); + @Deprecated private int damageBit; Tier(int bit) { @@ -370,13 +376,20 @@ public class Potion { } } + @Deprecated private static PotionBrewer brewer; + @Deprecated private static final int EXTENDED_BIT = 0x40; + @Deprecated private static final int POTION_BIT = 0xF; + @Deprecated private static final int SPLASH_BIT = 0x4000; + @Deprecated private static final int TIER_BIT = 0x20; + @Deprecated private static final int TIER_SHIFT = 5; + @Deprecated private static final int NAME_BIT = 0x3F; /** diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java index 24ee19d..7d86e36 100644 --- a/src/main/java/org/bukkit/potion/PotionEffect.java +++ b/src/main/java/org/bukkit/potion/PotionEffect.java @@ -18,13 +18,21 @@ import com.google.common.collect.ImmutableMap; */ @SerializableAs("PotionEffect") public class PotionEffect implements ConfigurationSerializable { + @Deprecated private static final String AMPLIFIER = "amplifier"; + @Deprecated private static final String DURATION = "duration"; + @Deprecated private static final String TYPE = "effect"; + @Deprecated private static final String AMBIENT = "ambient"; + @Deprecated private final int amplifier; + @Deprecated private final int duration; + @Deprecated private final PotionEffectType type; + @Deprecated private final boolean ambient; /** @@ -65,6 +73,7 @@ public class PotionEffect implements ConfigurationSerializable { this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT)); } + @Deprecated private static PotionEffectType getEffectType(Map map) { int type = getInt(map, TYPE); PotionEffectType effect = PotionEffectType.getById(type); @@ -74,6 +83,7 @@ public class PotionEffect implements ConfigurationSerializable { throw new NoSuchElementException(map + " does not contain " + TYPE); } + @Deprecated private static int getInt(Map map, Object key) { Object num = map.get(key); if (num instanceof Integer) { @@ -82,6 +92,7 @@ public class PotionEffect implements ConfigurationSerializable { throw new NoSuchElementException(map + " does not contain " + key); } + @Deprecated private static boolean getBool(Map map, Object key) { Object bool = map.get(key); if (bool instanceof Boolean) { diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java index 4919d59..bcd6afd 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectType.java +++ b/src/main/java/org/bukkit/potion/PotionEffectType.java @@ -126,8 +126,10 @@ public abstract class PotionEffectType { */ public static final PotionEffectType SATURATION = new PotionEffectTypeWrapper(23); + @Deprecated private final int id; + @Deprecated protected PotionEffectType(int id) { this.id = id; } @@ -202,9 +204,12 @@ public abstract class PotionEffectType { return "PotionEffectType[" + id + ", " + getName() + "]"; } + @Deprecated private static final PotionEffectType[] byId = new PotionEffectType[24]; + @Deprecated private static final Map byName = new HashMap(); // will break on updates. + @Deprecated private static boolean acceptingNew = true; /** diff --git a/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java b/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java index 5db1ce8..f785093 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java +++ b/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java @@ -1,6 +1,7 @@ package org.bukkit.potion; public class PotionEffectTypeWrapper extends PotionEffectType { + @Deprecated protected PotionEffectTypeWrapper(int id) { super(id); } diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java index a02b6a8..7ede2b7 100644 --- a/src/main/java/org/bukkit/potion/PotionType.java +++ b/src/main/java/org/bukkit/potion/PotionType.java @@ -16,7 +16,9 @@ public enum PotionType { INVISIBILITY(14, PotionEffectType.INVISIBILITY, 1), ; + @Deprecated private final int damageValue, maxLevel; + @Deprecated private final PotionEffectType effect; PotionType(int damageValue, PotionEffectType effect, int maxLevel) { diff --git a/src/main/java/org/bukkit/projectiles/BlockProjectileSource.java b/src/main/java/org/bukkit/projectiles/BlockProjectileSource.java index e713c0d..236aac3 100644 --- a/src/main/java/org/bukkit/projectiles/BlockProjectileSource.java +++ b/src/main/java/org/bukkit/projectiles/BlockProjectileSource.java @@ -2,6 +2,7 @@ package org.bukkit.projectiles; import org.bukkit.block.Block; +@Deprecated public interface BlockProjectileSource extends ProjectileSource { /** @@ -9,5 +10,6 @@ public interface BlockProjectileSource extends ProjectileSource { * * @return Block for the projectile source */ + @Deprecated public Block getBlock(); } diff --git a/src/main/java/org/bukkit/projectiles/ProjectileSource.java b/src/main/java/org/bukkit/projectiles/ProjectileSource.java index afad8d7..2f376dc 100644 --- a/src/main/java/org/bukkit/projectiles/ProjectileSource.java +++ b/src/main/java/org/bukkit/projectiles/ProjectileSource.java @@ -6,6 +6,7 @@ import org.bukkit.util.Vector; /** * Represents a valid source of a projectile. */ +@Deprecated public interface ProjectileSource { /** @@ -14,6 +15,7 @@ public interface ProjectileSource { * @param projectile class of the projectile to launch * @return the launched projectile */ + @Deprecated public T launchProjectile(Class projectile); /** @@ -24,5 +26,6 @@ public interface ProjectileSource { * @param velocity the velocity with which to launch * @return the launched projectile */ + @Deprecated public T launchProjectile(Class projectile, Vector velocity); } diff --git a/src/main/java/org/bukkit/scheduler/BukkitRunnable.java b/src/main/java/org/bukkit/scheduler/BukkitRunnable.java index 0351944..6f3c5fb 100644 --- a/src/main/java/org/bukkit/scheduler/BukkitRunnable.java +++ b/src/main/java/org/bukkit/scheduler/BukkitRunnable.java @@ -6,7 +6,9 @@ import org.bukkit.plugin.Plugin; /** * This class is provided as an easy way to handle scheduling tasks. */ +@Deprecated public abstract class BukkitRunnable implements Runnable { + @Deprecated private int taskId = -1; /** @@ -14,6 +16,7 @@ public abstract class BukkitRunnable implements Runnable { * * @throws IllegalStateException if task was not scheduled yet */ + @Deprecated public synchronized void cancel() throws IllegalStateException { Bukkit.getScheduler().cancelTask(getTaskId()); } @@ -27,6 +30,7 @@ public abstract class BukkitRunnable implements Runnable { * @throws IllegalStateException if this was already scheduled * @see BukkitScheduler#runTask(Plugin, Runnable) */ + @Deprecated public synchronized BukkitTask runTask(Plugin plugin) throws IllegalArgumentException, IllegalStateException { checkState(); return setupId(Bukkit.getScheduler().runTask(plugin, this)); @@ -44,6 +48,7 @@ public abstract class BukkitRunnable implements Runnable { * @throws IllegalStateException if this was already scheduled * @see BukkitScheduler#runTaskAsynchronously(Plugin, Runnable) */ + @Deprecated public synchronized BukkitTask runTaskAsynchronously(Plugin plugin) throws IllegalArgumentException, IllegalStateException { checkState(); return setupId(Bukkit.getScheduler().runTaskAsynchronously(plugin, this)); @@ -59,6 +64,7 @@ public abstract class BukkitRunnable implements Runnable { * @throws IllegalStateException if this was already scheduled * @see BukkitScheduler#runTaskLater(Plugin, Runnable, long) */ + @Deprecated public synchronized BukkitTask runTaskLater(Plugin plugin, long delay) throws IllegalArgumentException, IllegalStateException { checkState(); return setupId(Bukkit.getScheduler().runTaskLater(plugin, this, delay)); @@ -78,6 +84,7 @@ public abstract class BukkitRunnable implements Runnable { * @throws IllegalStateException if this was already scheduled * @see BukkitScheduler#runTaskLaterAsynchronously(Plugin, Runnable, long) */ + @Deprecated public synchronized BukkitTask runTaskLaterAsynchronously(Plugin plugin, long delay) throws IllegalArgumentException, IllegalStateException { checkState(); return setupId(Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, this, delay)); @@ -95,6 +102,7 @@ public abstract class BukkitRunnable implements Runnable { * @throws IllegalStateException if this was already scheduled * @see BukkitScheduler#runTaskTimer(Plugin, Runnable, long, long) */ + @Deprecated public synchronized BukkitTask runTaskTimer(Plugin plugin, long delay, long period) throws IllegalArgumentException, IllegalStateException { checkState(); return setupId(Bukkit.getScheduler().runTaskTimer(plugin, this, delay, period)); @@ -117,6 +125,7 @@ public abstract class BukkitRunnable implements Runnable { * @see BukkitScheduler#runTaskTimerAsynchronously(Plugin, Runnable, long, * long) */ + @Deprecated public synchronized BukkitTask runTaskTimerAsynchronously(Plugin plugin, long delay, long period) throws IllegalArgumentException, IllegalStateException { checkState(); return setupId(Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, this, delay, period)); @@ -128,6 +137,7 @@ public abstract class BukkitRunnable implements Runnable { * @return the task id that this runnable was scheduled as * @throws IllegalStateException if task was not scheduled yet */ + @Deprecated public synchronized int getTaskId() throws IllegalStateException { final int id = taskId; if (id == -1) { @@ -136,12 +146,14 @@ public abstract class BukkitRunnable implements Runnable { return id; } + @Deprecated private void checkState() { if (taskId != -1) { throw new IllegalStateException("Already scheduled as " + taskId); } } + @Deprecated private BukkitTask setupId(final BukkitTask task) { this.taskId = task.getTaskId(); return task; diff --git a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java index 44d94f0..f4f1367 100644 --- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java +++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java @@ -5,6 +5,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.List; +@Deprecated public interface BukkitScheduler { /** @@ -17,6 +18,7 @@ public interface BukkitScheduler { * @param delay Delay in server ticks before executing task * @return Task id number (-1 if scheduling failed) */ + @Deprecated public int scheduleSyncDelayedTask(Plugin plugin, Runnable task, long delay); /** @@ -28,6 +30,7 @@ public interface BukkitScheduler { * @param task Task to be executed * @return Task id number (-1 if scheduling failed) */ + @Deprecated public int scheduleSyncDelayedTask(Plugin plugin, Runnable task); /** @@ -41,6 +44,7 @@ public interface BukkitScheduler { * @param period Period in server ticks of the task * @return Task id number (-1 if scheduling failed) */ + @Deprecated public int scheduleSyncRepeatingTask(Plugin plugin, Runnable task, long delay, long period); /** @@ -108,6 +112,7 @@ public interface BukkitScheduler { * @param task Task to be executed * @return Future Future object related to the task */ + @Deprecated public Future callSyncMethod(Plugin plugin, Callable task); /** @@ -115,6 +120,7 @@ public interface BukkitScheduler { * * @param taskId Id number of task to be removed */ + @Deprecated public void cancelTask(int taskId); /** @@ -123,11 +129,13 @@ public interface BukkitScheduler { * * @param plugin Owner of tasks to be removed */ + @Deprecated public void cancelTasks(Plugin plugin); /** * Removes all tasks from the scheduler. */ + @Deprecated public void cancelAllTasks(); /** @@ -144,6 +152,7 @@ public interface BukkitScheduler { *

    * @return If the task is currently running. */ + @Deprecated public boolean isCurrentlyRunning(int taskId); /** @@ -157,6 +166,7 @@ public interface BukkitScheduler { *

    * @return If the task is queued to be run. */ + @Deprecated public boolean isQueued(int taskId); /** @@ -167,6 +177,7 @@ public interface BukkitScheduler { * * @return Active workers */ + @Deprecated public List getActiveWorkers(); /** @@ -175,6 +186,7 @@ public interface BukkitScheduler { * * @return Active workers */ + @Deprecated public List getPendingTasks(); /** @@ -186,6 +198,7 @@ public interface BukkitScheduler { * @throws IllegalArgumentException if plugin is null * @throws IllegalArgumentException if task is null */ + @Deprecated public BukkitTask runTask(Plugin plugin, Runnable task) throws IllegalArgumentException; /** @@ -200,6 +213,7 @@ public interface BukkitScheduler { * @throws IllegalArgumentException if plugin is null * @throws IllegalArgumentException if task is null */ + @Deprecated public BukkitTask runTaskAsynchronously(Plugin plugin, Runnable task) throws IllegalArgumentException; /** @@ -213,6 +227,7 @@ public interface BukkitScheduler { * @throws IllegalArgumentException if plugin is null * @throws IllegalArgumentException if task is null */ + @Deprecated public BukkitTask runTaskLater(Plugin plugin, Runnable task, long delay) throws IllegalArgumentException; /** @@ -229,6 +244,7 @@ public interface BukkitScheduler { * @throws IllegalArgumentException if plugin is null * @throws IllegalArgumentException if task is null */ + @Deprecated public BukkitTask runTaskLaterAsynchronously(Plugin plugin, Runnable task, long delay) throws IllegalArgumentException; /** @@ -243,6 +259,7 @@ public interface BukkitScheduler { * @throws IllegalArgumentException if plugin is null * @throws IllegalArgumentException if task is null */ + @Deprecated public BukkitTask runTaskTimer(Plugin plugin, Runnable task, long delay, long period) throws IllegalArgumentException; /** @@ -261,5 +278,6 @@ public interface BukkitScheduler { * @throws IllegalArgumentException if plugin is null * @throws IllegalArgumentException if task is null */ + @Deprecated public BukkitTask runTaskTimerAsynchronously(Plugin plugin, Runnable task, long delay, long period) throws IllegalArgumentException; } diff --git a/src/main/java/org/bukkit/scheduler/BukkitTask.java b/src/main/java/org/bukkit/scheduler/BukkitTask.java index e447e64..7b7de9f 100644 --- a/src/main/java/org/bukkit/scheduler/BukkitTask.java +++ b/src/main/java/org/bukkit/scheduler/BukkitTask.java @@ -5,6 +5,7 @@ import org.bukkit.plugin.Plugin; /** * Represents a task being executed by the scheduler */ +@Deprecated public interface BukkitTask { /** @@ -12,6 +13,7 @@ public interface BukkitTask { * * @return Task id number */ + @Deprecated public int getTaskId(); /** @@ -19,6 +21,7 @@ public interface BukkitTask { * * @return The Plugin that owns the task */ + @Deprecated public Plugin getOwner(); /** @@ -26,10 +29,12 @@ public interface BukkitTask { * * @return true if the task is run by main thread */ + @Deprecated public boolean isSync(); /** * Will attempt to cancel this task. */ + @Deprecated public void cancel(); } diff --git a/src/main/java/org/bukkit/scheduler/BukkitWorker.java b/src/main/java/org/bukkit/scheduler/BukkitWorker.java index fe1afbd..61e681e 100644 --- a/src/main/java/org/bukkit/scheduler/BukkitWorker.java +++ b/src/main/java/org/bukkit/scheduler/BukkitWorker.java @@ -8,6 +8,7 @@ import org.bukkit.plugin.Plugin; *

    * Workers are used to execute async tasks. */ +@Deprecated public interface BukkitWorker { /** @@ -15,6 +16,7 @@ public interface BukkitWorker { * * @return Task id number */ + @Deprecated public int getTaskId(); /** @@ -22,6 +24,7 @@ public interface BukkitWorker { * * @return The Plugin that owns the task */ + @Deprecated public Plugin getOwner(); /** @@ -29,6 +32,7 @@ public interface BukkitWorker { * * @return The Thread object for the worker */ + @Deprecated public Thread getThread(); } diff --git a/src/main/java/org/bukkit/scoreboard/Criterias.java b/src/main/java/org/bukkit/scoreboard/Criterias.java index cd81c87..7dcbed9 100644 --- a/src/main/java/org/bukkit/scoreboard/Criterias.java +++ b/src/main/java/org/bukkit/scoreboard/Criterias.java @@ -3,10 +3,15 @@ package org.bukkit.scoreboard; /** * Criteria names which trigger an objective to be modified by actions in-game */ +@Deprecated public class Criterias { + @Deprecated public static final String HEALTH; + @Deprecated public static final String PLAYER_KILLS; + @Deprecated public static final String TOTAL_KILLS; + @Deprecated public static final String DEATHS; static { @@ -16,5 +21,6 @@ public class Criterias { DEATHS="deathCount"; } + @Deprecated private Criterias() {} } diff --git a/src/main/java/org/bukkit/scoreboard/DisplaySlot.java b/src/main/java/org/bukkit/scoreboard/DisplaySlot.java index 5d58a18..16b9a21 100644 --- a/src/main/java/org/bukkit/scoreboard/DisplaySlot.java +++ b/src/main/java/org/bukkit/scoreboard/DisplaySlot.java @@ -3,6 +3,7 @@ package org.bukkit.scoreboard; /** * Locations for displaying objectives to the player */ +@Deprecated public enum DisplaySlot { BELOW_NAME, PLAYER_LIST, diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java index fd307eb..2f38f3e 100644 --- a/src/main/java/org/bukkit/scoreboard/Objective.java +++ b/src/main/java/org/bukkit/scoreboard/Objective.java @@ -7,6 +7,7 @@ import org.bukkit.OfflinePlayer; * objective is only relevant to the display of the associated {@link * #getScoreboard() scoreboard}. */ +@Deprecated public interface Objective { /** diff --git a/src/main/java/org/bukkit/scoreboard/Score.java b/src/main/java/org/bukkit/scoreboard/Score.java index c8c34ed..0e27575 100644 --- a/src/main/java/org/bukkit/scoreboard/Score.java +++ b/src/main/java/org/bukkit/scoreboard/Score.java @@ -7,6 +7,7 @@ import org.bukkit.OfflinePlayer; * #getObjective() objective}. Changing this will not affect any other * objective or scoreboard. */ +@Deprecated public interface Score { /** diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java index e9b0abd..e8147ad 100644 --- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java +++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java @@ -7,6 +7,7 @@ import org.bukkit.OfflinePlayer; /** * A scoreboard */ +@Deprecated public interface Scoreboard { /** diff --git a/src/main/java/org/bukkit/scoreboard/ScoreboardManager.java b/src/main/java/org/bukkit/scoreboard/ScoreboardManager.java index 00b67a1..bec2d93 100644 --- a/src/main/java/org/bukkit/scoreboard/ScoreboardManager.java +++ b/src/main/java/org/bukkit/scoreboard/ScoreboardManager.java @@ -5,6 +5,7 @@ import java.lang.ref.WeakReference; /** * Manager of Scoreboards */ +@Deprecated public interface ScoreboardManager { /** diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java index 50c6f76..c1fb786 100644 --- a/src/main/java/org/bukkit/scoreboard/Team.java +++ b/src/main/java/org/bukkit/scoreboard/Team.java @@ -10,6 +10,7 @@ import org.bukkit.potion.PotionEffectType; * properties. This team is only relevant to the display of the associated * {@link #getScoreboard() scoreboard}. */ +@Deprecated public interface Team { /** diff --git a/src/main/java/org/bukkit/util/BlockIterator.java b/src/main/java/org/bukkit/util/BlockIterator.java index 5c85778..6fe456f 100644 --- a/src/main/java/org/bukkit/util/BlockIterator.java +++ b/src/main/java/org/bukkit/util/BlockIterator.java @@ -14,28 +14,44 @@ import java.util.NoSuchElementException; /** * This class performs ray tracing and iterates along blocks on a line */ +@Deprecated public class BlockIterator implements Iterator { + @Deprecated private final World world; + @Deprecated private final int maxDistance; + @Deprecated private static final int gridSize = 1 << 24; + @Deprecated private boolean end = false; + @Deprecated private Block[] blockQueue = new Block[3]; + @Deprecated private int currentBlock = 0; + @Deprecated private int currentDistance = 0; + @Deprecated private int maxDistanceInt; + @Deprecated private int secondError; + @Deprecated private int thirdError; + @Deprecated private int secondStep; + @Deprecated private int thirdStep; + @Deprecated private BlockFace mainFace; + @Deprecated private BlockFace secondFace; + @Deprecated private BlockFace thirdFace; /** @@ -51,6 +67,7 @@ public class BlockIterator implements Iterator { * unloaded chunks. A value of 0 indicates no limit * */ + @Deprecated public BlockIterator(World world, Vector start, Vector direction, double yOffset, int maxDistance) { this.world = world; this.maxDistance = maxDistance; @@ -175,46 +192,57 @@ public class BlockIterator implements Iterator { } + @Deprecated private boolean blockEquals(Block a, Block b) { return a.getX() == b.getX() && a.getY() == b.getY() && a.getZ() == b.getZ(); } + @Deprecated private BlockFace getXFace(Vector direction) { return ((direction.getX() > 0) ? BlockFace.EAST : BlockFace.WEST); } + @Deprecated private BlockFace getYFace(Vector direction) { return ((direction.getY() > 0) ? BlockFace.UP : BlockFace.DOWN); } + @Deprecated private BlockFace getZFace(Vector direction) { return ((direction.getZ() > 0) ? BlockFace.SOUTH : BlockFace.NORTH); } + @Deprecated private double getXLength(Vector direction) { return Math.abs(direction.getX()); } + @Deprecated private double getYLength(Vector direction) { return Math.abs(direction.getY()); } + @Deprecated private double getZLength(Vector direction) { return Math.abs(direction.getZ()); } + @Deprecated private double getPosition(double direction, double position, int blockPosition) { return direction > 0 ? (position - blockPosition) : (blockPosition + 1 - position); } + @Deprecated private double getXPosition(Vector direction, Vector position, Block block) { return getPosition(direction.getX(), position.getX(), block.getX()); } + @Deprecated private double getYPosition(Vector direction, Vector position, Block block) { return getPosition(direction.getY(), position.getY(), block.getY()); } + @Deprecated private double getZPosition(Vector direction, Vector position, Block block) { return getPosition(direction.getZ(), position.getZ(), block.getZ()); } @@ -229,6 +257,7 @@ public class BlockIterator implements Iterator { * trace. Setting this value above 140 may lead to problems with * unloaded chunks. A value of 0 indicates no limit */ + @Deprecated public BlockIterator(Location loc, double yOffset, int maxDistance) { this(loc.getWorld(), loc.toVector(), loc.getDirection(), yOffset, maxDistance); } @@ -241,6 +270,7 @@ public class BlockIterator implements Iterator { * by this value */ + @Deprecated public BlockIterator(Location loc, double yOffset) { this(loc.getWorld(), loc.toVector(), loc.getDirection(), yOffset, 0); } @@ -251,6 +281,7 @@ public class BlockIterator implements Iterator { * @param loc The location for the start of the ray trace */ + @Deprecated public BlockIterator(Location loc) { this(loc, 0D); } @@ -264,6 +295,7 @@ public class BlockIterator implements Iterator { * unloaded chunks. A value of 0 indicates no limit */ + @Deprecated public BlockIterator(LivingEntity entity, int maxDistance) { this(entity.getLocation(), entity.getEyeHeight(), maxDistance); } @@ -274,6 +306,7 @@ public class BlockIterator implements Iterator { * @param entity Information from the entity is used to set up the trace */ + @Deprecated public BlockIterator(LivingEntity entity) { this(entity, 0); } @@ -282,6 +315,7 @@ public class BlockIterator implements Iterator { * Returns true if the iteration has more elements */ + @Deprecated public boolean hasNext() { scan(); return currentBlock != -1; @@ -293,6 +327,7 @@ public class BlockIterator implements Iterator { * @return the next Block in the trace */ + @Deprecated public Block next() { scan(); if (currentBlock <= -1) { @@ -302,10 +337,12 @@ public class BlockIterator implements Iterator { } } + @Deprecated public void remove() { throw new UnsupportedOperationException("[BlockIterator] doesn't support block removal"); } + @Deprecated private void scan() { if (currentBlock >= 0) { return; diff --git a/src/main/java/org/bukkit/util/BlockVector.java b/src/main/java/org/bukkit/util/BlockVector.java index bdf8f6d..77dd389 100644 --- a/src/main/java/org/bukkit/util/BlockVector.java +++ b/src/main/java/org/bukkit/util/BlockVector.java @@ -10,11 +10,13 @@ import org.bukkit.configuration.serialization.SerializableAs; * that BlockVectors are never changed once put into a hash set or hash map. */ @SerializableAs("BlockVector") +@Deprecated public class BlockVector extends Vector { /** * Construct the vector with all components as 0. */ + @Deprecated public BlockVector() { this.x = 0; this.y = 0; @@ -26,6 +28,7 @@ public class BlockVector extends Vector { * * @param vec The other vector. */ + @Deprecated public BlockVector(Vector vec) { this.x = vec.getX(); this.y = vec.getY(); @@ -39,6 +42,7 @@ public class BlockVector extends Vector { * @param y Y component * @param z Z component */ + @Deprecated public BlockVector(int x, int y, int z) { this.x = x; this.y = y; @@ -52,6 +56,7 @@ public class BlockVector extends Vector { * @param y Y component * @param z Z component */ + @Deprecated public BlockVector(double x, double y, double z) { this.x = x; this.y = y; @@ -65,6 +70,7 @@ public class BlockVector extends Vector { * @param y Y component * @param z Z component */ + @Deprecated public BlockVector(float x, float y, float z) { this.x = x; this.y = y; @@ -78,6 +84,7 @@ public class BlockVector extends Vector { * @return whether the other object is equivalent */ @Override + @Deprecated public boolean equals(Object obj) { if (!(obj instanceof BlockVector)) { return false; @@ -94,6 +101,7 @@ public class BlockVector extends Vector { * @return hash code */ @Override + @Deprecated public int hashCode() { return (Integer.valueOf((int) x).hashCode() >> 13) ^ (Integer.valueOf((int) y).hashCode() >> 7) ^ Integer.valueOf((int) z).hashCode(); } @@ -104,10 +112,12 @@ public class BlockVector extends Vector { * @return vector */ @Override + @Deprecated public BlockVector clone() { return (BlockVector) super.clone(); } + @Deprecated public static BlockVector deserialize(Map args) { double x = 0; double y = 0; diff --git a/src/main/java/org/bukkit/util/CachedServerIcon.java b/src/main/java/org/bukkit/util/CachedServerIcon.java index 5ca863b..9c551b9 100644 --- a/src/main/java/org/bukkit/util/CachedServerIcon.java +++ b/src/main/java/org/bukkit/util/CachedServerIcon.java @@ -12,4 +12,5 @@ import org.bukkit.event.server.ServerListPingEvent; * @see Server#loadServerIcon(java.io.File) * @see ServerListPingEvent#setServerIcon(CachedServerIcon) */ +@Deprecated public interface CachedServerIcon {} diff --git a/src/main/java/org/bukkit/util/ChatPaginator.java b/src/main/java/org/bukkit/util/ChatPaginator.java index 24802d1..8f69a9a 100644 --- a/src/main/java/org/bukkit/util/ChatPaginator.java +++ b/src/main/java/org/bukkit/util/ChatPaginator.java @@ -10,12 +10,19 @@ import java.util.List; * into an array of strings appropriate for displaying on the Minecraft player * console. */ +@Deprecated public class ChatPaginator { + @Deprecated public static final int GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH = 55; // Will never wrap, even with the largest characters + @Deprecated public static final int AVERAGE_CHAT_PAGE_WIDTH = 65; // Will typically not wrap using an average character distribution + @Deprecated public static final int UNBOUNDED_PAGE_WIDTH = Integer.MAX_VALUE; + @Deprecated public static final int OPEN_CHAT_PAGE_HEIGHT = 20; // The height of an expanded chat window + @Deprecated public static final int CLOSED_CHAT_PAGE_HEIGHT = 10; // The height of the default chat window + @Deprecated public static final int UNBOUNDED_PAGE_HEIGHT = Integer.MAX_VALUE; /** @@ -25,6 +32,7 @@ public class ChatPaginator { * @param pageNumber The page number to fetch. * @return A single chat page. */ + @Deprecated public static ChatPage paginate(String unpaginatedString, int pageNumber) { return paginate(unpaginatedString, pageNumber, GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH, CLOSED_CHAT_PAGE_HEIGHT); } @@ -38,6 +46,7 @@ public class ChatPaginator { * @param pageHeight The desired number of lines in a page. * @return A single chat page. */ + @Deprecated public static ChatPage paginate(String unpaginatedString, int pageNumber, int lineLength, int pageHeight) { String[] lines = wordWrap(unpaginatedString, lineLength); @@ -59,6 +68,7 @@ public class ChatPaginator { * @param lineLength The length of a line of text. * @return An array of word-wrapped lines. */ + @Deprecated public static String[] wordWrap(String rawString, int lineLength) { // A null string is a single line if (rawString == null) { @@ -141,26 +151,34 @@ public class ChatPaginator { return lines.toArray(new String[lines.size()]); } + @Deprecated public static class ChatPage { + @Deprecated private String[] lines; + @Deprecated private int pageNumber; + @Deprecated private int totalPages; + @Deprecated public ChatPage(String[] lines, int pageNumber, int totalPages) { this.lines = lines; this.pageNumber = pageNumber; this.totalPages = totalPages; } + @Deprecated public int getPageNumber() { return pageNumber; } + @Deprecated public int getTotalPages() { return totalPages; } + @Deprecated public String[] getLines() { return lines; diff --git a/src/main/java/org/bukkit/util/FileUtil.java b/src/main/java/org/bukkit/util/FileUtil.java index 7cabf4c..e2c7a21 100644 --- a/src/main/java/org/bukkit/util/FileUtil.java +++ b/src/main/java/org/bukkit/util/FileUtil.java @@ -9,6 +9,7 @@ import java.io.IOException; /** * Class containing file utilities */ +@Deprecated public class FileUtil { /** @@ -18,6 +19,7 @@ public class FileUtil { * @param outFile the target filename * @return true on success */ + @Deprecated public static boolean copy(File inFile, File outFile) { if (!inFile.exists()) { return false; diff --git a/src/main/java/org/bukkit/util/Java15Compat.java b/src/main/java/org/bukkit/util/Java15Compat.java index c119742..e253dd0 100644 --- a/src/main/java/org/bukkit/util/Java15Compat.java +++ b/src/main/java/org/bukkit/util/Java15Compat.java @@ -2,8 +2,10 @@ package org.bukkit.util; import java.lang.reflect.Array; +@Deprecated public class Java15Compat { @SuppressWarnings("unchecked") + @Deprecated public static T[] Arrays_copyOfRange(T[] original, int start, int end) { if (original.length >= start && 0 <= start) { if (start <= end) { diff --git a/src/main/java/org/bukkit/util/NumberConversions.java b/src/main/java/org/bukkit/util/NumberConversions.java index 29f81d0..c22c6e9 100644 --- a/src/main/java/org/bukkit/util/NumberConversions.java +++ b/src/main/java/org/bukkit/util/NumberConversions.java @@ -3,27 +3,34 @@ package org.bukkit.util; /** * Utils for casting number types to other number types */ +@Deprecated public final class NumberConversions { + @Deprecated private NumberConversions() {} + @Deprecated public static int floor(double num) { final int floor = (int) num; return floor == num ? floor : floor - (int) (Double.doubleToRawLongBits(num) >>> 63); } + @Deprecated public static int ceil(final double num) { final int floor = (int) num; return floor == num ? floor : floor + (int) (~Double.doubleToRawLongBits(num) >>> 63); } + @Deprecated public static int round(double num) { return floor(num + 0.5d); } + @Deprecated public static double square(double num) { return num * num; } + @Deprecated public static int toInt(Object object) { if (object instanceof Number) { return ((Number) object).intValue(); @@ -37,6 +44,7 @@ public final class NumberConversions { return 0; } + @Deprecated public static float toFloat(Object object) { if (object instanceof Number) { return ((Number) object).floatValue(); @@ -50,6 +58,7 @@ public final class NumberConversions { return 0; } + @Deprecated public static double toDouble(Object object) { if (object instanceof Number) { return ((Number) object).doubleValue(); @@ -63,6 +72,7 @@ public final class NumberConversions { return 0; } + @Deprecated public static long toLong(Object object) { if (object instanceof Number) { return ((Number) object).longValue(); @@ -76,6 +86,7 @@ public final class NumberConversions { return 0; } + @Deprecated public static short toShort(Object object) { if (object instanceof Number) { return ((Number) object).shortValue(); @@ -89,6 +100,7 @@ public final class NumberConversions { return 0; } + @Deprecated public static byte toByte(Object object) { if (object instanceof Number) { return ((Number) object).byteValue(); diff --git a/src/main/java/org/bukkit/util/StringUtil.java b/src/main/java/org/bukkit/util/StringUtil.java index 4a8753f..d5c6c31 100644 --- a/src/main/java/org/bukkit/util/StringUtil.java +++ b/src/main/java/org/bukkit/util/StringUtil.java @@ -3,6 +3,7 @@ package org.bukkit.util; import java.util.Collection; import org.apache.commons.lang.Validate; +@Deprecated public class StringUtil { /** @@ -21,6 +22,7 @@ public class StringUtil { * @throws IllegalArgumentException if originals contains a null element. * Note: the collection may be modified before this is thrown */ + @Deprecated public static > T copyPartialMatches(final String token, final Iterable originals, final T collection) throws UnsupportedOperationException, IllegalArgumentException { Validate.notNull(token, "Search token cannot be null"); Validate.notNull(collection, "Collection cannot be null"); @@ -47,6 +49,7 @@ public class StringUtil { * @throws NullPointerException if prefix is null * @throws IllegalArgumentException if string is null */ + @Deprecated public static boolean startsWithIgnoreCase(final String string, final String prefix) throws IllegalArgumentException, NullPointerException { Validate.notNull(string, "Cannot check a null string for a match"); if (string.length() < prefix.length()) { diff --git a/src/main/java/org/bukkit/util/Vector.java b/src/main/java/org/bukkit/util/Vector.java index 61116ea..75371be 100644 --- a/src/main/java/org/bukkit/util/Vector.java +++ b/src/main/java/org/bukkit/util/Vector.java @@ -15,23 +15,31 @@ import org.bukkit.configuration.serialization.SerializableAs; * clone() in order to get a copy. */ @SerializableAs("Vector") +@Deprecated public class Vector implements Cloneable, ConfigurationSerializable { + @Deprecated private static final long serialVersionUID = -2657651106777219169L; + @Deprecated private static Random random = new Random(); /** * Threshold for fuzzy equals(). */ + @Deprecated private static final double epsilon = 0.000001; + @Deprecated protected double x; + @Deprecated protected double y; + @Deprecated protected double z; /** * Construct the vector with all components as 0. */ + @Deprecated public Vector() { this.x = 0; this.y = 0; @@ -45,6 +53,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param y Y component * @param z Z component */ + @Deprecated public Vector(int x, int y, int z) { this.x = x; this.y = y; @@ -58,6 +67,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param y Y component * @param z Z component */ + @Deprecated public Vector(double x, double y, double z) { this.x = x; this.y = y; @@ -71,6 +81,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param y Y component * @param z Z component */ + @Deprecated public Vector(float x, float y, float z) { this.x = x; this.y = y; @@ -83,6 +94,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param vec The other vector * @return the same vector */ + @Deprecated public Vector add(Vector vec) { x += vec.x; y += vec.y; @@ -96,6 +108,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param vec The other vector * @return the same vector */ + @Deprecated public Vector subtract(Vector vec) { x -= vec.x; y -= vec.y; @@ -109,6 +122,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param vec The other vector * @return the same vector */ + @Deprecated public Vector multiply(Vector vec) { x *= vec.x; y *= vec.y; @@ -122,6 +136,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param vec The other vector * @return the same vector */ + @Deprecated public Vector divide(Vector vec) { x /= vec.x; y /= vec.y; @@ -135,6 +150,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param vec The other vector * @return the same vector */ + @Deprecated public Vector copy(Vector vec) { x = vec.x; y = vec.y; @@ -151,6 +167,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return the magnitude */ + @Deprecated public double length() { return Math.sqrt(NumberConversions.square(x) + NumberConversions.square(y) + NumberConversions.square(z)); } @@ -160,6 +177,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return the magnitude */ + @Deprecated public double lengthSquared() { return NumberConversions.square(x) + NumberConversions.square(y) + NumberConversions.square(z); } @@ -174,6 +192,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param o The other vector * @return the distance */ + @Deprecated public double distance(Vector o) { return Math.sqrt(NumberConversions.square(x - o.x) + NumberConversions.square(y - o.y) + NumberConversions.square(z - o.z)); } @@ -184,6 +203,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param o The other vector * @return the distance */ + @Deprecated public double distanceSquared(Vector o) { return NumberConversions.square(x - o.x) + NumberConversions.square(y - o.y) + NumberConversions.square(z - o.z); } @@ -194,6 +214,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param other The other vector * @return angle in radians */ + @Deprecated public float angle(Vector other) { double dot = dot(other) / (length() * other.length()); @@ -206,6 +227,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param other The other vector * @return this same vector (now a midpoint) */ + @Deprecated public Vector midpoint(Vector other) { x = (x + other.x) / 2; y = (y + other.y) / 2; @@ -219,6 +241,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param other The other vector * @return a new midpoint vector */ + @Deprecated public Vector getMidpoint(Vector other) { double x = (this.x + other.x) / 2; double y = (this.y + other.y) / 2; @@ -233,6 +256,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param m The factor * @return the same vector */ + @Deprecated public Vector multiply(int m) { x *= m; y *= m; @@ -247,6 +271,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param m The factor * @return the same vector */ + @Deprecated public Vector multiply(double m) { x *= m; y *= m; @@ -261,6 +286,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param m The factor * @return the same vector */ + @Deprecated public Vector multiply(float m) { x *= m; y *= m; @@ -275,6 +301,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param other The other vector * @return dot product */ + @Deprecated public double dot(Vector other) { return x * other.x + y * other.y + z * other.z; } @@ -291,6 +318,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param o The other vector * @return the same vector */ + @Deprecated public Vector crossProduct(Vector o) { double newX = y * o.z - o.y * z; double newY = z * o.x - o.z * x; @@ -307,6 +335,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return the same vector */ + @Deprecated public Vector normalize() { double length = length(); @@ -322,6 +351,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return the same vector */ + @Deprecated public Vector zero() { x = 0; y = 0; @@ -339,6 +369,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param max Maximum vector * @return whether this vector is in the AABB */ + @Deprecated public boolean isInAABB(Vector min, Vector max) { return x >= min.x && x <= max.x && y >= min.y && y <= max.y && z >= min.z && z <= max.z; } @@ -350,6 +381,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param radius Sphere radius * @return whether this vector is in the sphere */ + @Deprecated public boolean isInSphere(Vector origin, double radius) { return (NumberConversions.square(origin.x - x) + NumberConversions.square(origin.y - y) + NumberConversions.square(origin.z - z)) <= NumberConversions.square(radius); } @@ -359,6 +391,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return The X component. */ + @Deprecated public double getX() { return x; } @@ -369,6 +402,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return block X */ + @Deprecated public int getBlockX() { return NumberConversions.floor(x); } @@ -378,6 +412,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return The Y component. */ + @Deprecated public double getY() { return y; } @@ -388,6 +423,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return block y */ + @Deprecated public int getBlockY() { return NumberConversions.floor(y); } @@ -397,6 +433,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return The Z component. */ + @Deprecated public double getZ() { return z; } @@ -407,6 +444,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return block z */ + @Deprecated public int getBlockZ() { return NumberConversions.floor(z); } @@ -417,6 +455,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param x The new X component. * @return This vector. */ + @Deprecated public Vector setX(int x) { this.x = x; return this; @@ -428,6 +467,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param x The new X component. * @return This vector. */ + @Deprecated public Vector setX(double x) { this.x = x; return this; @@ -439,6 +479,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param x The new X component. * @return This vector. */ + @Deprecated public Vector setX(float x) { this.x = x; return this; @@ -450,6 +491,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param y The new Y component. * @return This vector. */ + @Deprecated public Vector setY(int y) { this.y = y; return this; @@ -461,6 +503,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param y The new Y component. * @return This vector. */ + @Deprecated public Vector setY(double y) { this.y = y; return this; @@ -472,6 +515,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param y The new Y component. * @return This vector. */ + @Deprecated public Vector setY(float y) { this.y = y; return this; @@ -483,6 +527,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param z The new Z component. * @return This vector. */ + @Deprecated public Vector setZ(int z) { this.z = z; return this; @@ -494,6 +539,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param z The new Z component. * @return This vector. */ + @Deprecated public Vector setZ(double z) { this.z = z; return this; @@ -505,6 +551,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param z The new Z component. * @return This vector. */ + @Deprecated public Vector setZ(float z) { this.z = z; return this; @@ -518,6 +565,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * with epsilon. */ @Override + @Deprecated public boolean equals(Object obj) { if (!(obj instanceof Vector)) { return false; @@ -534,6 +582,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @return hash code */ @Override + @Deprecated public int hashCode() { int hash = 7; @@ -549,6 +598,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @return vector */ @Override + @Deprecated public Vector clone() { try { return (Vector) super.clone(); @@ -561,6 +611,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * Returns this vector's components as x,y,z. */ @Override + @Deprecated public String toString() { return x + "," + y + "," + z; } @@ -571,6 +622,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param world The world to link the location to. * @return the location */ + @Deprecated public Location toLocation(World world) { return new Location(world, x, y, z); } @@ -583,6 +635,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param pitch The desired pitch. * @return the location */ + @Deprecated public Location toLocation(World world, float yaw, float pitch) { return new Location(world, x, y, z, yaw, pitch); } @@ -592,6 +645,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return A block vector. */ + @Deprecated public BlockVector toBlockVector() { return new BlockVector(x, y, z); } @@ -601,6 +655,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return The epsilon. */ + @Deprecated public static double getEpsilon() { return epsilon; } @@ -612,6 +667,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param v2 The second vector. * @return minimum */ + @Deprecated public static Vector getMinimum(Vector v1, Vector v2) { return new Vector(Math.min(v1.x, v2.x), Math.min(v1.y, v2.y), Math.min(v1.z, v2.z)); } @@ -623,6 +679,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @param v2 The second vector. * @return maximum */ + @Deprecated public static Vector getMaximum(Vector v1, Vector v2) { return new Vector(Math.max(v1.x, v2.x), Math.max(v1.y, v2.y), Math.max(v1.z, v2.z)); } @@ -633,10 +690,12 @@ public class Vector implements Cloneable, ConfigurationSerializable { * * @return A random vector. */ + @Deprecated public static Vector getRandom() { return new Vector(random.nextDouble(), random.nextDouble(), random.nextDouble()); } + @Deprecated public Map serialize() { Map result = new LinkedHashMap(); @@ -647,6 +706,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { return result; } + @Deprecated public static Vector deserialize(Map args) { double x = 0; double y = 0; diff --git a/src/main/java/org/bukkit/util/io/BukkitObjectInputStream.java b/src/main/java/org/bukkit/util/io/BukkitObjectInputStream.java index d4b2825..c780772 100644 --- a/src/main/java/org/bukkit/util/io/BukkitObjectInputStream.java +++ b/src/main/java/org/bukkit/util/io/BukkitObjectInputStream.java @@ -16,6 +16,7 @@ import org.bukkit.configuration.serialization.ConfigurationSerialization; * Behavior of implementations extending this class is not guaranteed across * future versions. */ +@Deprecated public class BukkitObjectInputStream extends ObjectInputStream { /** @@ -25,6 +26,7 @@ public class BukkitObjectInputStream extends ObjectInputStream { * @throws SecurityException * @see ObjectInputStream#ObjectInputStream() */ + @Deprecated protected BukkitObjectInputStream() throws IOException, SecurityException { super(); super.enableResolveObject(true); @@ -37,12 +39,14 @@ public class BukkitObjectInputStream extends ObjectInputStream { * @throws IOException * @see ObjectInputStream#ObjectInputStream(InputStream) */ + @Deprecated public BukkitObjectInputStream(InputStream in) throws IOException { super(in); super.enableResolveObject(true); } @Override + @Deprecated protected Object resolveObject(Object obj) throws IOException { if (obj instanceof Wrapper) { try { @@ -55,6 +59,7 @@ public class BukkitObjectInputStream extends ObjectInputStream { return super.resolveObject(obj); } + @Deprecated private static IOException newIOException(String string, Throwable cause) { IOException exception = new IOException(string); exception.initCause(cause); diff --git a/src/main/java/org/bukkit/util/io/BukkitObjectOutputStream.java b/src/main/java/org/bukkit/util/io/BukkitObjectOutputStream.java index c11e202..c769e9c 100644 --- a/src/main/java/org/bukkit/util/io/BukkitObjectOutputStream.java +++ b/src/main/java/org/bukkit/util/io/BukkitObjectOutputStream.java @@ -16,6 +16,7 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable; * Behavior of implementations extending this class is not guaranteed across * future versions. */ +@Deprecated public class BukkitObjectOutputStream extends ObjectOutputStream { /** @@ -25,6 +26,7 @@ public class BukkitObjectOutputStream extends ObjectOutputStream { * @throws SecurityException * @see ObjectOutputStream#ObjectOutputStream() */ + @Deprecated protected BukkitObjectOutputStream() throws IOException, SecurityException { super(); super.enableReplaceObject(true); @@ -37,12 +39,14 @@ public class BukkitObjectOutputStream extends ObjectOutputStream { * @throws IOException * @see ObjectOutputStream#ObjectOutputStream(OutputStream) */ + @Deprecated public BukkitObjectOutputStream(OutputStream out) throws IOException { super(out); super.enableReplaceObject(true); } @Override + @Deprecated protected Object replaceObject(Object obj) throws IOException { if (!(obj instanceof Serializable) && (obj instanceof ConfigurationSerializable)) { obj = Wrapper.newWrapper((ConfigurationSerializable) obj); diff --git a/src/main/java/org/bukkit/util/io/Wrapper.java b/src/main/java/org/bukkit/util/io/Wrapper.java index e45605b..f7ef432 100644 --- a/src/main/java/org/bukkit/util/io/Wrapper.java +++ b/src/main/java/org/bukkit/util/io/Wrapper.java @@ -9,6 +9,7 @@ import org.bukkit.configuration.serialization.ConfigurationSerialization; import com.google.common.collect.ImmutableMap; class Wrapper & Serializable> implements Serializable { + @Deprecated private static final long serialVersionUID = -986209235411767547L; final T map; @@ -17,6 +18,7 @@ class Wrapper & Serializable> implements Serializable { return new Wrapper>(ImmutableMap.builder().put(ConfigurationSerialization.SERIALIZED_TYPE_KEY, ConfigurationSerialization.getAlias(obj.getClass())).putAll(obj.serialize()).build()); } + @Deprecated private Wrapper(T map) { this.map = map; } diff --git a/src/main/java/org/bukkit/util/noise/NoiseGenerator.java b/src/main/java/org/bukkit/util/noise/NoiseGenerator.java index 72c92f3..6184d3f 100644 --- a/src/main/java/org/bukkit/util/noise/NoiseGenerator.java +++ b/src/main/java/org/bukkit/util/noise/NoiseGenerator.java @@ -3,10 +3,15 @@ package org.bukkit.util.noise; /** * Base class for all noise generators */ +@Deprecated public abstract class NoiseGenerator { + @Deprecated protected final int perm[] = new int[512]; + @Deprecated protected double offsetX; + @Deprecated protected double offsetY; + @Deprecated protected double offsetZ; /** @@ -15,18 +20,22 @@ public abstract class NoiseGenerator { * @param x Value to floor * @return Floored value */ + @Deprecated public static int floor(double x) { return x >= 0 ? (int) x : (int) x - 1; } + @Deprecated protected static double fade(double x) { return x * x * x * (x * (x * 6 - 15) + 10); } + @Deprecated protected static double lerp(double x, double y, double z) { return y + x * (z - y); } + @Deprecated protected static double grad(int hash, double x, double y, double z) { hash &= 15; double u = hash < 8 ? x : y; @@ -40,6 +49,7 @@ public abstract class NoiseGenerator { * @param x X coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public double noise(double x) { return noise(x, 0, 0); } @@ -51,6 +61,7 @@ public abstract class NoiseGenerator { * @param y Y coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public double noise(double x, double y) { return noise(x, y, 0); } @@ -63,6 +74,7 @@ public abstract class NoiseGenerator { * @param z Z coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public abstract double noise(double x, double y, double z); /** @@ -75,6 +87,7 @@ public abstract class NoiseGenerator { * @param amplitude How much to alter the amplitude by each octave * @return Resulting noise */ + @Deprecated public double noise(double x, int octaves, double frequency, double amplitude) { return noise(x, 0, 0, octaves, frequency, amplitude); } @@ -90,6 +103,7 @@ public abstract class NoiseGenerator { * @param normalized If true, normalize the value to [-1, 1] * @return Resulting noise */ + @Deprecated public double noise(double x, int octaves, double frequency, double amplitude, boolean normalized) { return noise(x, 0, 0, octaves, frequency, amplitude, normalized); } @@ -105,6 +119,7 @@ public abstract class NoiseGenerator { * @param amplitude How much to alter the amplitude by each octave * @return Resulting noise */ + @Deprecated public double noise(double x, double y, int octaves, double frequency, double amplitude) { return noise(x, y, 0, octaves, frequency, amplitude); } @@ -121,6 +136,7 @@ public abstract class NoiseGenerator { * @param normalized If true, normalize the value to [-1, 1] * @return Resulting noise */ + @Deprecated public double noise(double x, double y, int octaves, double frequency, double amplitude, boolean normalized) { return noise(x, y, 0, octaves, frequency, amplitude, normalized); } @@ -137,6 +153,7 @@ public abstract class NoiseGenerator { * @param amplitude How much to alter the amplitude by each octave * @return Resulting noise */ + @Deprecated public double noise(double x, double y, double z, int octaves, double frequency, double amplitude) { return noise(x, y, z, octaves, frequency, amplitude, false); } @@ -154,6 +171,7 @@ public abstract class NoiseGenerator { * @param normalized If true, normalize the value to [-1, 1] * @return Resulting noise */ + @Deprecated public double noise(double x, double y, double z, int octaves, double frequency, double amplitude, boolean normalized) { double result = 0; double amp = 1; diff --git a/src/main/java/org/bukkit/util/noise/OctaveGenerator.java b/src/main/java/org/bukkit/util/noise/OctaveGenerator.java index a87304b..71d6c3b 100644 --- a/src/main/java/org/bukkit/util/noise/OctaveGenerator.java +++ b/src/main/java/org/bukkit/util/noise/OctaveGenerator.java @@ -3,12 +3,18 @@ package org.bukkit.util.noise; /** * Creates noise using unbiased octaves */ +@Deprecated public abstract class OctaveGenerator { + @Deprecated protected final NoiseGenerator[] octaves; + @Deprecated protected double xScale = 1; + @Deprecated protected double yScale = 1; + @Deprecated protected double zScale = 1; + @Deprecated protected OctaveGenerator(NoiseGenerator[] octaves) { this.octaves = octaves; } @@ -21,6 +27,7 @@ public abstract class OctaveGenerator { * * @param scale New value to scale each coordinate by */ + @Deprecated public void setScale(double scale) { setXScale(scale); setYScale(scale); @@ -32,6 +39,7 @@ public abstract class OctaveGenerator { * * @return X scale */ + @Deprecated public double getXScale() { return xScale; } @@ -41,6 +49,7 @@ public abstract class OctaveGenerator { * * @param scale New X scale */ + @Deprecated public void setXScale(double scale) { xScale = scale; } @@ -50,6 +59,7 @@ public abstract class OctaveGenerator { * * @return Y scale */ + @Deprecated public double getYScale() { return yScale; } @@ -59,6 +69,7 @@ public abstract class OctaveGenerator { * * @param scale New Y scale */ + @Deprecated public void setYScale(double scale) { yScale = scale; } @@ -68,6 +79,7 @@ public abstract class OctaveGenerator { * * @return Z scale */ + @Deprecated public double getZScale() { return zScale; } @@ -77,6 +89,7 @@ public abstract class OctaveGenerator { * * @param scale New Z scale */ + @Deprecated public void setZScale(double scale) { zScale = scale; } @@ -86,6 +99,7 @@ public abstract class OctaveGenerator { * * @return Clone of the individual octaves */ + @Deprecated public NoiseGenerator[] getOctaves() { return octaves.clone(); } @@ -99,6 +113,7 @@ public abstract class OctaveGenerator { * @param amplitude How much to alter the amplitude by each octave * @return Resulting noise */ + @Deprecated public double noise(double x, double frequency, double amplitude) { return noise(x, 0, 0, frequency, amplitude); } @@ -113,6 +128,7 @@ public abstract class OctaveGenerator { * @param normalized If true, normalize the value to [-1, 1] * @return Resulting noise */ + @Deprecated public double noise(double x, double frequency, double amplitude, boolean normalized) { return noise(x, 0, 0, frequency, amplitude, normalized); } @@ -127,6 +143,7 @@ public abstract class OctaveGenerator { * @param amplitude How much to alter the amplitude by each octave * @return Resulting noise */ + @Deprecated public double noise(double x, double y, double frequency, double amplitude) { return noise(x, y, 0, frequency, amplitude); } @@ -142,6 +159,7 @@ public abstract class OctaveGenerator { * @param normalized If true, normalize the value to [-1, 1] * @return Resulting noise */ + @Deprecated public double noise(double x, double y, double frequency, double amplitude, boolean normalized) { return noise(x, y, 0, frequency, amplitude, normalized); } @@ -157,6 +175,7 @@ public abstract class OctaveGenerator { * @param amplitude How much to alter the amplitude by each octave * @return Resulting noise */ + @Deprecated public double noise(double x, double y, double z, double frequency, double amplitude) { return noise(x, y, z, frequency, amplitude, false); } @@ -173,6 +192,7 @@ public abstract class OctaveGenerator { * @param normalized If true, normalize the value to [-1, 1] * @return Resulting noise */ + @Deprecated public double noise(double x, double y, double z, double frequency, double amplitude, boolean normalized) { double result = 0; double amp = 1; diff --git a/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java b/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java index 5e034c1..194af13 100644 --- a/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java +++ b/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java @@ -9,12 +9,16 @@ import org.bukkit.World; * @see SimplexNoiseGenerator "Improved" and faster version with slighly * different results */ +@Deprecated public class PerlinNoiseGenerator extends NoiseGenerator { + @Deprecated protected static final int grad3[][] = {{1, 1, 0}, {-1, 1, 0}, {1, -1, 0}, {-1, -1, 0}, {1, 0, 1}, {-1, 0, 1}, {1, 0, -1}, {-1, 0, -1}, {0, 1, 1}, {0, -1, 1}, {0, 1, -1}, {0, -1, -1}}; + @Deprecated private static final PerlinNoiseGenerator instance = new PerlinNoiseGenerator(); + @Deprecated protected PerlinNoiseGenerator() { int p[] = {151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, @@ -45,6 +49,7 @@ public class PerlinNoiseGenerator extends NoiseGenerator { * * @param world World to construct this generator for */ + @Deprecated public PerlinNoiseGenerator(World world) { this(new Random(world.getSeed())); } @@ -54,6 +59,7 @@ public class PerlinNoiseGenerator extends NoiseGenerator { * * @param seed Seed to construct this generator for */ + @Deprecated public PerlinNoiseGenerator(long seed) { this(new Random(seed)); } @@ -63,6 +69,7 @@ public class PerlinNoiseGenerator extends NoiseGenerator { * * @param rand Random to construct with */ + @Deprecated public PerlinNoiseGenerator(Random rand) { offsetX = rand.nextDouble() * 256; offsetY = rand.nextDouble() * 256; @@ -89,6 +96,7 @@ public class PerlinNoiseGenerator extends NoiseGenerator { * @param x X coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public static double getNoise(double x) { return instance.noise(x); } @@ -101,6 +109,7 @@ public class PerlinNoiseGenerator extends NoiseGenerator { * @param y Y coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public static double getNoise(double x, double y) { return instance.noise(x, y); } @@ -114,6 +123,7 @@ public class PerlinNoiseGenerator extends NoiseGenerator { * @param z Z coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public static double getNoise(double x, double y, double z) { return instance.noise(x, y, z); } @@ -123,11 +133,13 @@ public class PerlinNoiseGenerator extends NoiseGenerator { * * @return Singleton */ + @Deprecated public static PerlinNoiseGenerator getInstance() { return instance; } @Override + @Deprecated public double noise(double x, double y, double z) { x += offsetX; y += offsetY; @@ -180,6 +192,7 @@ public class PerlinNoiseGenerator extends NoiseGenerator { * @param amplitude How much to alter the amplitude by each octave * @return Resulting noise */ + @Deprecated public static double getNoise(double x, int octaves, double frequency, double amplitude) { return instance.noise(x, octaves, frequency, amplitude); } @@ -195,6 +208,7 @@ public class PerlinNoiseGenerator extends NoiseGenerator { * @param amplitude How much to alter the amplitude by each octave * @return Resulting noise */ + @Deprecated public static double getNoise(double x, double y, int octaves, double frequency, double amplitude) { return instance.noise(x, y, octaves, frequency, amplitude); } @@ -211,6 +225,7 @@ public class PerlinNoiseGenerator extends NoiseGenerator { * @param amplitude How much to alter the amplitude by each octave * @return Resulting noise */ + @Deprecated public static double getNoise(double x, double y, double z, int octaves, double frequency, double amplitude) { return instance.noise(x, y, z, octaves, frequency, amplitude); } diff --git a/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java b/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java index 55b7ad7..3d5600f 100644 --- a/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java +++ b/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java @@ -6,6 +6,7 @@ import org.bukkit.World; /** * Creates perlin noise through unbiased octaves */ +@Deprecated public class PerlinOctaveGenerator extends OctaveGenerator { /** @@ -14,6 +15,7 @@ public class PerlinOctaveGenerator extends OctaveGenerator { * @param world World to construct this generator for * @param octaves Amount of octaves to create */ + @Deprecated public PerlinOctaveGenerator(World world, int octaves) { this(new Random(world.getSeed()), octaves); } @@ -24,6 +26,7 @@ public class PerlinOctaveGenerator extends OctaveGenerator { * @param seed Seed to construct this generator for * @param octaves Amount of octaves to create */ + @Deprecated public PerlinOctaveGenerator(long seed, int octaves) { this(new Random(seed), octaves); } @@ -34,10 +37,12 @@ public class PerlinOctaveGenerator extends OctaveGenerator { * @param rand Random object to construct this generator for * @param octaves Amount of octaves to create */ + @Deprecated public PerlinOctaveGenerator(Random rand, int octaves) { super(createOctaves(rand, octaves)); } + @Deprecated private static NoiseGenerator[] createOctaves(Random rand, int octaves) { NoiseGenerator[] result = new NoiseGenerator[octaves]; diff --git a/src/main/java/org/bukkit/util/noise/SimplexNoiseGenerator.java b/src/main/java/org/bukkit/util/noise/SimplexNoiseGenerator.java index b052f3c..a537ec7 100644 --- a/src/main/java/org/bukkit/util/noise/SimplexNoiseGenerator.java +++ b/src/main/java/org/bukkit/util/noise/SimplexNoiseGenerator.java @@ -11,19 +11,33 @@ import org.bukkit.World; * * http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf */ +@Deprecated public class SimplexNoiseGenerator extends PerlinNoiseGenerator { + @Deprecated protected static final double SQRT_3 = Math.sqrt(3); + @Deprecated protected static final double SQRT_5 = Math.sqrt(5); + @Deprecated protected static final double F2 = 0.5 * (SQRT_3 - 1); + @Deprecated protected static final double G2 = (3 - SQRT_3) / 6; + @Deprecated protected static final double G22 = G2 * 2.0 - 1; + @Deprecated protected static final double F3 = 1.0 / 3.0; + @Deprecated protected static final double G3 = 1.0 / 6.0; + @Deprecated protected static final double F4 = (SQRT_5 - 1.0) / 4.0; + @Deprecated protected static final double G4 = (5.0 - SQRT_5) / 20.0; + @Deprecated protected static final double G42 = G4 * 2.0; + @Deprecated protected static final double G43 = G4 * 3.0; + @Deprecated protected static final double G44 = G4 * 4.0 - 1.0; + @Deprecated protected static final int grad4[][] = {{0, 1, 1, 1}, {0, 1, 1, -1}, {0, 1, -1, 1}, {0, 1, -1, -1}, {0, -1, 1, 1}, {0, -1, 1, -1}, {0, -1, -1, 1}, {0, -1, -1, -1}, {1, 0, 1, 1}, {1, 0, 1, -1}, {1, 0, -1, 1}, {1, 0, -1, -1}, @@ -32,6 +46,7 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { {-1, 1, 0, 1}, {-1, 1, 0, -1}, {-1, -1, 0, 1}, {-1, -1, 0, -1}, {1, 1, 1, 0}, {1, 1, -1, 0}, {1, -1, 1, 0}, {1, -1, -1, 0}, {-1, 1, 1, 0}, {-1, 1, -1, 0}, {-1, -1, 1, 0}, {-1, -1, -1, 0}}; + @Deprecated protected static final int simplex[][] = { {0, 1, 2, 3}, {0, 1, 3, 2}, {0, 0, 0, 0}, {0, 2, 3, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {1, 2, 3, 0}, {0, 2, 1, 3}, {0, 0, 0, 0}, {0, 3, 1, 2}, {0, 3, 2, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {1, 3, 2, 0}, @@ -41,9 +56,12 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {2, 0, 1, 3}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {3, 0, 1, 2}, {3, 0, 2, 1}, {0, 0, 0, 0}, {3, 1, 2, 0}, {2, 1, 0, 3}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {3, 1, 0, 2}, {0, 0, 0, 0}, {3, 2, 0, 1}, {3, 2, 1, 0}}; + @Deprecated protected static double offsetW; + @Deprecated private static final SimplexNoiseGenerator instance = new SimplexNoiseGenerator(); + @Deprecated protected SimplexNoiseGenerator() { super(); } @@ -53,6 +71,7 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { * * @param world World to construct this generator for */ + @Deprecated public SimplexNoiseGenerator(World world) { this(new Random(world.getSeed())); } @@ -62,6 +81,7 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { * * @param seed Seed to construct this generator for */ + @Deprecated public SimplexNoiseGenerator(long seed) { this(new Random(seed)); } @@ -71,19 +91,23 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { * * @param rand Random to construct with */ + @Deprecated public SimplexNoiseGenerator(Random rand) { super(rand); offsetW = rand.nextDouble() * 256; } + @Deprecated protected static double dot(int g[], double x, double y) { return g[0] * x + g[1] * y; } + @Deprecated protected static double dot(int g[], double x, double y, double z) { return g[0] * x + g[1] * y + g[2] * z; } + @Deprecated protected static double dot(int g[], double x, double y, double z, double w) { return g[0] * x + g[1] * y + g[2] * z + g[3] * w; } @@ -95,6 +119,7 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { * @param xin X coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public static double getNoise(double xin) { return instance.noise(xin); } @@ -107,6 +132,7 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { * @param yin Y coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public static double getNoise(double xin, double yin) { return instance.noise(xin, yin); } @@ -120,6 +146,7 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { * @param zin Z coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public static double getNoise(double xin, double yin, double zin) { return instance.noise(xin, yin, zin); } @@ -134,11 +161,13 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { * @param w W coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public static double getNoise(double x, double y, double z, double w) { return instance.noise(x, y, z, w); } @Override + @Deprecated public double noise(double xin, double yin, double zin) { xin += offsetX; yin += offsetY; @@ -278,6 +307,7 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { } @Override + @Deprecated public double noise(double xin, double yin) { xin += offsetX; yin += offsetY; @@ -363,6 +393,7 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { * @param w W coordinate * @return Noise at given location, from range -1 to 1 */ + @Deprecated public double noise(double x, double y, double z, double w) { x += offsetX; y += offsetY; @@ -514,6 +545,7 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator { * * @return Singleton */ + @Deprecated public static SimplexNoiseGenerator getInstance() { return instance; } diff --git a/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java b/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java index 61e66aa..54b1250 100644 --- a/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java +++ b/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java @@ -6,7 +6,9 @@ import org.bukkit.World; /** * Creates simplex noise through unbiased octaves */ +@Deprecated public class SimplexOctaveGenerator extends OctaveGenerator { + @Deprecated private double wScale = 1; /** @@ -15,6 +17,7 @@ public class SimplexOctaveGenerator extends OctaveGenerator { * @param world World to construct this generator for * @param octaves Amount of octaves to create */ + @Deprecated public SimplexOctaveGenerator(World world, int octaves) { this(new Random(world.getSeed()), octaves); } @@ -25,6 +28,7 @@ public class SimplexOctaveGenerator extends OctaveGenerator { * @param seed Seed to construct this generator for * @param octaves Amount of octaves to create */ + @Deprecated public SimplexOctaveGenerator(long seed, int octaves) { this(new Random(seed), octaves); } @@ -35,11 +39,13 @@ public class SimplexOctaveGenerator extends OctaveGenerator { * @param rand Random object to construct this generator for * @param octaves Amount of octaves to create */ + @Deprecated public SimplexOctaveGenerator(Random rand, int octaves) { super(createOctaves(rand, octaves)); } @Override + @Deprecated public void setScale(double scale) { super.setScale(scale); setWScale(scale); @@ -50,6 +56,7 @@ public class SimplexOctaveGenerator extends OctaveGenerator { * * @return W scale */ + @Deprecated public double getWScale() { return wScale; } @@ -59,6 +66,7 @@ public class SimplexOctaveGenerator extends OctaveGenerator { * * @param scale New W scale */ + @Deprecated public void setWScale(double scale) { wScale = scale; } @@ -75,6 +83,7 @@ public class SimplexOctaveGenerator extends OctaveGenerator { * @param amplitude How much to alter the amplitude by each octave * @return Resulting noise */ + @Deprecated public double noise(double x, double y, double z, double w, double frequency, double amplitude) { return noise(x, y, z, w, frequency, amplitude, false); } @@ -92,6 +101,7 @@ public class SimplexOctaveGenerator extends OctaveGenerator { * @param normalized If true, normalize the value to [-1, 1] * @return Resulting noise */ + @Deprecated public double noise(double x, double y, double z, double w, double frequency, double amplitude, boolean normalized) { double result = 0; double amp = 1; @@ -117,6 +127,7 @@ public class SimplexOctaveGenerator extends OctaveGenerator { return result; } + @Deprecated private static NoiseGenerator[] createOctaves(Random rand, int octaves) { NoiseGenerator[] result = new NoiseGenerator[octaves]; diff --git a/src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java b/src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java index 092370e..e570fb1 100644 --- a/src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java +++ b/src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java @@ -3,12 +3,17 @@ package org.bukkit.util.permissions; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionDefault; +@Deprecated public final class BroadcastPermissions { + @Deprecated private static final String ROOT = "bukkit.broadcast"; + @Deprecated private static final String PREFIX = ROOT + "."; + @Deprecated private BroadcastPermissions() {} + @Deprecated public static Permission registerPermissions(Permission parent) { Permission broadcasts = DefaultPermissions.registerPermission(ROOT, "Allows the user to receive all broadcast messages", parent); diff --git a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java index 4638c91..59738ec 100644 --- a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java +++ b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java @@ -3,12 +3,17 @@ package org.bukkit.util.permissions; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionDefault; +@Deprecated public final class CommandPermissions { + @Deprecated private static final String ROOT = "bukkit.command"; + @Deprecated private static final String PREFIX = ROOT + "."; + @Deprecated private CommandPermissions() {} + @Deprecated private static Permission registerWhitelist(Permission parent) { Permission whitelist = DefaultPermissions.registerPermission(PREFIX + "whitelist", "Allows the user to modify the server whitelist", PermissionDefault.OP, parent); @@ -24,6 +29,7 @@ public final class CommandPermissions { return whitelist; } + @Deprecated private static Permission registerBan(Permission parent) { Permission ban = DefaultPermissions.registerPermission(PREFIX + "ban", "Allows the user to ban people", PermissionDefault.OP, parent); @@ -35,6 +41,7 @@ public final class CommandPermissions { return ban; } + @Deprecated private static Permission registerUnban(Permission parent) { Permission unban = DefaultPermissions.registerPermission(PREFIX + "unban", "Allows the user to unban people", PermissionDefault.OP, parent); @@ -46,6 +53,7 @@ public final class CommandPermissions { return unban; } + @Deprecated private static Permission registerOp(Permission parent) { Permission op = DefaultPermissions.registerPermission(PREFIX + "op", "Allows the user to change operators", PermissionDefault.OP, parent); @@ -57,6 +65,7 @@ public final class CommandPermissions { return op; } + @Deprecated private static Permission registerSave(Permission parent) { Permission save = DefaultPermissions.registerPermission(PREFIX + "save", "Allows the user to save the worlds", PermissionDefault.OP, parent); @@ -69,6 +78,7 @@ public final class CommandPermissions { return save; } + @Deprecated private static Permission registerTime(Permission parent) { Permission time = DefaultPermissions.registerPermission(PREFIX + "time", "Allows the user to alter the time", PermissionDefault.OP, parent); @@ -80,6 +90,7 @@ public final class CommandPermissions { return time; } + @Deprecated public static Permission registerPermissions(Permission parent) { Permission commands = DefaultPermissions.registerPermission(ROOT, "Gives the user the ability to use all CraftBukkit commands", parent); diff --git a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java index 8c0df8e..b44e349 100644 --- a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java +++ b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java @@ -5,16 +5,22 @@ import org.bukkit.Bukkit; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionDefault; +@Deprecated public final class DefaultPermissions { + @Deprecated private static final String ROOT = "craftbukkit"; + @Deprecated private static final String LEGACY_PREFIX = "craft"; + @Deprecated private DefaultPermissions() {} + @Deprecated public static Permission registerPermission(Permission perm) { return registerPermission(perm, true); } + @Deprecated public static Permission registerPermission(Permission perm, boolean withLegacy) { Permission result = perm; @@ -33,44 +39,52 @@ public final class DefaultPermissions { return result; } + @Deprecated public static Permission registerPermission(Permission perm, Permission parent) { parent.getChildren().put(perm.getName(), true); return registerPermission(perm); } + @Deprecated public static Permission registerPermission(String name, String desc) { Permission perm = registerPermission(new Permission(name, desc)); return perm; } + @Deprecated public static Permission registerPermission(String name, String desc, Permission parent) { Permission perm = registerPermission(name, desc); parent.getChildren().put(perm.getName(), true); return perm; } + @Deprecated public static Permission registerPermission(String name, String desc, PermissionDefault def) { Permission perm = registerPermission(new Permission(name, desc, def)); return perm; } + @Deprecated public static Permission registerPermission(String name, String desc, PermissionDefault def, Permission parent) { Permission perm = registerPermission(name, desc, def); parent.getChildren().put(perm.getName(), true); return perm; } + @Deprecated public static Permission registerPermission(String name, String desc, PermissionDefault def, Map children) { Permission perm = registerPermission(new Permission(name, desc, def, children)); return perm; } + @Deprecated public static Permission registerPermission(String name, String desc, PermissionDefault def, Map children, Permission parent) { Permission perm = registerPermission(name, desc, def, children); parent.getChildren().put(perm.getName(), true); return perm; } + @Deprecated public static void registerCorePermissions() { Permission parent = registerPermission(ROOT, "Gives the user the ability to use all CraftBukkit utilities and commands"); diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java index 9fca481..8c596bf 100644 --- a/src/main/java/org/spigotmc/CustomTimingsHandler.java +++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java @@ -16,16 +16,26 @@ import org.bukkit.World; public class CustomTimingsHandler { + @Deprecated private static final Collection ALL_HANDLERS = new HashSet(); + @Deprecated private static CustomTimingsHandler[] BAKED_HANDLERS; /*========================================================================*/ + @Deprecated private final String name; + @Deprecated private final CustomTimingsHandler parent; + @Deprecated private long count = 0; + @Deprecated private long start = 0; + @Deprecated private long timingDepth = 0; + @Deprecated private long totalTime = 0; + @Deprecated private long curTickTotal = 0; + @Deprecated private long violations = 0; public CustomTimingsHandler(String name) diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java index 24d4942..6860c07 100644 --- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java +++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java @@ -11,8 +11,11 @@ import org.bukkit.event.entity.EntityEvent; public class EntityDismountEvent extends EntityEvent { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final Entity dismounted; public EntityDismountEvent(Entity what, Entity dismounted) diff --git a/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java index 16aa2a7..9a50f3d 100644 --- a/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java +++ b/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java @@ -12,8 +12,11 @@ import org.bukkit.event.entity.EntityEvent; public class EntityMountEvent extends EntityEvent implements Cancellable { + @Deprecated private static final HandlerList handlers = new HandlerList(); + @Deprecated private boolean cancelled; + @Deprecated private final Entity mount; public EntityMountEvent(Entity what, Entity mount) diff --git a/src/test/java/org/bukkit/DyeColorTest.java b/src/test/java/org/bukkit/DyeColorTest.java index 9e30fbf..504de7d 100644 --- a/src/test/java/org/bukkit/DyeColorTest.java +++ b/src/test/java/org/bukkit/DyeColorTest.java @@ -64,6 +64,7 @@ public class DyeColorTest { testColorable(new Wool(Material.WOOL, dye.getWoolData())); } + @Deprecated private void testColorable(final Colorable colorable) { assertThat(colorable.getColor(), is(this.dye)); } diff --git a/src/test/java/org/bukkit/LocationTest.java b/src/test/java/org/bukkit/LocationTest.java index fa24776..13385f4 100644 --- a/src/test/java/org/bukkit/LocationTest.java +++ b/src/test/java/org/bukkit/LocationTest.java @@ -17,6 +17,7 @@ import com.google.common.collect.ImmutableList; @RunWith(Parameterized.class) public class LocationTest { + @Deprecated private static final double δ = 1.0 / 1000000; /** *

    @@ -27,6 +28,7 @@ public class LocationTest {
          * => a = √(1/2) ∎
          * 
    */ + @Deprecated private static final double HALF_UNIT = Math.sqrt(1 / 2f); /** *
    @@ -37,6 +39,7 @@ public class LocationTest {
          * => a = √(1/4) ∎
          * 
    */ + @Deprecated private static final double HALF_HALF_UNIT = Math.sqrt(1 / 4f); @Parameters(name= "{index}: {0}") @@ -113,6 +116,7 @@ public class LocationTest { ); } + @Deprecated private static Object[] getRandom(Random random, int index) { final double YAW_FACTOR = 360; final double YAW_OFFSET = 0; @@ -179,14 +183,17 @@ public class LocationTest { assertThat(vector.getZ(), is(closeTo(z, δ))); } + @Deprecated private Vector getVector() { return new Vector(x, y, z); } + @Deprecated private static Location getEmptyLocation() { return new Location(null, 0, 0, 0); } + @Deprecated private Location getLocation() { Location location = getEmptyLocation(); location.setYaw(yaw); diff --git a/src/test/java/org/bukkit/TestServer.java b/src/test/java/org/bukkit/TestServer.java index 2d84032..4c299df 100644 --- a/src/test/java/org/bukkit/TestServer.java +++ b/src/test/java/org/bukkit/TestServer.java @@ -13,10 +13,12 @@ import org.bukkit.plugin.SimplePluginManager; import com.google.common.collect.ImmutableMap; public class TestServer implements InvocationHandler { + @Deprecated private static interface MethodHandler { Object handle(TestServer server, Object[] args); } + @Deprecated private static final Map methods; static { @@ -82,8 +84,11 @@ public class TestServer implements InvocationHandler { } } + @Deprecated private Thread creatingThread = Thread.currentThread(); + @Deprecated private PluginManager pluginManager; + @Deprecated private TestServer() {}; public static Server getInstance() { diff --git a/src/test/java/org/bukkit/conversations/ConversationTest.java b/src/test/java/org/bukkit/conversations/ConversationTest.java index 732caab..014040b 100644 --- a/src/test/java/org/bukkit/conversations/ConversationTest.java +++ b/src/test/java/org/bukkit/conversations/ConversationTest.java @@ -87,6 +87,7 @@ public class ConversationTest { assertEquals(conversation, forWhom.abandonedConverstion); } + @Deprecated private class FirstPrompt extends StringPrompt { public String getPromptText(ConversationContext context) { @@ -100,9 +101,11 @@ public class ConversationTest { } } + @Deprecated private class SecondPrompt extends MessagePrompt { @Override + @Deprecated protected Prompt getNextPrompt(ConversationContext context) { return Prompt.END_OF_CONVERSATION; } diff --git a/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java b/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java index d1c0f42..926f453 100644 --- a/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java +++ b/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java @@ -49,10 +49,12 @@ public class ValidatingPromptTest { //TODO: TestPlayerNamePrompt() + @Deprecated private class TestBooleanPrompt extends BooleanPrompt { public boolean result; @Override + @Deprecated protected Prompt acceptValidatedInput(ConversationContext context, boolean input) { result = input; return null; @@ -63,6 +65,7 @@ public class ValidatingPromptTest { } } + @Deprecated private class TestFixedSetPrompt extends FixedSetPrompt { public String result; @@ -71,6 +74,7 @@ public class ValidatingPromptTest { } @Override + @Deprecated protected Prompt acceptValidatedInput(ConversationContext context, String input) { result = input; return null; @@ -81,10 +85,12 @@ public class ValidatingPromptTest { } } + @Deprecated private class TestNumericPrompt extends NumericPrompt { public Number result; @Override + @Deprecated protected Prompt acceptValidatedInput(ConversationContext context, Number input) { result = input; return null; @@ -95,6 +101,7 @@ public class ValidatingPromptTest { } } + @Deprecated private class TestRegexPrompt extends RegexPrompt { public String result; @@ -103,6 +110,7 @@ public class ValidatingPromptTest { } @Override + @Deprecated protected Prompt acceptValidatedInput(ConversationContext context, String input) { result = input; return null; diff --git a/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java b/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java index 619bf30..e863ccc 100644 --- a/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java +++ b/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java @@ -22,6 +22,7 @@ public class PlayerChatTabCompleteEventTest { assertThat(getToken(" "), is("")); } + @Deprecated private String getToken(String message) { return new PlayerChatTabCompleteEvent(TestPlayer.getInstance(), message, ImmutableList.of()).getLastToken(); } diff --git a/src/test/java/org/bukkit/event/TestEvent.java b/src/test/java/org/bukkit/event/TestEvent.java index 25904f5..51ea0f5 100644 --- a/src/test/java/org/bukkit/event/TestEvent.java +++ b/src/test/java/org/bukkit/event/TestEvent.java @@ -2,6 +2,7 @@ package org.bukkit.event; public class TestEvent extends Event { + @Deprecated private static final HandlerList handlers = new HandlerList(); public TestEvent(boolean async) { diff --git a/src/test/java/org/bukkit/metadata/FixedMetadataValueTest.java b/src/test/java/org/bukkit/metadata/FixedMetadataValueTest.java index 5583b27..40e293d 100644 --- a/src/test/java/org/bukkit/metadata/FixedMetadataValueTest.java +++ b/src/test/java/org/bukkit/metadata/FixedMetadataValueTest.java @@ -8,7 +8,9 @@ import org.bukkit.plugin.TestPlugin; import org.junit.Test; public class FixedMetadataValueTest { + @Deprecated private Plugin plugin = new TestPlugin("X"); + @Deprecated private FixedMetadataValue subject; @Test diff --git a/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java b/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java index a3172db..aa93107 100644 --- a/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java +++ b/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java @@ -8,7 +8,9 @@ import java.util.concurrent.Callable; import static org.junit.Assert.*; public class LazyMetadataValueTest { + @Deprecated private LazyMetadataValue subject; + @Deprecated private TestPlugin plugin = new TestPlugin("x"); @Test @@ -113,6 +115,7 @@ public class LazyMetadataValueTest { assertEquals(1, counter.value()); } + @Deprecated private LazyMetadataValue makeSimpleCallable(final Object value) { return new LazyMetadataValue(plugin, new Callable() { public Object call() throws Exception { @@ -121,7 +124,9 @@ public class LazyMetadataValueTest { }); } + @Deprecated private class Counter { + @Deprecated private int c = 0; public void increment() { diff --git a/src/test/java/org/bukkit/metadata/MetadataConversionTest.java b/src/test/java/org/bukkit/metadata/MetadataConversionTest.java index a595cc8..31b01a2 100644 --- a/src/test/java/org/bukkit/metadata/MetadataConversionTest.java +++ b/src/test/java/org/bukkit/metadata/MetadataConversionTest.java @@ -24,9 +24,12 @@ import static org.junit.Assert.assertEquals; /** */ public class MetadataConversionTest { + @Deprecated private Plugin plugin = new TestPlugin("x"); + @Deprecated private FixedMetadataValue subject; + @Deprecated private void setSubject(Object value) { subject = new FixedMetadataValue(plugin, value); } diff --git a/src/test/java/org/bukkit/metadata/MetadataStoreTest.java b/src/test/java/org/bukkit/metadata/MetadataStoreTest.java index 30f0368..2192133 100644 --- a/src/test/java/org/bukkit/metadata/MetadataStoreTest.java +++ b/src/test/java/org/bukkit/metadata/MetadataStoreTest.java @@ -12,7 +12,9 @@ import org.bukkit.plugin.TestPlugin; import org.junit.Test; public class MetadataStoreTest { + @Deprecated private Plugin pluginX = new TestPlugin("x"); + @Deprecated private Plugin pluginY = new TestPlugin("y"); StringMetadataStore subject = new StringMetadataStore(); @@ -122,13 +124,16 @@ public class MetadataStoreTest { assertFalse(subject.hasMetadata("subject", "otherKey")); } + @Deprecated private class StringMetadataStore extends MetadataStoreBase implements MetadataStore { @Override + @Deprecated protected String disambiguate(String subject, String metadataKey) { return subject + ":" + metadataKey; } } + @Deprecated private class Counter { int c = 0; diff --git a/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java b/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java index 7d8a17f..5a80e13 100644 --- a/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java +++ b/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java @@ -7,6 +7,7 @@ import org.bukkit.plugin.TestPlugin; import org.junit.Test; public class MetadataValueAdapterTest { + @Deprecated private TestPlugin plugin = new TestPlugin("x"); @Test @@ -67,6 +68,7 @@ public class MetadataValueAdapterTest { } /** Get a fixed value MetadataValue. */ + @Deprecated private MetadataValue simpleValue(Object value) { return new FixedMetadataValue(plugin, value); } @@ -80,8 +82,10 @@ public class MetadataValueAdapterTest { * value() method exactly once and no caching is going on. */ class IncrementingMetaValue extends MetadataValueAdapter { + @Deprecated private int internalValue = 0; + @Deprecated protected IncrementingMetaValue(Plugin owningPlugin) { super(owningPlugin); } diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java index 6b86128..8ae4e21 100644 --- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java +++ b/src/test/java/org/bukkit/plugin/PluginManagerTest.java @@ -12,12 +12,15 @@ import org.junit.After; import org.junit.Test; public class PluginManagerTest { + @Deprecated private class MutableObject { volatile Object value = null; } + @Deprecated private static final PluginManager pm = TestServer.getInstance().getPluginManager(); + @Deprecated private final MutableObject store = new MutableObject(); @Test @@ -152,6 +155,7 @@ public class PluginManagerTest { this.testRemovePermissionByPermission("CaMeL"); } + @Deprecated private void testRemovePermissionByName(final String name) { final Permission perm = new Permission(name); pm.addPermission(perm); @@ -160,6 +164,7 @@ public class PluginManagerTest { assertThat("Permission \"" + name + "\" was not removed", pm.getPermission(name), is(nullValue())); } + @Deprecated private void testRemovePermissionByPermission(final String name) { final Permission perm = new Permission(name); pm.addPermission(perm); diff --git a/src/test/java/org/bukkit/plugin/TestPlugin.java b/src/test/java/org/bukkit/plugin/TestPlugin.java index 7e09892..e03deb9 100644 --- a/src/test/java/org/bukkit/plugin/TestPlugin.java +++ b/src/test/java/org/bukkit/plugin/TestPlugin.java @@ -13,8 +13,10 @@ import org.bukkit.generator.ChunkGenerator; import com.avaje.ebean.EbeanServer; public class TestPlugin extends PluginBase { + @Deprecated private boolean enabled = true; + @Deprecated final private String pluginName; public TestPlugin(String pluginName) { diff --git a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java index 644e6d1..23cfc4d 100644 --- a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java +++ b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java @@ -12,6 +12,7 @@ public class StandardMessengerTest { return new StandardMessenger(); } + @Deprecated private int count = 0; public TestPlugin getPlugin() { return new TestPlugin("" + count++); @@ -282,6 +283,7 @@ public class StandardMessengerTest { assertEquals(messenger.getIncomingChannelRegistrations(plugin3, "qux")); } + @Deprecated private static void assertEquals(Collection actual, T... expected) { assertThat("Size of the array", actual.size(), is(expected.length)); assertThat(actual, hasItems(expected)); diff --git a/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java b/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java index 98860ec..76f8bb0 100644 --- a/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java +++ b/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java @@ -4,8 +4,11 @@ import org.bukkit.entity.Player; import static org.junit.Assert.*; public class TestMessageListener implements PluginMessageListener { + @Deprecated private final String channel; + @Deprecated private final byte[] message; + @Deprecated private boolean received = false; public TestMessageListener(String channel, byte[] message) { diff --git a/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java b/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java index 71f59c5..b559185 100644 --- a/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java +++ b/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java @@ -10,10 +10,13 @@ import org.bukkit.entity.Player; public class TestPlayer implements InvocationHandler { + @Deprecated private static interface MethodHandler { Object handle(TestPlayer server, Object[] args); } + @Deprecated private static final Constructor constructor; + @Deprecated private static final HashMap methods = new HashMap(); static { try { @@ -30,6 +33,7 @@ public class TestPlayer implements InvocationHandler { } } + @Deprecated private TestPlayer() {}; public static Player getInstance() { diff --git a/src/test/java/org/bukkit/potion/PotionTest.java b/src/test/java/org/bukkit/potion/PotionTest.java index 58252ae..8a683ea 100644 --- a/src/test/java/org/bukkit/potion/PotionTest.java +++ b/src/test/java/org/bukkit/potion/PotionTest.java @@ -143,6 +143,8 @@ public class PotionTest { assertEquals(16, potion.toDamageValue()); } + @Deprecated private static final int EXTENDED_BIT = 0x40; + @Deprecated private static final int SPLASH_BIT = 0x4000; } -- 1.8.3.2