Added plugin API, WIP
This commit is contained in:
parent
09053c4235
commit
b70d0ceed6
2 changed files with 30 additions and 7 deletions
|
@ -2,6 +2,7 @@ package buttondevteam;
|
||||||
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
import org.bukkit.plugin.PluginDescriptionFile;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
@ -9,36 +10,42 @@ import buttondevteam.alisolarflare.aliarrow.AliArrowSubPlugin;
|
||||||
import buttondevteam.core.CoreSubPlugin;
|
import buttondevteam.core.CoreSubPlugin;
|
||||||
|
|
||||||
public class MainPlugin extends JavaPlugin {
|
public class MainPlugin extends JavaPlugin {
|
||||||
|
public static MainPlugin Instance;
|
||||||
|
|
||||||
private PluginDescriptionFile pdfFile;
|
private PluginDescriptionFile pdfFile;
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
private AliArrowSubPlugin aliArrowSubPlugin;
|
private AliArrowSubPlugin aliArrowSubPlugin;
|
||||||
private CoreSubPlugin playerSubPlugin;
|
private CoreSubPlugin playerSubPlugin;
|
||||||
|
|
||||||
public void onEnable(){
|
public void onEnable() {
|
||||||
//Logs "Plugin Enabled", registers commands
|
// Logs "Plugin Enabled", registers commands
|
||||||
|
Instance = this;
|
||||||
pdfFile = getDescription();
|
pdfFile = getDescription();
|
||||||
logger = getLogger();
|
logger = getLogger();
|
||||||
logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ").");
|
logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion() + ").");
|
||||||
|
|
||||||
registerSubPlugins();
|
registerSubPlugins();
|
||||||
registerCommands();
|
registerCommands();
|
||||||
registerEvents();
|
registerEvents();
|
||||||
|
|
||||||
logger.info(pdfFile.getName() + " has been Enabled (V." + pdfFile.getVersion()+ ").");
|
logger.info(pdfFile.getName() + " has been Enabled (V." + pdfFile.getVersion() + ").");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerSubPlugins() {
|
private void registerSubPlugins() {
|
||||||
aliArrowSubPlugin = new AliArrowSubPlugin(this);
|
aliArrowSubPlugin = new AliArrowSubPlugin(this);
|
||||||
aliArrowSubPlugin.register();
|
aliArrowSubPlugin.register();
|
||||||
playerSubPlugin = new CoreSubPlugin(this);
|
playerSubPlugin = new CoreSubPlugin(this);
|
||||||
playerSubPlugin.register();
|
playerSubPlugin.register();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerCommands() {
|
private void registerCommands() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerEvents() {
|
private void registerEvents() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
16
src/buttondevteam/core/TBMCPluginsAPI.java
Normal file
16
src/buttondevteam/core/TBMCPluginsAPI.java
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
package buttondevteam.core;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
public final class TBMCPluginsAPI {
|
||||||
|
private static List<Plugin> plugins = new ArrayList<>(); //TODO: Automatically load
|
||||||
|
|
||||||
|
public static boolean UpdatePlugin(String name) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> GetPluginNames()
|
||||||
|
}
|
Loading…
Reference in a new issue