36 lines
1.0 KiB
Java
36 lines
1.0 KiB
Java
package com.massivecraft.factions.chat.tag;
|
|
|
|
import com.massivecraft.factions.chat.ChatTag;
|
|
import com.massivecraft.factions.entity.Faction;
|
|
import com.massivecraft.factions.entity.MPlayer;
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
public class ChatTagRoleprefix extends ChatTag
|
|
{
|
|
// -------------------------------------------- //
|
|
// INSTANCE & CONSTRUCT
|
|
// -------------------------------------------- //
|
|
|
|
private ChatTagRoleprefix() { super("factions_roleprefix"); }
|
|
private static ChatTagRoleprefix i = new ChatTagRoleprefix();
|
|
public static ChatTagRoleprefix get() { return i; }
|
|
|
|
// -------------------------------------------- //
|
|
// OVERRIDE
|
|
// -------------------------------------------- //
|
|
|
|
@Override
|
|
public String getReplacement(CommandSender sender, CommandSender recipient)
|
|
{
|
|
// Get entities
|
|
MPlayer usender = MPlayer.get(sender);
|
|
|
|
// No "force"
|
|
Faction faction = usender.getFaction();
|
|
if (faction.isNone()) return "";
|
|
|
|
return usender.getRole().getPrefix();
|
|
}
|
|
|
|
}
|