Commits
Wesley Wolfe authored f93e9fc7b77
3 3 | import java.awt.image.BufferedImage; |
4 4 | import java.io.File; |
5 5 | import java.util.Iterator; |
6 6 | import java.util.List; |
7 7 | import java.util.Map; |
8 8 | import java.util.Set; |
9 9 | import java.util.UUID; |
10 10 | import java.util.logging.Logger; |
11 11 | |
12 12 | import org.bukkit.Warning.WarningState; |
13 + | import org.bukkit.command.CommandException; |
13 14 | import org.bukkit.command.CommandSender; |
14 15 | import org.bukkit.command.ConsoleCommandSender; |
15 16 | import org.bukkit.command.PluginCommand; |
16 17 | import org.bukkit.entity.Player; |
17 18 | import org.bukkit.event.inventory.InventoryType; |
18 19 | import org.bukkit.help.HelpMap; |
19 20 | import org.bukkit.inventory.ItemStack; |
20 21 | import org.bukkit.inventory.Inventory; |
21 22 | import org.bukkit.inventory.InventoryHolder; |
23 + | import org.bukkit.inventory.ItemFactory; |
22 24 | import org.bukkit.inventory.Recipe; |
23 25 | import org.bukkit.map.MapView; |
24 26 | import org.bukkit.plugin.PluginManager; |
25 27 | import org.bukkit.plugin.ServicesManager; |
26 28 | import org.bukkit.plugin.messaging.Messenger; |
27 29 | import org.bukkit.scheduler.BukkitScheduler; |
28 30 | import org.bukkit.scoreboard.ScoreboardManager; |
29 31 | import org.bukkit.util.CachedServerIcon; |
30 32 | |
31 33 | import com.avaje.ebean.config.ServerConfig; |
32 - | import org.bukkit.inventory.ItemFactory; |
33 34 | |
34 35 | /** |
35 36 | * Represents the Bukkit core, for version and Server singleton handling |
36 37 | */ |
37 38 | public final class Bukkit { |
38 39 | private static Server server; |
39 40 | |
40 41 | /** |
41 42 | * Static class cannot be initialized. |
42 43 | */ |
305 306 | /** |
306 307 | * @see Server#savePlayers() |
307 308 | */ |
308 309 | public static void savePlayers() { |
309 310 | server.savePlayers(); |
310 311 | } |
311 312 | |
312 313 | /** |
313 314 | * @see Server#dispatchCommand(CommandSender sender, String commandLine) |
314 315 | */ |
315 - | public static boolean dispatchCommand(CommandSender sender, String commandLine) { |
316 + | public static boolean dispatchCommand(CommandSender sender, String commandLine) throws CommandException { |
316 317 | return server.dispatchCommand(sender, commandLine); |
317 318 | } |
318 319 | |
319 320 | /** |
320 321 | * @see Server#configureDbConfig(ServerConfig config) |
321 322 | */ |
322 323 | public static void configureDbConfig(ServerConfig config) { |
323 324 | server.configureDbConfig(config); |
324 325 | } |
325 326 | |
594 595 | /** |
595 596 | * @see Server#createInventory(InventoryHolder owner, InventoryType type, String title) |
596 597 | */ |
597 598 | public static Inventory createInventory(InventoryHolder owner, InventoryType type, String title) { |
598 599 | return server.createInventory(owner, type, title); |
599 600 | } |
600 601 | |
601 602 | /** |
602 603 | * @see Server#createInventory(InventoryHolder owner, int size) |
603 604 | */ |
604 - | public static Inventory createInventory(InventoryHolder owner, int size) { |
605 + | public static Inventory createInventory(InventoryHolder owner, int size) throws IllegalArgumentException { |
605 606 | return server.createInventory(owner, size); |
606 607 | } |
607 608 | |
608 609 | /** |
609 610 | * @see Server#createInventory(InventoryHolder owner, int size, String |
610 611 | * title) |
611 612 | */ |
612 - | public static Inventory createInventory(InventoryHolder owner, int size, String title) { |
613 + | public static Inventory createInventory(InventoryHolder owner, int size, String title) throws IllegalArgumentException { |
613 614 | return server.createInventory(owner, size, title); |
614 615 | } |
615 616 | |
616 617 | /** |
617 618 | * @see Server#getHelpMap() |
618 619 | */ |
619 620 | public static HelpMap getHelpMap() { |
620 621 | return server.getHelpMap(); |
621 622 | } |
622 623 | |
693 694 | /** |
694 695 | * @see Server#getServerIcon() |
695 696 | */ |
696 697 | public static CachedServerIcon getServerIcon() { |
697 698 | return server.getServerIcon(); |
698 699 | } |
699 700 | |
700 701 | /** |
701 702 | * @see Server#loadServerIcon(File) |
702 703 | */ |
703 - | public static CachedServerIcon loadServerIcon(File file) throws Exception { |
704 + | public static CachedServerIcon loadServerIcon(File file) throws IllegalArgumentException, Exception { |
704 705 | return server.loadServerIcon(file); |
705 706 | } |
706 707 | |
707 708 | /** |
708 709 | * @see Server#loadServerIcon(BufferedImage) |
709 710 | */ |
710 - | public static CachedServerIcon loadServerIcon(BufferedImage image) throws Exception { |
711 + | public static CachedServerIcon loadServerIcon(BufferedImage image) throws IllegalArgumentException, Exception { |
711 712 | return server.loadServerIcon(image); |
712 713 | } |
713 714 | |
714 715 | /** |
715 716 | * @see Server#setIdleTimeout(int) |
716 717 | */ |
717 718 | public static void setIdleTimeout(int threshold) { |
718 719 | server.setIdleTimeout(threshold); |
719 720 | } |
720 721 | |