Factions3/src/com/massivecraft/factions/entity/MFlagColl.java

64 lines
1.3 KiB
Java
Raw Normal View History

package com.massivecraft.factions.entity;
2017-03-24 13:05:58 +01:00
import com.massivecraft.massivecore.store.Coll;
import java.util.ArrayList;
import java.util.List;
public class MFlagColl extends Coll<MFlag>
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static MFlagColl i = new MFlagColl();
public static MFlagColl get() { return i; }
private MFlagColl()
{
this.setLowercasing(true);
}
2015-02-02 00:25:29 +01:00
// -------------------------------------------- //
// STACK TRACEABILITY
// -------------------------------------------- //
@Override
public void onTick()
{
super.onTick();
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
2016-02-25 22:28:09 +01:00
public void setActive(boolean active)
{
2016-02-25 22:28:09 +01:00
super.setActive(active);
2017-03-12 17:55:01 +01:00
if (!active) return;
MFlag.setupStandardFlags();
}
// -------------------------------------------- //
// EXTRAS
// -------------------------------------------- //
public List<MFlag> getAll(boolean registered)
{
2017-03-12 17:55:01 +01:00
// Create
List<MFlag> ret = new ArrayList<MFlag>();
2017-03-12 17:55:01 +01:00
// Fill
for (MFlag mflag : this.getAll())
{
if (mflag.isRegistered() != registered) continue;
ret.add(mflag);
}
2017-03-12 17:55:01 +01:00
// Return
return ret;
}
}