From dd1c703c9ff5fcaf625b479c5f800489663fc746 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 17 Nov 2016 12:40:59 +1100 Subject: Update to Minecraft 1.11 --- pom.xml | 8 +- src/main/java/org/bukkit/Bukkit.java | 19 -- src/main/java/org/bukkit/DyeColor.java | 30 --- src/main/java/org/bukkit/Material.java | 39 +++- src/main/java/org/bukkit/Particle.java | 4 +- src/main/java/org/bukkit/Server.java | 17 -- src/main/java/org/bukkit/Sound.java | 36 +++- src/main/java/org/bukkit/Statistic.java | 3 +- src/main/java/org/bukkit/block/ShulkerBox.java | 8 + src/main/java/org/bukkit/command/Command.java | 15 -- .../org/bukkit/command/TabCommandExecutor.java | 16 -- .../java/org/bukkit/enchantments/Enchantment.java | 10 + src/main/java/org/bukkit/entity/AbstractHorse.java | 99 ++++++++++ src/main/java/org/bukkit/entity/ChestedHorse.java | 22 +++ src/main/java/org/bukkit/entity/Donkey.java | 6 + src/main/java/org/bukkit/entity/ElderGuardian.java | 6 + src/main/java/org/bukkit/entity/EntityType.java | 208 +++++++++++++-------- src/main/java/org/bukkit/entity/Evoker.java | 6 + src/main/java/org/bukkit/entity/EvokerFangs.java | 6 + src/main/java/org/bukkit/entity/FallingSand.java | 9 - src/main/java/org/bukkit/entity/Guardian.java | 8 +- src/main/java/org/bukkit/entity/Horse.java | 126 ++----------- src/main/java/org/bukkit/entity/Husk.java | 6 + src/main/java/org/bukkit/entity/Llama.java | 49 +++++ src/main/java/org/bukkit/entity/LlamaSpit.java | 6 + src/main/java/org/bukkit/entity/Mule.java | 6 + .../java/org/bukkit/entity/PoweredMinecart.java | 9 - src/main/java/org/bukkit/entity/Skeleton.java | 10 +- src/main/java/org/bukkit/entity/SkeletonHorse.java | 6 + .../java/org/bukkit/entity/StorageMinecart.java | 9 - src/main/java/org/bukkit/entity/Stray.java | 6 + src/main/java/org/bukkit/entity/Vex.java | 6 + src/main/java/org/bukkit/entity/Vindicator.java | 6 + .../java/org/bukkit/entity/WitherSkeleton.java | 6 + src/main/java/org/bukkit/entity/Zombie.java | 21 +-- src/main/java/org/bukkit/entity/ZombieHorse.java | 6 + .../java/org/bukkit/entity/ZombieVillager.java | 19 ++ .../org/bukkit/event/block/BlockIgniteEvent.java | 5 - .../bukkit/event/entity/CreatureSpawnEvent.java | 7 - .../event/entity/EntityChangeBlockEvent.java | 14 -- .../event/entity/EntityDamageByBlockEvent.java | 5 - .../event/entity/EntityDamageByEntityEvent.java | 5 - .../org/bukkit/event/entity/EntityDamageEvent.java | 14 +- .../event/entity/EntityRegainHealthEvent.java | 5 - .../bukkit/event/entity/EntityResurrectEvent.java | 45 +++++ .../org/bukkit/event/entity/HorseJumpEvent.java | 10 +- .../org/bukkit/event/inventory/CraftItemEvent.java | 5 - .../event/inventory/InventoryClickEvent.java | 5 - .../event/player/PlayerCommandPreprocessEvent.java | 33 ---- .../org/bukkit/event/player/PlayerFishEvent.java | 12 -- .../bukkit/event/player/PlayerInventoryEvent.java | 44 ----- .../org/bukkit/event/player/PlayerLoginEvent.java | 31 --- .../java/org/bukkit/inventory/LlamaInventory.java | 23 +++ .../java/org/bukkit/inventory/meta/MapMeta.java | 24 +++ src/main/java/org/bukkit/map/MapView.java | 15 ++ .../java/org/bukkit/plugin/java/JavaPlugin.java | 50 ----- src/main/java/org/bukkit/potion/Potion.java | 74 -------- src/main/java/org/bukkit/util/Java15Compat.java | 26 --- src/test/java/org/bukkit/DyeColorTest.java | 4 +- 59 files changed, 646 insertions(+), 682 deletions(-) create mode 100644 src/main/java/org/bukkit/block/ShulkerBox.java delete mode 100644 src/main/java/org/bukkit/command/TabCommandExecutor.java create mode 100644 src/main/java/org/bukkit/entity/AbstractHorse.java create mode 100644 src/main/java/org/bukkit/entity/ChestedHorse.java create mode 100644 src/main/java/org/bukkit/entity/Donkey.java create mode 100644 src/main/java/org/bukkit/entity/ElderGuardian.java create mode 100644 src/main/java/org/bukkit/entity/Evoker.java create mode 100644 src/main/java/org/bukkit/entity/EvokerFangs.java delete mode 100644 src/main/java/org/bukkit/entity/FallingSand.java create mode 100644 src/main/java/org/bukkit/entity/Husk.java create mode 100644 src/main/java/org/bukkit/entity/Llama.java create mode 100644 src/main/java/org/bukkit/entity/LlamaSpit.java create mode 100644 src/main/java/org/bukkit/entity/Mule.java delete mode 100644 src/main/java/org/bukkit/entity/PoweredMinecart.java create mode 100644 src/main/java/org/bukkit/entity/SkeletonHorse.java delete mode 100644 src/main/java/org/bukkit/entity/StorageMinecart.java create mode 100644 src/main/java/org/bukkit/entity/Stray.java create mode 100644 src/main/java/org/bukkit/entity/Vex.java create mode 100644 src/main/java/org/bukkit/entity/Vindicator.java create mode 100644 src/main/java/org/bukkit/entity/WitherSkeleton.java create mode 100644 src/main/java/org/bukkit/entity/ZombieHorse.java create mode 100644 src/main/java/org/bukkit/entity/ZombieVillager.java create mode 100644 src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java delete mode 100644 src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java create mode 100644 src/main/java/org/bukkit/inventory/LlamaInventory.java delete mode 100644 src/main/java/org/bukkit/util/Java15Compat.java diff --git a/pom.xml b/pom.xml index 653b01f0..06f8ed69 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.bukkit bukkit - 1.10.2-R0.1-SNAPSHOT + 1.11-R0.1-SNAPSHOT jar Bukkit @@ -80,7 +80,7 @@ org.yaml snakeyaml - 1.15 + 1.17 compile @@ -123,7 +123,7 @@ org.codehaus.mojo animal-sniffer-maven-plugin - 1.14 + 1.15 process-classes @@ -143,7 +143,7 @@ org.apache.maven.plugins maven-shade-plugin - 2.4.1 + 2.4.3 package diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index 2ace8c15..093aec25 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -697,25 +697,6 @@ public final class Bukkit { return server.isHardcore(); } - /** - * Gets whether to use vanilla (false) or exact behaviour (true). - * - *
    - *
  • Vanilla behaviour: check for collisions and move the player if - * needed. - *
  • Exact behaviour: spawn players exactly where they should be. - *
- * - * @return true if exact location locations are used for spawning, false - * for vanilla collision detection or otherwise - * - * @deprecated non standard and unused feature. - */ - @Deprecated - public static boolean useExactLoginLocation() { - return server.useExactLoginLocation(); - } - /** * Shutdowns the server, stopping everything. */ diff --git a/src/main/java/org/bukkit/DyeColor.java b/src/main/java/org/bukkit/DyeColor.java index 214806e6..16f53483 100644 --- a/src/main/java/org/bukkit/DyeColor.java +++ b/src/main/java/org/bukkit/DyeColor.java @@ -90,20 +90,6 @@ public enum DyeColor { this.firework = firework; } - /** - * Gets the associated (wool) data value representing this color. - * - * @return A byte containing the (wool) data value of this color - * @deprecated The name is misleading. It would imply {@link - * Material#INK_SACK} but uses {@link Material#WOOL} - * @see #getWoolData() - * @see #getDyeData() - */ - @Deprecated - public byte getData() { - return getWoolData(); - } - /** * Gets the associated wool data value representing this color. * @@ -146,22 +132,6 @@ public enum DyeColor { return firework; } - /** - * Gets the DyeColor with the given (wool) data value. - * - * @param data (wool) data value to fetch - * @return The {@link DyeColor} representing the given value, or null if - * it doesn't exist - * @deprecated The name is misleading. It would imply {@link - * Material#INK_SACK} but uses {@link Material#WOOL} - * @see #getByDyeData(byte) - * @see #getByWoolData(byte) - */ - @Deprecated - public static DyeColor getByData(final byte data) { - return getByWoolData(data); - } - /** * Gets the DyeColor with the given wool data value. * diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index 4bea3654..62062234 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -286,6 +286,23 @@ public enum Material { RED_NETHER_BRICK(215), BONE_BLOCK(216), STRUCTURE_VOID(217), + OBSERVER(218), + WHITE_SHULKER_BOX(219, 1), + ORANGE_SHULKER_BOX(220, 1), + MAGENTA_SHULKER_BOX(221, 1), + LIGHT_BLUE_SHULKER_BOX(222, 1), + YELLOW_SHULKER_BOX(223, 1), + LIME_SHULKER_BOX(224, 1), + PINK_SHULKER_BOX(225, 1), + GRAY_SHULKER_BOX(226, 1), + SILVER_SHULKER_BOX(227, 1), + CYAN_SHULKER_BOX(228, 1), + PURPLE_SHULKER_BOX(229, 1), + BLUE_SHULKER_BOX(230, 1), + BROWN_SHULKER_BOX(231, 1), + GREEN_SHULKER_BOX(232, 1), + RED_SHULKER_BOX(233, 1), + BLACK_SHULKER_BOX(234, 1), STRUCTURE_BLOCK(255), // ----- Item Separator ----- IRON_SPADE(256, 1, 250), @@ -484,6 +501,8 @@ public enum Material { BOAT_JUNGLE(446, 1), BOAT_ACACIA(447, 1), BOAT_DARK_OAK(448, 1), + TOTEM(449, 1), + SHULKER_SHELL(450), GOLD_RECORD(2256, 1), GREEN_RECORD(2257, 1), RECORD_3(2258, 1), @@ -735,8 +754,7 @@ public enum Material { } /** - * Check if the material is a block and solid (cannot be passed through by - * a player) + * Check if the material is a block and solid (can be built upon) * * @return True if this material is a block and solid */ @@ -909,6 +927,23 @@ public enum Material { case NETHER_WART_BLOCK: case RED_NETHER_BRICK: case BONE_BLOCK: + case OBSERVER: + case WHITE_SHULKER_BOX: + case ORANGE_SHULKER_BOX: + case MAGENTA_SHULKER_BOX: + case LIGHT_BLUE_SHULKER_BOX: + case YELLOW_SHULKER_BOX: + case LIME_SHULKER_BOX: + case PINK_SHULKER_BOX: + case GRAY_SHULKER_BOX: + case SILVER_SHULKER_BOX: + case CYAN_SHULKER_BOX: + case PURPLE_SHULKER_BOX: + case BLUE_SHULKER_BOX: + case BROWN_SHULKER_BOX: + case GREEN_SHULKER_BOX: + case RED_SHULKER_BOX: + case BLACK_SHULKER_BOX: return true; default: return false; diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java index a002ddcf..9794c13e 100644 --- a/src/main/java/org/bukkit/Particle.java +++ b/src/main/java/org/bukkit/Particle.java @@ -50,7 +50,9 @@ public enum Particle { END_ROD, DAMAGE_INDICATOR, SWEEP_ATTACK, - FALLING_DUST(MaterialData.class); + FALLING_DUST(MaterialData.class), + TOTEM, + SPIT; private final Class dataType; diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 60bcec8b..480d873e 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -569,23 +569,6 @@ public interface Server extends PluginMessageRecipient { */ public boolean isHardcore(); - /** - * Gets whether to use vanilla (false) or exact behaviour (true). - * - *
    - *
  • Vanilla behaviour: check for collisions and move the player if - * needed. - *
  • Exact behaviour: spawn players exactly where they should be. - *
- * - * @return true if exact location locations are used for spawning, false - * for vanilla collision detection or otherwise - * - * @deprecated non standard and unused feature. - */ - @Deprecated - public boolean useExactLoginLocation(); - /** * Shutdowns the server, stopping everything. */ diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java index f1a3148a..615f3172 100644 --- a/src/main/java/org/bukkit/Sound.java +++ b/src/main/java/org/bukkit/Sound.java @@ -5,8 +5,8 @@ package org.bukkit; *

* WARNING: At any time, sounds may be added/removed from this Enum or even * MineCraft itself! There is no guarantee the sounds will play. There is no - * guarantee values will not be removed from this Enum. As such, you should - * not depend on the ordinal values of this class. + * guarantee values will not be removed from this Enum. As such, you should not + * depend on the ordinal values of this class. */ public enum Sound { AMBIENT_CAVE, @@ -94,6 +94,8 @@ public enum Sound { BLOCK_SAND_HIT, BLOCK_SAND_PLACE, BLOCK_SAND_STEP, + BLOCK_SHULKER_BOX_CLOSE, + BLOCK_SHULKER_BOX_OPEN, BLOCK_SLIME_BREAK, BLOCK_SLIME_FALL, BLOCK_SLIME_HIT, @@ -182,6 +184,7 @@ public enum Sound { ENTITY_ELDER_GUARDIAN_CURSE, ENTITY_ELDER_GUARDIAN_DEATH, ENTITY_ELDER_GUARDIAN_DEATH_LAND, + ENTITY_ELDER_GUARDIAN_FLOP, ENTITY_ELDER_GUARDIAN_HURT, ENTITY_ELDER_GUARDIAN_HURT_LAND, ENTITY_ENDERDRAGON_AMBIENT, @@ -203,9 +206,16 @@ public enum Sound { ENTITY_ENDERMITE_HURT, ENTITY_ENDERMITE_STEP, ENTITY_ENDERPEARL_THROW, + ENTITY_EVOCATION_FANGS_ATTACK, + ENTITY_EVOCATION_ILLAGER_AMBIENT, + ENTITY_EVOCATION_ILLAGER_CAST_SPELL, + ENTITY_EVOCATION_ILLAGER_DEATH, + ENTITY_EVOCATION_ILLAGER_HURT, + ENTITY_EVOCATION_ILLAGER_PREPARE_ATTACK, + ENTITY_EVOCATION_ILLAGER_PREPARE_SUMMON, + ENTITY_EVOCATION_ILLAGER_PREPARE_WOLOLO, ENTITY_EXPERIENCE_BOTTLE_THROW, ENTITY_EXPERIENCE_ORB_PICKUP, - ENTITY_EXPERIENCE_ORB_TOUCH, ENTITY_FIREWORK_BLAST, ENTITY_FIREWORK_BLAST_FAR, ENTITY_FIREWORK_LARGE_BLAST, @@ -278,6 +288,15 @@ public enum Sound { ENTITY_LIGHTNING_IMPACT, ENTITY_LIGHTNING_THUNDER, ENTITY_LINGERINGPOTION_THROW, + ENTITY_LLAMA_AMBIENT, + ENTITY_LLAMA_ANGRY, + ENTITY_LLAMA_CHEST, + ENTITY_LLAMA_DEATH, + ENTITY_LLAMA_EAT, + ENTITY_LLAMA_HURT, + ENTITY_LLAMA_SPIT, + ENTITY_LLAMA_STEP, + ENTITY_LLAMA_SWAG, ENTITY_MAGMACUBE_DEATH, ENTITY_MAGMACUBE_HURT, ENTITY_MAGMACUBE_JUMP, @@ -286,6 +305,7 @@ public enum Sound { ENTITY_MINECART_RIDING, ENTITY_MOOSHROOM_SHEAR, ENTITY_MULE_AMBIENT, + ENTITY_MULE_CHEST, ENTITY_MULE_DEATH, ENTITY_MULE_HURT, ENTITY_PAINTING_BREAK, @@ -379,12 +399,19 @@ public enum Sound { ENTITY_STRAY_HURT, ENTITY_STRAY_STEP, ENTITY_TNT_PRIMED, + ENTITY_VEX_AMBIENT, + ENTITY_VEX_CHARGE, + ENTITY_VEX_DEATH, + ENTITY_VEX_HURT, ENTITY_VILLAGER_AMBIENT, ENTITY_VILLAGER_DEATH, ENTITY_VILLAGER_HURT, ENTITY_VILLAGER_NO, ENTITY_VILLAGER_TRADING, ENTITY_VILLAGER_YES, + ENTITY_VINDICATION_ILLAGER_AMBIENT, + ENTITY_VINDICATION_ILLAGER_DEATH, + ENTITY_VINDICATION_ILLAGER_HURT, ENTITY_WITCH_AMBIENT, ENTITY_WITCH_DEATH, ENTITY_WITCH_DRINK, @@ -432,10 +459,12 @@ public enum Sound { ENTITY_ZOMBIE_VILLAGER_STEP, ITEM_ARMOR_EQUIP_CHAIN, ITEM_ARMOR_EQUIP_DIAMOND, + ITEM_ARMOR_EQUIP_ELYTRA, ITEM_ARMOR_EQUIP_GENERIC, ITEM_ARMOR_EQUIP_GOLD, ITEM_ARMOR_EQUIP_IRON, ITEM_ARMOR_EQUIP_LEATHER, + ITEM_BOTTLE_EMPTY, ITEM_BOTTLE_FILL, ITEM_BOTTLE_FILL_DRAGONBREATH, ITEM_BUCKET_EMPTY, @@ -450,6 +479,7 @@ public enum Sound { ITEM_SHIELD_BLOCK, ITEM_SHIELD_BREAK, ITEM_SHOVEL_FLATTEN, + ITEM_TOTEM_USE, MUSIC_CREATIVE, MUSIC_CREDITS, MUSIC_DRAGON, diff --git a/src/main/java/org/bukkit/Statistic.java b/src/main/java/org/bukkit/Statistic.java index 3f0ec9f5..a23397f5 100644 --- a/src/main/java/org/bukkit/Statistic.java +++ b/src/main/java/org/bukkit/Statistic.java @@ -61,7 +61,8 @@ public enum Statistic { FURNACE_INTERACTION, CRAFTING_TABLE_INTERACTION, CHEST_OPENED, - SLEEP_IN_BED; + SLEEP_IN_BED, + SHULKER_BOX_OPENED; private final Type type; diff --git a/src/main/java/org/bukkit/block/ShulkerBox.java b/src/main/java/org/bukkit/block/ShulkerBox.java new file mode 100644 index 00000000..c58711ce --- /dev/null +++ b/src/main/java/org/bukkit/block/ShulkerBox.java @@ -0,0 +1,8 @@ +package org.bukkit.block; + +import org.bukkit.inventory.InventoryHolder; + +/** + * Represents a ShulkerBox. + */ +public interface ShulkerBox extends BlockState, InventoryHolder, Lockable { } diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java index 00264b57..7adc6ee9 100644 --- a/src/main/java/org/bukkit/command/Command.java +++ b/src/main/java/org/bukkit/command/Command.java @@ -57,21 +57,6 @@ public abstract class Command { */ public abstract boolean execute(CommandSender sender, String commandLabel, String[] args); - /** - * Executed on tab completion for this command, returning a list of - * options the player can tab through. - * - * @deprecated This method is not supported and returns null - * @param sender Source object which is executing this command - * @param args All arguments passed to the command, split via ' ' - * @return a list of tab-completions for the specified arguments. This - * will never be null. List may be immutable. - */ - @Deprecated - public List tabComplete(CommandSender sender, String[] args) { - return null; - } - /** * Executed on tab completion for this command, returning a list of * options the player can tab through. diff --git a/src/main/java/org/bukkit/command/TabCommandExecutor.java b/src/main/java/org/bukkit/command/TabCommandExecutor.java deleted file mode 100644 index d24d795c..00000000 --- a/src/main/java/org/bukkit/command/TabCommandExecutor.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.bukkit.command; - -import java.util.List; - -/** - * Represents a class which can handle command tab completion and commands - * - * @deprecated Remains for plugins that would have implemented it even without - * functionality - * @see TabExecutor - */ -@Deprecated -public interface TabCommandExecutor extends CommandExecutor { - public List onTabComplete(); - -} diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java index 5348f5c4..b6692fa4 100644 --- a/src/main/java/org/bukkit/enchantments/Enchantment.java +++ b/src/main/java/org/bukkit/enchantments/Enchantment.java @@ -60,6 +60,11 @@ public abstract class Enchantment { */ public static final Enchantment FROST_WALKER = new EnchantmentWrapper(9); + /** + * Item cannot be removed + */ + public static final Enchantment BINDING_CURSE = new EnchantmentWrapper(10); + /** * Increases damage against all targets */ @@ -146,6 +151,11 @@ public abstract class Enchantment { */ public static final Enchantment MENDING = new EnchantmentWrapper(70); + /** + * Item disappears instead of dropping + */ + public static final Enchantment VANISHING_CURSE = new EnchantmentWrapper(71); + private static final Map byId = new HashMap(); private static final Map byName = new HashMap(); private static boolean acceptingNew = true; diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java new file mode 100644 index 00000000..319d4550 --- /dev/null +++ b/src/main/java/org/bukkit/entity/AbstractHorse.java @@ -0,0 +1,99 @@ +package org.bukkit.entity; + +import org.bukkit.inventory.InventoryHolder; + +/** + * Represents a Horse-like creature. + */ +public interface AbstractHorse extends Animals, Vehicle, InventoryHolder, Tameable { + + /** + * Gets the horse's variant. + *

+ * A horse's variant defines its physical appearance and capabilities. + * Whether a horse is a regular horse, donkey, mule, or other kind of horse + * is determined using the variant. + * + * @return a {@link Variant} representing the horse's variant + * @deprecated different variants are different classes + */ + @Deprecated + public Horse.Variant getVariant(); + + /** + * @param variant + * @deprecated you are required to spawn a different entity + */ + @Deprecated + public void setVariant(Horse.Variant variant); + + /** + * Gets the domestication level of this horse. + *

+ * A higher domestication level indicates that the horse is closer to + * becoming tame. As the domestication level gets closer to the max + * domestication level, the chance of the horse becoming tame increases. + * + * @return domestication level + */ + public int getDomestication(); + + /** + * Sets the domestication level of this horse. + *

+ * Setting the domestication level to a high value will increase the + * horse's chances of becoming tame. + *

+ * Domestication level must be greater than zero and no greater than + * the max domestication level of the horse, determined with + * {@link #getMaxDomestication()} + * + * @param level domestication level + */ + public void setDomestication(int level); + + /** + * Gets the maximum domestication level of this horse. + *

+ * The higher this level is, the longer it will likely take + * for the horse to be tamed. + * + * @return the max domestication level + */ + public int getMaxDomestication(); + + /** + * Sets the maximum domestication level of this horse. + *

+ * Setting a higher max domestication will increase the amount of + * domesticating (feeding, riding, etc.) necessary in order to tame it, + * while setting a lower max value will have the opposite effect. + *

+ * Maximum domestication must be greater than zero. + * + * @param level the max domestication level + */ + public void setMaxDomestication(int level); + + /** + * Gets the jump strength of this horse. + *

+ * Jump strength defines how high the horse can jump. A higher jump strength + * increases how high a jump will go. + * + * @return the horse's jump strength + */ + public double getJumpStrength(); + + /** + * Sets the jump strength of this horse. + *

+ * A higher jump strength increases how high a jump will go. + * Setting a jump strength to 0 will result in no jump. + * You cannot set a jump strength to a value below 0 or + * above 2. + * + * @param strength jump strength for this horse + */ + public void setJumpStrength(double strength); +} diff --git a/src/main/java/org/bukkit/entity/ChestedHorse.java b/src/main/java/org/bukkit/entity/ChestedHorse.java new file mode 100644 index 00000000..24780af6 --- /dev/null +++ b/src/main/java/org/bukkit/entity/ChestedHorse.java @@ -0,0 +1,22 @@ +package org.bukkit.entity; + +/** + * Represents Horse-like creatures which can carry an inventory. + */ +public interface ChestedHorse extends AbstractHorse { + + /** + * Gets whether the horse has a chest equipped. + * + * @return true if the horse has chest storage + */ + public boolean isCarryingChest(); + + /** + * Sets whether the horse has a chest equipped. Removing a chest will also + * clear the chest's inventory. + * + * @param chest true if the horse should have a chest + */ + public void setCarryingChest(boolean chest); +} diff --git a/src/main/java/org/bukkit/entity/Donkey.java b/src/main/java/org/bukkit/entity/Donkey.java new file mode 100644 index 00000000..b554e330 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Donkey.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a Donkey - variant of {@link ChestedHorse}. + */ +public interface Donkey extends ChestedHorse { } diff --git a/src/main/java/org/bukkit/entity/ElderGuardian.java b/src/main/java/org/bukkit/entity/ElderGuardian.java new file mode 100644 index 00000000..5ca1d4c9 --- /dev/null +++ b/src/main/java/org/bukkit/entity/ElderGuardian.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents an ElderGuardian - variant of {@link Guardian}. + */ +public interface ElderGuardian extends Guardian { } diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java index 028e1f2e..c79a0035 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java @@ -24,172 +24,225 @@ public enum EntityType { * Spawn with {@link World#dropItem(Location, ItemStack)} or {@link * World#dropItemNaturally(Location, ItemStack)} */ - DROPPED_ITEM("Item", Item.class, 1, false), + DROPPED_ITEM("item", Item.class, 1, false), /** * An experience orb. */ - EXPERIENCE_ORB("XPOrb", ExperienceOrb.class, 2), + EXPERIENCE_ORB("xp_orb", ExperienceOrb.class, 2), + /** + * @see AreaEffectCloud + */ + AREA_EFFECT_CLOUD("area_effect_cloud", AreaEffectCloud.class, 3), + /** + * @see ElderGuardian + */ + ELDER_GUARDIAN("elder_guardian", ElderGuardian.class, 4), + /** + * @see WitherSkull + */ + WITHER_SKELETON("wither_skeleton", WitherSkeleton.class, 5), + /** + * @See Stray + */ + STRAY("stray", Stray.class, 6), + /** + * A flying chicken egg. + */ + EGG("egg", Egg.class, 7), /** * A leash attached to a fencepost. */ - LEASH_HITCH("LeashKnot", LeashHitch.class, 8), + LEASH_HITCH("leash_knot", LeashHitch.class, 8), /** * A painting on a wall. */ - PAINTING("Painting", Painting.class, 9), + PAINTING("painting", Painting.class, 9), /** * An arrow projectile; may get stuck in the ground. */ - ARROW("Arrow", Arrow.class, 10), + ARROW("arrow", Arrow.class, 10), /** * A flying snowball. */ - SNOWBALL("Snowball", Snowball.class, 11), + SNOWBALL("snowball", Snowball.class, 11), /** * A flying large fireball, as thrown by a Ghast for example. */ - FIREBALL("Fireball", LargeFireball.class, 12), + FIREBALL("fireball", LargeFireball.class, 12), /** * A flying small fireball, such as thrown by a Blaze or player. */ - SMALL_FIREBALL("SmallFireball", SmallFireball.class, 13), + SMALL_FIREBALL("small_fireball", SmallFireball.class, 13), /** * A flying ender pearl. */ - ENDER_PEARL("ThrownEnderpearl", EnderPearl.class, 14), + ENDER_PEARL("ender_pearl", EnderPearl.class, 14), /** * An ender eye signal. */ - ENDER_SIGNAL("EyeOfEnderSignal", EnderSignal.class, 15), + ENDER_SIGNAL("eye_of_ender_signal", EnderSignal.class, 15), + /** + * A flying splash potion. + */ + SPLASH_POTION("potion", SplashPotion.class, 16, false), /** * A flying experience bottle. */ - THROWN_EXP_BOTTLE("ThrownExpBottle", ThrownExpBottle.class, 17), + THROWN_EXP_BOTTLE("xp_bottle", ThrownExpBottle.class, 17), /** * An item frame on a wall. */ - ITEM_FRAME("ItemFrame", ItemFrame.class, 18), + ITEM_FRAME("item_frame", ItemFrame.class, 18), /** * A flying wither skull projectile. */ - WITHER_SKULL("WitherSkull", WitherSkull.class, 19), + WITHER_SKULL("wither_skull", WitherSkull.class, 19), /** * Primed TNT that is about to explode. */ - PRIMED_TNT("PrimedTnt", TNTPrimed.class, 20), + PRIMED_TNT("tnt", TNTPrimed.class, 20), /** * A block that is going to or is about to fall. */ - FALLING_BLOCK("FallingSand", FallingBlock.class, 21, false), + FALLING_BLOCK("falling_block", FallingBlock.class, 21, false), /** * Internal representation of a Firework once it has been launched. */ - FIREWORK("FireworksRocketEntity", Firework.class, 22, false), + FIREWORK("fireworks_rocket", Firework.class, 22, false), /** - * Like {@link #ARROW} but tipped with a specific potion which is applied on contact. + * @see Husk */ - TIPPED_ARROW("TippedArrow", TippedArrow.class, 23), + HUSK("husk", Husk.class, 23), /** * Like {@link #TIPPED_ARROW} but causes the {@link PotionEffectType#GLOWING} effect on all team members. */ - SPECTRAL_ARROW("SpectralArrow", SpectralArrow.class, 24), + SPECTRAL_ARROW("spectral_arrow", SpectralArrow.class, 24), /** * Bullet fired by {@link #SHULKER}. */ - SHULKER_BULLET("ShulkerBullet", ShulkerBullet.class, 25), + SHULKER_BULLET("shulker_bullet", ShulkerBullet.class, 25), /** * Like {@link #FIREBALL} but with added effects. */ - DRAGON_FIREBALL("DragonFireball", DragonFireball.class, 26), + DRAGON_FIREBALL("dragon_fireball", DragonFireball.class, 26), + /** + * @see ZombieVillager + */ + ZOMBIE_VILLAGER("zombie_villager", ZombieVillager.class, 27), + /** + * @see SkeletonHorse + */ + SKELETON_HORSE("skeleton_horse", SkeletonHorse.class, 28), + /** + * @see ZombieHorse + */ + ZOMBIE_HORSE("zombie_horse", ZombieHorse.class, 29), /** * Mechanical entity with an inventory for placing weapons / armor into. */ - ARMOR_STAND("ArmorStand", ArmorStand.class, 30), + ARMOR_STAND("armor_stand", ArmorStand.class, 30), + /** + * @see Donkey + */ + DONKEY("donkey", Donkey.class, 31), + /** + * @see Mule + */ + MULE("mule", Mule.class, 32), + /** + * @see EvokerFangs + */ + EVOKER_FANGS("evocation_fangs", EvokerFangs.class, 33), + /** + * @see Evoker + */ + EVOKER("evocation_illager", Evoker.class, 34), + /** + * @see Vex + */ + VEX("vex", Vex.class, 35), + /** + * @see Vindicator + */ + VINDICATOR("vindication_illager", Vindicator.class, 36), /** * @see CommandMinecart */ - MINECART_COMMAND("MinecartCommandBlock", CommandMinecart.class, 40), + MINECART_COMMAND("commandblock_minecart", CommandMinecart.class, 40), /** * A placed boat. */ - BOAT("Boat", Boat.class, 41), + BOAT("boat", Boat.class, 41), /** * @see RideableMinecart */ - MINECART("MinecartRideable", RideableMinecart.class, 42), + MINECART("minecart", RideableMinecart.class, 42), /** * @see StorageMinecart */ - MINECART_CHEST("MinecartChest", StorageMinecart.class, 43), + MINECART_CHEST("chest_minecart", StorageMinecart.class, 43), /** * @see PoweredMinecart */ - MINECART_FURNACE("MinecartFurnace", PoweredMinecart.class, 44), + MINECART_FURNACE("chest_minecart", PoweredMinecart.class, 44), /** * @see ExplosiveMinecart */ - MINECART_TNT("MinecartTNT", ExplosiveMinecart.class, 45), + MINECART_TNT("tnt_minecart", ExplosiveMinecart.class, 45), /** * @see HopperMinecart */ - MINECART_HOPPER("MinecartHopper", HopperMinecart.class, 46), + MINECART_HOPPER("hopper_minecart", HopperMinecart.class, 46), /** * @see SpawnerMinecart */ - MINECART_MOB_SPAWNER("MinecartMobSpawner", SpawnerMinecart.class, 47), - CREEPER("Creeper", Creeper.class, 50), - SKELETON("Skeleton", Skeleton.class, 51), - SPIDER("Spider", Spider.class, 52), - GIANT("Giant", Giant.class, 53), - ZOMBIE("Zombie", Zombie.class, 54), - SLIME("Slime", Slime.class, 55), - GHAST("Ghast", Ghast.class, 56), - PIG_ZOMBIE("PigZombie", PigZombie.class, 57), - ENDERMAN("Enderman", Enderman.class, 58), - CAVE_SPIDER("CaveSpider", CaveSpider.class, 59), - SILVERFISH("Silverfish", Silverfish.class, 60), - BLAZE("Blaze", Blaze.class, 61), - MAGMA_CUBE("LavaSlime", MagmaCube.class, 62), - ENDER_DRAGON("EnderDragon", EnderDragon.class, 63), - WITHER("WitherBoss", Wither.class, 64), - BAT("Bat", Bat.class, 65), - WITCH("Witch", Witch.class, 66), - ENDERMITE("Endermite", Endermite.class, 67), - GUARDIAN("Guardian", Guardian.class, 68), - SHULKER("Shulker", Shulker.class, 69), - PIG("Pig", Pig.class, 90), - SHEEP("Sheep", Sheep.class, 91), - COW("Cow", Cow.class, 92), - CHICKEN("Chicken", Chicken.class, 93), - SQUID("Squid", Squid.class, 94), - WOLF("Wolf", Wolf.class, 95), - MUSHROOM_COW("MushroomCow", MushroomCow.class, 96), - SNOWMAN("SnowMan", Snowman.class, 97), - OCELOT("Ozelot", Ocelot.class, 98), - IRON_GOLEM("VillagerGolem", IronGolem.class, 99), - HORSE("EntityHorse", Horse.class, 100), - RABBIT("Rabbit", Rabbit.class, 101), - POLAR_BEAR("PolarBear", PolarBear.class, 102), - VILLAGER("Villager", Villager.class, 120), - ENDER_CRYSTAL("EnderCrystal", EnderCrystal.class, 200), + MINECART_MOB_SPAWNER("spawner_minecart", SpawnerMinecart.class, 47), + CREEPER("creeper", Creeper.class, 50), + SKELETON("skeleton", Skeleton.class, 51), + SPIDER("spider", Spider.class, 52), + GIANT("giant", Giant.class, 53), + ZOMBIE("zombie", Zombie.class, 54), + SLIME("slime", Slime.class, 55), + GHAST("ghast", Ghast.class, 56), + PIG_ZOMBIE("zombie_pigman", PigZombie.class, 57), + ENDERMAN("enderman", Enderman.class, 58), + CAVE_SPIDER("cave_spider", CaveSpider.class, 59), + SILVERFISH("silverfish", Silverfish.class, 60), + BLAZE("blaze", Blaze.class, 61), + MAGMA_CUBE("magma_cube", MagmaCube.class, 62), + ENDER_DRAGON("ender_dragon", EnderDragon.class, 63), + WITHER("wither", Wither.class, 64), + BAT("bat", Bat.class, 65), + WITCH("witch", Witch.class, 66), + ENDERMITE("endermite", Endermite.class, 67), + GUARDIAN("guardian", Guardian.class, 68), + SHULKER("shulker", Shulker.class, 69), + PIG("pig", Pig.class, 90), + SHEEP("sheep", Sheep.class, 91), + COW("cow", Cow.class, 92), + CHICKEN("chicken", Chicken.class, 93), + SQUID("squid", Squid.class, 94), + WOLF("wolf", Wolf.class, 95), + MUSHROOM_COW("mooshroom", MushroomCow.class, 96), + SNOWMAN("snowman", Snowman.class, 97), + OCELOT("ocelot", Ocelot.class, 98), + IRON_GOLEM("villager_golem", IronGolem.class, 99), + HORSE("horse", Horse.class, 100), + RABBIT("rabbit", Rabbit.class, 101), + POLAR_BEAR("polar_bear", PolarBear.class, 102), + LLAMA("llama", Llama.class, 103), + LLAMA_SPIT("llama_spit", LlamaSpit.class, 104), + VILLAGER("villager", Villager.class, 120), + ENDER_CRYSTAL("ender_crystal", EnderCrystal.class, 200), // These don't have an entity ID in nms.EntityTypes. - /** - * A flying splash potion - */ - SPLASH_POTION(null, SplashPotion.class, -1, false), /** * A flying lingering potion */ LINGERING_POTION(null, LingeringPotion.class, -1, false), - AREA_EFFECT_CLOUD(null, AreaEffectCloud.class, -1), - /** - * A flying chicken egg. - */ - EGG(null, Egg.class, -1, false), /** * A fishing line and bobber. */ - FISHING_HOOK(null, Fish.class, -1, false), + FISHING_HOOK(null, FishHook.class, -1, false), /** * A bolt of lightning. *

@@ -199,6 +252,11 @@ public enum EntityType { WEATHER(null, Weather.class, -1, false), PLAYER(null, Player.class, -1, false), COMPLEX_PART(null, ComplexEntityPart.class, -1, false), + /** + * Like {@link #ARROW} but tipped with a specific potion which is applied on + * contact. + */ + TIPPED_ARROW("TippedArrow", TippedArrow.class, -1), /** * An unknown entity without an Entity Class */ diff --git a/src/main/java/org/bukkit/entity/Evoker.java b/src/main/java/org/bukkit/entity/Evoker.java new file mode 100644 index 00000000..4b7fd3ae --- /dev/null +++ b/src/main/java/org/bukkit/entity/Evoker.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents an Evoker. + */ +public interface Evoker extends Monster { } diff --git a/src/main/java/org/bukkit/entity/EvokerFangs.java b/src/main/java/org/bukkit/entity/EvokerFangs.java new file mode 100644 index 00000000..e82e3966 --- /dev/null +++ b/src/main/java/org/bukkit/entity/EvokerFangs.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents Evoker Fangs. + */ +public interface EvokerFangs extends Entity { } diff --git a/src/main/java/org/bukkit/entity/FallingSand.java b/src/main/java/org/bukkit/entity/FallingSand.java deleted file mode 100644 index 758d47db..00000000 --- a/src/main/java/org/bukkit/entity/FallingSand.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.bukkit.entity; - -/** - * Represents a falling block. - * - * @deprecated See {@link FallingBlock} - */ -@Deprecated -public interface FallingSand extends FallingBlock {} diff --git a/src/main/java/org/bukkit/entity/Guardian.java b/src/main/java/org/bukkit/entity/Guardian.java index 39d8a892..98af0563 100644 --- a/src/main/java/org/bukkit/entity/Guardian.java +++ b/src/main/java/org/bukkit/entity/Guardian.java @@ -6,16 +6,14 @@ public interface Guardian extends Monster { * Check if the Guardian is an elder Guardian * * @return true if the Guardian is an Elder Guardian, false if not - * @deprecated Entity subtypes will be separate entities in a future Minecraft release + * @deprecated should check if instance of {@link ElderGuardian}. */ @Deprecated public boolean isElder(); /** - * Set the Guardian to an elder Guardian or not - * - * @param shouldBeElder True if this Guardian should be a elder Guardian, false if not - * @deprecated Entity subtypes will be separate entities in a future Minecraft release + * @param shouldBeElder + * @deprecated Must spawn a new {@link ElderGuardian}. */ @Deprecated public void setElder(boolean shouldBeElder); diff --git a/src/main/java/org/bukkit/entity/Horse.java b/src/main/java/org/bukkit/entity/Horse.java index 1c6b2815..a280ab2c 100644 --- a/src/main/java/org/bukkit/entity/Horse.java +++ b/src/main/java/org/bukkit/entity/Horse.java @@ -1,18 +1,16 @@ package org.bukkit.entity; import org.bukkit.inventory.HorseInventory; -import org.bukkit.inventory.InventoryHolder; /** * Represents a Horse. - * @deprecated Entity subtypes will be separate entities in a future Minecraft release */ -@Deprecated -public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { +public interface Horse extends AbstractHorse { /** - * Represents the different types of horses that may exist. + * @deprecated different variants are differing classes */ + @Deprecated public enum Variant { /** * A normal horse @@ -34,6 +32,10 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { * A skeleton horse */ SKELETON_HORSE, + /** + * Not really a horse :) + */ + LLAMA ; } @@ -99,37 +101,6 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { ; } - /** - * Gets the horse's variant. - *

- * A horse's variant defines its physical appearance and capabilities. - * Whether a horse is a regular horse, donkey, mule, or other kind of - * horse is determined using the variant. - * - * @return a {@link Variant} representing the horse's variant - * @deprecated Entity subtypes will be separate entities in a future Minecraft release - */ - @Deprecated - public Variant getVariant(); - - /** - * Sets the horse's variant. - *

- * A horse's variant defines its physical appearance and capabilities. - * Whether a horse is a regular horse, donkey, mule, or other kind of - * horse can be set using the variant. - *

- * Setting a horse's variant does not change its attributes such as - * its owner and its tamed status, but changing a mule or donkey - * with a chest to another variant which does not support a chest - * will remove the chest and its contents. - * - * @param variant a {@link Variant} for this horse - * @deprecated Entity subtypes will be separate entities in a future Minecraft release - */ - @Deprecated - public void setVariant(Variant variant); - /** * Gets the horse's color. *

@@ -173,90 +144,19 @@ public interface Horse extends Animals, Vehicle, InventoryHolder, Tameable { public void setStyle(Style style); /** - * Gets whether the horse has a chest equipped. - * - * @return true if the horse has chest storage + * @return + * @deprecated see {@link ChestedHorse} */ + @Deprecated public boolean isCarryingChest(); /** - * Sets whether the horse has a chest equipped. - * Removing a chest will also clear the chest's inventory. - * - * @param chest true if the horse should have a chest + * @param chest + * @deprecated see {@link ChestedHorse} */ + @Deprecated public void setCarryingChest(boolean chest); - /** - * Gets the domestication level of this horse. - *

- * A higher domestication level indicates that the horse is closer to - * becoming tame. As the domestication level gets closer to the max - * domestication level, the chance of the horse becoming tame increases. - * - * @return domestication level - */ - public int getDomestication(); - - /** - * Sets the domestication level of this horse. - *

- * Setting the domestication level to a high value will increase the - * horse's chances of becoming tame. - *

- * Domestication level must be greater than zero and no greater than - * the max domestication level of the horse, determined with - * {@link #getMaxDomestication()} - * - * @param level domestication level - */ - public void setDomestication(int level); - - /** - * Gets the maximum domestication level of this horse. - *

- * The higher this level is, the longer it will likely take - * for the horse to be tamed. - * - * @return the max domestication level - */ - public int getMaxDomestication(); - - /** - * Sets the maximum domestication level of this horse. - *

- * Setting a higher max domestication will increase the amount of - * domesticating (feeding, riding, etc.) necessary in order to tame it, - * while setting a lower max value will have the opposite effect. - *

- * Maximum domestication must be greater than zero. - * - * @param level the max domestication level - */ - public void setMaxDomestication(int level); - - /** - * Gets the jump strength of this horse. - *

- * Jump strength defines how high the horse can jump. A higher jump strength - * increases how high a jump will go. - * - * @return the horse's jump strength - */ - public double getJumpStrength(); - - /** - * Sets the jump strength of this horse. - *

- * A higher jump strength increases how high a jump will go. - * Setting a jump strength to 0 will result in no jump. - * You cannot set a jump strength to a value below 0 or - * above 2. - * - * @param strength jump strength for this horse - */ - public void setJumpStrength(double strength); - @Override public HorseInventory getInventory(); } diff --git a/src/main/java/org/bukkit/entity/Husk.java b/src/main/java/org/bukkit/entity/Husk.java new file mode 100644 index 00000000..17139a2e --- /dev/null +++ b/src/main/java/org/bukkit/entity/Husk.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a Husk - variant of {@link Zombie}. + */ +public interface Husk extends Zombie { } diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java new file mode 100644 index 00000000..fc574e49 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Llama.java @@ -0,0 +1,49 @@ +package org.bukkit.entity; + +import org.bukkit.inventory.LlamaInventory; + +/** + * Represents a Llama. + */ +public interface Llama extends ChestedHorse { + + /** + * Represents the base color that the llama has. + */ + public enum Color { + + /** + * A cream-colored llama. + */ + CREAMY, + /** + * A white llama. + */ + WHITE, + /** + * A brown llama. + */ + BROWN, + /** + * A gray llama. + */ + GRAY; + } + + /** + * Gets the llamas's color. + * + * @return a {@link Color} representing the llama's color + */ + public Color getColor(); + + /** + * Sets the llama's color. + * + * @param color a {@link Color} for this llama + */ + public void setColor(Color color); + + @Override + public LlamaInventory getInventory(); +} diff --git a/src/main/java/org/bukkit/entity/LlamaSpit.java b/src/main/java/org/bukkit/entity/LlamaSpit.java new file mode 100644 index 00000000..9890dffe --- /dev/null +++ b/src/main/java/org/bukkit/entity/LlamaSpit.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents Llama spit. + */ +public interface LlamaSpit extends Projectile { } diff --git a/src/main/java/org/bukkit/entity/Mule.java b/src/main/java/org/bukkit/entity/Mule.java new file mode 100644 index 00000000..4f5efb36 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Mule.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a Mule - variant of {@link ChestedHorse}. + */ +public interface Mule extends ChestedHorse { } diff --git a/src/main/java/org/bukkit/entity/PoweredMinecart.java b/src/main/java/org/bukkit/entity/PoweredMinecart.java deleted file mode 100644 index 38240a90..00000000 --- a/src/main/java/org/bukkit/entity/PoweredMinecart.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.bukkit.entity; - -/** - * @deprecated This class has been moved into a sub package; {@link - * org.bukkit.entity.minecart.PoweredMinecart} should be used instead. - * @see org.bukkit.entity.minecart.PoweredMinecart - */ -@Deprecated -public interface PoweredMinecart extends org.bukkit.entity.minecart.PoweredMinecart {} diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java index 4f6e36b9..2a02ab85 100644 --- a/src/main/java/org/bukkit/entity/Skeleton.java +++ b/src/main/java/org/bukkit/entity/Skeleton.java @@ -9,23 +9,21 @@ public interface Skeleton extends Monster { * Gets the current type of this skeleton. * * @return Current type - * @deprecated Entity subtypes will be separate entities in a future Minecraft release + * @deprecated should check what class instance this is */ @Deprecated public SkeletonType getSkeletonType(); /** - * Sets the new type of this skeleton. - * - * @param type New type - * @deprecated Entity subtypes will be separate entities in a future Minecraft release + * @deprecated Must spawn a new subtype variant */ @Deprecated public void setSkeletonType(SkeletonType type); /* - * Represents the various different Skeleton types. + * @deprecated classes are different types */ + @Deprecated public enum SkeletonType { /** diff --git a/src/main/java/org/bukkit/entity/SkeletonHorse.java b/src/main/java/org/bukkit/entity/SkeletonHorse.java new file mode 100644 index 00000000..b2c6b6a8 --- /dev/null +++ b/src/main/java/org/bukkit/entity/SkeletonHorse.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a SkeletonHorse - variant of {@link AbstractHorse}. + */ +public interface SkeletonHorse extends AbstractHorse { } diff --git a/src/main/java/org/bukkit/entity/StorageMinecart.java b/src/main/java/org/bukkit/entity/StorageMinecart.java deleted file mode 100644 index 5436d708..00000000 --- a/src/main/java/org/bukkit/entity/StorageMinecart.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.bukkit.entity; - -/** - * @deprecated This class has been moved into a sub package; {@link - * org.bukkit.entity.minecart.StorageMinecart} should be used instead. - * @see org.bukkit.entity.minecart.StorageMinecart - */ -@Deprecated -public interface StorageMinecart extends org.bukkit.entity.minecart.StorageMinecart {} diff --git a/src/main/java/org/bukkit/entity/Stray.java b/src/main/java/org/bukkit/entity/Stray.java new file mode 100644 index 00000000..9c83f98e --- /dev/null +++ b/src/main/java/org/bukkit/entity/Stray.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a Stray - variant of {@link Skeleton}. + */ +public interface Stray extends Skeleton { } diff --git a/src/main/java/org/bukkit/entity/Vex.java b/src/main/java/org/bukkit/entity/Vex.java new file mode 100644 index 00000000..a2f2fcae --- /dev/null +++ b/src/main/java/org/bukkit/entity/Vex.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a Vex. + */ +public interface Vex extends Monster { } diff --git a/src/main/java/org/bukkit/entity/Vindicator.java b/src/main/java/org/bukkit/entity/Vindicator.java new file mode 100644 index 00000000..47fd24f3 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Vindicator.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a Vindicator. + */ +public interface Vindicator extends Monster { } diff --git a/src/main/java/org/bukkit/entity/WitherSkeleton.java b/src/main/java/org/bukkit/entity/WitherSkeleton.java new file mode 100644 index 00000000..7045014e --- /dev/null +++ b/src/main/java/org/bukkit/entity/WitherSkeleton.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a WitherSkeleton - variant of {@link Skeleton}. + */ +public interface WitherSkeleton extends Skeleton { } diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java index 420eaa43..4deaaff8 100644 --- a/src/main/java/org/bukkit/entity/Zombie.java +++ b/src/main/java/org/bukkit/entity/Zombie.java @@ -23,35 +23,28 @@ public interface Zombie extends Monster { * Gets whether the zombie is a villager * * @return Whether the zombie is a villager - * @deprecated Entity subtypes will be separate entities in a future Minecraft release + * @deprecated check if instanceof {@link ZombieVillager}. */ @Deprecated public boolean isVillager(); /** - * Sets whether the zombie is a villager - * - * @param flag Whether the zombie is a villager - * @deprecated Entity subtypes will be separate entities in a future Minecraft release + * @param flag + * @deprecated must spawn {@link ZombieVillager}. */ @Deprecated public void setVillager(boolean flag); /** - * Sets whether the zombie is a villager - * - * @param profession the profession of the villager or null to clear - * @deprecated Entity subtypes will be separate entities in a future Minecraft release + * @param profession + * @see ZombieVillager#getVillagerProfession() */ @Deprecated public void setVillagerProfession(Villager.Profession profession); /** - * Returns the villager profession of the zombie if the - * zombie is a villager - * - * @return the profession or null - * @deprecated Entity subtypes will be separate entities in a future Minecraft release + * @return + * @see ZombieVillager#getVillagerProfession() */ @Deprecated public Villager.Profession getVillagerProfession(); diff --git a/src/main/java/org/bukkit/entity/ZombieHorse.java b/src/main/java/org/bukkit/entity/ZombieHorse.java new file mode 100644 index 00000000..4179b68b --- /dev/null +++ b/src/main/java/org/bukkit/entity/ZombieHorse.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a ZombieHorse - variant of {@link AbstractHorse}. + */ +public interface ZombieHorse extends AbstractHorse { } diff --git a/src/main/java/org/bukkit/entity/ZombieVillager.java b/src/main/java/org/bukkit/entity/ZombieVillager.java new file mode 100644 index 00000000..f6ab96c8 --- /dev/null +++ b/src/main/java/org/bukkit/entity/ZombieVillager.java @@ -0,0 +1,19 @@ +package org.bukkit.entity; + +/** + * Represents a {@link Zombie} which was once a {@link Villager}. + */ +public interface ZombieVillager extends Zombie { + + /** + * Sets the villager profession of this zombie. + */ + public void setVillagerProfession(Villager.Profession profession); + + /** + * Returns the villager profession of this zombie. + * + * @return the profession or null + */ + public Villager.Profession getVillagerProfession(); +} diff --git a/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java b/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java index 5ea8b07f..3c85866e 100644 --- a/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java @@ -19,11 +19,6 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable { private final Block ignitingBlock; private boolean cancel; - @Deprecated - public BlockIgniteEvent(final Block theBlock, final IgniteCause cause, final Player thePlayer) { - this(theBlock, cause, (Entity) thePlayer); - } - public BlockIgniteEvent(final Block theBlock, final IgniteCause cause, final Entity ignitingEntity) { this(theBlock, cause, ignitingEntity, null); } diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java index 45cfe4f6..361e0df3 100644 --- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java @@ -96,13 +96,6 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable { * When a creature spawns because of a lightning strike */ LIGHTNING, - /** - * When a creature is spawned by a player that is sleeping - * - * @deprecated No longer used - */ - @Deprecated - BED, /** * When a snowman is spawned by being built */ diff --git a/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java index 41be9ca9..9f69ded6 100644 --- a/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java @@ -3,7 +3,6 @@ package org.bukkit.event.entity; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; @@ -17,19 +16,6 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable { private final Material to; private final byte data; - /** - * - * @param what the LivingEntity causing the change - * @param block the block (before the change) - * @param to the future material being changed to - * @deprecated Provided as a backward compatibility before the data byte - * was provided, and type increased to all entities - */ - @Deprecated - public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to) { - this (what, block, to, (byte) 0); - } - /** * * @param what the Entity causing the change diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java index 2ff121e3..31c6a012 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java @@ -12,11 +12,6 @@ import org.bukkit.entity.Entity; public class EntityDamageByBlockEvent extends EntityDamageEvent { private final Block damager; - @Deprecated - public EntityDamageByBlockEvent(final Block damager, final Entity damagee, final DamageCause cause, final int damage) { - 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); diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java index 49e74c30..f121786a 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java @@ -11,11 +11,6 @@ import org.bukkit.entity.Entity; public class EntityDamageByEntityEvent extends EntityDamageEvent { private final Entity damager; - @Deprecated - public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final int damage) { - 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); diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java index 0201d597..d0e66c6d 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java @@ -28,11 +28,6 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { private boolean cancelled; private final DamageCause cause; - @Deprecated - public EntityDamageEvent(final Entity damagee, final DamageCause cause, final int damage) { - this(damagee, cause, (double) damage); - } - @Deprecated public EntityDamageEvent(final Entity damagee, final DamageCause cause, final double damage) { this(damagee, cause, new EnumMap(ImmutableMap.of(DamageModifier.BASE, damage)), new EnumMap>(ImmutableMap.of(DamageModifier.BASE, ZERO))); @@ -431,6 +426,13 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { *

* Damage: 1 */ - HOT_FLOOR + HOT_FLOOR, + /** + * Damage caused when an entity is colliding with too many entities due + * to the maxEntityCramming game rule. + *

+ * Damage: 6 + */ + CRAMMING } } diff --git a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java index a7b3517a..c7e9ba6f 100644 --- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java @@ -14,11 +14,6 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable private double amount; private final RegainReason regainReason; - @Deprecated - public EntityRegainHealthEvent(final Entity entity, final int amount, final RegainReason regainReason) { - this(entity, (double) amount, regainReason); - } - public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason) { super(entity); this.amount = amount; diff --git a/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java b/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java new file mode 100644 index 00000000..17cd6657 --- /dev/null +++ b/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java @@ -0,0 +1,45 @@ +package org.bukkit.event.entity; + +import org.bukkit.entity.LivingEntity; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; + +/** + * Called when an entity dies and may have the opportunity to be resurrected. + * Will be called in a cancelled state if the entity does not have a totem + * equipped. + */ +public class EntityResurrectEvent extends EntityEvent implements Cancellable { + + private static final HandlerList handlers = new HandlerList(); + // + private boolean cancelled; + + public EntityResurrectEvent(LivingEntity what) { + super(what); + } + + @Override + public LivingEntity getEntity() { + return (LivingEntity) entity; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancelled) { + this.cancelled = cancelled; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + 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 21ebab6e..17949136 100644 --- a/src/main/java/org/bukkit/event/entity/HorseJumpEvent.java +++ b/src/main/java/org/bukkit/event/entity/HorseJumpEvent.java @@ -1,8 +1,8 @@ package org.bukkit.event.entity; -import org.bukkit.entity.Horse; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; +import org.bukkit.entity.AbstractHorse; /** * Called when a horse jumps. @@ -12,7 +12,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable { private boolean cancelled; private float power; - public HorseJumpEvent(final Horse horse, final float power) { + public HorseJumpEvent(final AbstractHorse horse, final float power) { super(horse); this.power = power; } @@ -30,8 +30,8 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable { } @Override - public Horse getEntity() { - return (Horse) entity; + public AbstractHorse getEntity() { + return (AbstractHorse) entity; } /** @@ -47,7 +47,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable { * Power does not affect how high the horse is capable of jumping, only * how much of its jumping capability will be used in this jump. To set * the horse's overall jump strength, see {@link - * Horse#setJumpStrength(double)}. + * AbstractHorse#setJumpStrength(double)}. * * @return jump strength */ diff --git a/src/main/java/org/bukkit/event/inventory/CraftItemEvent.java b/src/main/java/org/bukkit/event/inventory/CraftItemEvent.java index ba3f5e5f..dafaf41e 100644 --- a/src/main/java/org/bukkit/event/inventory/CraftItemEvent.java +++ b/src/main/java/org/bukkit/event/inventory/CraftItemEvent.java @@ -11,11 +11,6 @@ import org.bukkit.inventory.Recipe; public class CraftItemEvent extends InventoryClickEvent { private Recipe recipe; - @Deprecated - public CraftItemEvent(Recipe recipe, InventoryView what, SlotType type, int slot, boolean right, boolean shift) { - this(recipe, what, type, slot, right ? (shift ? ClickType.SHIFT_RIGHT : ClickType.RIGHT) : (shift ? ClickType.SHIFT_LEFT : ClickType.LEFT), InventoryAction.PICKUP_ALL); - } - public CraftItemEvent(Recipe recipe, InventoryView what, SlotType type, int slot, ClickType click, InventoryAction action) { super(what, type, slot, click, action); this.recipe = recipe; diff --git a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java index 28198b8b..55527652 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java @@ -53,11 +53,6 @@ public class InventoryClickEvent extends InventoryInteractEvent { private ItemStack current = null; private int hotbarKey = -1; - @Deprecated - public InventoryClickEvent(InventoryView view, SlotType type, int slot, boolean right, boolean shift) { - this(view, type, slot, right ? (shift ? ClickType.SHIFT_RIGHT : ClickType.RIGHT) : (shift ? ClickType.SHIFT_LEFT : ClickType.LEFT), InventoryAction.SWAP_WITH_CURSOR); - } - public InventoryClickEvent(InventoryView view, SlotType type, int slot, ClickType click, InventoryAction action) { super(view); this.slot_type = type; diff --git a/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java b/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java index 1ec81732..a128e205 100644 --- a/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java @@ -49,7 +49,6 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell private static final HandlerList handlers = new HandlerList(); private boolean cancel = false; private String message; - private String format = "<%1$s> %2$s"; private final Set recipients; public PlayerCommandPreprocessEvent(final Player player, final String message) { @@ -110,38 +109,6 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell this.player = player; } - /** - * Gets the format to use to display this chat message - * - * @deprecated This method is provided for backward compatibility with no - * guarantee to the use of the format. - * @return String.Format compatible format string - */ - @Deprecated - public String getFormat() { - return format; - } - - /** - * Sets the format to use to display this chat message - * - * @deprecated This method is provided for backward compatibility with no - * guarantee to the effect of modifying the format. - * @param format String.Format compatible format string - */ - @Deprecated - public void setFormat(final String format) { - // Oh for a better way to do this! - try { - String.format(format, player, message); - } catch (RuntimeException ex) { - ex.fillInStackTrace(); - throw ex; - } - - this.format = format; - } - /** * Gets a set of recipients that this chat message will be displayed to. *

diff --git a/src/main/java/org/bukkit/event/player/PlayerFishEvent.java b/src/main/java/org/bukkit/event/player/PlayerFishEvent.java index 4d6b29ad..72eebe96 100644 --- a/src/main/java/org/bukkit/event/player/PlayerFishEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerFishEvent.java @@ -17,18 +17,6 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { private final State state; private final Fish hookEntity; - /** - * @deprecated replaced by {@link #PlayerFishEvent(Player, Entity, Fish, - * State)} to include the {@link Fish} hook entity. - * @param player the player fishing - * @param entity the caught entity - * @param state the state of fishing - */ - @Deprecated - public PlayerFishEvent(final Player player, final Entity entity, final State state) { - this(player, entity, null, state); - } - public PlayerFishEvent(final Player player, final Entity entity, final Fish hookEntity, final State state) { super(player); this.entity = entity; diff --git a/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java b/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java deleted file mode 100644 index 2ec69d78..00000000 --- a/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.bukkit.event.player; - -import org.bukkit.entity.Player; -import org.bukkit.event.HandlerList; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryOpenEvent; -import org.bukkit.inventory.Inventory; - -/** - * Represents a player related inventory event; note that this event never - * actually did anything - * - * @deprecated Use {@link InventoryClickEvent} or {@link InventoryOpenEvent} - * instead, or one of the other inventory events in {@link - * org.bukkit.event.inventory}. - */ -@Deprecated -public class PlayerInventoryEvent extends PlayerEvent { - private static final HandlerList handlers = new HandlerList(); - protected Inventory inventory; - - public PlayerInventoryEvent(final Player player, final Inventory inventory) { - super(player); - this.inventory = inventory; - } - - /** - * Gets the Inventory involved in this event - * - * @return Inventory - */ - public Inventory getInventory() { - return inventory; - } - - @Override - public HandlerList getHandlers() { - return handlers; - } - - 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 68834ddd..8b012ea9 100644 --- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java @@ -15,25 +15,6 @@ public class PlayerLoginEvent extends PlayerEvent { private Result result = Result.ALLOWED; private String message = ""; - /** - * @deprecated Address should be provided in other constructor - * @param player The {@link Player} for this event - */ - @Deprecated - public PlayerLoginEvent(final Player player) { - this(player, "", null); - } - - /** - * @deprecated Address should be provided in other constructor - * @param player The {@link Player} for this event - * @param hostname The hostname that was used to connect to the server - */ - @Deprecated - public PlayerLoginEvent(final Player player, final String hostname) { - this(player, hostname, null); - } - /** * This constructor defaults message to an empty string, and result to * ALLOWED @@ -49,18 +30,6 @@ public class PlayerLoginEvent extends PlayerEvent { this.address = address; } - /** - * @deprecated Address and hostname should be provided in other - * constructor - * @param player The {@link Player} for this event - * @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, final Result result, final String message) { - this(player, "", null, result, message); - } - /** * This constructor pre-configures the event with a result and message * diff --git a/src/main/java/org/bukkit/inventory/LlamaInventory.java b/src/main/java/org/bukkit/inventory/LlamaInventory.java new file mode 100644 index 00000000..406fb18f --- /dev/null +++ b/src/main/java/org/bukkit/inventory/LlamaInventory.java @@ -0,0 +1,23 @@ +package org.bukkit.inventory; + +import org.bukkit.entity.Llama; + +/** + * An interface to the inventory of a {@link Llama}. + */ +public interface LlamaInventory extends Inventory { + + /* + * Gets the item in the llama's decor slot. + * + * @return the decor item + */ + ItemStack getDecor(); + + /** + * Sets the item in the llama's decor slot. + * + * @param stack the new item + */ + void setDecor(ItemStack stack); +} diff --git a/src/main/java/org/bukkit/inventory/meta/MapMeta.java b/src/main/java/org/bukkit/inventory/meta/MapMeta.java index fb5c2970..4dbe95d5 100644 --- a/src/main/java/org/bukkit/inventory/meta/MapMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/MapMeta.java @@ -19,5 +19,29 @@ public interface MapMeta extends ItemMeta { */ void setScaling(boolean value); + /** + * Checks for existence of a location name. + * + * @return true if this has a location name + */ + boolean hasLocationName(); + + /** + * Gets the location name that is set. + *

+ * Plugins should check that hasLocationName() returns true + * before calling this method. + * + * @return the location name that is set + */ + String getLocationName(); + + /** + * Sets the location name. + * + * @param name the name to set + */ + void setLocationName(String name); + MapMeta clone(); } diff --git a/src/main/java/org/bukkit/map/MapView.java b/src/main/java/org/bukkit/map/MapView.java index 65c41596..18a9936f 100644 --- a/src/main/java/org/bukkit/map/MapView.java +++ b/src/main/java/org/bukkit/map/MapView.java @@ -154,4 +154,19 @@ public interface MapView { */ public boolean removeRenderer(MapRenderer renderer); + /** + * Whether the map will show a smaller position cursor (true), or no + * position cursor (false) when cursor is outside of map's range. + * + * @return unlimited tracking state + */ + boolean isUnlimitedTracking(); + + /** + * Whether the map will show a smaller position cursor (true), or no + * position cursor (false) when cursor is outside of map's range. + * + * @param unlimited tracking state + */ + void setUnlimitedTracking(boolean unlimited); } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java index d9757bf8..bcb8a679 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java @@ -67,27 +67,6 @@ public abstract class JavaPlugin extends PluginBase { ((PluginClassLoader) classLoader).initialize(this); } - /** - * @deprecated This method is intended for unit testing purposes when the - * other {@linkplain #JavaPlugin(JavaPluginLoader, - * PluginDescriptionFile, File, File) constructor} cannot be used. - *

- * Its existence may be temporary. - * @param loader the plugin loader - * @param server the server instance - * @param description the plugin's description - * @param dataFolder the plugin's data folder - * @param file the location of the plugin - */ - @Deprecated - protected JavaPlugin(final PluginLoader loader, final Server server, final PluginDescriptionFile description, final File dataFolder, final File file) { - final ClassLoader classLoader = this.getClass().getClassLoader(); - if (classLoader instanceof PluginClassLoader) { - throw new IllegalStateException("Cannot use initialization constructor at runtime"); - } - init(loader, server, description, dataFolder, file, classLoader); - } - protected JavaPlugin(final JavaPluginLoader loader, final PluginDescriptionFile description, final File dataFolder, final File file) { final ClassLoader classLoader = this.getClass().getClassLoader(); if (classLoader instanceof PluginClassLoader) { @@ -296,23 +275,6 @@ public abstract class JavaPlugin extends PluginBase { } } - /** - * @param loader the plugin loader - * @param server the server instance - * @param description the plugin's description - * @param dataFolder the plugin's data folder - * @param file the location of the plugin - * @param classLoader the class loader - * @deprecated This method is legacy and will be removed - it must be - * replaced by the specially provided constructor(s). - */ - @Deprecated - protected final void initialize(PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader) { - if (server.getWarningState() == WarningState.OFF) { - return; - } - getLogger().log(Level.WARNING, getClass().getName() + " is already initialized", server.getWarningState() == WarningState.DEFAULT ? null : new AuthorNagException("Explicit initialization")); - } final void init(PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader) { this.loader = loader; @@ -361,18 +323,6 @@ public abstract class JavaPlugin extends PluginBase { return input; } - /** - * Gets the initialization status of this plugin - * - * @return true if this plugin is initialized, otherwise false - * @deprecated This method cannot return false, as {@link - * JavaPlugin} is now initialized in the constructor. - */ - @Deprecated - public final boolean isInitialized() { - return true; - } - /** * {@inheritDoc} */ diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java index 28d24f6b..7aa5a2d1 100644 --- a/src/main/java/org/bukkit/potion/Potion.java +++ b/src/main/java/org/bukkit/potion/Potion.java @@ -33,33 +33,6 @@ public class Potion { this.type = type; } - /** - * @deprecated In favour of {@link #Potion(PotionType, int)} - */ - @Deprecated - public Potion(PotionType type, Tier tier) { - this(type, tier == Tier.TWO ? 2 : 1); - Validate.notNull(type, "Type cannot be null"); - } - - /** - * @deprecated In favour of {@link #Potion(PotionType, int, boolean)} - */ - @Deprecated - public Potion(PotionType type, Tier tier, boolean splash) { - this(type, tier == Tier.TWO ? 2 : 1, splash); - } - - /** - * @deprecated In favour of {@link #Potion(PotionType, int, boolean, - * boolean)} - */ - @Deprecated - public Potion(PotionType type, Tier tier, boolean splash, boolean extended) { - this(type, tier, splash); - this.extended = extended; - } - /** * Create a new potion of the given type and level. * @@ -192,17 +165,6 @@ public class Potion { return level; } - /** - * Returns the {@link Tier} of this potion. - * - * @return The tier of this potion - * @deprecated - */ - @Deprecated - public Tier getTier() { - return level == 2 ? Tier.TWO : Tier.ONE; - } - /** * Returns the {@link PotionType} of this potion. * @@ -261,18 +223,6 @@ public class Potion { splash = isSplash; } - /** - * Sets the {@link Tier} of this potion. - * - * @param tier The new tier of this potion - * @deprecated In favour of {@link #setLevel(int)} - */ - @Deprecated - public void setTier(Tier tier) { - Validate.notNull(tier, "tier cannot be null"); - this.level = (tier == Tier.TWO ? 2 : 1); - } - /** * Sets the {@link PotionType} of this potion. * @@ -326,30 +276,6 @@ public class Potion { return itemStack; } - @Deprecated - public enum Tier { - ONE(0), - TWO(0x20); - - private int damageBit; - - Tier(int bit) { - damageBit = bit; - } - - public int getDamageBit() { - return damageBit; - } - - public static Tier getByDamageBit(int damageBit) { - for (Tier tier : Tier.values()) { - if (tier.damageBit == damageBit) - return tier; - } - return null; - } - } - private static PotionBrewer brewer; private static final int EXTENDED_BIT = 0x40; diff --git a/src/main/java/org/bukkit/util/Java15Compat.java b/src/main/java/org/bukkit/util/Java15Compat.java deleted file mode 100644 index dc14e8a5..00000000 --- a/src/main/java/org/bukkit/util/Java15Compat.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.bukkit.util; - -import java.lang.reflect.Array; - -/** - * @deprecated Bukkit targets Java 1.6. This class will be removed in a - * subsequent release. - */ -@Deprecated -public class Java15Compat { - @SuppressWarnings("unchecked") - public static T[] Arrays_copyOfRange(T[] original, int start, int end) { - if (original.length >= start && 0 <= start) { - if (start <= end) { - int length = end - start; - int copyLength = Math.min(length, original.length - start); - T[] copy = (T[]) Array.newInstance(original.getClass().getComponentType(), length); - - System.arraycopy(original, start, copy, 0, copyLength); - return copy; - } - throw new IllegalArgumentException(); - } - throw new ArrayIndexOutOfBoundsException(); - } -} diff --git a/src/test/java/org/bukkit/DyeColorTest.java b/src/test/java/org/bukkit/DyeColorTest.java index 3a82df77..6dcfac6b 100644 --- a/src/test/java/org/bukkit/DyeColorTest.java +++ b/src/test/java/org/bukkit/DyeColorTest.java @@ -32,9 +32,9 @@ public class DyeColorTest { @Test @SuppressWarnings("deprecation") public void getByData() { - byte data = dye.getData(); + byte data = dye.getWoolData(); - DyeColor byData = DyeColor.getByData(data); + DyeColor byData = DyeColor.getByWoolData(data); assertThat(byData, is(dye)); } -- cgit v1.2.3