Hooking into Seasons
Here are the most important method you may use in the API.
First you may load the Seasons in your JavaPlugin class
Seasons seasons = (org.rominos2.Seasons.api.Seasons) this.getServer().getPluginManager().getPlugin("Seasons");
The Seasons plugin is divided in SeasonsManager for each World
That's way you can use :
SeasonsManager manager = seasons.getManager(World world);
In each Manager, there are some informations about Season in this World and also method to change Weather and Season...
manager.changeWeather(SeasonsWeather weather); manager.changeSeason(SeasonObject season);
There also properties that don't change on Seasons, like the Color of the messages or others informations.
SeasonsSettings properties = manager.getProperties(); properties.isActive(); properties.isSnowRegen(); properties.getSeasons();
The last one permit to get all the Seasons that turn in this World.
Each Season contains a LOT of information, from the name to the Spout Notification Material on Special Day.
You can also get it from the Manager (it will return the current Season)
SeasonObject season = manager.getSeason(); season.getName(); season.setName(String name); season.getDayTime(); season.setDayTime(int time);
Creating New Season and active it
You can also create new Seasons with a enourmouse constructor :
SeasonObject(String name, String shortName, int weatherPercentages, Double lengths, HashMap<Integer, String> specialDays, String texture, int snowPond, Material notificationSeasonMaterial, Material notificationDayMaterial, double snowPlaceSpeed, double snowRemoveSpeed, int dayTime, int nightTime);
The int percentages must be filled by a 3-length table with the Sun, Rain and Thunder Percentage. It must make 100%
The others one seems obvious to describe (name ?)
To run the Season in the World you must now add it to the Properties and then launch it
I Want Moar !
Some more Managers of Season (Time Manager, SignManager) can be get from the main Manager
SignManager signsmanager = manager.getSignManager(); TimeManager timemanager = manager.getTimeManager();
If you really want more, you can look at the JavaDoc : JavaDoc on Dropbox.net
With these informations, you are ready to code somtething with Seasons
Don't forget to send me the link of your plugin to paste it in the "Seasons plugins list" on the Main page of Seasons
Have Fun !