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