Examples of AutoRefRegion


Examples of org.mctourney.autoreferee.regions.AutoRefRegion

  public ScoreRegionGoal(AutoRefTeam team, Element elt)
  {
    this(team);
    for (Element child : elt.getChildren())
    {
      AutoRefRegion reg = AutoRefRegion.fromElement(team.getMatch(), child);
      if (reg != null) this.regions.add(reg);
    }
  }
View Full Code Here

Examples of org.mctourney.autoreferee.regions.AutoRefRegion

      sender.sendMessage("Teams are " + match.getTeamList());
      return true;
    }

    Selection sel = worldEdit.getSelection(player);
    AutoRefRegion reg = null;

    if ((sel instanceof CuboidSelection))
    {
      CuboidSelection csel = (CuboidSelection) sel;
      reg = new CuboidRegion(csel.getMinimumPoint(), csel.getMaximumPoint());
    }

    // if we couldn't get a region from WorldEdit
    if (reg == null) return false;

    // add the selection to the start regions
    if (isStartRegion)
    {
      match.addStartRegion(reg);
      sender.sendMessage("Region now marked as a start region!");
      return true;
    }

    // name this region if it has a name
    if (options.hasOption('N'))
      reg.setName(options.getOptionValue('N', null));

    for (AutoRefRegion.Flag flag : AutoRefRegion.Flag.values())
      if (options.hasOption(flag.getMark())) reg.toggle(flag);
    for (AutoRefTeam team : teams) if (team.addRegion(reg))
      sender.sendMessage(reg.toString() + " set as " + team.getDisplayName() + "'s region.");
    return true;
  }
View Full Code Here

Examples of org.mctourney.autoreferee.regions.AutoRefRegion

      return true;
    }

    AutoRefTeam team = match.getTeam(args[0]);
    Selection sel = worldEdit.getSelection(player);
    AutoRefRegion reg = null;

    if ((sel instanceof CuboidSelection))
    {
      CuboidSelection csel = (CuboidSelection) sel;
      reg = new CuboidRegion(csel.getMinimumPoint(), csel.getMaximumPoint());
    }
    else
    {
      sender.sendMessage("You must have a selection with WorldEdit already to run this method.");
      return true;
    }

    CoreGoal core = new CoreGoal(team, reg);
    if (options.hasOption('r'))
      try { core.setRange(Long.parseLong(options.getOptionValue('r'))); }
      catch (NumberFormatException e)
      { sender.sendMessage(ChatColor.RED + options.getOptionValue('r') + " is not a valid range."); }

    team.addGoal(core);
    sender.sendMessage(reg.toString() + " set as " + team.getDisplayName() + "'s TARGET core.");
    sender.sendMessage(team.getDisplayName() + " will be attacking this core, not defending it.");
    return 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.