Skip to content
Multitallented edited this page May 15, 2019 · 7 revisions

List of public functions I promise not to change:

Town

  • Town town = TownManager.getInstance().getTown("TownName");
  • town.getName();
  • town.getLocation();
  • town.getPower();
  • town.getMaxPower();
  • HashMap<UUID, String> people = town.getPeople(); // map of player UUIDs mapped to their role in the town. People with the role of "ally" are not members of the town. They are members of allied towns.

TownType

  • TownType townType = (TownType) ItemManager.getInstance().getItemType(town.getType());
  • townType.getBuildRadius(); // returns half of the width/length not counting the center block. ie: 50 = 101x101 size town, 40 = 81x81
  • townType.getBuildRadiusY(); // returns the height not counting the center block

Region

  • Region region = RegionManager.getInstance().getRegionAt(location);
  • Set regions = RegionManager.getInstance().getContainingRegions(location, 50); // get all regions within 100x100x100 square of that location
  • region.getLocation(); // location of the center block of the region
  • region.getRadiusXP(); // positive X length
  • region.getRadiusXN(); // negative X length
  • region.getRadiusYP(); // positive Y height
  • region.getRadiusYN(); // negative Y height
  • region.getRadiusZP(); // positive Z width
  • region.getRadiusZN(); // negative Z width
  • region.hasUpkeepItems(ignoreReagents); // returns whether the region has at least one upkeep. boolean param to ignore reagents and just look at inputs

RegionType

  • RegionType regionType = (RegionType) ItemManager.getInstance().getItemType(region.getType());
  • String regionTypeName = regionType.getRebuild(); // region type name of the child region
  • boolean mustRebuild = regionType.getRebuildRequired(); // boolean of whether or not the region needs to be upgraded or can be built as a standalone