diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2012-10-22 03:30:04 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-10-27 22:15:59 -0400 |
commit | a446bb7e8f2f84af21f3c38ba1531df2a7a7cb32 (patch) | |
tree | cad6b307f966992df2a35aae96a264cfd7d2ac85 /src/main | |
parent | 703a067355bb89ea54346723d772d3c71f4c27c2 (diff) | |
download | bukkit-a446bb7e8f2f84af21f3c38ba1531df2a7a7cb32.tar bukkit-a446bb7e8f2f84af21f3c38ba1531df2a7a7cb32.tar.gz bukkit-a446bb7e8f2f84af21f3c38ba1531df2a7a7cb32.tar.lz bukkit-a446bb7e8f2f84af21f3c38ba1531df2a7a7cb32.tar.xz bukkit-a446bb7e8f2f84af21f3c38ba1531df2a7a7cb32.zip |
Update Bukkit for Minecraft 1.4(.2) changes.
Diffstat (limited to 'src/main')
22 files changed, 485 insertions, 33 deletions
diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java index 02ac8983..7f35d7e7 100644 --- a/src/main/java/org/bukkit/Art.java +++ b/src/main/java/org/bukkit/Art.java @@ -29,12 +29,13 @@ public enum Art { STAGE(16, 2, 2), VOID(17, 2, 2), SKULL_AND_ROSES(18, 2, 2), - FIGHTERS(19, 4, 2), - POINTER(20, 4, 4), - PIGSCENE(21, 4, 4), - BURNINGSKULL(22, 4, 4), - SKELETON(23, 4, 3), - DONKEYKONG(24, 4, 3); + WITHER(19, 2, 2), + FIGHTERS(20, 4, 2), + POINTER(21, 4, 4), + PIGSCENE(22, 4, 4), + BURNINGSKULL(23, 4, 4), + SKELETON(24, 4, 3), + DONKEYKONG(25, 4, 3); private int id, width, height; private static final HashMap<String, Art> BY_NAME = Maps.newHashMap(); diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index 5ea03379..102db215 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -143,6 +143,27 @@ public enum Material { DRAGON_EGG(122), REDSTONE_LAMP_OFF(123), REDSTONE_LAMP_ON(124), + WOOD_DOUBLE_STEP(125, WoodenStep.class), + WOOD_STEP(126, WoodenStep.class), + COCOA(127, CocoaPlant.class), + SANDSTONE_STAIRS(128, Stairs.class), + EMERALD_ORE(129), + ENDER_CHEST(130, EnderChest.class), + TRIPWIRE_HOOK(131, TripwireHook.class), + TRIPWIRE(132, Tripwire.class), + EMERALD_BLOCK(133), + SPRUCE_WOOD_STAIRS(134, Stairs.class), + BIRCH_WOOD_STAIRS(135, Stairs.class), + JUNGLE_WOOD_STAIRS(136, Stairs.class), + COMMAND(137, Command.class), + BEACON(138), + COBBLE_WALL(139), + FLOWER_POT(140, FlowerPot.class), + CARROT(141), + POTATO(142), + WOOD_BUTTON(143, Button.class), + SKULL(144, Skull.class), + ANVIL(145), // ----- Item Separator ----- IRON_SPADE(256, 1, 250), IRON_PICKAXE(257, 1, 250), @@ -249,7 +270,7 @@ public enum Material { /** * @see MapView */ - MAP(358, 1, MaterialData.class), + MAP(358, MaterialData.class), SHEARS(359, 1, 238), MELON(360), PUMPKIN_SEEDS(361), @@ -280,6 +301,21 @@ public enum Material { MONSTER_EGG(383, 64, SpawnEgg.class), EXP_BOTTLE(384, 64), FIREBALL(385, 64), + BOOK_AND_QUILL(386, 1), + WRITTEN_BOOK(387, 1), + EMERALD(388, 64), + ITEM_FRAME(389), + FLOWER_POT_ITEM(390), + CARROT_ITEM(391), + POTATO_ITEM(392), + BAKED_POTATO(393), + POISONOUS_POTATO(394), + EMPTY_MAP(395), + GOLDEN_CARROT(396), + SKULL_ITEM(397), + CARROT_STICK(398, 1, 25), + NETHER_STAR(399), + PUMPKIN_PIE(400), GOLD_RECORD(2256, 1), GREEN_RECORD(2257, 1), RECORD_3(2258, 1), @@ -291,22 +327,7 @@ public enum Material { RECORD_9(2264, 1), RECORD_10(2265, 1), RECORD_11(2266, 1), - WOOD_DOUBLE_STEP(125, WoodenStep.class), - WOOD_STEP(126, WoodenStep.class), - COCOA(127, CocoaPlant.class), - SANDSTONE_STAIRS(128, Stairs.class), - EMERALD_ORE(129), - ENDER_CHEST(130, EnderChest.class), - TRIPWIRE_HOOK(131, TripwireHook.class), - TRIPWIRE(132, Tripwire.class), - EMERALD_BLOCK(133), - SPRUCE_WOOD_STAIRS(134, Stairs.class), - BIRCH_WOOD_STAIRS(135, Stairs.class), - JUNGLE_WOOD_STAIRS(136, Stairs.class), - BOOK_AND_QUILL(386, 1), - WRITTEN_BOOK(387, 1), - EMERALD(388, 64); - + ; private final int id; private final Class<? extends MaterialData> data; @@ -423,6 +444,12 @@ public enum Material { */ public boolean isEdible() { return equals(Material.BREAD) + || equals(Material.CARROT_ITEM) + || equals(Material.BAKED_POTATO) + || equals(Material.POTATO_ITEM) + || equals(Material.POISONOUS_POTATO) + || equals(Material.GOLDEN_CARROT) + || equals(Material.PUMPKIN_PIE) || equals(Material.COOKIE) || equals(Material.MELON) || equals(Material.MUSHROOM_SOUP) diff --git a/src/main/java/org/bukkit/command/defaults/TeleportCommand.java b/src/main/java/org/bukkit/command/defaults/TeleportCommand.java index 55be9da3..cbb42abe 100644 --- a/src/main/java/org/bukkit/command/defaults/TeleportCommand.java +++ b/src/main/java/org/bukkit/command/defaults/TeleportCommand.java @@ -16,7 +16,7 @@ import com.google.common.collect.ImmutableList; public class TeleportCommand extends VanillaCommand { public TeleportCommand() { super("tp"); - this.description = "Teleports the given player to another player"; + this.description = "Teleports the given player to another player or location"; this.usageMessage = "/tp [player] <target>\n/tp [player] <x> <y> <z>"; this.setPermission("bukkit.command.teleport"); } @@ -56,9 +56,14 @@ public class TeleportCommand extends VanillaCommand { player.teleport(target, TeleportCause.COMMAND); Command.broadcastCommandMessage(sender, "Teleported " + player.getName() + " to " + target.getName()); } else if (player.getWorld() != null) { - int x = getInteger(sender, args[args.length - 3], -30000000, 30000000); - int y = getInteger(sender, args[args.length - 2], 0, 256); - int z = getInteger(sender, args[args.length - 1], -30000000, 30000000); + double x = getCoordinate(sender, player.getLocation().getX(), args[args.length - 3]); + double y = getCoordinate(sender,player.getLocation().getY(), args[args.length - 2], 0, 0); + double z = getCoordinate(sender, player.getLocation().getZ(), args[args.length - 1]); + + if (x == -30000001 || y == -30000001 || z == -30000001) { + sender.sendMessage("Please provide a valid location!"); + return true; + } Location location = new Location(player.getWorld(), x, y, z); player.teleport(location); @@ -67,6 +72,39 @@ public class TeleportCommand extends VanillaCommand { return true; } + private double getCoordinate(CommandSender sender, double current, String input) { + return getCoordinate(sender, current, input, -30000000, 30000000); + } + + private double getCoordinate(CommandSender sender, double current, String input, int min, int max) { + boolean relative = input.startsWith("~"); + double result = relative ? current : 0; + + if (!relative || input.length() > 1) { + boolean exact = input.contains("."); + if (relative) input = input.substring(1); + + double testResult = getDouble(sender, input); + if (testResult == -30000001) { + return -30000001; + } + result += testResult; + + if (!exact && !relative) result += 0.5f; + } + if (min != 0 || max != 0) { + if (result < min) { + result = -30000001; + } + + if (result > max) { + result = -30000001; + } + } + + return result; + } + @Override public boolean matches(String input) { return input.equalsIgnoreCase("tp"); diff --git a/src/main/java/org/bukkit/command/defaults/VanillaCommand.java b/src/main/java/org/bukkit/command/defaults/VanillaCommand.java index 1fdcc81e..fc0edf90 100644 --- a/src/main/java/org/bukkit/command/defaults/VanillaCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VanillaCommand.java @@ -38,6 +38,26 @@ public abstract class VanillaCommand extends Command { return i; } + public static double getDouble(CommandSender sender, String input) { + try { + return Double.parseDouble(input); + } catch (NumberFormatException ex) { + return -30000001; + } + } + + public static double getDouble(CommandSender sender, String input, double min, double max) { + double result = getDouble(sender, input); + + if (result < min) { + result = min; + } else if (result > max) { + result = max; + } + + return result; + } + protected String createString(String[] args, int start) { StringBuilder string = new StringBuilder(); diff --git a/src/main/java/org/bukkit/entity/Ambient.java b/src/main/java/org/bukkit/entity/Ambient.java new file mode 100644 index 00000000..779e3897 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Ambient.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents an ambient mob + */ +public interface Ambient extends LivingEntity {} diff --git a/src/main/java/org/bukkit/entity/Bat.java b/src/main/java/org/bukkit/entity/Bat.java new file mode 100644 index 00000000..a1e400e3 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Bat.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a Bat + */ +public interface Bat extends Ambient {} diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java index 7f1e08d5..4a5f0d0e 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java @@ -13,11 +13,13 @@ public enum EntityType { PAINTING("Painting", Painting.class, 9), ARROW("Arrow", Arrow.class, 10), SNOWBALL("Snowball", Snowball.class, 11), - FIREBALL("Fireball", Fireball.class, 12), + LARGE_FIREBALL("Fireball", LargeFireball.class, 12), SMALL_FIREBALL("SmallFireball", SmallFireball.class, 13), ENDER_PEARL("ThrownEnderpearl", EnderPearl.class, 14), ENDER_SIGNAL("EyeOfEnderSignal", EnderSignal.class, 15), THROWN_EXP_BOTTLE("ThrownExpBottle", ThrownExpBottle.class, 17), + ITEM_FRAME("ItemFrame", ItemFrame.class, 18), + WITHER_SKULL("WitherSkull", WitherSkull.class, 19), PRIMED_TNT("PrimedTnt", TNTPrimed.class, 20), FALLING_BLOCK("FallingSand", FallingBlock.class, 21, false), MINECART("Minecart", Minecart.class, 40), @@ -36,6 +38,9 @@ public enum EntityType { 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), PIG("Pig", Pig.class, 90), SHEEP("Sheep", Sheep.class, 91), COW("Cow", Cow.class, 92), @@ -136,4 +141,4 @@ public enum EntityType { public boolean isAlive() { return living; } -}
\ No newline at end of file +} diff --git a/src/main/java/org/bukkit/entity/Hanging.java b/src/main/java/org/bukkit/entity/Hanging.java new file mode 100644 index 00000000..46548ec0 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Hanging.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a Hanging entity + */ +public interface Hanging extends Entity {} diff --git a/src/main/java/org/bukkit/entity/ItemFrame.java b/src/main/java/org/bukkit/entity/ItemFrame.java new file mode 100644 index 00000000..769cfd2f --- /dev/null +++ b/src/main/java/org/bukkit/entity/ItemFrame.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents an Item Frame + */ +public interface ItemFrame extends Hanging {} diff --git a/src/main/java/org/bukkit/entity/LargeFireball.java b/src/main/java/org/bukkit/entity/LargeFireball.java new file mode 100644 index 00000000..fc3a1093 --- /dev/null +++ b/src/main/java/org/bukkit/entity/LargeFireball.java @@ -0,0 +1,7 @@ +package org.bukkit.entity; + +/** + * Represents a large {@link Fireball} + */ +public interface LargeFireball extends Fireball { +} diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java new file mode 100644 index 00000000..9c5dc1f9 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Witch.java @@ -0,0 +1,7 @@ +package org.bukkit.entity; + +/** + * Represents a Witch + */ +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 new file mode 100644 index 00000000..0922c5c6 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Wither.java @@ -0,0 +1,7 @@ +package org.bukkit.entity; + +/** + * Represents a Wither boss + */ +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 new file mode 100644 index 00000000..8c71a9b9 --- /dev/null +++ b/src/main/java/org/bukkit/entity/WitherSkull.java @@ -0,0 +1,8 @@ +package org.bukkit.entity; + +/** + * Represents a wither skull {@link Fireball} + */ +public interface WitherSkull extends Fireball { + +} diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java index ce6797a7..c6746294 100644 --- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java @@ -128,6 +128,10 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable { */ BUILD_IRONGOLEM, /** + * When a wither boss is spawned by being built + */ + BUILD_WITHER, + /** * When an iron golem is spawned to defend a village */ VILLAGE_DEFENSE, diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java index f059b407..5238cd58 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java @@ -177,6 +177,10 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { */ MAGIC, /** + * + */ + WITHER, + /** * Custom damage. * <p /> * Damage: variable diff --git a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java index fceabee0..2d4c927b 100644 --- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java @@ -93,6 +93,14 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable */ MAGIC_REGEN, /** + * When a wither is filling its health during spawning + */ + WITHER_SPAWN, + /** + * When an entity is damaged by the Wither potion effect + */ + WITHER, + /** * Any other reason not covered by the reasons above */ CUSTOM diff --git a/src/main/java/org/bukkit/inventory/AnvilInventory.java b/src/main/java/org/bukkit/inventory/AnvilInventory.java new file mode 100644 index 00000000..52c89647 --- /dev/null +++ b/src/main/java/org/bukkit/inventory/AnvilInventory.java @@ -0,0 +1,4 @@ +package org.bukkit.inventory; + +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 new file mode 100644 index 00000000..342a8be9 --- /dev/null +++ b/src/main/java/org/bukkit/inventory/BeaconInventory.java @@ -0,0 +1,14 @@ +package org.bukkit.inventory; + +public interface BeaconInventory extends Inventory { + /** + * Set the item powering the beacon. + * @param item The new item + */ + void setItem(ItemStack item); + /** + * Get the item powering the beacon. + * @return The current item. + */ + ItemStack getItem(); +} diff --git a/src/main/java/org/bukkit/material/Command.java b/src/main/java/org/bukkit/material/Command.java new file mode 100644 index 00000000..01d0ac7f --- /dev/null +++ b/src/main/java/org/bukkit/material/Command.java @@ -0,0 +1,59 @@ +package org.bukkit.material; + +import org.bukkit.block.BlockFace; +import org.bukkit.Material; + +/** + * Represents a command block + */ +public class Command extends MaterialData implements Redstone { + public Command() { + super(Material.COMMAND); + } + + public Command(final int type) { + super(type); + } + + public Command(final Material type) { + super(type); + } + + public Command(final int type, final byte data) { + super(type, data); + } + + public Command(final Material type, final byte data) { + super(type, data); + } + + /** + * Gets the current state of this Material, indicating if it's powered or + * unpowered + * + * @return true if powered, otherwise false + */ + public boolean isPowered() { + return (getData() & 1) != 0; + } + + /** + * Sets the current state of this Material + * + * @param bool + * whether or not the command block is powered + */ + public void setPowered(boolean bool) { + setData((byte) (bool ? (getData() | 1) : (getData() & -2))); + } + + @Override + public String toString() { + return super.toString() + " " + (isPowered() ? "" : "NOT ") + "POWERED"; + } + + @Override + public Command clone() { + return (Command) super.clone(); + } +} diff --git a/src/main/java/org/bukkit/material/FlowerPot.java b/src/main/java/org/bukkit/material/FlowerPot.java new file mode 100644 index 00000000..c59891ad --- /dev/null +++ b/src/main/java/org/bukkit/material/FlowerPot.java @@ -0,0 +1,119 @@ +package org.bukkit.material; + +import org.bukkit.GrassSpecies; +import org.bukkit.Material; +import org.bukkit.TreeSpecies; + +/** + * Represents a flower pot. + */ +public class FlowerPot extends MaterialData { + + /** + * Default constructor for a flower pot. + */ + public FlowerPot() { + super(Material.FLOWER_POT); + } + + public FlowerPot(final int type) { + super(type); + } + + public FlowerPot(final Material type) { + super(type); + } + + public FlowerPot(final int type, final byte data) { + super(type, data); + } + + public FlowerPot(final Material type, final byte data) { + super(type, data); + } + + /** + * Get the material in the flower pot + * + * @return material MaterialData for the block currently in the flower pot or null if empty + */ + public MaterialData getContents() { + switch (getData()) { + case 1: + return new MaterialData(Material.RED_ROSE); + case 2: + return new MaterialData(Material.YELLOW_FLOWER); + case 3: + return new Tree(TreeSpecies.GENERIC); + case 4: + return new Tree(TreeSpecies.REDWOOD); + case 5: + return new Tree(TreeSpecies.BIRCH); + case 6: + return new Tree(TreeSpecies.JUNGLE); + case 7: + return new MaterialData(Material.RED_MUSHROOM); + case 8: + return new MaterialData(Material.BROWN_MUSHROOM); + case 9: + return new MaterialData(Material.CACTUS); + case 10: + return new MaterialData(Material.DEAD_BUSH); + case 11: + return new LongGrass(GrassSpecies.FERN_LIKE); + default: + return null; + } + } + + /** + * Set the contents of the flower pot + * + * @param materialData MaterialData of the block to put in the flower pot. + */ + public void setContents(MaterialData materialData) { + Material mat = materialData.getItemType(); + + if (mat == Material.RED_ROSE) { + setData((byte) 1); + } else if (mat == Material.YELLOW_FLOWER) { + setData((byte) 2); + } else if (mat == Material.RED_MUSHROOM) { + setData((byte) 7); + } else if (mat == Material.BROWN_MUSHROOM) { + setData((byte) 8); + } else if (mat == Material.CACTUS) { + setData((byte) 9); + } else if (mat == Material.DEAD_BUSH) { + setData((byte) 10); + } else if (mat == Material.SAPLING) { + TreeSpecies species = ((Tree) materialData).getSpecies(); + + if (species == TreeSpecies.GENERIC) { + setData((byte) 3); + } else if (species == TreeSpecies.REDWOOD) { + setData((byte) 4); + } else if (species == TreeSpecies.BIRCH) { + setData((byte) 5); + } else { + setData((byte) 6); + } + } else if (mat == Material.LONG_GRASS) { + GrassSpecies species = ((LongGrass) materialData).getSpecies(); + + if (species == GrassSpecies.FERN_LIKE) { + setData((byte) 11); + } + } + } + + @Override + public String toString() { + return super.toString() + " containing " + getContents(); + } + + @Override + public FlowerPot clone() { + return (FlowerPot) super.clone(); + } +} diff --git a/src/main/java/org/bukkit/material/Skull.java b/src/main/java/org/bukkit/material/Skull.java new file mode 100644 index 00000000..77130fb9 --- /dev/null +++ b/src/main/java/org/bukkit/material/Skull.java @@ -0,0 +1,92 @@ +package org.bukkit.material; + +import org.bukkit.Material; +import org.bukkit.block.BlockFace; + +/** + * Represents a skull. + */ +public class Skull extends MaterialData implements Directional { + public Skull() { + super(Material.SKULL); + } + + /** + * Instantiate a skull facing in a particular direction. + * + * @param direction the direction the skull's face is facing + */ + public Skull(BlockFace direction) { + this(); + setFacingDirection(direction); + } + + public Skull(final int type) { + super(type); + } + + public Skull(final Material type) { + super(type); + } + + public Skull(final int type, final byte data) { + super(type, data); + } + + public Skull(final Material type, final byte data) { + super(type, data); + } + + public void setFacingDirection(BlockFace face) { + int data; + + switch (face) { + case EAST: + data = 0x1; + break; + + case SOUTH: + data = 0x2; + break; + + case WEST: + data = 0x3; + break; + + case NORTH: + default: + data = 0x4; + } + + setData((byte) (data & 3)); + } + + public BlockFace getFacing() { + int data = getData() & 7; + + switch (data) { + case 0x1: + return BlockFace.EAST; + + case 0x2: + return BlockFace.SOUTH; + + case 0x3: + return BlockFace.WEST; + + case 0x4: + default: + return BlockFace.SOUTH; + } + } + + @Override + public String toString() { + return super.toString() + " facing " + getFacing(); + } + + @Override + public Skull clone() { + return (Skull) super.clone(); + } +} diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java index 59e0ac36..c478844f 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectType.java +++ b/src/main/java/org/bukkit/potion/PotionEffectType.java @@ -75,7 +75,7 @@ public abstract class PotionEffectType { public static final PotionEffectType WATER_BREATHING = new PotionEffectTypeWrapper(13); /** - * Grants invisibility. NOTE: Unusable due to not being implemented by Minecraft. + * Grants invisibility. */ @Deprecated public static final PotionEffectType INVISIBILITY = new PotionEffectTypeWrapper(14); // unimplemented @@ -86,8 +86,7 @@ public abstract class PotionEffectType { public static final PotionEffectType BLINDNESS = new PotionEffectTypeWrapper(15); /** - * Allows an entity to see in the dark. NOTE: Unusable due to not being - * implemented by Minecraft. + * Allows an entity to see in the dark. */ @Deprecated public static final PotionEffectType NIGHT_VISION = new PotionEffectTypeWrapper(16); // unimplemented @@ -107,6 +106,11 @@ public abstract class PotionEffectType { */ public static final PotionEffectType POISON = new PotionEffectTypeWrapper(19); + /** + * Deals damage to an entity over time and gives the health to the shooter. + */ + public static final PotionEffectType WITHER = new PotionEffectTypeWrapper(20); + private final int id; protected PotionEffectType(int id) { @@ -172,7 +176,7 @@ public abstract class PotionEffectType { return "PotionEffectType[" + id + ", " + getName() + "]"; } - private static final PotionEffectType[] byId = new PotionEffectType[20]; + private static final PotionEffectType[] byId = new PotionEffectType[21]; private static final Map<String, PotionEffectType> byName = new HashMap<String, PotionEffectType>(); // will break on updates. private static boolean acceptingNew = true; |