API

Storm includes an API for develops that allows programmers to precisely control which weather is turned on or off, and add new weathers.

Note: to use the API, you need to reference Storm.jar.

The most important part of this API is the weather manager <sup>1</sup>, it stored as a static member of the Storm class, and can be accessed as Storm.manager.

Weather Control

The most basic and probably the most used methods are WeatherManager.startWeather() and WeatherManager.stopWeather(). They both have two overloads, one takes (weatherName, worldName), the other takes (weatherName, aCollectionOfWorldNames).

Example:

// Starts weather `x` on world `example`
Storm.manager.startWeather("x", "example");
// Starts weather `y` on worlds (`foo`, `bar`)
Storm.manager.startWeather("y", Arrays.asList("foo", "bar"));

// Stops weather `x` on world `example`
Storm.manager.stopWeather("x", "example");
// Stops weather `y` on worlds (`foo`, `bar`)
Storm.manager.stopWeather("y", Arrays.asList("foo", "bar"));

1: com.github.StormTeam.Storm.Weather.WeatherManager


Comments

Posts Quoted:
Reply
Clear All Quotes