Update docs, bump version, add methods to get exception types

This commit is contained in:
William278 committed 2023-05-07 16:16:55 +01:00
1 parent 9ad75f1814
commit 4c21a930ef
7 files changed
+162 -40

No files matched your search

+16 -1
View File
@@ -21,4 +21,19 @@ HuskHomes provides a number of API events your plugin can listen to when certain
| `TeleportBackEvent` | 4.1 | ✅ | Called when a player teleports to their last position (`/back`)‡ |
† If the player uses `/delhome all` or `/delwarp all` to delete all their homes or all the warps, a single `DeleteAllHomesEvent` or `DeleteAllWarpsEvent` is fired instead.
‡ Called on the server the player *is teleported from*; not necessarily where the executor of the teleport is.
‡ Called on the server the player *is teleported from*; not necessarily where the executor of the teleport is.
## Events on Sponge & Fabric
Sponge, which has a similar Event api as Bukkit, has equivalent events for all of the above, prefixed with `Sponge` (so HomeCreateEvent on Bukkit is SpongeHomeCreateEvent on Sponge).
Fabric uses callbacks for handling events. HuskHomes provides callback equivalents for all the above events. For instance, to handle what to do when someone creates a home, you can register a callback to handle what to do as follows:
<details>
<summary>HuskHomes and Fabric callbacks</summary>
```java
HomeCreateCallback.EVENT.register((player, home) -> {
// Do something with the player and home
return ActionResult.SUCCESS; // Return an appropriate ActionResult
});.
```
</details>