API Introduction
ScalaPlot exposes a public API (the scalaplot-api module) that lets other plugins read and modify plot state: fetching plot info, managing trust/bans, claiming/resetting/deleting, ratings, report status, and dedicated Bukkit events.
Adding the dependency
Section titled “Adding the dependency”Add Plot as a soft or hard dependency in your plugin.yml:
depend: [Plot]# or, if optional:softdepend: [Plot]And add the ScalaPlot-API module (found in scalaplot-api/target/ScalaPlot-API-X.X.X.jar) as a compile-time dependency in your Maven/Gradle project.
Getting the API instance
Section titled “Getting the API instance”- Retrieve the
Plotplugin from Bukkit. - Cast it to the
PublicAPIinterface. - Call the available methods.
import com.scala.plotAPI.PublicAPI;import org.bukkit.Bukkit;
PublicAPI api = (PublicAPI) Bukkit.getPluginManager().getPlugin("Plot");
if (api != null) { boolean premium = api.isPremium(); // ...}What the API exposes
Section titled “What the API exposes”- Plot retrieval: by location, owner, or ID.
- Trust and ban management:
trustPlayer,untrustPlayer,banPlayer,unbanPlayer. - Plot operations:
claimPlot,resetPlot,deletePlot. - Ratings and reports:
getAverageRating,getStatus/setStatus. - Bukkit events: claim, ban, trust, enter/leave, ownership change, backup, reports.
- Internal managers: access to
PlotManager,WorldEditManager,MapManagerfor advanced usage.
Continue with PublicAPI: methods for the full reference.