aboutsummaryrefslogtreecommitdiffstats
path: root/docs/API.md
diff options
context:
space:
mode:
authorLMBishop <13875753+LMBishop@users.noreply.github.com>2023-07-05 15:28:17 +0100
committerLMBishop <13875753+LMBishop@users.noreply.github.com>2023-07-05 15:28:17 +0100
commite85f8eea9dfe76dacc86728b20c4a0036ec71c1d (patch)
tree3d67553c597e7851b657cfa2638887699b2b4ace /docs/API.md
parent4c9a7d83a19828e64ea7f90ddf69f9212bb7a7d9 (diff)
Add /docs directory
This is part of a migration from GitHub wikis to GitHub pages
Diffstat (limited to 'docs/API.md')
-rw-r--r--docs/API.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/API.md b/docs/API.md
new file mode 100644
index 00000000..03ea4d8a
--- /dev/null
+++ b/docs/API.md
@@ -0,0 +1,32 @@
+***
+
+### 🔨 ***This page is under construction***
+*The information contained here may be inaccurate or incomplete. You can help by [contributing information to the wiki](https://github.com/LMBishop/Quests/wiki/Contributing-to-the-wiki).*
+
+***
+
+Quests provides an API for other people to use. **This API is experimental and may be subject to change.** For usages, it is best to take a look into the plugin itself.
+
+## Bukkit
+You can get an instance of Quests as you would with any other plugin:
+```java
+BukkitQuestsPlugin questsPlugin = (BukkitQuestsPlugin) Bukkit.getPluginManager().getPlugin("Quests");
+```
+From there, you can access the `QPlayerManager`, `QuestManager` etc. See the javadoc in [this file](https://github.com/LMBishop/Quests/blob/master/common/src/main/java/com/leonardobishop/quests/common/plugin/Quests.java), and in each class for more info on its purpose.
+
+### Events
+Quests provides some Bukkit events, you can see them all [here](https://github.com/LMBishop/Quests/tree/master/bukkit/src/main/java/com/leonardobishop/quests/bukkit/api/event).
+
+### Registering task types
+Task types **must** be registered during startup, after Quests has initialized its task type manager. You cannot register task types after this period as individual quests are registered to their task types for performance reasons.
+
+```java
+@Override
+public void onEnable() {
+ // ...
+ Quests questsPlugin = (Quests) Bukkit.getPluginManager().getPlugin("Quests");
+ BukkitTaskTypeManager taskTypeManager = (BukkitTaskTypeManager) questsPlugin.getTaskTypeManager();
+
+ taskTypeManager.registerTaskType(new ...);
+}
+``` \ No newline at end of file