Class ParticleUtils

java.lang.Object
dev.esophose.playerparticles.util.ParticleUtils

public final class ParticleUtils
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.util.List<org.bukkit.Material> BLOCK_MATERIALS  
    static java.util.List<java.lang.String> BLOCK_MATERIALS_STRING  
    static org.bukkit.Material FALLBACK_MATERIAL  
    static java.util.List<org.bukkit.Material> ITEM_MATERIALS  
    static java.util.List<java.lang.String> ITEM_MATERIALS_STRING  
  • Method Summary

    Modifier and Type Method Description
    static org.bukkit.Material closestMatch​(java.lang.String input)
    Finds a block/item as a material from a string
    static org.bukkit.Material closestMatchWithFallback​(boolean fallback, java.lang.String... input)
    Finds a block/item as a material from a list of possible strings Contains a fallback to the barrier icon just in case
    static boolean containsConfigSpecialCharacters​(java.lang.String string)  
    static java.lang.String formatName​(java.lang.String string)
    Formats a string from the format "word_word" to "Word Word"
    static int getSmallestPositiveInt​(int[] n)
    Gets the smallest positive integer from an array
    static org.bukkit.block.Block getTargetBlock​(org.bukkit.entity.Player player)  
    static boolean isPlayerVisible​(org.bukkit.entity.Player player)  
    static java.lang.String rgbToHex​(int r, int g, int b)  

    Methods inherited from class java.lang.Object

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

    • FALLBACK_MATERIAL

      public static final org.bukkit.Material FALLBACK_MATERIAL
    • BLOCK_MATERIALS

      public static final java.util.List<org.bukkit.Material> BLOCK_MATERIALS
    • ITEM_MATERIALS

      public static final java.util.List<org.bukkit.Material> ITEM_MATERIALS
    • BLOCK_MATERIALS_STRING

      public static final java.util.List<java.lang.String> BLOCK_MATERIALS_STRING
    • ITEM_MATERIALS_STRING

      public static final java.util.List<java.lang.String> ITEM_MATERIALS_STRING
  • Method Details

    • closestMatch

      public static org.bukkit.Material closestMatch​(java.lang.String input)
      Finds a block/item as a material from a string
      Parameters:
      input - The material name as a string
      Returns:
      The material from the string
    • closestMatchWithFallback

      public static org.bukkit.Material closestMatchWithFallback​(boolean fallback, java.lang.String... input)
      Finds a block/item as a material from a list of possible strings Contains a fallback to the barrier icon just in case
      Parameters:
      fallback - If the material should fall back to barrier
      input - A list of material names
      Returns:
      The first matching material
    • formatName

      public static java.lang.String formatName​(java.lang.String string)
      Formats a string from the format "word_word" to "Word Word"
      Parameters:
      string - The input string
      Returns:
      The input string but formatted with each word capitalized
    • getSmallestPositiveInt

      public static int getSmallestPositiveInt​(int[] n)
      Gets the smallest positive integer from an array
      Parameters:
      n - The array containing non-available integers
      Returns:
      The smallest positive integer not in the given array
    • containsConfigSpecialCharacters

      public static boolean containsConfigSpecialCharacters​(java.lang.String string)
    • isPlayerVisible

      public static boolean isPlayerVisible​(org.bukkit.entity.Player player)
    • rgbToHex

      public static java.lang.String rgbToHex​(int r, int g, int b)
    • getTargetBlock

      public static org.bukkit.block.Block getTargetBlock​(org.bukkit.entity.Player player)