Class StormBuilder

java.lang.Object
net.nullved.pmweatherapi.storm.StormBuilder

public class StormBuilder extends Object
A builder for Storms that makes it easy to create and spawn them. Create a StormBuilder with any constructor or atPlayer(StormType, Player)
To spawn the storm in the world, use buildAndSpawn(). To only create the storm instance, use build()
Since:
0.14.15.5
  • Constructor Details

    • StormBuilder

      public StormBuilder(dev.protomanly.pmweather.weather.WeatherHandler weatherHandler, StormType type, net.minecraft.world.phys.Vec3 position)
      Create a new StormBuilder
      Parameters:
      weatherHandler - The WeatherHandler to use
      type - The StormType of storm
      position - The Vec3 representing the position of the Storm
      Since:
      0.14.15.5
    • StormBuilder

      public StormBuilder(net.minecraft.world.level.Level level, StormType type, net.minecraft.world.phys.Vec3 position)
      Create a new StormBuilder
      Parameters:
      level - The Level to spawn in
      type - The StormType of storm
      position - The Vec3 representing the position of the Storm
      Since:
      0.14.15.5
    • StormBuilder

      public StormBuilder(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, StormType type, net.minecraft.world.phys.Vec3 position)
      Create a new StormBuilder
      Parameters:
      dimension - The ResourceKey of the dimension to spawn in
      type - The StormType of storm
      position - The Vec3 representing the position of the Storm
      Since:
      0.14.15.5
  • Method Details

    • atPlayer

      public static StormBuilder atPlayer(StormType type, net.minecraft.world.entity.player.Player player)
      Creates a StormBuilder at a Player's dimension and position
      Parameters:
      type - The StormType of storm
      player - The Player to grab the dimension and position from
      Returns:
      A new StormBuilder
      Since:
      0.14.15.5
    • aimAtPlayer

      public StormBuilder aimAtPlayer(net.minecraft.world.entity.player.Player player)
      Aims the Storm at the given player. Overrides velocity(Vec3). Overriden by aimAtAnyPlayer()
      Parameters:
      player - The Player to aim the Storm at
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • aimAtAnyPlayer

      public StormBuilder aimAtAnyPlayer()
      Aims the Storm at a random player. Overrides velocity(Vec3) and aimAtPlayer(Player)
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • visualOnly

      public StormBuilder visualOnly(boolean visualOnly)
      Set the Storm to be visual only
      Parameters:
      visualOnly - Whether the storm should be visual only
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • risk

      public StormBuilder risk(float risk)
      Sets the risk of the Storm
      Parameters:
      risk - The risk
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • rankineFactor

      public StormBuilder rankineFactor(float rankineFactor)
      Sets the rankine factor of the Storm
      Parameters:
      rankineFactor - The rankine factor
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • width

      public StormBuilder width(float width)
      Sets the width of the Storm
      Parameters:
      width - The width
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • smoothWidth

      public StormBuilder smoothWidth(float smoothWidth)
      Sets the smooth width of the Storm
      Parameters:
      smoothWidth - The smooth width
      Returns:
      The StormBuilder instance
      Since:
      0.15.0.0
    • maxWidth

      public StormBuilder maxWidth(int maxWidth)
      Sets the max width of the Storm
      Parameters:
      maxWidth - The max width
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • stage

      public StormBuilder stage(int stage)
      Sets the stage of the Storm
      Parameters:
      stage - The stage
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • maxStage

      public StormBuilder maxStage(int maxStage)
      Sets the max stage of the Storm
      Parameters:
      maxStage - The max stage
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • energy

      public StormBuilder energy(int energy)
      Sets the energy of the Storm
      Parameters:
      energy - The energy
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • coldEnergy

      public StormBuilder coldEnergy(int coldEnergy)
      Sets the cold energy of the Storm
      Parameters:
      coldEnergy - The cold energy
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • maxColdEnergy

      public StormBuilder maxColdEnergy(int maxColdEnergy)
      Sets the max cold energy of the Storm
      Parameters:
      maxColdEnergy - The max cold energy
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • windspeed

      public StormBuilder windspeed(int windspeed)
      Sets the windspeed of the Storm
      Parameters:
      windspeed - The windspeed
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • cycloneWindspeed

      public StormBuilder cycloneWindspeed(float cycloneWindspeed)
      Sets the cyclone windspeed of the Storm
      Parameters:
      cycloneWindspeed - The cyclone windspeed
      Returns:
      The StormBuilder instance
      Since:
      0.15.0.0
    • smoothWindspeed

      public StormBuilder smoothWindspeed(float smoothWindspeed)
      Sets the smooth windspeed of the Storm
      Parameters:
      smoothWindspeed - The smooth windspeed
      Returns:
      The StormBuilder instance
      Since:
      0.15.0.0
    • maxWindspeed

      public StormBuilder maxWindspeed(int maxWindspeed)
      Sets the max windspeed of the Storm
      Parameters:
      maxWindspeed - The max windspeed
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • velocity

      public StormBuilder velocity(net.minecraft.world.phys.Vec3 velocity)
      Sets the velocity of the Storm. Overriden by aimAtPlayer(Player) and aimAtAnyPlayer()
      Parameters:
      velocity - The velocity of the storm
      Returns:
      The StormBuilder instance
      Since:
      0.14.15.5
    • build

      public dev.protomanly.pmweather.weather.Storm build()
      Builds the final storm, but does NOT spawn it. To spawn in, use buildAndSpawn() instead
      Returns:
      The built Storm instance
      Since:
      0.14.15.5
    • buildAndSpawn

      public dev.protomanly.pmweather.weather.Storm buildAndSpawn()
      Builds the final storm and spawns it. To NOT spawn it, use build() instead
      Returns:
      The built Storm instance
      Since:
      0.14.15.5