API

The API adds many ways for developers to interact with RealisticSeasons. The RealisticSeasons API can be imported by importing the plugin jar directly into your project. Maven is still a work in progress. Don't forget to add RealisticSeasons as a (soft) depend in your plugin.yml. Here is a list of all the methods and events.

Methods

SeasonsAPI seasonsapi = SeasonsAPI.getInstance(); gets an instance of SeasonsAPI. This will be used in the next methods.

seasonsapi.setSeason(World w, Season s); seasonsapi.setSeason(p.getWorld(), Season.WINTER); Change the season in a world. Will also update the date.

Season season = seasonsapi.getSeason(World w); Get the current season of a world

seasonsapi.setDate(World w, Date date); seasonsapi.setDate(p.getWorld(), new Date(1, 1, 2022)); Change the date in a world. May also update seasons. Make sure to import the RealisticSeasons Date object and not the java one.

Date date = seasonsapi.getDate(World w); Get the current date in a world.

int temperature = seasonsapi.getTemperature(Player p); Get the temperature of a player

int airtemperature = seasonsapi.getAirTemperature(Location loc); Get air temperature on location.

seasonsapi.applyTimedTemperatureEffect(Player p, int modifier, int seconds); Apply a temporary temperature effect to a player. modifier is how much the temperature of the player should change.

TemperatureEffect effect = seasonsapi.applyPermanentTemperatureEffect(Player p, int modifier); Apply a "permanent" temperature effect to the player. The effect will not be removed unless you remove it yourself. Not persistent through restarts. effect.cancel(); The temperature effect will be removed again

int seconds = seasonsapi.getSeconds(World w); int minutes = seasonsapi.getMinutes(World w); int hours = seasonsapi.getHours(World w); Get seconds, minutes and hours of the time in a world. String dayOfWeek = seasonsapi.getDayOfWeek(World w) Get the day of the week as a name. It uses names in calendar.yml String monthName = seasonsapi.getCurrentMonthName(World w) Get month as a name. It uses names in calendar.yml

SeasonBiome biome = getReplacementSeasonBiome(String biomeName, Season s) SeasonBiome biome = getReplacementSeasonBiome(Location l, Season s) SeasonBiome biome = getReplacementSeasonBiome(Biome b, Season s) String hex = biome.getFogColor() String hex = biome.getWaterColor() String hex = biome.getWaterFogColor() String hex = biome.getSkyColor() String hex = biome.getFoliageColor() String hex = biome.getGrassColor() Get some information about the season colors in a biome or location. Format is in hex.

Events

The plugin also has its own events:

Last updated