Skip to content
Multitallented edited this page Dec 8, 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());
  • List regionTypeName = regionType.getRebuild(); // region type names of the child regions
  • boolean mustRebuild = regionType.getRebuildRequired(); // boolean of whether or not the region needs to be upgraded or can be built as a standalone

Events

  • PlayerEnterRegionEvent
  • PlayerExitRegionEvent
  • PlayerEnterTownEvent
  • PlayerExitTownEvent
  • PlayerInRegionEvent (triggered about every 2 seconds when a player is in a region)
  • PlayerInTownEvent (triggered about every 2 seconds when a player is in a town)
  • RegionCreatedEvent
  • RegionDestroyedEvent
  • TownCreatedEvent
  • RenameTownEvent
  • TownEvolveEvent (When a town gets upgraded)
  • TownDevolveEvent (When a town gets downgraded)
  • TownDestroyedEvent
  • RegionTickEvent (triggered about every 2 seconds for each region)
  • RegionUpkeepEvent (when a region has a successful upkeep of any type)