xaniox / HeavySpleef

Advanced and highly configurable Spleef plugin for Bukkit
http://dev.bukkit.org/server-mods/heavyspleef/
GNU General Public License v3.0
12 stars 19 forks source link

No API No Life #38

Closed NicoNekoDev closed 8 years ago

NicoNekoDev commented 8 years ago

`public class HeavySpleefPlugin extends JavaPlugin {

private HeavySpleef heavySpleef;

@Override
public void onEnable() {
    heavySpleef = new HeavySpleef(this);

    Module flagModule = new FlagModule(heavySpleef);
    Module commandModule = new CommandModule(heavySpleef);
    Module persistenceModule = new PersistenceModule(heavySpleef);
    Module addOnModule = new AddOnModule(heavySpleef);
    Module legacyModule = new MigrationModule(heavySpleef);

    heavySpleef.registerModule(legacyModule);
    heavySpleef.registerModule(commandModule);
    heavySpleef.registerModule(flagModule);
    heavySpleef.registerModule(persistenceModule);
    heavySpleef.registerModule(addOnModule);
    heavySpleef.enableModules(LoadPolicy.Lifecycle.PRE_LOAD);

    heavySpleef.load();

    heavySpleef.enableModules(LoadPolicy.Lifecycle.POST_LOAD);
    heavySpleef.addGamesLoadCallback(new GamesLoadCallback() {

        @Override
        public void onGamesLoaded(List<Game> games) {
            heavySpleef.enableModules(LoadPolicy.Lifecycle.POST_GAMES_LOAD);
        }
    });

    heavySpleef.enable();
    heavySpleef.enableModules(LoadPolicy.Lifecycle.POST_ENABLE);
}

@Override
public void onDisable() {
    if (heavySpleef != null) {
        heavySpleef.disable(); 
    }
}

   public HeavySpleef getAPI() { <- this here
            return heavySpleef;
   }

}` not to hard to implement this... i realy need to check if a player is in a game (that running)

xaniox commented 8 years ago

Thanks for pointing this out. I added a HeavySpleefPlugin#getCoreHeavySpleef() getter to the plugin class in the latest development build 307. https://ci.xaniox.de/job/HeavySpleef/