Class Prefix

java.lang.Object
de.kiridevs.kiricore.Prefix

public class Prefix
extends java.lang.Object
The Prefix class can be used to easily generate standardized chat prefixes, complete with colors. Each instance has a chat prefix for the console and one for the player, the difference being that the player chat prefix uses §f (bold text) while the console chat prefix does not.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.lang.String console
    The generated chat prefix WITHOUT §f (bold text) to be used for messages shown in console (e.g.
    java.lang.String player
    The generated chat prefix WITH §f (bold text) to be used for messages sent to players (and only players!)
  • Constructor Summary

    Constructors 
    Constructor Description
    Prefix​(java.lang.String service, java.lang.String serviceColor, java.lang.String textColor)
    Constructor of the Prefix class.
  • Method Summary

    Methods inherited from class java.lang.Object

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

    • console

      public final java.lang.String console
      The generated chat prefix WITHOUT §f (bold text) to be used for messages shown in console (e.g. server broadcasts, answers to commands executed by everything except players)
    • player

      public final java.lang.String player
      The generated chat prefix WITH §f (bold text) to be used for messages sent to players (and only players!)
  • Constructor Details

    • Prefix

      public Prefix​(java.lang.String service, java.lang.String serviceColor, java.lang.String textColor)
      Constructor of the Prefix class. Generates both console and player prefixes.
      Parameters:
      service - The name of the service (i.e. PlugIn) the prefix is being generated for - the part between the brackets
      serviceColor - The Minecraft color code to render the service (i.e. PlugIn) name in. If multiple are used, they have to be separated with '§' signs.
      textColor - The Minecraft color code to render the actual chat message in. If multiple are used, they have to be separated with '§' signs.