Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package org.bukkit.plugin;
2
3import com.avaje.ebean.EbeanServer;
4import org.bukkit.Server;
5import org.bukkit.command.CommandExecutor;
6import org.bukkit.generator.ChunkGenerator;
7import org.bukkit.util.config.Configuration;
8
9import java.io.File;
10
11/**
12 * Represents a Plugin
13 */
14public interface Plugin extends CommandExecutor {
15
16 /**
17 * Returns the folder that the plugin data's files are located in. The
18 * folder may not yet exist.
19 *
20 * @return
21 */
22 public File getDataFolder();
23
24 /**
25 * Returns the plugin.yaml file containing the details for this plugin
26 *
27 * @return Contents of the plugin.yaml file
28 */
29 public PluginDescriptionFile getDescription();
30
31 /**
32 * Returns the main configuration file. It should be loaded.
33 *
34 * @return
35 */
36 public Configuration getConfiguration();
37
38 /**
39 * Gets the associated PluginLoader responsible for this plugin
40 *
41 * @return PluginLoader that controls this plugin
42 */
43 public PluginLoader getPluginLoader();
44
45 /**
46 * Returns the Server instance currently running this plugin
47 *
48 * @return Server running this plugin
49 */
50 public Server getServer();
51
52 /**
53 * Returns a value indicating whether or not this plugin is currently enabled
54 *
55 * @return true if this plugin is enabled, otherwise false
56 */
57 public boolean isEnabled();
58
59 /**
60 * Called when this plugin is disabled
61 */
62 public void onDisable();
63
64 /**
65 * Called after a plugin is loaded but before it has been enabled.
66 * When mulitple plugins are loaded, the onLoad() for all plugins is called before any onEnable() is called.
67 */
68 public void onLoad();
69
70 /**
71 * Called when this plugin is enabled
72 */
73 public void onEnable();
74
75 /**
76 * Simple boolean if we can still nag to the logs about things
77 *
78 * @return boolean whether we can nag
79 */
80 public boolean isNaggable();
81
82 /**
83 * Set naggable state
84 *
85 * @param canNag is this plugin still naggable?
86 */
87 public void setNaggable(boolean canNag);
88
89 /**
90 * Gets the {@link EbeanServer} tied to this plugin
91 *
92 * @return Ebean server instance
93 */
94 public EbeanServer getDatabase();
95
96 /**
97 * Gets a {@link ChunkGenerator} for use in a default world, as specified in the server configuration
98 *
99 * @param worldName Name of the world that this will be applied to
100 * @param id Unique ID, if any, that was specified to indicate which generator was requested
101 * @return ChunkGenerator for use in the default world generation
102 */
103 public ChunkGenerator getDefaultWorldGenerator(String worldName, String id);
104}