Package dev.sefiraat.sefilib.string
Class Theme
java.lang.Object
dev.sefiraat.sefilib.string.Theme
A Theme is used to coordinate the display of Items and Strings within your addon.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ThemeA Pale Yellow theme indicating where to click in the middle of a text.static final ThemeA Red error theme.static final ThemeA White notice theme.static final ThemeA Gray passive theme.static final ThemeA Green success theme.static final ThemeA Yellow warning theme. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionApplies the theme color to a given stringstatic StringapplyThemeAsTitle(Theme themeType, String string1, Object value) Applies the theme color to the first string and PASSIVE to the secondstatic StringapplyThemeToString(Theme themeType, Object value) Applies the theme color to a given stringApplies the theme color to the first string and PASSIVE to the secondReturns the given string with the theme's color applied.net.md_5.bungee.api.ChatColorgetColor()Returns theChatColorof this themegetDustOptions(float size) Gets theParticle.DustOptionsfor this theme.Returns the loreline for this theme without the color applied.static ItemStackGets an ItemStack with a pre-populated lore and name with themed colors.static io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStackthemedSeed(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 seedsstatic io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStackthemedSeed(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 seedsstatic io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStackthemedSlimefunItemStack(String id, ItemStack itemStack, Theme themeType, String name, String... lore) Gets a SlimefunItemStack with a pre-populated lore and name with themed colors.static io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStackthemedSlimefunItemStack(String id, ItemStack itemStack, Theme themeType, String name, List<String> lore) Gets a SlimefunItemStack with a pre-populated lore and name with themed colors.static io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStackGets a SlimefunItemStack with a pre-populated lore and name with themed colors.toString()Gets the color code for this theme as a string.
-
Field Details
-
WARNING
A Yellow warning theme. -
ERROR
A Red error theme. -
NOTICE
A White notice theme. -
PASSIVE
A Gray passive theme. -
SUCCESS
A Green success theme. -
CLICK_INFO
A Pale Yellow theme indicating where to click in the middle of a text.
-
-
Constructor Details
-
Method Details
-
color
Returns the given string with the theme's color applied.- Parameters:
string- The string to color.- Returns:
- The colored string.
-
apply
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
Applies the theme color to the first string and PASSIVE to the second- Parameters:
value1- The Object (as string) to apply the color tovalue2- 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 theChatColorof this theme- Returns:
- The
ChatColorof this theme
-
getDustOptions
Gets theParticle.DustOptionsfor this theme.- Parameters:
size- The size of the particle- Returns:
- The
Particle.DustOptionsfor this theme.
-
toString
Gets 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 newSlimefunItemStackitemStack- The vanillaItemStackused to base theSlimefunItemStackonthemeType- TheThemeChatColorto apply to theSlimefunItemStacknamename- The name to apply to theSlimefunItemStacklore- The lore lines for theSlimefunItemStack. 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 newSlimefunItemStackitemStack- The vanillaItemStackused to base theSlimefunItemStackonthemeType- TheThemeChatColorto apply to theSlimefunItemStacknamename- The name to apply to theSlimefunItemStacklore- The lore lines for theSlimefunItemStack. 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 newSlimefunItemStackmaterial- The vanillaItemStackused to base theSlimefunItemStackonthemeType- TheThemeChatColorto apply to theSlimefunItemStacknamename- The name to apply to theSlimefunItemStacklore- The lore lines for theSlimefunItemStack. 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 newSlimefunItemStackseedStack- The vanillaItemStackused to base theSlimefunItemStackonthemeType- TheThemeChatColorto apply to theSlimefunItemStacknamename- The name to apply to theSlimefunItemStacklore- The lore lines for theSlimefunItemStack. 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 newSlimefunItemStackseedStack- The vanillaItemStackused to base theSlimefunItemStackonthemeType- TheThemeChatColorto apply to theSlimefunItemStacknamename- The name to apply to theSlimefunItemStacklore- The lore lines for theSlimefunItemStack. Lore is book-ended with empty strings.validPlacements- A list of valid placements for this seed.- Returns:
- Returns the new
SlimefunItemStack
-
applyThemeToString
Applies the theme color to a given string- Parameters:
themeType- TheThemeto apply the color fromvalue- 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- TheThemeto apply the color fromstring1- The string to apply the color tovalue- The object to apply PASSIVE to as string- Returns:
- Returns the string provides preceded by the color
-
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.
-