use of com.massivecraft.factions.entity.Faction in project UltimateChat by FabioZumbi12.
the class UCFactionsHook method formatFac.
@Override
public String formatFac(String text, Player sender, Object receiver) {
MPlayer mp = MPlayer.get(sender.getUniqueId());
if (!mp.getFaction().isNone()) {
Faction fac = mp.getFaction();
text = text.replace("{fac-id}", fac.getId()).replace("{fac-name}", fac.getName());
if (fac.hasMotd()) {
text = text.replace("{fac-motd}", fac.getMotd());
}
if (fac.hasDescription()) {
text = text.replace("{fac-description}", fac.getDescription());
}
if (receiver instanceof Player) {
MPlayer recmp = MPlayer.get(((Player) receiver).getUniqueId());
text = text.replace("{fac-relation-name}", fac.getName(recmp)).replace("{fac-relation-color}", fac.getColorTo(recmp).toString());
}
}
return text;
}
use of com.massivecraft.factions.entity.Faction in project UltimateChat by FabioZumbi12.
the class UCFactionsHook method formatFac.
public static String formatFac(String text, Player sender, Object receiver) {
MPlayer mp = MPlayer.get(sender.getUniqueId());
if (!mp.getFaction().isNone()) {
Faction fac = mp.getFaction();
text = text.replace("{fac-id}", fac.getId()).replace("{fac-name}", fac.getName());
if (fac.hasMotd()) {
text = text.replace("{fac-motd}", fac.getMotd());
}
if (fac.hasDescription()) {
text = text.replace("{fac-description}", fac.getDescription());
}
if (receiver instanceof Player) {
MPlayer recmp = MPlayer.get(((Player) receiver).getUniqueId());
text = text.replace("{fac-relation-name}", fac.getName(recmp)).replace("{fac-relation-color}", fac.getColorTo(recmp).toString());
}
}
return text;
}
use of com.massivecraft.factions.entity.Faction in project Depenizen by DenizenScript.
the class FactionsBridge method factionTagEvent.
public void factionTagEvent(ReplaceableTagEvent event) {
Attribute attribute = event.getAttributes().fulfill(1);
// <--[tag]
// @attribute <faction[<name>]>
// @returns FactionTag
// @plugin Depenizen, Factions
// @description
// Returns the faction for the input name.
// -->
String nameOrId = attribute.getParam();
Faction f = FactionColl.get().getByName(nameOrId);
if (f == null && FactionColl.get().containsId(nameOrId)) {
f = FactionColl.get().get(nameOrId);
}
if (f != null) {
event.setReplacedObject(new FactionTag(f).getObjectAttribute(attribute.fulfill(1)));
}
}
Aggregations