-
Notifications
You must be signed in to change notification settings - Fork 90
Create an integration
Thijs Wiefferink edited this page Aug 11, 2018
·
1 revision
To hook into AreaShop from your own plugin you can add it as a Maven dependency (recommended) or manual dependency.
-
Add my Maven repository:
<repositories> <repository> <id>nlthijs48</id> <url>http://maven.wiefferink.me</url> </repository> </repositories>
-
Add the Maven dependency:
<dependencies> <dependency> <groupId>me.wiefferink</groupId> <artifactId>areashop</artifactId> <version>2.4.0-SNAPSHOT</version> </dependency> </dependencies>
- Get a reference to Areashop:
- Use
AreaShop areaShop = AreaShop.getInstance();
- Or use
AreaShop areaShop = (AreaShop)Bukkit.getServer().getPluginManager().getPlugin("AreaShop");
- Using AreaShop as optional dependency? Use the second option, check if
getPlugin()
returns non-null, after that instantiate your classes that use AreaShop.
- Use
- Use
areaShop.getFileManager().getRegions()
(orgetBuys()
orgetRents()
orgetRegion(String name)
) - Call methods on the region to edit anything you need (see the javadocs)
- Choose an event to listen for, see available types here.
- In the
ask
folder are cancel-able events for renting/buying/etc. - In the
notify
folder are the same events, buy only for notifying a certain action happened.
- In the
- Create a standard Bukkit event handler:
@EventHandler public void sellingRegion(SellingRegionEvent event) { // Handle the event }
If you have any questions about how to use or modify AreaShop then feel free to message me. You can create a ticket or message me through Spigot or BukkitDev.