diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/Achievement.java | 104 | ||||
-rw-r--r-- | src/main/java/org/bukkit/Bukkit.java | 23 | ||||
-rw-r--r-- | src/main/java/org/bukkit/Material.java | 34 | ||||
-rw-r--r-- | src/main/java/org/bukkit/Server.java | 43 | ||||
-rw-r--r-- | src/main/java/org/bukkit/Statistic.java | 64 | ||||
-rw-r--r-- | src/main/java/org/bukkit/TreeSpecies.java | 11 | ||||
-rw-r--r-- | src/main/java/org/bukkit/TreeType.java | 8 | ||||
-rw-r--r-- | src/main/java/org/bukkit/WorldType.java | 3 | ||||
-rw-r--r-- | src/main/java/org/bukkit/block/Biome.java | 40 | ||||
-rw-r--r-- | src/main/java/org/bukkit/block/CommandBlock.java | 80 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/EntityType.java | 5 | ||||
-rw-r--r-- | src/main/java/org/bukkit/entity/minecart/CommandMinecart.java | 36 | ||||
-rw-r--r-- | src/main/java/org/bukkit/event/server/ServerListPingEvent.java | 15 | ||||
-rw-r--r-- | src/main/java/org/bukkit/potion/PotionType.java | 1 | ||||
-rw-r--r-- | src/main/java/org/bukkit/util/CachedServerIcon.java | 15 |
15 files changed, 317 insertions, 165 deletions
diff --git a/src/main/java/org/bukkit/Achievement.java b/src/main/java/org/bukkit/Achievement.java index dcc695e3..aa4e9865 100644 --- a/src/main/java/org/bukkit/Achievement.java +++ b/src/main/java/org/bukkit/Achievement.java @@ -1,82 +1,48 @@ package org.bukkit; -import java.util.Map; - -import com.google.common.collect.Maps; - /** * Represents an achievement, which may be given to players */ public enum Achievement { - OPEN_INVENTORY(0), - MINE_WOOD(1), - BUILD_WORKBENCH(2), - BUILD_PICKAXE(3), - BUILD_FURNACE(4), - ACQUIRE_IRON(5), - BUILD_HOE(6), - MAKE_BREAD(7), - BAKE_CAKE(8), - BUILD_BETTER_PICKAXE(9), - COOK_FISH(10), - ON_A_RAIL(11), - BUILD_SWORD(12), - KILL_ENEMY(13), - KILL_COW(14), - FLY_PIG(15), - SNIPE_SKELETON(16), - GET_DIAMONDS(17), - NETHER_PORTAL(18), - GHAST_RETURN(19), - GET_BLAZE_ROD(20), - BREW_POTION(21), - END_PORTAL(22), - THE_END(23), - ENCHANTMENTS(24), - OVERKILL(25), - BOOKCASE(26); + OPEN_INVENTORY, + MINE_WOOD, + BUILD_WORKBENCH, + BUILD_PICKAXE, + BUILD_FURNACE, + ACQUIRE_IRON, + BUILD_HOE, + MAKE_BREAD, + BAKE_CAKE, + BUILD_BETTER_PICKAXE, + COOK_FISH, + ON_A_RAIL, + BUILD_SWORD, + KILL_ENEMY, + KILL_COW, + FLY_PIG, + SNIPE_SKELETON, + GET_DIAMONDS, + NETHER_PORTAL, + GHAST_RETURN, + GET_BLAZE_ROD, + BREW_POTION, + END_PORTAL, + THE_END, + ENCHANTMENTS, + OVERKILL, + BOOKCASE, + BREED_COW, + SPAWN_WITHER, + KILL_WITHER, + FULL_BEACON, + EXPLORE_ALL_BIOMES, + DIAMONDS_TO_YOU, + ; /** * The offset used to distinguish Achievements and Statistics - */ - public final static int STATISTIC_OFFSET = 0x500000; - private final static Map<Integer, Achievement> BY_ID = Maps.newHashMap(); - private final int id; - - private Achievement(int id) { - this.id = STATISTIC_OFFSET + id; - } - - /** - * Gets the ID for this achievement. - * <p> - * Note that this is offset using {@link #STATISTIC_OFFSET} - * - * @return ID of this achievement * @deprecated Magic value */ @Deprecated - public int getId() { - return id; - } - - /** - * Gets the achievement associated with the given ID. - * <p> - * Note that the ID must already be offset using {@link #STATISTIC_OFFSET} - * - * @param id ID of the achievement to return - * @return Achievement with the given ID - * @deprecated Magic value - */ - @Deprecated - public static Achievement getById(int id) { - return BY_ID.get(id); - } - - static { - for (Achievement achievement : values()) { - BY_ID.put(achievement.id, achievement); - } - } + public final static int STATISTIC_OFFSET = 0x500000; } diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index 7a9502a2..7fd85e79 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -1,5 +1,6 @@ package org.bukkit; +import java.awt.image.BufferedImage; import java.io.File; import java.util.Iterator; import java.util.List; @@ -25,6 +26,7 @@ import org.bukkit.plugin.ServicesManager; import org.bukkit.plugin.messaging.Messenger; import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scoreboard.ScoreboardManager; +import org.bukkit.util.CachedServerIcon; import com.avaje.ebean.config.ServerConfig; import org.bukkit.inventory.ItemFactory; @@ -654,4 +656,25 @@ public final class Bukkit { public static ScoreboardManager getScoreboardManager() { return server.getScoreboardManager(); } + + /** + * @see Server#getServerIcon() + */ + public static CachedServerIcon getServerIcon() { + return server.getServerIcon(); + } + + /** + * @see Server#loadServerIcon(File)() + */ + public static CachedServerIcon loadServerIcon(File file) throws Exception { + return server.loadServerIcon(file); + } + + /** + * @see Server#loadServerIcon(BufferedImage) + */ + public static CachedServerIcon loadServerIcon(BufferedImage image) throws Exception { + return server.loadServerIcon(image); + } } diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index 0b8765dc..338fd569 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -157,7 +157,9 @@ public enum Material { CAKE_BLOCK(92, 64, Cake.class), DIODE_BLOCK_OFF(93, Diode.class), DIODE_BLOCK_ON(94, Diode.class), + @Deprecated LOCKED_CHEST(95), + STAINED_GLASS(95), TRAP_DOOR(96, TrapDoor.class), MONSTER_EGGS(97, MonsterEggs.class), SMOOTH_BRICK(98, SmoothBrick.class), @@ -222,10 +224,17 @@ public enum Material { ACTIVATOR_RAIL(157, PoweredRail.class), DROPPER(158, Dispenser.class), STAINED_CLAY(159), + STAINED_GLASS_PANE(160), + LEAVES_2(161), + LOG_2(162), + ACACIA_STAIRS(163), + DARK_OAK_STAIRS(164), HAY_BLOCK(170), CARPET(171), HARD_CLAY(172), COAL_BLOCK(173), + PACKED_ICE(174), + DOUBLE_PLANT(175), // ----- Item Separator ----- IRON_SPADE(256, 1, 250), IRON_PICKAXE(257, 1, 250), @@ -364,7 +373,7 @@ public enum Material { EXP_BOTTLE(384, 64), FIREBALL(385, 64), BOOK_AND_QUILL(386, 1), - WRITTEN_BOOK(387, 1), + WRITTEN_BOOK(387, 16), EMERALD(388, 64), ITEM_FRAME(389), FLOWER_POT_ITEM(390), @@ -391,6 +400,7 @@ public enum Material { DIAMOND_BARDING(419, 1), LEASH(420), NAME_TAG(421), + COMMAND_MINECART(422, 1), GOLD_RECORD(2256, 1), GREEN_RECORD(2257, 1), RECORD_3(2258, 1), @@ -706,6 +716,7 @@ public enum Material { case JACK_O_LANTERN: case CAKE_BLOCK: case LOCKED_CHEST: + case STAINED_GLASS: case TRAP_DOOR: case MONSTER_EGGS: case SMOOTH_BRICK: @@ -756,6 +767,12 @@ public enum Material { case HAY_BLOCK: case HARD_CLAY: case COAL_BLOCK: + case STAINED_GLASS_PANE: + case LEAVES_2: + case LOG_2: + case ACACIA_STAIRS: + case DARK_OAK_STAIRS: + case PACKED_ICE: return true; default: return false; @@ -815,6 +832,7 @@ public enum Material { case REDSTONE_COMPARATOR_ON: case ACTIVATOR_RAIL: case CARPET: + case DOUBLE_PLANT: return true; default: return false; @@ -850,7 +868,6 @@ public enum Material { case WOOD_PLATE: case JUKEBOX: case FENCE: - case LOCKED_CHEST: case TRAP_DOOR: case HUGE_MUSHROOM_1: case HUGE_MUSHROOM_2: @@ -864,6 +881,10 @@ public enum Material { case TRAPPED_CHEST: case DAYLIGHT_DETECTOR: case CARPET: + case LEAVES_2: + case LOG_2: + case ACACIA_STAIRS: + case DARK_OAK_STAIRS: return true; default: return false; @@ -885,6 +906,8 @@ public enum Material { case LEAVES: case LONG_GRASS: case WOOL: + case YELLOW_FLOWER: + case RED_ROSE: case TNT: case BOOKSHELF: case WOOD_STAIRS: @@ -897,6 +920,10 @@ public enum Material { case JUNGLE_WOOD_STAIRS: case HAY_BLOCK: case COAL_BLOCK: + case LEAVES_2: + case LOG_2: + case CARPET: + case DOUBLE_PLANT: return true; default: return false; @@ -954,7 +981,6 @@ public enum Material { case NETHERRACK: case SOUL_SAND: case JACK_O_LANTERN: - case LOCKED_CHEST: case MONSTER_EGGS: case SMOOTH_BRICK: case HUGE_MUSHROOM_1: @@ -977,6 +1003,8 @@ public enum Material { case HAY_BLOCK: case HARD_CLAY: case COAL_BLOCK: + case LOG_2: + case PACKED_ICE: return true; default: return false; diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index aa45f162..0e789315 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -1,5 +1,6 @@ package org.bukkit; +import java.awt.image.BufferedImage; import java.io.File; import java.util.Iterator; import java.util.List; @@ -15,6 +16,7 @@ import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; import org.bukkit.event.inventory.InventoryType; +import org.bukkit.event.server.ServerListPingEvent; import org.bukkit.help.HelpMap; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryHolder; @@ -27,6 +29,7 @@ import org.bukkit.plugin.messaging.Messenger; import org.bukkit.plugin.messaging.PluginMessageRecipient; import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scoreboard.ScoreboardManager; +import org.bukkit.util.CachedServerIcon; import com.avaje.ebean.config.ServerConfig; import org.bukkit.inventory.ItemFactory; @@ -709,4 +712,44 @@ public interface Server extends PluginMessageRecipient { * @return the scoreboard manager or null if no worlds are loaded. */ ScoreboardManager getScoreboardManager(); + + /** + * Gets an instance of the server's default server-icon. + * + * @return the default server-icon; null values may be used by the + * implementation to indicate no defined icon, but this behavior is + * not guaranteed + */ + CachedServerIcon getServerIcon(); + + /** + * Loads an image from a file, and returns a cached image for the + * specific server-icon. + * <p> + * Size and type are implementation defined. An incompatible file is + * guaranteed to throw an implementation-defined {@link Exception}. + * + * @param file the file to load the from + * @throws IllegalArgumentException if image is null + * @throws Exception if the image does not meet current server + * server-icon specifications + * @return a cached server-icon that can be used for a {@link + * ServerListPingEvent#setServerIcon(CachedServerIcon)} + */ + CachedServerIcon loadServerIcon(File file) throws IllegalArgumentException, Exception; + + /** + * Creates a cached server-icon for the specific image. + * <p> + * Size and type are implementation defined. An incompatible file is + * guaranteed to throw an implementation-defined {@link Exception}. + * + * @param image the image to use + * @throws IllegalArgumentException if image is null + * @throws Exception if the image does not meet current server + * server-icon specifications + * @return a cached server-icon that can be used for a {@link + * ServerListPingEvent#setServerIcon(CachedServerIcon)} + */ + CachedServerIcon loadServerIcon(BufferedImage image) throws IllegalArgumentException, Exception; } diff --git a/src/main/java/org/bukkit/Statistic.java b/src/main/java/org/bukkit/Statistic.java index 884fcb69..33e851ad 100644 --- a/src/main/java/org/bukkit/Statistic.java +++ b/src/main/java/org/bukkit/Statistic.java @@ -1,54 +1,36 @@ package org.bukkit; -import java.util.Map; - -import com.google.common.collect.Maps; - /** * Represents a countable statistic, which is collected by the client */ public enum Statistic { - DAMAGE_DEALT(2020), - DAMAGE_TAKEN(2021), - DEATHS(2022), - MOB_KILLS(2023), - PLAYER_KILLS(2024), - FISH_CAUGHT(2025), - MINE_BLOCK(16777216, true), - USE_ITEM(6908288, false), - BREAK_ITEM(16973824, true); + DAMAGE_DEALT, + DAMAGE_TAKEN, + DEATHS, + MOB_KILLS, + PLAYER_KILLS, + FISH_CAUGHT, + MINE_BLOCK(true), + USE_ITEM(false), + BREAK_ITEM(true); - private final static Map<Integer, Statistic> BY_ID = Maps.newHashMap(); - private final int id; private final boolean isSubstat; private final boolean isBlock; - private Statistic(int id) { - this(id, false, false); + private Statistic() { + this(false, false); } - private Statistic(int id, boolean isBlock) { - this(id, true, isBlock); + private Statistic(boolean isBlock) { + this(true, isBlock); } - private Statistic(int id, boolean isSubstat, boolean isBlock) { - this.id = id; + private Statistic(boolean isSubstat, boolean isBlock) { this.isSubstat = isSubstat; this.isBlock = isBlock; } /** - * Gets the ID for this statistic. - * - * @return ID of this statistic - * @deprecated Magic value - */ - @Deprecated - public int getId() { - return id; - } - - /** * Checks if this is a substatistic. * <p> * A substatistic exists in mass for each block or item, depending on {@link #isBlock()} @@ -67,22 +49,4 @@ public enum Statistic { public boolean isBlock() { return isSubstat && isBlock; } - - /** - * Gets the statistic associated with the given ID. - * - * @param id ID of the statistic to return - * @return statistic with the given ID - * @deprecated Magic value - */ - @Deprecated - public static Statistic getById(int id) { - return BY_ID.get(id); - } - - static { - for (Statistic statistic : values()) { - BY_ID.put(statistic.id, statistic); - } - } } diff --git a/src/main/java/org/bukkit/TreeSpecies.java b/src/main/java/org/bukkit/TreeSpecies.java index 388668bd..de5e7461 100644 --- a/src/main/java/org/bukkit/TreeSpecies.java +++ b/src/main/java/org/bukkit/TreeSpecies.java @@ -24,7 +24,16 @@ public enum TreeSpecies { /** * Represents jungle trees. */ - JUNGLE(0x3); + JUNGLE(0x3), + /** + * Represents acacia trees. + */ + ACACIA(0x4), + /** + * Represents dark oak trees. + */ + DARK_OAK(0x5), + ; private final byte data; private final static Map<Byte, TreeSpecies> BY_DATA = Maps.newHashMap(); diff --git a/src/main/java/org/bukkit/TreeType.java b/src/main/java/org/bukkit/TreeType.java index 8945e4c9..91229278 100644 --- a/src/main/java/org/bukkit/TreeType.java +++ b/src/main/java/org/bukkit/TreeType.java @@ -49,4 +49,12 @@ public enum TreeType { * Swamp tree (regular with vines on the side) */ SWAMP, + /** + * Acacia tree. + */ + ACACIA, + /** + * Dark Oak tree. + */ + DARK_OAK, } diff --git a/src/main/java/org/bukkit/WorldType.java b/src/main/java/org/bukkit/WorldType.java index ae2b50b1..201852df 100644 --- a/src/main/java/org/bukkit/WorldType.java +++ b/src/main/java/org/bukkit/WorldType.java @@ -10,7 +10,8 @@ public enum WorldType { NORMAL("DEFAULT"), FLAT("FLAT"), VERSION_1_1("DEFAULT_1_1"), - LARGE_BIOMES("LARGEBIOMES"); + LARGE_BIOMES("LARGEBIOMES"), + AMPLIFIED("AMPLIFIED"); private final static Map<String, WorldType> BY_NAME = Maps.newHashMap(); private final String name; diff --git a/src/main/java/org/bukkit/block/Biome.java b/src/main/java/org/bukkit/block/Biome.java index 90694f8b..8b902f44 100644 --- a/src/main/java/org/bukkit/block/Biome.java +++ b/src/main/java/org/bukkit/block/Biome.java @@ -26,5 +26,43 @@ public enum Biome { TAIGA_HILLS, SMALL_MOUNTAINS, JUNGLE, - JUNGLE_HILLS + JUNGLE_HILLS, + JUNGLE_EDGE, + DEEP_OCEAN, + STONE_BEACH, + COLD_BEACH, + BIRCH_FOREST, + BIRCH_FOREST_HILLS, + ROOFED_FOREST, + COLD_TAIGA, + COLD_TAIGA_HILLS, + MEGA_TAIGA, + MEGA_TAIGA_HILLS, + EXTREME_HILLS_PLUS, + SAVANNA, + SAVANNA_PLATEAU, + MESA, + MESA_PLATEAU_FOREST, + MESA_PLATEAU, + SUNFLOWER_PLAINS, + DESERT_MOUNTAINS, + FLOWER_FOREST, + TAIGA_MOUNTAINS, + SWAMPLAND_MOUNTAINS, + ICE_PLAINS_SPIKES, + JUNGLE_MOUNTAINS, + JUNGLE_EDGE_MOUNTAINS, + COLD_TAIGA_MOUNTAINS, + SAVANNA_MOUNTAINS, + SAVANNA_PLATEAU_MOUNTAINS, + MESA_BRYCE, + MESA_PLATEAU_FOREST_MOUNTAINS, + MESA_PLATEAU_MOUNTAINS, + BIRCH_FOREST_MOUNTAINS, + BIRCH_FOREST_HILLS_MOUNTAINS, + ROOFED_FOREST_MOUNTAINS, + MEGA_SPRUCE_TAIGA, + EXTREME_HILLS_MOUNTAINS, + EXTREME_HILLS_PLUS_MOUNTAINS, + MEGA_SPRUCE_TAIGA_HILLS, } diff --git a/src/main/java/org/bukkit/block/CommandBlock.java b/src/main/java/org/bukkit/block/CommandBlock.java index 01e37251..85d53455 100644 --- a/src/main/java/org/bukkit/block/CommandBlock.java +++ b/src/main/java/org/bukkit/block/CommandBlock.java @@ -1,40 +1,40 @@ -package org.bukkit.block;
-
-public interface CommandBlock extends BlockState {
-
- /**
- * Gets the command that this CommandBlock will run when powered.
- * This will never return null. If the CommandBlock does not have a
- * command, an empty String will be returned instead.
- *
- * @return Command that this CommandBlock will run when powered.
- */
- public String getCommand();
-
- /**
- * Sets the command that this CommandBlock will run when powered.
- * Setting the command to null is the same as setting it to an empty
- * String.
- *
- * @param command Command that this CommandBlock will run when powered.
- */
- public void setCommand(String command);
-
- /**
- * Gets the name of this CommandBlock. The name is used with commands
- * that this CommandBlock executes. This name will never be null, and
- * by default is "@".
- *
- * @return Name of this CommandBlock.
- */
- public String getName();
-
- /**
- * Sets the name of this CommandBlock. The name is used with commands
- * that this CommandBlock executes. Setting the name to null is the
- * same as setting it to "@".
- *
- * @param name New name for this CommandBlock.
- */
- public void setName(String name);
-}
+package org.bukkit.block; + +public interface CommandBlock extends BlockState { + + /** + * Gets the command that this CommandBlock will run when powered. + * This will never return null. If the CommandBlock does not have a + * command, an empty String will be returned instead. + * + * @return Command that this CommandBlock will run when powered. + */ + public String getCommand(); + + /** + * Sets the command that this CommandBlock will run when powered. + * Setting the command to null is the same as setting it to an empty + * String. + * + * @param command Command that this CommandBlock will run when powered. + */ + public void setCommand(String command); + + /** + * Gets the name of this CommandBlock. The name is used with commands + * that this CommandBlock executes. This name will never be null, and + * by default is "@". + * + * @return Name of this CommandBlock. + */ + public String getName(); + + /** + * Sets the name of this CommandBlock. The name is used with commands + * that this CommandBlock executes. Setting the name to null is the + * same as setting it to "@". + * + * @param name New name for this CommandBlock. + */ + public void setName(String name); +} diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java index de3050ad..74837999 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java @@ -3,6 +3,7 @@ package org.bukkit.entity; import java.util.HashMap; import java.util.Map; +import org.bukkit.entity.minecart.CommandMinecart; import org.bukkit.entity.minecart.HopperMinecart; import org.bukkit.entity.minecart.SpawnerMinecart; import org.bukkit.entity.minecart.RideableMinecart; @@ -81,6 +82,10 @@ public enum EntityType { FALLING_BLOCK("FallingSand", FallingBlock.class, 21, false), FIREWORK("FireworksRocketEntity", Firework.class, 22, false), /** + * @see CommandMinecart + */ + MINECART_COMMAND("MinecartCommandBlock", CommandMinecart.class, 40), + /** * A placed boat. */ BOAT("Boat", Boat.class, 41), diff --git a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java new file mode 100644 index 00000000..e5026807 --- /dev/null +++ b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java @@ -0,0 +1,36 @@ +package org.bukkit.entity.minecart; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Minecart; + +public interface CommandMinecart extends Minecart, CommandSender { + + /** + * Gets the command that this CommandMinecart will run when activated. + * This will never return null. If the CommandMinecart does not have a + * command, an empty String will be returned instead. + * + * @return Command that this CommandMinecart will run when powered. + */ + public String getCommand(); + + /** + * Sets the command that this CommandMinecart will run when activated. + * Setting the command to null is the same as setting it to an empty + * String. + * + * @param command Command that this CommandMinecart will run when + * activated. + */ + public void setCommand(String command); + + /** + * Sets the name of this CommandMinecart. The name is used with commands + * that this CommandMinecart executes. Setting the name to null is the + * same as setting it to "@". + * + * @param name New name for this CommandMinecart. + */ + public void setName(String name); + +} diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java index d8369bce..e138e3ad 100644 --- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java @@ -3,6 +3,7 @@ package org.bukkit.event.server; import java.net.InetAddress; import org.bukkit.event.HandlerList; +import org.bukkit.util.CachedServerIcon; /** * Called when a server list ping is coming in. @@ -75,6 +76,20 @@ public class ServerListPingEvent extends ServerEvent { this.maxPlayers = maxPlayers; } + /** + * Sets the server-icon sent to the client. + * + * @param icon the icon to send to the client + * @throws IllegalArgumentException if the {@link CachedServerIcon} is + * not created by the caller of this event; null may be accepted for + * some implementations + * @throws UnsupportedOperationException if the caller of this event does + * not support setting the server icon + */ + public void setServerIcon(CachedServerIcon icon) throws IllegalArgumentException, UnsupportedOperationException { + throw new UnsupportedOperationException(); + } + @Override public HandlerList getHandlers() { return handlers; diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java index dab02935..a02b6a81 100644 --- a/src/main/java/org/bukkit/potion/PotionType.java +++ b/src/main/java/org/bukkit/potion/PotionType.java @@ -12,6 +12,7 @@ public enum PotionType { STRENGTH(9, PotionEffectType.INCREASE_DAMAGE, 2), SLOWNESS(10, PotionEffectType.SLOW, 1), INSTANT_DAMAGE(12, PotionEffectType.HARM, 2), + WATER_BREATHING(13, PotionEffectType.WATER_BREATHING, 1), INVISIBILITY(14, PotionEffectType.INVISIBILITY, 1), ; diff --git a/src/main/java/org/bukkit/util/CachedServerIcon.java b/src/main/java/org/bukkit/util/CachedServerIcon.java new file mode 100644 index 00000000..5ca863b3 --- /dev/null +++ b/src/main/java/org/bukkit/util/CachedServerIcon.java @@ -0,0 +1,15 @@ +package org.bukkit.util; + +import org.bukkit.Server; +import org.bukkit.event.server.ServerListPingEvent; + +/** + * This is a cached version of a server-icon. It's internal representation + * and implementation is undefined. + * + * @see Server#getServerIcon() + * @see Server#loadServerIcon(java.awt.image.BufferedImage) + * @see Server#loadServerIcon(java.io.File) + * @see ServerListPingEvent#setServerIcon(CachedServerIcon) + */ +public interface CachedServerIcon {} |