Package com.massivecraft.factions.chat.tag

Source Code of com.massivecraft.factions.chat.tag.ChatTagTitle

package com.massivecraft.factions.chat.tag;

import org.bukkit.command.CommandSender;

import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer;

public class ChatTagTitle extends ChatTagAbstract
{
  // -------------------------------------------- //
  // INSTANCE & CONSTRUCT
  // -------------------------------------------- //
 
  private ChatTagTitle() { super("factions_title"); }
  private static ChatTagTitle i = new ChatTagTitle();
  public static ChatTagTitle get() { return i; }
 
  // -------------------------------------------- //
  // OVERRIDE
  // -------------------------------------------- //

  @Override
  public String getReplacement(CommandSender sender, CommandSender recipient)
  {
    // Check disabled
    if (UConf.isDisabled(sender)) return "";
   
    // Get entities
    UPlayer usender = UPlayer.get(sender);
   
    if (!usender.hasTitle()) return "";
    return usender.getTitle();
  }

}
TOP

Related Classes of com.massivecraft.factions.chat.tag.ChatTagTitle

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.