use of com.denizenscript.depenizen.bukkit.objects.factions.FactionTag in project Depenizen by DenizenScript.
the class FactionsBridge method tagEvent.
public void tagEvent(ReplaceableTagEvent event) {
Attribute attribute = event.getAttributes().fulfill(1);
// -->
if (attribute.startsWith("list_factions")) {
ListTag factions = new ListTag();
for (Faction f : FactionColl.get().getAll()) {
factions.addObject(new FactionTag(f));
}
event.setReplacedObject(factions.getObjectAttribute(attribute.fulfill(1)));
}
}
use of com.denizenscript.depenizen.bukkit.objects.factions.FactionTag 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