Examples of FPerm


Examples of com.massivecraft.factions.FPerm

        Iterator<Entry<FPerm, Set<Rel>>> iter = target.entrySet().iterator();
        while (iter.hasNext())
        {
          Entry<FPerm, Set<Rel>> entry = iter.next();
         
          FPerm key = entry.getKey();         
          if (key == null)
          {
            // TODO: I have no idea why this key is null at times... Why?
            System.out.println("key was null :/");
            iter.remove();
            continue;
          }
         
          Set<Rel> keyDefault = key.getDefault(this);
          Set<Rel> value = entry.getValue();
         
          if (keyDefault.equals(value))
          {
            iter.remove();
View Full Code Here

Examples of com.massivecraft.factions.FPerm

        msg(perm.getStateInfo(faction.getPermittedRelations(perm), true));
      }
      return;
    }
   
    FPerm perm = this.arg(1, ARFPerm.get());
    if (perm == null) return;
    //System.out.println("perm = "+perm);
   
    if ( ! this.argIsSet(2))
    {
      msg(Txt.titleize("Perm for " + faction.describeTo(usender, true)));
      msg(FPerm.getStateHeaders());
      msg(perm.getStateInfo(faction.getPermittedRelations(perm), true));
      return;
    }
   
    // Do the sender have the right to change perms for this faction?
    if ( ! FPerm.PERMS.has(usender, faction, true)) return;
   
    Rel rel = this.arg(2, ARRel.get());
    if (rel == null) return;
   
    if (!this.argIsSet(3))
    {
      msg("<b>Should <h>%s <b>have the <h>%s <b>permission or not?\nYou must <h>add \"yes\" or \"no\" <b>at the end.", Txt.getNicedEnum(rel), Txt.getNicedEnum(perm));
      return;
    }
   
    Boolean val = this.arg(3, ARBoolean.get(), null);
    if (val == null) return;
   
    // Do the change
    //System.out.println("setRelationPermitted perm "+perm+", rel "+rel+", val "+val);
    faction.setRelationPermitted(perm, rel, val);
   
    // The following is to make sure the leader always has the right to change perms if that is our goal.
    if (perm == FPerm.PERMS && FPerm.PERMS.getDefault(faction).contains(Rel.LEADER))
    {
      faction.setRelationPermitted(FPerm.PERMS, Rel.LEADER, true);
    }
   
    msg(Txt.titleize("Perm for " + faction.describeTo(usender, true)));
    msg(FPerm.getStateHeaders());
    msg(perm.getStateInfo(faction.getPermittedRelations(perm), true));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.