Class WeatherType
java.lang.Object
org.cyclops.evilcraft.core.weather.WeatherType
- Direct Known Subclasses:
WeatherTypeAny,WeatherTypeClear,WeatherTypeLightning,WeatherTypeRain
Abstract class for weather types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WeatherTypeAny weather type.static final WeatherTypeClear weather.static final WeatherTypeLightning.static final WeatherTypeRain.static final WeatherType[]Array that contains all possible weather types -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidactivate(net.minecraft.server.level.ServerLevel world) Activate this weather in the given world.voidactivate(net.minecraft.server.level.ServerLevel world, boolean activate) Activate or deactivate this weather in the given world.abstract voiddeactivate(net.minecraft.server.level.ServerLevel world) Deactivate this weather in the given world.static WeatherTypegetActiveWeather(net.minecraft.world.level.Level world) Returns the current active weather type.abstract booleanisActive(net.minecraft.world.level.Level world) Check if this weather is active in the given world.toString()static WeatherTypeGet a weather type by name.
-
Field Details
-
ANY
Any weather type. -
CLEAR
Clear weather. -
RAIN
Rain. -
LIGHTNING
Lightning. -
WEATHER_TYPES
Array that contains all possible weather types
-
-
Constructor Details
-
WeatherType
-
-
Method Details
-
toString
-
isActive
public abstract boolean isActive(net.minecraft.world.level.Level world) Check if this weather is active in the given world.- Parameters:
world- The world.- Returns:
- If it is active.
-
activate
public abstract void activate(net.minecraft.server.level.ServerLevel world) Activate this weather in the given world.- Parameters:
world- The world.
-
deactivate
public abstract void deactivate(net.minecraft.server.level.ServerLevel world) Deactivate this weather in the given world.- Parameters:
world- The world.
-
activate
public void activate(net.minecraft.server.level.ServerLevel world, boolean activate) Activate or deactivate this weather in the given world.- Parameters:
world- The world.activate- If the weather must be activated.
-
getActiveWeather
Returns the current active weather type.- Parameters:
world- The world.- Returns:
- The current active
WeatherType, or null in case no known active weather type was found.
-
valueOf
Get a weather type by name.- Parameters:
type- The type name.- Returns:
- The weather type.
-