refactor: significantly refactor internals, remove Sponge (#708)

* feat: start database refactor

Adds database migrations

* refactor: refactor database system

Now supports migrations

* refactor: begin major internals rewrite

move to using provider-style interfaces similar to huskclaims
bukkit done, still need to do fabric and sponge

* refactor: remove sponge, checkstyle

Low usage and high maintenance time cost. We will examine Forge instead in the future.

* refactor: implement refactoring changes on fabric

also fix various refactor quirks on Bukkit

* refactor: tidy metrics logic

* build: bump deps
This commit is contained in:
William authored and GitHub committed 2024-10-28 20:49:57 +00:00
1 parent 05bcad9249
commit ffe995ef5f
162 files changed
+3890 -5730

No files matched your search

+1 -3
View File
@@ -24,11 +24,9 @@ HuskHomes provides a number of API events your plugin can listen to when certain
† 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.
## Events on Sponge & Fabric
## Events on Fabric
> **Note:** Check the [[API]] introduction for details on targeting platforms
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>
+1 -2
View File
@@ -1,6 +1,5 @@
> **Please Note:** The HuskHomes API itself is only available on Bukkit, but Fabric and Sponge do support [API events](api-events).
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 (timed) `Teleport`s, including cross-server teleports
+3 -4
View File
@@ -21,7 +21,6 @@ The HuskHomes API is available for the following platforms:
* `bukkit` - Bukkit, Spigot, Paper, etc. Provides Bukkit API event listeners and adapters to `org.bukkit` objects.
* `fabric` - Fabric, Quilt, etc. Provides Fabric API event callbacks and adapters to `net.minecraft` objects.
* `sponge` - Sponge. Provides Sponge API events.
* `common` - Common API for all platforms.
<details>
@@ -38,7 +37,7 @@ The HuskHomes API is available for the following platforms:
2. [Adding HuskHomes as a dependency](#2-adding-huskhomes-as-a-dependency)
3. [Next steps](#3-next-steps)
## API Introduction
## 1 API Introduction
### 1.1 Setup with Maven
<details>
<summary>Maven setup information</summary>
@@ -84,7 +83,7 @@ dependencies {
```
</details>
## 2. Adding HuskHomes as a dependency
## 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
@@ -97,7 +96,7 @@ softdepend: # Or, use 'depend' here
- HuskHomes
```
## 3. Next steps
## 3 Next steps
Now that you've got everything ready, you can start doing stuff with the HuskHomes API!
- [[API Examples]]
- [[API Events]]
+1 -1
View File
@@ -48,7 +48,7 @@ disabled-commands:
</details>
## Fallback namespace
> **Applies to:** Spigot, Paper, Fabric, Sponge
> **Applies to:** Spigot, Paper, or Fabric
All commands are registered with a fallback namespace, so that you can still access them. For instance, `/minecraft:tp` will run the default Minecraft teleport command, while `/huskhomes:tp` will run HuskHomes' tp command.
+1 -1
View File
@@ -1,7 +1,7 @@
This page contains the configuration structure for HuskHomes.
## Configuration structure
📁 `plugins/HuskHomes/` (Spigot) OR `config/huskhomes/` (Fabric, Sponge)
📁 `plugins/HuskHomes/` (Spigot) OR `config/huskhomes/` (Fabric)
- 📄 `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
-8
View File
@@ -17,14 +17,6 @@ To enable the Economy Hook on a Spigot/Paper server, install both [Vault](https:
To enable the Economy Hook on a Fabric server, the [Impactor Economy](https://modrinth.com/mod/impactor) mod must be installed to provide an API for plugins to perform economy operations. Then, set `enabled` to `true` under the `economy` section of [`config.yml`](config-files).
</details>
<details>
<summary>Sponge setup</summary>
> **Applies to:** Sponge
To enable the Economy Hook on a Sponge server, you require a mod installed for managing player economy accounts through the Sponge economy API. Then, set `enabled` to `true` under the `economy` section of [`config.yml`](config-files).
</details>
### Bypassing economy checks
Players with the `huskhomes.bypass_economy_checks` [permission node](commands) bypass economy checks and can perform economy actions without paying.
+1 -1
View File
@@ -1,7 +1,7 @@
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.
[LuckPerms](https://luckperms.net) is the standard, stable and recommended permissions plugin, and works on Spigot or Fabric 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>`):
+8 -9
View File
@@ -1,9 +1,9 @@
This will walk you through installing HuskHomes on your Spigot, Fabric or Sponge server, or proxy network of servers.
This will walk you through installing HuskHomes on your Spigot or Fabric server, or proxy network of servers.
## Requirements
> **Note:** If the plugin fails to load, please check that you are not running an [incompatible version combination](Unsupported-Versions)
* A Spigot (1.17.1+), Fabric (latest Minecraft version), or Sponge (Implementing API v10) _Minecraft: Java Edition_ server running on Java 17+
* A Spigot (1.17.1+) or Fabric (latest Minecraft version) _Minecraft: Java Edition_ server running on Java 17+
* (For proxy network support) A proxy server (Velocity, BungeeCord) and MySQL (v8.0+)/MariaDB/PostgreSQL database
* (For optional [[Redis support]]) A Redis database (v5.0+)
@@ -11,13 +11,12 @@ This will walk you through installing HuskHomes on your Spigot, Fabric or Sponge
Download the correct jar file for your server from the [latest release page](https://github.com/WiIIiam278/HuskHomes/releases/latest):
* the `HuskHomes-Paper` 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.
These instructions are for simply installing HuskHomes on one Spigot or Fabric 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.
- Place the plugin jar file in the `/plugins/` directory of your Spigot server, or the `/mods` directory of your Fabric 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](Config-Files) and locales to your liking.
@@ -27,16 +26,16 @@ These instructions are for simply installing HuskHomes on one Spigot, Fabric or
-----
## 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.
These instructions are for installing HuskHomes on multiple Spigot or Fabric 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.
- Place the plugin jar file in the `/plugins/` directory of each Spigot server, or the `/mods` directory of your Fabric 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.
- 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) folder to it to make updating it easier.
### 3. Configure servers to use cross-server mode
- Navigate to the HuskHomes [config](Config-Files) file on each server (`~/plugins/HuskHomes/config.yml` on Spigot, `~/config/huskhomes/config.yml` on Fabric/Sponge)
- Navigate to the HuskHomes [config](Config-Files) file on each server (`~/plugins/HuskHomes/config.yml` on Spigot, `~/config/huskhomes/config.yml` on Fabric)
- Under `database`, set `type` to `MYSQL`, `MARIADB` or `POSTGRESQL` (depending on which type of database you wish to use)
- Under `mysql`/`credentials`, enter the credentials of your MySQL, MariaDB or PostgreSQL database server.
- Scroll down and look for the `cross_server` section. Set `enabled` to `true`.