Class WeatherType

java.lang.Object
org.cyclops.evilcraft.core.weather.WeatherType
Direct Known Subclasses:
WeatherTypeAny, WeatherTypeClear, WeatherTypeLightning, WeatherTypeRain

public abstract class WeatherType extends Object
Abstract class for weather types.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final WeatherType
    Any weather type.
    static final WeatherType
    Clear weather.
    static final WeatherType
    Lightning.
    static final WeatherType
    Rain.
    static final WeatherType[]
    Array that contains all possible weather types
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    activate(net.minecraft.server.level.ServerLevel world)
    Activate this weather in the given world.
    void
    activate(net.minecraft.server.level.ServerLevel world, boolean activate)
    Activate or deactivate this weather in the given world.
    abstract void
    deactivate(net.minecraft.server.level.ServerLevel world)
    Deactivate this weather in the given world.
    getActiveWeather(net.minecraft.world.level.Level world)
    Returns the current active weather type.
    abstract boolean
    isActive(net.minecraft.world.level.Level world)
    Check if this weather is active in the given world.
     
    Get a weather type by name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • ANY

      public static final WeatherType ANY
      Any weather type.
    • CLEAR

      public static final WeatherType CLEAR
      Clear weather.
    • RAIN

      public static final WeatherType RAIN
      Rain.
    • LIGHTNING

      public static final WeatherType LIGHTNING
      Lightning.
    • WEATHER_TYPES

      public static final WeatherType[] WEATHER_TYPES
      Array that contains all possible weather types
  • Constructor Details

    • WeatherType

      protected WeatherType(String name)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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

      public static WeatherType getActiveWeather(net.minecraft.world.level.Level world)
      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

      public static WeatherType valueOf(String type)
      Get a weather type by name.
      Parameters:
      type - The type name.
      Returns:
      The weather type.