Skip to content
superator2018@gmail.com edited this page Apr 26, 2019 · 12 revisions

Maven dependency

  <repository>
      <id>SRegionProtector-master</id>
      <url>https://raw.github.com/SergeyDertan/SRegionProtector/mvn-repo/</url>
      <snapshots>
          <enabled>true</enabled>
          <updatePolicy>always</updatePolicy>
      </snapshots>
  </repository>
sergeydertan.sregionprotector SRegionProtector LATEST To use API methods you need to get main class instance with SRegionProtectorMain api = SRegionProtectorMain.getInstance() ## Get region by name >api.getRegionManager().getRegion(String name)

return region instance or null

Get region by pos

api.getChunkManager().getRegion(Vector3 pos, String levelName)

return region instance or null

Check overlapping

api.getRegionManager().checkOverlap(Vector3 pos1, Vector3 pos2, String level, String creator, boolean checkSellFlag, Region self) return true if region overlapping

Working with flags

Custom flags not supported see RegionFlags class

Adding custom pages to chest UI

Page.addPage(Page page) your page will appear on the main page You need to override:

  • getIcon() - return icon item for the main page
  • getName() - page name for the item for gettings its instance
  • handle(Item clickedItem, Region currentUIRegion, Player player) - handle clicked button, return true if page refresh required
  • getItems(Region currentUIRegion, int pageNumber) - create items for the page, see default pages for example; you can add navigators (next page, refresh, prevous page) with Page.addNavigators(Collection youItems); also you need mark items as a ui items by calling Page.prepareItems(Collection youItems, int pageNumber) if you want to make you own default pages you can modify Page.PAGES
Clone this wiki locally