docs: Add docs and corresponding workflow

This commit is contained in:
William committed 2023-04-21 19:00:57 +01:00
1 parent 4b8a0f5719
commit daa50c8d04
24 files changed
+810

No files matched your search

+4
View File
@@ -4,6 +4,10 @@ name: CI Tests & Publish
on:
push:
branches: [ 'master' ]
paths-ignore:
- 'docs/**'
- 'workflows/**'
- 'README.md'
permissions:
contents: read
+28
View File
@@ -0,0 +1,28 @@
# Update the GitHub Wiki documentation when a push is made to docs/
name: Update Docs
on:
push:
branches: [ 'master' ]
paths:
- 'docs/**'
- 'workflows/**'
tags-ignore:
- '*'
permissions:
contents: write
jobs:
deploy-wiki:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Code'
uses: actions/checkout@v3
- name: 'Push Changes to Wiki'
uses: Andrew-Chen-Wang/github-wiki-action@v3
env:
WIKI_DIR: 'docs/'
GH_TOKEN: ${{ github.token }}
GH_MAIL: '[email protected]'
GH_NAME: 'github-actions[bot]'
+24
View File
@@ -0,0 +1,24 @@
HuskHomes provides a number of API events your plugin can listen to when certain actions are performed. Most of these events are cancellable, letting you stop them from executing if you wish.
## List of API events
| Bukkit Event class | Since | Cancellable | Description |
|-------------------------------|:-----:|:-----------:|--------------------------------------------------------------------------|
| `HomeCreateEvent` | 4.0 | ✅ | Called when a player sets a home |
| `HomeListEvent` | 3.0 | ✅ | Called when a player requests to view a list of homes / public homes |
| `HomeEditEvent` | 4.0 | ✅ | Called when a player edits a home (privacy, relocate, description, name) |
| `HomeDeleteEvent` | 3.0 | ✅ | Called when a player deletes a home† |
| `DeleteAllHomesEvent` | 3.2.1 | ✅ | Called when a player uses `/delhome all` to delete all their homes |
| `WarpCreateEvent` | 4.0 | ✅ | Called when a player sets a warp |
| `WarpListEvent` | 3.0 | ✅ | Called when a player requests to view a list of warps |
| `WarpEditEvent` | 4.0 | ✅ | Called when a player edits a warp (relocate, description, name) |
| `WarpDeleteEvent` | 3.0 | ✅ | Called when a player deletes a warp† |
| `DeleteAllWarpsEvent` | 3.2.1 | ✅ | Called when a player uses `/delwarp all` to delete all warps |
| `SendTeleportRequestEvent` | 4.1 | ✅ | Called when a player sends a teleport request (`/tpa`) |
| `ReceiveTeleportRequestEvent` | 4.1 | ✅ | Called when a player receives a teleport request from someone |
| `ReplyTeleportRequestEvent` | 4.1 | ✅ | Called when a player accepts or declines a teleport request |
| `TeleportWarmupEvent` | 3.0 | ✅ | Called when a player starts a teleport warmup countdown |
| `TeleportEvent` | 3.0 | ✅ | Called when a player is teleported‡ |
| `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.
+143
View File
@@ -0,0 +1,143 @@
The HuskHomes API provides methods and classes for:
* getting, creating and updating `Home`s and `Warp`s
* getting information about `SavedUser` data
* building and executing `Teleport`s, including cross-server teleports
* provide custom `RandomTeleportEngine`s for extending the `/rtp` command's functionality.
In addition, [[API Events]] are available for handling when certain actions take place.
This page will walk you through some of these. Note that this documentation is *incomplete*; if you'd like to help improve it, get in touch on our Discord.
## Project setup
### Creating a class to interface with the API
- Unless your plugin completely relies on HuskHomes, you shouldn't put HuskHomes API calls into your main class, otherwise if HuskHomes is not installed you'll encounter `ClassNotFoundException`s
<details>
<summary>Creating a hook class</summary>
```java
public class HuskHomesAPIHook {
public HuskHomesAPIHook() {
// Ready to do stuff with the API
}
}
```
</details>
### Checking if HuskHomes is present and creating the hook
- Check to make sure the HuskHomes plugin is present before instantiating the API hook class
<details>
<summary>Instantiating your hook</summary>
```java
public class MyPlugin extends JavaPlugin {
public HuskHomesAPIHook huskHomesHook;
@Override
public void onEnable() {
if (Bukkit.getPluginManager().getPlugin("HuskHomes") != null) {
this.huskHomesHook = new HuskHomesAPIHook();
}
}
}
```
</details>
### Getting an instance of the API
- You can now get the API instance by calling `HuskHomesAPI#getInstance()`
<details>
<summary>Getting an API instance</summary>
```java
import net.william278.huskhomes.api.HuskHomesAPI;
public class HuskHomesAPIHook {
private final HuskHomesAPI huskHomesAPI;
public HuskHomesAPIHook() {
this.huskHomesAPI = HuskHomesAPI.getInstance();
}
}
```
</details>
### The CompletableFuture
A number of methods from the HuskHomesAPI return asynchronously-executing [CompletableFutures](https://www.baeldung.com/java-completablefuture) to ensure the database queries they rely on do not block the main server thread. When a future has finished executing, you can accept the result through a `#thenAccept()`.
You should never call `#join()` on futures returned from the HuskHomesAPI as futures are processed on server asynchronous tasks, which could lead to thread deadlock and crash your server if you attempt to lock the main thread to process them.
## Getting a player's homes
To get a list of a player's homes, you can call
<details>
<summary>Printing a home list to console</summary>
```java
public class HuskSyncAPIHook {
private final HuskHomesAPI huskHomesAPI;
// This method prints out a player's homes into console using stdout
public void printPlayerHomes(UUID uuid) {
// Use this to adapt an online player to an OnlineUser, which extends User (accepted by getUserHomes).
// To get the homes of an offline user, use: User.of(uuid, username);
OnlineUser user = huskHomesAPI.adaptUser(Bukkit.getPlayer(uuid));
// A lot of HuskHomes' API methods return as futures which execute asynchronously.
huskHomesAPI.getUserHomes(user).thenAccept(homeList -> { // Use #thenAccept(data) to run after the future has executed with data
for (Home home : homeList) {
// The home and warp object both extend SavedPosition, which maps a position object to a name and description
System.out.println(home.meta.name); // It's best to use your plugin logger, but this is just an example.
}
});
}
}
```
</details>
## Creating Teleports
The API provides a method for getting a `TeleportBuilder`, which can be used to build a `Teleport` (with toTeleport) or `TimedTeleport` (with toTimedTeleport; a teleport that requires the user to stand still for a period of time first). Teleports can be cross-server.
<details>
<summary>Building a teleport</summary>
```java
public class HuskSyncAPIHook {
private final HuskHomesAPI huskHomesAPI;
// This teleports a player to 128, 64, 128 on the server "server"
public void teleportPlayer(Player player) {
// Use this to adapt an online player to an OnlineUser, which extends User (accepted by getUserHomes).
OnlineUser onlineUser = huskHomesAPI.adaptUser(player);
// The TeleportBuilder accepts a class that (extends/is a) Position. This can be a Home, Warp or constructed Position.
// --> Note that the World object needs the name and UID of the world.
// --> The UID will be used if the world can't be found by name. You can just pass it a random UUID if you don't have it.
Position position = Position.at(
128, 64, 128,
World.from("world", UUID.randomUUID()), "server"
);
// To construct a teleport, get a TeleportBuilder with #teleportBuilder
try {
huskHomesAPI.teleportBuilder()
.teleporter(onlineUser) // The person being teleported
.target(position) // The target position
.toTimedTeleport()
.execute(); // #execute() can throw a TeleportationException
} catch(TeleportationException e) {
e.printStackTrace();
}
}
}
```
</details>
+75
View File
@@ -0,0 +1,75 @@
![HuskHomes CI](https://jitpack.io/v/WiIIiam278/HuskHomes2.svg)
The HuskHomes API provides methods for getting, editing and updating user homes and warps, as well as functionality for building and executing (cross-server) teleports.
The API is distributed via [JitPack](https://jitpack.io/#net.william278/HuskHomes2). Please note that HuskHomes API v1, v2 and v3 are not compatible.
(Some) javadocs are also available to view on Jitpack [here](https://javadoc.jitpack.io/net/william278/HuskHomes2/latest/javadoc/).
## Table of contents
1. Adding the API to your project
2. Adding HuskHomes as a dependency
3. Next steps
## API Introduction
### 1.1 Setup with Maven
<details>
<summary>Maven setup information</summary>
Add the repository to your `pom.xml` as per below.
```xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
```
Add the dependency to your `pom.xml` as per below. Replace `version` with the latest version of HuskHomes (without the v): ![Latest version](https://img.shields.io/github/v/tag/WiIIiam278/HuskHomes2?color=%23282828&label=%20&style=flat-square)
```xml
<dependency>
<groupId>net.william278</groupId>
<artifactId>HuskHomes2</artifactId>
<version>version</version>
<scope>provided</scope>
</dependency>
```
</details>
### 1.2 Setup with Gradle
<details>
<summary>Gradle setup information</summary>
Add the dependency like so to your `build.gradle`:
```groovy
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```
Add the dependency as per below. Replace `version` with the latest version of HuskHomes (without the v): ![Latest version](https://img.shields.io/github/v/tag/WiIIiam278/HuskHomes2?color=%23282828&label=%20&style=flat-square)
```groovy
dependencies {
compileOnly 'net.william278:HuskHomes2:version'
}
```
</details>
### 2. Adding HuskHomes as a dependency
Add HuskHomes to your `softdepend` (if you want to optionally use HuskHomes) or `depend` (if your plugin relies on HuskHomes) section in `plugin.yml` of your project.
```yaml
name: MyPlugin
version: 1.0
main: net.william278.myplugin.MyPlugin
author: William278
description: 'A plugin that hooks with the HuskHomes API!'
softdepend: # Or, use 'depend' here
- HuskHomes
```
### 3. Next steps
Now that you've got everything ready, you can start doing stuff with the HuskHomes API!
- [[API Examples]]
- [[API Events]]
+108
View File
@@ -0,0 +1,108 @@
HuskHomes provides a range of commands for you to use. This page will detail the permissions for each command to [let you manage access](managing-access) to the plugin's different features.
## Commands & Permissions Table
This is a table of HuskHomes' commands and their required permission nodes. Additional permissions provided by the plugin to control other variables are detailed further below!
| Command | Aliases | Description | Base Permission&dagger; |
|-----------------------------------------------------------------|------------------------------|-----------------------------------------------------|-------------------------------|
| `/home <name>` | | Teleport to a home | `huskhomes.command.home` |
| `/sethome <name>` | | Set a new home with given name | `huskhomes.command.sethome` |
| `/homelist [page]` | `/homes` | Get a list of your homes | `huskhomes.command.homelist` |
| `/delhome <name>` | | Delete a home you previously set | `huskhomes.command.delhome` |
| `/edithome <name> [rename/description/relocate/privacy] [args]` | | Edit one of your homes | `huskhomes.command.edithome` |
| `/phome [<owner_name.home_name>]` | `/publichome` | Teleport to a public home | `huskhomes.command.phome` |
| `/phomelist [page]` | `/publichomelist`, `/phomes` | View the list of public homes | `huskhomes.command.phomelist` |
| `/warp <name>` | | Teleport to a warp | `huskhomes.command.warp` |
| `/setwarp <name>` | | Set a new warp with given name | `huskhomes.command.setwarp` |
| `/warplist [page]` | `/warps` | View the list of warps | `huskhomes.command.warplist` |
| `/delwarp <name>` | | Delete a warp | `huskhomes.command.delwarp` |
| `/editwarp <name> [rename/description/relocate] [args]` | | Edit a warp | `huskhomes.command.editwarp` |
| `/tp <target> [destination]` | `/tpo` | Teleport to another player or location | `huskhomes.command.tp` |
| `/tphere <player>` | `/tpohere` | Teleport another player to you | `huskhomes.command.tphere` |
| `/tpa <player>` | | Request to teleport to another player | `huskhomes.command.tpa` |
| `/tpahere <player>` | | Request another player to teleport to you | `huskhomes.command.tpahere` |
| `/tpaccept [player]` | `/tpyes` | Accept a teleport request | `huskhomes.command.tpaccept` |
| `/tpdecline [player]` | `/tpdeny`, `/tpno` | Decline a teleport request | `huskhomes.command.tpdecline` |
| `/rtp [player]` | | Teleport randomly into the wild | `huskhomes.command.rtp` |
| `/tpignore` | | Ignore incoming teleport requests | `huskhomes.command.tpignore` |
| `/tpoffline <player>` | | Teleport to where a player was last online | `huskhomes.command.tpoffline` |
| `/tpall` | | Teleport everyone to your position | `huskhomes.command.tpall` |
| `/tpaall` | | Request that everyone teleports to you | `huskhomes.command.tpaall` |
| `/spawn` | | Teleport to spawn | `huskhomes.command.spawn` |
| `/setspawn` | | Set the spawn position | `huskhomes.command.setspawn` |
| `/back` | | Return to your previous position, or where you died | `huskhomes.command.back` |
| `/huskhomes [about/help/reload/update]` | | View plugin information & reload configs | `huskhomes.command.huskhomes` |
&dagger;Required permission for basic command execution; some commands require additional permissions for certain functions (See below&hellip;)
## Disabling Commands
If you'd like to disable a command, add it to the `disabled_commands` section of your config file as detailed below. Note that on servers running Paper for versions earlier than Minecraft 1.19.4, or servers just running plain Spigot instead of Paper (not recommended&mdash;please upgrade to Paper!), disabled commands will still be _registered_ but a disabled command message will appear. On servers running Paper for Minecraft 1.19.4+, HuskHomes will be registered as a Paper Plugin (and will appear as such in the `/plugins` menu) and disabled commands will not be registered at all.
<details>
<summary>Disabling a command in config.yml</summary>
```yaml
# Disabled commands (e.g. ['/home', '/warp'] to disable /home and /warp)
disabled_commands: [ '/rtp' ]
```
</details>
## Other Permissions
### Changing set home, public home & free home limits
You can modify the maximum number of homes, the allotment of free homes and the number of public homes a user can set through permission nodes.
* `huskhomes.max_homes.<amount>` — Determines the max number of homes a user can set
* `huskhomes.free_homes.<amount>` — Determines the allotment of homes the user can set for free, before they have to pay&dagger;
* `huskhomes.max_public_homes.<amount>` — Determines the maximum number of homes a user can make public
&dagger;Only effective on servers that make use of the economy hook.
If users have multiple permission nodes (i.e. from being in multiple permission groups), HuskHomes will accept the highest. If you would prefer the nodes to _stack_, you can set the `stack_permission_limits` setting in the plugin config file to `true` (under `general`).
Note that these permission-set values override the values set in the plugin config (`max_homes`, `max_public_homes` under `general` and `free_homes` under `economy`).
### Return by death on /back
This permission controls whether users can return to where they died. Note that return by death must be enabled in the config for this to work.
| Permission | Command | Description |
|--------------------------------|---------|---------------------------------------|
| `huskhomes.command.back.death` | `/back` | Use /back to return to where you died |
### Home privacy
These permissions allow you to make a home public/private (toggling its privacy). There are also permissions that let you use, edit and delete homes that have not been set publicly.
| Permission | Command | Description |
|--------------------------------------|-------------------------------------------------------------------------------------|----------------------------------------------|
| `huskhomes.command.edithome.privacy` | `/edithome <name> privacy [public/private]` | Modify the privacy of a home |
| `huskhomes.command.home.other` | `/homelist <player> [page]` | View a list of a user's homes |
| `huskhomes.command.home.other` | `/home [<owner_name>.<home_name>]` | Teleport to a user's home, public or private |
| `huskhomes.command.edithome.other` | `/edithome [<owner_name>.<home_name>] [rename/description/relocate/privacy] [args]` | Edit a user's home |
| `huskhomes.command.delhome.other` | `/delhome [<owner_name>.<home_name>]` | Delete a user's home |
### Cooldown, warmup and economy bypasses
These permissions let you bypass teleportation warmup checks, rtp cooldown checks and economy checks
| Permission | Description |
|------------------------------------|--------------------------------------------|
| `huskhomes.bypass_teleport_warmup` | Bypass timed teleportation warmups&dagger; |
| `huskhomes.bypass_economy_checks` | Bypass economy checks |
| `huskhomes.rtp.bypass_cooldown` | Bypass the cooldown on /rtp&ddagger; |
&dagger;This is not effective when the teleport warmup time is set `<= 0` in the config file.
&ddagger;This is not effective when the /rtp cooldown time is set `<= 0` in the config file.
### Advanced teleportation
These permissions allow you to use /tp and /rtp to teleport other players remotely and to coordinates.
| Permission | Command | Description |
|------------------------------------|---------------------------------------------|-------------------------------------|
| `huskhomes.command.tp.other` | `/tp [player] <x> <y> <z> [world] [server]` | Teleport a user other than yourself |
| `huskhomes.command.tp.coordinates` | `/tp [player] <x> <y> <z> [world] [server]` | Teleport to a set of coordinates. |
| `huskhomes.command.rtp.other` | `/rtp [player]` | Randomly teleport another player. |
| `huskhomes.command.spawn.other` | `/spawn [player]` | Teleport another player to spawn. |
| `huskhomes.command.warp.other` | `/warp [name] [player]` | Teleport another player to a warp. |
### /huskhomes command arguments
These permissions control what arguments of the /huskhomes command a user may use.
| Permission | Command | Description |
|--------------------------------------|--------------------------|--------------------------------------------|
| `huskhomes.command.huskhomes.help` | `/huskhomes help [page]` | View a list of HuskHomes commands |
| `huskhomes.command.huskhomes.about` | `/huskhomes [about]` | View the plugin about menu |
| `huskhomes.command.huskhomes.reload` | `/huskhomes reload` | Reload the plugin config and message files |
| `huskhomes.command.huskhomes.update` | `/huskhomes update` | Check for updates |
+151
View File
@@ -0,0 +1,151 @@
This page contains the configuration structure for HuskHomes.
## Configuration structure
📁 `plugins/HuskHomes/` (Spigot) OR `config/huskhomes/` (Fabric, Sponge)
- 📄 `config.yml`: General plugin configuration
- 📄 `server.yml`: (Cross-server setups only) Server ID configuration
- 📄 `spawn.yml`: Local saved server spawn position. Use /setspawn to generate this file
- 📄 `messages-xx-xx.yml`: Plugin locales, formatted in MineDown (see [[Translations]])
## Example files
<details>
<summary>config.yml</summary>
```yaml
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ HuskHomes Config ┃
# ┃ Developed by William278 ┃
# ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
# ┣╸ Information: https://william278.net/project/huskhomes
# ┗╸ Documentation: https://william278.net/docs/huskhomes
language: en-gb
check_for_updates: true
database:
# Database connection settings
type: SQLITE
mysql:
credentials:
host: localhost
port: 3306
database: HuskHomes
username: root
password: pa55w0rd
parameters: ?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
connection_pool:
# MySQL connection pool properties
size: 12
idle: 12
lifetime: 1800000
keepalive: 30000
timeout: 20000
table_names:
player_data: huskhomes_users
saved_position_data: huskhomes_saved_positions
position_data: huskhomes_position_data
home_data: huskhomes_homes
warp_data: huskhomes_warps
teleport_data: huskhomes_teleports
general:
# General plugin settings
max_homes: 10
max_public_homes: 10
stack_permission_limits: false
permission_restrict_warps: false
overwrite_existing_homes_warps: true
teleport_warmup_time: 5
teleport_warmup_display: ACTION_BAR
teleport_request_expiry_time: 60
strict_tpa_here_requests: true
allow_unicode_names: false
allow_unicode_descriptions: true
back_command_return_by_death: true
back_command_save_teleport_event: false
list_items_per_page: 12
asynchronous_teleports: true
play_sound_effects: true
sound_effects:
teleportation_cancelled: entity.item.break
teleportation_warmup: block.note_block.banjo
teleportation_complete: entity.enderman.teleport
teleport_request_received: entity.experience_orb.pickup
brigadier_tab_completion: true
cross_server:
# Enable teleporting across proxied servers. Requires MySQL
enabled: false
messenger_type: PLUGIN_MESSAGE
cluster_id: ''
global_spawn:
enabled: false
warp_name: Spawn
global_respawning: false
redis_credentials:
host: localhost
port: 6379
password: ''
use_ssl: false
rtp:
# Random teleport (/rtp) command settings
cooldown_length: 10
radius: 5000
spawn_radius: 500
distribution_mean: 0.75
distribution_deviation: 2.0
restricted_worlds:
- world_nether
- world_the_end
economy:
# Charge for certain actions (requires Vault)
enabled: false
# Use this currency for payments (works only with RedisEconomy), defaults to Vault currency
redis_economy_name: vault
free_home_slots: 5
costs:
back_command: 0.0
additional_home_slot: 100.0
random_teleport: 25.0
make_home_public: 50.0
map_hook:
# Display public homes/warps on your web map (supports Dynmap and BlueMap)
enabled: true
show_public_homes: true
show_warps: true
# Disabled commands (e.g. ['/home', '/warp'] to disable /home and /warp)
disabled_commands: []
```
</details>
<details>
<summary>spawn.yml</summary>
You should generate this file in-game with the `/setspawn` command.
```yaml
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ Server /spawn location cache ┃
# ┃ Edit in-game using /setspawn ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
x: 0.0
y: 64.0
z: 0.0
yaw: 180.0
pitch: 0.0
world_name: world
world_uuid: 00000000-0000-0000-0000-000000000000
```
</details>
<details>
<summary>server.yml</summary>
This file is only present if your server uses cross-server mode to run HuskHomes on a proxy network.
```yaml
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ HuskHomes Server ID config ┃
# ┃ Developed by William278 ┃
# ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
# ┣╸ This file should contain the ID of this server as defined in your proxy config.
# ┣╸ If you join it using /server alpha, then set it to 'alpha' (case-sensitive)
# ┗╸ You only need to touch this if you're using cross-server mode.
name: beta
```
</details>
+20
View File
@@ -0,0 +1,20 @@
HuskHomes supports charging players' Vault economy balances for performing certain actions. This requires the Vault plugin and a compatible economy plugin.
To enable the economy hook, set `enabled` to `true` under the `economy` section of the config. Players with the `huskhomes.bypass.economy` permission bypass economy checks and don't need to pay for things.
## Home slots
With the economy hook enabled, players will need to pay for home slots beyond their initial "free" allotment.
The price will be levied against the player when they attempt to set home and have no free slots left. A warning message will notify the player of this when they have set their last free home slot.
You can configure the number of 'free home slots' a user gets using the `free_home_slots` setting in the `economy` section. The default is `5`.
## Economy actions
You can set prices to charge for these actions.
| Action | Description | Default Price |
|------------------------|---------------------------------------------|---------------|
| `ADDITIONAL_HOME_SLOT` | When a user wants to buy another home slot | `$100.00` |
| `MAKE_HOME_PUBLIC` | When a user wants to make thier home public | `$50.00` |
| `RANDOM_TELEPORT` | When a user executes /rtp | `$25.00` |
| `BACK_COMMAND` | When a user executes /back | `$0.00` |
+16
View File
@@ -0,0 +1,16 @@
**HuskHomesGUI** is an add-on for HuskHomes that lets you view and edit homes through a GUI (chest-style) menu, rather than the chat menus.
![image](https://user-images.githubusercontent.com/31187453/216150666-aab981ba-3d44-471b-9e54-72dd5034bbee.png)
You can download it from [Spigot](https://www.spigotmc.org/resources/huskhomesgui.91059/), [Polymart](https://polymart.org/resource/huskhomesgui.928) and [Modrinth](https://modrinth.com/plugin/huskhomesgui) and view the [source code here](https://github.com/WiIIiam278/HuskHomesGUI).
## Setup
1. Download the latest version of HuskHomesGUI
2. Place it in the `~/plugins/` folder of your server, alongside the latest version of HuskHomes
3. Restart your server
4. The `/home` and `/warp` commands will now have been replaced with the GUI.
5. If you want, you can edit the `~/plugins/HuskHomesGUI/config.yml` file to modify visual options, or change the plugin language.
## Command
The `/huskhomesgui <reload|about>` command lets you check the version and reload the plugin. The permission node for it is `huskhomesgui.command.huskhomesgui`.
+11
View File
@@ -0,0 +1,11 @@
HuskHomes supports global respawning, an advanced setting for networks of multiple servers that wish for players to have just one bed respawn, rather than per-server bed respawns.
To enable global respawn, your network must first be correctly configured in `cross_server` mode. Then, set `global_respawning` to `true` under the `cross_server` section.
## How it works
* When a player interacts with a bed or respawn anchor, HuskHomes will update the user's global respawn position to match their respawn position on that server.
* When a player dies, the player will be sent to the server they set their spawn in with a special `RESPAWN` teleport type.
* When the player arrives at their respawn server, the game will finsih the teleport to their respawn position. If their respawn position is missing or obstructed, the player will instead be moved to the world spawn on that server.
## Limitation
* Plugins, commands and other ways in which a player's spawn may be updated will have no effect on a user's global respawn position, due to Spigot not having an event for this. This limitation may be removed in the future with extended support for Paper.
+3
View File
@@ -0,0 +1,3 @@
HuskHomes lets you define one global cross-server `/spawn` point, for server networks who wish to define just one spawn position. This function uses a `/warp` to act as the cross-server spawn position.
To enable global /spawn, your network must first be correctly configured in `cross_server` mode. Then, enable `global_spawn` under the `cross_server` section. You can additionally configure the name of the warp to use by modifying the `warp_name` parameter (default: `'Spawn'`).
+33
View File
@@ -0,0 +1,33 @@
# [![HuskHomes banner](https://raw.githubusercontent.com/WiIIiam278/HuskHomes2/master/images/banner.png)](https://github.com/WiIIiam278/HuskHomes2)
Welcome to the plugin documentation for HuskHomes v3.x+, the home and teleportation suite developed by William278. Please click through to the topic you'd like to read about.
## Guides
* 📚 [[Setup]]
* 📦 [[Legacy Migration]] (*v2 → v3*)
* 📄 [[Config Files]]
* 📝 [[Translations]]
* ⛔ [[Managing Access]]
* 🖥️ [[Commands]]
## Documentation
* ⛅ [[Redis Support]]
* 🟩 [[Plan Hook]]
* 🗺️ [[Map Hooks]]
* 💵 [[Economy Hook]]
* ⚠️ [[Strict Tpahere]]
* 🚫 [[Restricted Warps]]
* 🛏️ [[Global Respawning]]
* 🌎 [[Global Spawn]]
* ✍️ [[Placeholders]]
* ⭐ [[GUI Add-on]]
* 📦 [[API]]
* 💡 [[API Examples]]
* ❗ [[API Events]]
## Links
* 💻 [GitHub](https://github.com/WiIIiam278/HuskHomes2)
* 📂 [Downloads](https://www.spigotmc.org/resources/huskhomes.83767/)
* 🚰 [Spigot](https://www.spigotmc.org/resources/huskhomes.83767/)
* 🛒 [Polymart](https://polymart.org/resource/huskhomes.284/)
* 🔧 [Modrinth](https://modrinth.com/plugin/huskhomes)
* 💬 [Discord Support](https://discord.gg/tVYhJfyDWG)
+14
View File
@@ -0,0 +1,14 @@
> ⚠️ Migration from v2.11.x to v4.x is not supported; you must first download HuskHomes v3.2.2 and carry out the migration in that version, before upgrading to v4.x. No migration is needed between v3.x and v4.x as the two versions have the same database schema.
To upgrade from HuskHomes v2.11.2 to v3.x, please carry out the following steps:
* Delete the old `HuskHomes-2.x.jar` from your server(s) `plugins` folder(s).
* Drag in the new HuskHomes v3.x jar file to the folder.
* In your `plugins/HuskHomes/` folder, delete the `messages.yml` file to let it regenerate.
* Start your server. If you are running multiple servers, start just one server. HuskHomes will automatically upgrade your data.
* If you are running on multiple servers:
- Delete `plugins/HuskHomes/config.yml` from each of your other servers.
- Start each server you deleted config.yml from.
- Once they have started, stop them again and navigate to the newly generated config.yml file on each server and update it with your database credentials and set the database type to MYSQL from SQLITE. Be sure to enable cross_server mode, too.
* Update your Permissions plugin groups to make use of the [new permission nodes](https://william278.net/docs/huskhomes/Commands)
That's it! Enjoy HuskHomes v3.x.
+18
View File
@@ -0,0 +1,18 @@
To manage access to HuskHomes' features on your server, you should use a permission management plugin. However, if you're just throwing up a server with a home plugin for a group of mates, you can also just use the plugin on it's own without one and change some settings in `config.yml`.
### LuckPerms
[LuckPerms](https://luckperms.net) is the standard, stable and recommended permissions plugin, and works on Spigot, Fabric and Sponge servers. Follow the LuckPerms setup guide to get started. You can then use the `/lp editor` to assign the permissions detailed on this page to groups. A lot of HuskHomes' permissions are enabled for default users ([see below](#without-a-permissions-plugin)). You can set permissions to "false" to revoke a node from a group.
### Without a permissions plugin
All commands have default operator level access grants to let you use them without a permissions plugin. The following commands require operator (`/op <name>`):
* /tp
* /tphere
* /tpaall
* /tpall
* /setspawn
* /setwarp
* /delwarp
* /editwarp
* /tpoffline
All other commands (but _not all sub-commands_) may be used by players by default; you can [disable them outright](commands#disabling-commands) to prevent players from using them, or install a permissions plugin if you'd like finer control (_recommended_).
+15
View File
@@ -0,0 +1,15 @@
HuskHomes supports displaying homes and warps as markers on server web mapping plugins. Currently, [Dynmap](https://github.com/webbukkit/dynmap) and [BlueMap](https://github.com/BlueMap-Minecraft/BlueMap) are supported.
Pl3xMap/SquareMap and the wake of forks left after the original plugin was discontinued are unsupported due to lack of a consistent API for them at the moment. Support for [Pl3xMap v2](https://github.com/BillyGalbreath/Pl3xMap/) is planned for when that API matures.
To enable support for map hooks, edit your config.yml file under the `map_hook` section so that `enabled` is `true`. You can customise whether to show public homes, warps or both on the map.
## Dynmap
![Dynmap markers screenshot](https://raw.githubusercontent.com/WiIIiam278/HuskHomes2/master/images/dynmap-hook.png)
To enable Dynmap support, ensure that the `map_hook` is enabled in config.yml and that the latest version of Dynmap is installed on your server. Then, restart your server and your map will be populated with HuskHomes' markers.
You can click on the markers to view a popup containing information about the public home/warp.
## BlueMap
![BlueMap markers screenshot](https://raw.githubusercontent.com/WiIIiam278/HuskHomes2/master/images/bluemap-hook.png)
To enable BlueMap support, ensure that the `map_hook` is enabled in config.yml and that the latest version of BlueMap is installed on your server. Then, restart your server and your map will be populated with HuskHomes' markers.
+16
View File
@@ -0,0 +1,16 @@
If you have [PlaceholderAPI](https://github.com/PlaceholderAPI/PlaceholderAPI) installed, HuskHomes (v4.0.5+) will automatically register a hook providing a number of placeholders that will be replaced with their appropriate values.
## List of placeholders
| Placeholder | Description | Example Value |
|------------------------------------|---------------------------------------------------------------------|---------------------|
| `%huskhomes_homes_count%` | The number of homes this user has set | 3 |
| `%huskhomes_max_homes%` | The maximum number of homes this user can set | 10 |
| `%huskhomes_max_public_homes%` | The number of homes this user can make public | 5 |
| `%huskhomes_free_home_slots%` | The number of homes this user can make for free&dagger; | 5 |
| `%huskhomes_home_slots%` | The number of additional home slots this user has purchased&dagger; | 2 |
| `%huskhomes_homes_list%` | A comma-separated list of this user's homes | home, castle, tower |
| `%huskhomes_public_homes_count%` | The number of homes this user has set to public | 3 |
| `%huskhomes_public_homes_list%` | A comma-separated list of this user's public homes | castle, tower |
| `%huskhomes_ignoring_tp_requests%` | Whether this user is ignoring teleport requests | true |
&dagger;Only effective on servers that make use of the [[Economy Hook]].
+12
View File
@@ -0,0 +1,12 @@
HuskHomes supports displaying statistics about user sethomes on your [Player Analytics](https://github.com/plan-player-analytics/Plan) (Plan) web panel.
![Plan hook screenshots](https://raw.githubusercontent.com/WiIIiam278/HuskHomes2/master/images/plan-hook.png)
## Requirements
- HuskSync v2.0+
- Plan v5.4.1690+
## Setup
1. Install Plan to your Spigot server(s) with HuskHomes installed
2. Configure Plan as necessary and restart your servers
3. Data will start showing up on Player pages on the "Plugins" panel, under "HuskHomes."
+10
View File
@@ -0,0 +1,10 @@
For networks of connected servers, HuskHomes supports Redis (v5.0+) as an alternative to the default Plugin messaging protocol, for servers that would like to use it.
## Setup
To make use of Redis, your network must first be correctly configured in `cross_server` mode. Then, follow these steps:
1. Turn off all your servers.
2. Ensure your Redis server is online.
3. Modify the `config.yml` files of each server, filling in the redis `credentials` in the `cross_server` section.
- Most Redis installations don't have a password by default. You can probably leave `password` blank (`''`).
5. Set the `messenger_type` to `REDIS`
6. Save your config files and turn on each server. Check to make sure the plugin enabled the network messenger successfully on startup. If it didn't, check your credentials (try without setting the password and SSL mode off if neccessary).
+3
View File
@@ -0,0 +1,3 @@
HuskHomes supports restricting warps behind permission nodes. This means that players require a corresponding `huskhomes.command.warp.<name>` node to view and use warps, else they will see an error message.
To enable permission-restricted warps, set `permission_restrict_warps` to `true` under `general`. Don't forget to grant users the necessary permission nodes (`huskhomes.command.warp.<name>`).
+54
View File
@@ -0,0 +1,54 @@
This will walk you through installing HuskHomes on your Spigot, Fabric or Sponge server, or proxy network of servers.
## Requirements
* A Spigot (1.16.5+), Fabric (latest Minecraft version), or Sponge (Implementing API v8) _Minecraft: Java Edition_ server running on Java 16+
* (For proxy network support) A proxy server (Velocity, BungeeCord) and MySQL (v8.0+) database
* (For optional [[Redis support]]) A Redis database (v5.0+)
## Download HuskHomes for your server
Download the correct jar file for your server from the [latest release page](https://github.com/WiIIiam278/HuskHomes2/releases/latest):
* the `HuskHomes-Plugin` jar for Spigot or Paper servers
* the `HuskHomes-Fabric` jar for Fabric servers
* or the `HuskHomes-Sponge` jar for Sponge servers
## Single-server Setup Instructions
These instructions are for simply installing HuskHomes on one Spigot, Fabric or Sponge server.
### 1. Install the jar
- Place the plugin jar file in the `/plugins/` directory of your Spigot server, or the `/mods` directory of your Fabric/Sponge server.
### 2. Restart the server and configure
- Start, then stop your server to let HuskHomes generate the config file.
- You can now edit the config and locales to your liking.
### 3. Turn on your server
- Start your server again and enjoy HuskHomes!
-----
## Multi-server Setup Instructions
These instructions are for installing HuskHomes on multiple Spigot, Fabric or Sponge servers and having them network together. A MySQL database (v8.0+) is required.
### 1. Install the jar
- Place the plugin jar file in the `/plugins/` directory of each Spigot server, or the `/mods` directory of your Fabric/Sponge server.
- You do not need to install HuskHomes as a proxy plugin.
### 2. Restart the server and configure
- Start, then stop every server to let HuskHomes generate the config file.
- Advanced users: If you'd prefer, you can just create one config.yml file and create symbolic links in each `/plugins/HuskHomes/` (`/config/huskhomes/` on Fabric/Sponge) folder to it to make updating it easier.
### 3. Configure servers to use cross-server mode
- Navigate to the HuskHomes config file on each server (`~/plugins/HuskHomes/config.yml` on Spigot, `~/config/huskhomes/config.yml` on Fabric/Sponge)
- Under `database`, set `type` to `MYSQL`
- Under `mysql`/`credentials`, enter the credentials of your MySQL database server.
- Scroll down and look for the `cross_server` section. Set `enabled` to `true`.
- You can additionally configure a Redis server to use for network messaging, if you prefer (set the `messenger_type` to `REDIS` if you do this).
- Save the config file. Make sure you have updated the file on every server.
### 4. Restart servers and set server.yml values
- Restart each server again. A `server.yml` file should generate inside the plugin config directory you navigated to earlier
- Set the `name` of the server in this file to the ID of this server as defined in the config of your proxy (e.g. if this is the "hub" server you access with `/server hub`, put "hub" here)
### 5. Restart your servers one last time
- Provided your MySQL datbase credentials were correct, your network should now be setup to use HuskHomes!
- You can delete the `HuskHomesData.db` SQLite flatfile that was generated, if you would like.
## Next steps
* [Commands & Permissions](Commands)
* [[Config Files]]
* [[Redis Support]]
* [[Translations]]
+6
View File
@@ -0,0 +1,6 @@
HuskHomes provides an option to enforce strict `/tpahere` requests. This alters the behaviour of the `/tpahere` command.
* Strict `/tpahere` requests **disabled**: When a player accepts a `/tpahere` request, they will be teleported to the current position of the player at the end of their warmup period.
* Strict `/tpahere` requests **enabled**: When a player accepts a `/tpahere` request, they will be teleported to the position of the player when they executed the `/tpahere` command.
You may wish to use strict `/tpahere` requests if your server makes use of contextual permission nodes to restrict where players can use `/tpahere`. You can set whether to use strict `/tpahere` requests using the `strict_tpa_here_requests` setting under `general` in the HuskHomes config.yml file.
+14
View File
@@ -0,0 +1,14 @@
HuskHomes supports a number of community-sourced translations of the plugin locales into different languages. The default language is [`en-gb`](https://github.com/WiIIiam278/HuskHomes2/blob/master/common/src/main/resources/locales/en-gb.yml) (English). The messages file is formatted using [MineDown](https://github.com/Phoenix616/MineDown).
You can change which preset language option to use by changing the top-level `language` setting in the plugin config.yml file. You must change this to one of the supported language codes. You can [view a list of the supported languages](https://github.com/WiIIiam278/HuskHomes2/tree/master/common/src/main/resources/locales) by looking at the locales source folder.
## Contributing Locales
You can contribute locales by submitting a pull request with a yaml file containing translations of the [default locales](https://github.com/WiIIiam278/HuskHomes2/blob/master/common/src/main/resources/locales/en-gb.yml) into your language. Here's a few pointers for doing this:
* Do not translate the locale keys themselves (e.g. `teleporting_offline_player`)
* Your pull request should be for a file in the [locales folder](https://github.com/WiIIiam278/HuskHomes2/tree/master/common/src/main/resources/locales)
* Do not translate the [MineDown](https://github.com/Phoenix616/MineDown) markdown syntax itself or commands and their parameters; only the english interface text
* Each locale should be on one line, and the header should be removed.
* Use the correct ISO 639-1 [locale code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) for your language and dialect
* If you are able to, you can add your name to the `AboutMenu` translators credit list yourself, otherwise this can be done for you
Thank you for your interest in making HuskHomes more accessible around the world!
+2
View File
@@ -0,0 +1,2 @@
| This documentation is available via [william278.net](https://william278.net/docs/huskhomes/) |
|----------------------------------------------------------------------------------------------|
+30
View File
@@ -0,0 +1,30 @@
## Guides
* 📚 [[Setup]]
* 📦 [[Legacy Migration]] (*v2 → v3*)
* 📄 [[Config Files]]
* 📝 [[Translations]]
* ⛔ [[Managing Access]]
* 🖥️ [[Commands]]
## Documentation
* ⛅ [[Redis Support]]
* 🟩 [[Plan Hook]]
* 🗺️ [[Map Hooks]]
* 💵 [[Economy Hook]]
* ⚠️ [[Strict Tpahere]]
* 🚫 [[Restricted Warps]]
* 🛏️ [[Global Respawning]]
* 🌎 [[Global Spawn]]
* ✍️ [[Placeholders]]
* ⭐ [[GUI Add-on]]
* 📦 [[API]]
* 💡 [[API Examples]]
* ❗ [[API Events]]
## Links
* 💻 [GitHub](https://github.com/WiIIiam278/HuskHomes2)
* 📂 [Downloads](https://www.spigotmc.org/resources/huskhomes.83767/)
* 🚰 [Spigot](https://www.spigotmc.org/resources/huskhomes.83767/)
* 🛒 [Polymart](https://polymart.org/resource/huskhomes.284/)
* 🔧 [Modrinth](https://modrinth.com/plugin/huskhomes)
* 💬 [Discord Support](https://discord.gg/tVYhJfyDWG)