Class LVMath

java.lang.Object
hm.zelha.particlesfx.util.LVMath

public final class LVMath extends Object
location and vector math utils for cleaner code, not meant to be used outside ParticleSFX internals
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.Location
    additionToLocation(org.bukkit.Location toSet, org.bukkit.Location toAddTo, org.bukkit.util.Vector addend)
     
    static org.bukkit.Location
    additionToLocation(org.bukkit.Location toSet, org.bukkit.Location toAddTo, org.bukkit.util.Vector addend, boolean causedByCompound)
     
    static org.bukkit.util.Vector
    divide(org.bukkit.util.Vector vector, double dividend)
     
    static double
    getAbsoluteSum(org.bukkit.util.Vector vector)
     
    static org.bukkit.util.Vector
    subtractToVector(org.bukkit.util.Vector toSet, org.bukkit.Location location, org.bukkit.Location subtrahend)
     
    static org.bukkit.util.Vector
    toVector(org.bukkit.util.Vector vector, org.bukkit.Location location)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getAbsoluteSum

      public static double getAbsoluteSum(org.bukkit.util.Vector vector)
      Parameters:
      vector - vector to get absolute sum from
      Returns:
      the sum of the absolute values of the X, Y, and Z of the given vector
    • toVector

      public static org.bukkit.util.Vector toVector(org.bukkit.util.Vector vector, org.bukkit.Location location)
      Parameters:
      vector - vector to copy the given location's info to
      location - the location to copy
      Returns:
      the given vector
    • divide

      public static org.bukkit.util.Vector divide(org.bukkit.util.Vector vector, double dividend)
      Parameters:
      vector - vector to divide
      dividend - number to divide the given vector's X, Y, and Z coordinates by
      Returns:
      the given vector, with its coordinates divided by the given dividend or zeroed if the dividend is 0 or not finite.
    • subtractToVector

      public static org.bukkit.util.Vector subtractToVector(org.bukkit.util.Vector toSet, org.bukkit.Location location, org.bukkit.Location subtrahend)
      Parameters:
      toSet - vector to modify
      location - location to be subtracted from
      subtrahend - location to be subtracted
      Returns:
      the given vector
    • additionToLocation

      public static org.bukkit.Location additionToLocation(org.bukkit.Location toSet, org.bukkit.Location toAddTo, org.bukkit.util.Vector addend, boolean causedByCompound)
      Parameters:
      toSet - location to modify
      toAddTo - location to be added to
      addend - vector to add
      causedByCompound - whether this was caused by a ParticleShapeCompound
      Returns:
      the location that was modified
    • additionToLocation

      public static org.bukkit.Location additionToLocation(org.bukkit.Location toSet, org.bukkit.Location toAddTo, org.bukkit.util.Vector addend)
      Parameters:
      toSet - location to modify
      toAddTo - location to be added to
      addend - vector to add
      Returns:
      the location that was modified