Package com.massivecraft.factions.entity

Examples of com.massivecraft.factions.entity.FactionColl


  }
 
  public LinkedHashSet<Faction> getGrantedFactions(Object universe)
  {
    LinkedHashSet<Faction> ret = new LinkedHashSet<Faction>();
    FactionColl coll = FactionColls.get().get(universe);
    for (String factionId : this.getFactionIds())
    {
      ret.add(coll.get(factionId));
    }
    return ret;
  }
View Full Code Here


    // Arg
    String newName = this.arg(0);
   
    // TODO does not first test cover selfcase?
   
    FactionColl factionColl = FactionColls.get().get(usenderFaction);
    if (factionColl.isNameTaken(newName) && ! MiscUtil.getComparisonString(newName).equals(usenderFaction.getComparisonName()))
    {
      msg("<b>That name is already taken");
      return;
    }

    ArrayList<String> errors = new ArrayList<String>();
    errors.addAll(factionColl.validateName(newName));
    if (errors.size() > 0)
    {
      sendMessage(errors);
      return;
    }
View Full Code Here

 
    // Args
    String newName = this.arg(0);
   
    // Verify
    FactionColl coll = FactionColls.get().get(usender);
   
    if (coll.isNameTaken(newName))
    {
      msg("<b>That name is already in use.");
      return;
    }
   
    ArrayList<String> nameValidationErrors = coll.validateName(newName);
    if (nameValidationErrors.size() > 0)
    {
      sendMessage(nameValidationErrors);
      return;
    }

    // Pre-Generate Id
    String factionId = MStore.createId();
   
    // Event
    FactionsEventCreate createEvent = new FactionsEventCreate(sender, coll.getUniverse(), factionId, newName);
    createEvent.run();
    if (createEvent.isCancelled()) return;
   
    // Apply
    Faction faction = coll.create(factionId);
    faction.setName(newName);
   
    usender.setRole(Rel.LEADER);
    usender.setFaction(faction);
   
View Full Code Here

TOP

Related Classes of com.massivecraft.factions.entity.FactionColl

Copyright © 2018 www.massapicom. 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.