Class Font
java.lang.Object
com.github.stefvanschie.inventoryframework.font.util.Font
- Direct Known Subclasses:
CSVFont
public abstract class Font
extends java.lang.Object
An interface for fonts
- Since:
- 0.5.0
-
Field Summary
Fields Modifier and Type Field Description static Font
BIRCH_PLANKS
The birch planks fontstatic Font
BLACK
The black fontstatic Font
BLUE
The blue fontstatic Font
BROWN
The brown fontstatic Font
COBBLESTONE
The cobblestone fontstatic Font
CYAN
The cyan fontstatic Font
DIAMOND
The diamond fontstatic Font
DIRT
The dirt fontstatic Font
GOLD
The gold fontstatic Font
GRAY
The gray fontstatic Font
GREEN
The green fontstatic Font
JUNGLE_PLANKS
The jungle planks fontstatic Font
LETTER_CUBE
The letter cube fontstatic Font
LIGHT_BLUE
The light blue fontstatic Font
LIGHT_GRAY
The light gray fontstatic Font
LIME
The lime fontstatic Font
MAGENTA
The magenta fontstatic Font
MONITOR
The monitor fontstatic Font
OAK_LOG
The oak log fontstatic Font
OAK_PLANKS
The oak planks fontstatic Font
ORANGE
The orange fontstatic Font
PINK
The pink fontstatic Font
PLUSH
The plush fontstatic Font
PUMPKIN
The pumpkin fontstatic Font
PURPLE
The purple fontstatic Font
QUARTZ
The quartz fontstatic Font
RAINBOW
The rainbow fontstatic Font
RED
The red fontstatic Font
SPRUCE_PLANKS
The spruce planks fontstatic Font
STONE
The stone fontstatic Font
WATERMELON
The watermelon fontstatic Font
WHITE
The white fontstatic Font
YELLOW
The yellow font -
Constructor Summary
Constructors Constructor Description Font()
-
Method Summary
Modifier and Type Method Description static @Nullable Font
fromName(@NotNull java.lang.String name)
Gets a font by its name.abstract @NotNull org.bukkit.inventory.ItemStack
getDefaultItem()
Gets a default item for characters that do not have a dedicated itemstatic void
registerFont(@NotNull java.lang.String name, @NotNull Font font)
Registers a custom font so it can be used in lookups and XML files.abstract @Nullable org.bukkit.inventory.ItemStack
toItem(char character)
Turns the specified character into anItemStack
representing the specified character.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
BIRCH_PLANKS
The birch planks font -
BLACK
The black font -
BLUE
The blue font -
BROWN
The brown font -
COBBLESTONE
The cobblestone font -
CYAN
The cyan font -
DIAMOND
The diamond font -
DIRT
The dirt font -
GOLD
The gold font -
GRAY
The gray font -
GREEN
The green font -
JUNGLE_PLANKS
The jungle planks font -
LETTER_CUBE
The letter cube font -
LIGHT_BLUE
The light blue font -
LIGHT_GRAY
The light gray font -
LIME
The lime font -
MAGENTA
The magenta font -
MONITOR
The monitor font -
OAK_LOG
The oak log font -
OAK_PLANKS
The oak planks font -
ORANGE
The orange font -
PINK
The pink font -
PLUSH
The plush font -
PUMPKIN
The pumpkin font -
PURPLE
The purple font -
QUARTZ
The quartz font -
RAINBOW
The rainbow font -
RED
The red font -
SPRUCE_PLANKS
The spruce planks font -
STONE
The stone font -
WATERMELON
The watermelon font -
WHITE
The white font -
YELLOW
The yellow font
-
-
Constructor Details
-
Font
public Font()
-
-
Method Details
-
getDefaultItem
@NotNull @Contract(pure=true) public abstract @NotNull org.bukkit.inventory.ItemStack getDefaultItem()Gets a default item for characters that do not have a dedicated item- Returns:
- the default item
- Since:
- 0.5.0
-
toItem
@Nullable @Contract(pure=true) public abstract @Nullable org.bukkit.inventory.ItemStack toItem(char character)Turns the specified character into anItemStack
representing the specified character. If there is no item for the specified character this will return null.- Parameters:
character
- the character to get an item from- Returns:
- the item
- Since:
- 0.5.0
-
fromName
@Nullable @Contract(pure=true) public static @Nullable Font fromName(@NotNull @NotNull java.lang.String name)Gets a font by its name. The name will be made uppercase and spaces will be replaced with underscore before trying to access it.- Parameters:
name
- the name of the font- Returns:
- the font
- Since:
- 0.5.0
-
registerFont
@Contract(pure=true) public static void registerFont(@NotNull @NotNull java.lang.String name, @NotNull @NotNull Font font)Registers a custom font so it can be used in lookups and XML files. The name will be made upper case and spaces will be turned into underscores to ensure a standardized format for all font names.- Parameters:
name
- the font namefont
- the font- Since:
- 0.5.0
-