Class Theme

java.lang.Object
dev.sefiraat.sefilib.string.Theme

public class Theme extends Object
A Theme is used to coordinate the display of Items and Strings within your addon.
  • Field Details

    • WARNING

      public static final Theme WARNING
      A Yellow warning theme.
    • ERROR

      public static final Theme ERROR
      A Red error theme.
    • NOTICE

      public static final Theme NOTICE
      A White notice theme.
    • PASSIVE

      public static final Theme PASSIVE
      A Gray passive theme.
    • SUCCESS

      public static final Theme SUCCESS
      A Green success theme.
    • CLICK_INFO

      public static final Theme CLICK_INFO
      A Pale Yellow theme indicating where to click in the middle of a text.
  • Constructor Details

    • Theme

      public Theme(@Nonnull net.md_5.bungee.api.ChatColor color)
      Creates a new Theme without a lore line.
      Parameters:
      color - The color of this theme.
    • Theme

      public Theme(@Nonnull net.md_5.bungee.api.ChatColor color, @Nonnull String loreLine)
      Creates a new Theme.
      Parameters:
      color - The color of this theme.
      loreLine - The lore line of this theme.
  • Method Details

    • color

      public String color(@Nonnull String string)
      Returns the given string with the theme's color applied.
      Parameters:
      string - The string to color.
      Returns:
      The colored string.
    • apply

      @Nonnull public String apply(@Nonnull Object value)
      Applies the theme color to a given string
      Parameters:
      value - The Object (as string) to apply the color to
      Returns:
      Returns the string provides preceded by the color
    • asTitle

      @Nonnull public String asTitle(@Nonnull Object value1, @Nonnull Object value2)
      Applies the theme color to the first string and PASSIVE to the second
      Parameters:
      value1 - The Object (as string) to apply the color to
      value2 - The Object (as string) to apply PASSIVE to
      Returns:
      Returns the string provides preceded by the color
    • getColor

      @Nonnull public net.md_5.bungee.api.ChatColor getColor()
      Returns the ChatColor of this theme
      Returns:
      The ChatColor of this theme
    • getDustOptions

      @Nonnull public Particle.DustOptions getDustOptions(float size)
      Gets the Particle.DustOptions for this theme.
      Parameters:
      size - The size of the particle
      Returns:
      The Particle.DustOptions for this theme.
    • toString

      @Nonnull public String toString()
      Gets the color code for this theme as a string.
      Overrides:
      toString in class Object
      Returns:
      The color code for this theme as a string.
    • themedSlimefunItemStack

      @Nonnull @ParametersAreNonnullByDefault public static io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack themedSlimefunItemStack(String id, ItemStack itemStack, Theme themeType, String name, String... lore)
      Gets a SlimefunItemStack with a pre-populated lore and name with themed colors.
      Parameters:
      id - The ID for the new SlimefunItemStack
      itemStack - The vanilla ItemStack used to base the SlimefunItemStack on
      themeType - The Theme ChatColor to apply to the SlimefunItemStack name
      name - The name to apply to the SlimefunItemStack
      lore - The lore lines for the SlimefunItemStack. Lore is book-ended with empty strings.
      Returns:
      Returns the new SlimefunItemStack
    • themedSlimefunItemStack

      @Nonnull @ParametersAreNonnullByDefault public static io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack themedSlimefunItemStack(String id, ItemStack itemStack, Theme themeType, String name, List<String> lore)
      Gets a SlimefunItemStack with a pre-populated lore and name with themed colors.
      Parameters:
      id - The ID for the new SlimefunItemStack
      itemStack - The vanilla ItemStack used to base the SlimefunItemStack on
      themeType - The Theme ChatColor to apply to the SlimefunItemStack name
      name - The name to apply to the SlimefunItemStack
      lore - The lore lines for the SlimefunItemStack. Lore is book-ended with empty strings.
      Returns:
      Returns the new SlimefunItemStack
    • themedSlimefunItemStack

      @Nonnull @ParametersAreNonnullByDefault public static io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack themedSlimefunItemStack(String id, Material material, Theme themeType, String name, String... lore)
      Gets a SlimefunItemStack with a pre-populated lore and name with themed colors.
      Parameters:
      id - The ID for the new SlimefunItemStack
      material - The vanilla ItemStack used to base the SlimefunItemStack on
      themeType - The Theme ChatColor to apply to the SlimefunItemStack name
      name - The name to apply to the SlimefunItemStack
      lore - The lore lines for the SlimefunItemStack. Lore is book-ended with empty strings.
      Returns:
      Returns the new SlimefunItemStack
    • themedSeed

      @Nonnull @ParametersAreNonnullByDefault public static io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack themedSeed(String id, ItemStack seedStack, Theme themeType, String name, String[] lore, String[] validPlacements)
      Gets a SlimefunItemStack with a pre-populated lore and name with themed colors with parameters for the plantable items/materials for seeds
      Parameters:
      id - The ID for the new SlimefunItemStack
      seedStack - The vanilla ItemStack used to base the SlimefunItemStack on
      themeType - The Theme ChatColor to apply to the SlimefunItemStack name
      name - The name to apply to the SlimefunItemStack
      lore - The lore lines for the SlimefunItemStack. Lore is book-ended with empty strings.
      validPlacements - A list of valid placements for this seed.
      Returns:
      Returns the new SlimefunItemStack
    • themedSeed

      @Nonnull @ParametersAreNonnullByDefault public static io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack themedSeed(String id, ItemStack seedStack, Theme themeType, String name, List<String> lore, List<String> validPlacements)
      Gets a SlimefunItemStack with a pre-populated lore and name with themed colors with parameters for the plantable items/materials for seeds
      Parameters:
      id - The ID for the new SlimefunItemStack
      seedStack - The vanilla ItemStack used to base the SlimefunItemStack on
      themeType - The Theme ChatColor to apply to the SlimefunItemStack name
      name - The name to apply to the SlimefunItemStack
      lore - The lore lines for the SlimefunItemStack. Lore is book-ended with empty strings.
      validPlacements - A list of valid placements for this seed.
      Returns:
      Returns the new SlimefunItemStack
    • applyThemeToString

      @Nonnull public static String applyThemeToString(@Nonnull Theme themeType, @Nonnull Object value)
      Applies the theme color to a given string
      Parameters:
      themeType - The Theme to apply the color from
      value - The object (as string) to apply the color to
      Returns:
      Returns the string provides preceded by the color
    • applyThemeAsTitle

      @Nonnull @ParametersAreNonnullByDefault public static String applyThemeAsTitle(Theme themeType, String string1, Object value)
      Applies the theme color to the first string and PASSIVE to the second
      Parameters:
      themeType - The Theme to apply the color from
      string1 - The string to apply the color to
      value - The object to apply PASSIVE to as string
      Returns:
      Returns the string provides preceded by the color
    • getLoreLine

      @Nonnull public String getLoreLine()
      Returns the loreline for this theme without the color applied.
      Returns:
      Returns the loreline for this theme without the color applied.
    • themedItemStack

      @Nonnull @ParametersAreNonnullByDefault public static ItemStack themedItemStack(Material material, Theme themeType, String name, @Nullable List<String> lore)
      Gets an ItemStack with a pre-populated lore and name with themed colors.
      Parameters:
      material - The Material used to base the ItemStack on
      themeType - The Theme ChatColor to apply to the ItemStack name
      name - The name to apply to the ItemStack
      lore - The lore lines for the ItemStack. Lore is book-ended with empty strings.
      Returns:
      Returns the new ItemStack