Factions/src/com/massivecraft/factions/entity/MPermColl.java

59 lines
1.3 KiB
Java
Raw Normal View History

package com.massivecraft.factions.entity;
import java.util.ArrayList;
import java.util.List;
import com.massivecraft.massivecore.store.Coll;
public class MPermColl extends Coll<MPerm>
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static MPermColl i = new MPermColl();
public static MPermColl get() { return i; }
private MPermColl()
{
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);
if ( ! active) return;
MPerm.setupStandardPerms();
}
// -------------------------------------------- //
// EXTRAS
// -------------------------------------------- //
public List<MPerm> getAll(boolean registered)
{
List<MPerm> ret = new ArrayList<MPerm>();
for (MPerm mperm : this.getAll())
{
if (mperm.isRegistered() != registered) continue;
ret.add(mperm);
}
return ret;
}
}