Class MapFont

java.lang.Object
org.bukkit.map.MapFont
Direct Known Subclasses:
MinecraftFont

public class MapFont extends Object
Represents a bitmap font drawable to a map.
  • Field Details Link icon

    • malleable Link icon

      protected boolean malleable
  • Constructor Details Link icon

    • MapFont Link icon

      public MapFont()
  • Method Details Link icon

    • setChar Link icon

      public void setChar(char ch, @NotNull MapFont.CharacterSprite sprite)
      Set the sprite for a given character.
      Parameters:
      ch - The character to set the sprite for.
      sprite - The CharacterSprite to set.
      Throws:
      IllegalStateException - if this font is static.
    • getChar Link icon

      @Nullable public MapFont.CharacterSprite getChar(char ch)
      Get the sprite for a given character.
      Parameters:
      ch - The character to get the sprite for.
      Returns:
      The CharacterSprite associated with the character, or null if there is none.
    • getWidth Link icon

      public int getWidth(@NotNull String text)
      Get the width of the given text as it would be rendered using this font.
      Parameters:
      text - The text.
      Returns:
      The width in pixels.
    • getHeight Link icon

      public int getHeight()
      Get the height of this font.
      Returns:
      The height of the font.
    • isValid Link icon

      public boolean isValid(@NotNull String text)
      Check whether the given text is valid.
      Parameters:
      text - The text.
      Returns:
      True if the string contains only defined characters, false otherwise.