Testing the new money interface
This commit is contained in:
31
src/com/massivecraft/factions/ExtractorFactionAccountId.java
Normal file
31
src/com/massivecraft/factions/ExtractorFactionAccountId.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.massivecraft.factions;
|
||||
|
||||
import com.massivecraft.mcore.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();
|
||||
if (factionId == null) return null;
|
||||
return "faction-"+factionId;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user