2022-08-05 00:34:54 +02:00
|
|
|
package com.massivecraft.factions;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.entity.Faction;
|
|
|
|
import com.massivecraft.massivecore.util.extractor.Extractor;
|
|
|
|
|
|
|
|
public class ExtractorFactionAccountId implements Extractor {
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// INSTANCE & CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
private static ExtractorFactionAccountId i = new ExtractorFactionAccountId();
|
|
|
|
|
|
|
|
public static ExtractorFactionAccountId get() {
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE: EXTRACTOR
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Object extract(Object o) {
|
|
|
|
if (o instanceof Faction) {
|
|
|
|
String factionId = ((Faction) o).getId();
|
2023-04-01 14:52:14 +02:00
|
|
|
if (factionId == null) {
|
|
|
|
return null;
|
|
|
|
}
|
2022-08-05 00:34:54 +02:00
|
|
|
return Factions.FACTION_MONEY_ACCOUNT_ID_PREFIX + factionId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|