Package com.massivecraft.factions.entity

Examples of com.massivecraft.factions.entity.Faction


  public void perform()
  {
    Double amount = this.arg(0, ARDouble.get());
    if (amount == null) return;
   
    Faction from = this.arg(1, ARFaction.get(sender));
    if (from == null) return;
   
    Faction to = this.arg(2, ARFaction.get(sender));
    if (to == null) return;
   
    boolean success = Econ.transferMoney(usender, from, to, amount);

    if (success && MConf.get().logMoneyTransactions)
    {
      Factions.get().log(ChatColor.stripColor(Txt.parse("%s transferred %s from the faction \"%s\" to the faction \"%s\"", usender.getName(), Money.format(from, amount), from.describeTo(null), to.describeTo(null))));
    }
  }
View Full Code Here


    UPlayer uplayer = UPlayerColls.get().get(event.getTo()).get(player);
   
    PS chunkFrom = PS.valueOf(event.getFrom()).getChunk(true);
    PS chunkTo = PS.valueOf(event.getTo()).getChunk(true);
   
    Faction factionFrom = BoardColls.get().getFactionAt(chunkFrom);
    Faction factionTo = BoardColls.get().getFactionAt(chunkTo);
   
    // ... and send info onwards.
    this.chunkChangeTerritoryInfo(uplayer, player, chunkFrom, chunkTo, factionFrom, factionTo);
    this.chunkChangeAutoClaim(uplayer, chunkTo);
  }
View Full Code Here

  // -------------------------------------------- //
 
  public void chunkChangeAutoClaim(UPlayer uplayer, PS chunkTo)
  {
    // If the player is auto claiming ...
    Faction autoClaimFaction = uplayer.getAutoClaimFaction();
    if (autoClaimFaction == null) return;
   
    // ... try claim.
    uplayer.tryClaim(autoClaimFaction, chunkTo, true, true);
  }
View Full Code Here

   
    @Override
    public void deserialize(final Fields fields) throws StreamCorruptedException {
      final String universe = fields.getObject("universe", String.class);
      final String id = fields.getObject("id", String.class);
      final Faction f = FactionColls.get().getForUniverse(universe).get(id); // getForUniverse creates a new "Coll" if none exists
      if (f == null)
        throw new StreamCorruptedException("Invalid faction " + id + " in universe " + universe);
      faction = f;
    }
View Full Code Here

  }
 
  @Override
  @Nullable
  public Region getRegion_i(final World world, final String name) {
    final Faction f = FactionColls.get().getForUniverse(world.getName()).getByName(name);
    if (f != null)
      return new FactionsRegion(f);
    return null;
  }
View Full Code Here

TOP

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

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.