9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-19 14:59:21 +00:00
Files
HuskSync/docs/Setup.md
William 89368778f3 feat: add support for Fabric targeting Minecraft 1.20.1 (#217)
* Upgrade the Fabric version and rewrite the code.

* Migrate the completed code of version 1.19.2.

* fabric: some events.

* Updated open source license to Apache 2.0.

* Add Plan analyzer support.

* Fix build.

* `UnsupportedOperationException`

* More fabric implementation work, update to v3's structure

* Suppress compiler warnings

* Add commands, adjust registration order

* Inventory and ender chest data/serializers

* Update license headers

* Fixup shaded library relocations

* Fix build

* Potion effects & location serializers

* Catch `Files.createDirectory(path);` in `#getDataFolder`

* Update fabric.mod.json metadata, correct icon

* Events for Fabric (#218)

* Added apache commons pool2 dependency

A NoClassDefFoundError would get thrown without this dependency. Relocation appears to not work very well either, so it has been excluded for now

* Added in Item Pickup and Drop events and mixins

* Update husksync.mixins.json

* Switch drop item event to using Network Handler mixin

* Implemented even more events

- Interact block (place too)
- Interact Entity
- Use Item
- Block Break
- Player damage
- Inventory Click (handles drops)
- Player Commands

* Re-implement the dropItem mixin

* Set dropItem mixin as cancellable

* deps: Include all bukkit runtime deps

* fix/fabric: Supply AudienceProvider to `ConsoleUser` constructor

* docs: credit Fabric porters :)

* fix: Item deserialization now working

* refactor: Remove inventory debug log

* docs: Update `fabric.mod.json`

* refactor: update with upstream changes

* fix: dangling JD comment

* fix: config file reference fixes

* refactor: optimize imports, fix relocation

* refactor: move tag references to common

* refactor: use lombok for data / serializer methods

* fix: bad annotating

* refactor: adjust callback formatting

* fabric: bump deps, refactor to match main branch

* fabric: more serializer type work

* feat: register more fabric data serializers

also fixes a compile issue on bukkit, and refactors the JSON serializer to be in the common module

* feat: implement remaining Fabric serializers

* feat: add on-the-fly DFU for Fabric

Now auto-upgrades item data to support version bumps. Also improved the schema a lil' bit.

* feat: add missing mixins

* feat: implement toKeep/toDrop option on Fabric

* feat: apply stats on sync

* build: append fabric MC version to file name

* feat: add HuskSync API support for Fabric

Also updates the docs

* refactor: fixup a deprecation in the wrong spot

* refactor: optimize fabric item serializing in-line with Bukkit

* feat: implement viewer GUIs on Fabric

* docs: Fabric is in Alpha for now

---------

Co-authored-by: hanbings <hanbings@hanbings.io>
Co-authored-by: Stampede <carterblowers01@gmail.com>
2024-06-09 22:41:37 +01:00

3.8 KiB

Warning: Fabric support is currently in beta and is not production ready yet. Customers can get in touch on Discord to request the Fabric build, or you can self-compile.

This will walk you through installing HuskSync on your network of Spigot or Fabric servers.

Requirements

Warning: Mixing and matching Fabric/Spigot servers is not supported, and all servers must be running the same Minecraft version.

Note: Please also note some specific legacy Paper/Purpur versions are not compatible with HuskSync.

  • A MySQL Database (v8.0+)
    • OR a MariaDB, PostrgreSQL or MongoDB database, which are also supported
  • A Redis Database (v5.0+) — see FAQs for more details.
  • Any number of Spigot servers, connected by a BungeeCord or Velocity-based proxy (Minecraft v1.17.1+, running Java 17+)
    • OR a network of Fabric servers, connected by a Fabric proxy (Minecraft v1.20.1, running Java 17+)

Setup Instructions

1. Install the jar

  • Place the plugin jar file in the /plugins/ or /mods/ directory of each Spigot/Fabric server respectively.
  • You do not need to install HuskSync as a proxy plugin.
  • Spigot users: You can additionally install ProtocolLib or PacketEvents for better locked user handling.
  • Fabric users: Ensure the latest Fabric API mod jar is installed!

2. Restart servers

  • Start, then stop every server to let HuskSync generate the config file.
  • HuskSync will throw an error in the console and disable itself as it is unable to connect to the database. You haven't set the credentials yet, so this is expected.

3. Enter Mysql & Redis database credentials

  • Navigate to the new config file on each server (~/plugins/HuskSync/config.yml on Spigot, ~/config/husksync/config.yml on Fabric)
  • Under credentials in the database section, enter the credentials of your (MySQL/MariaDB/MongoDB/PostgreSQL) Database. You shouldn't touch the connection_pool properties.
  • Under credentials in the redis section, enter the credentials of your Redis Database. If your Redis server doesn't have a password, leave the password blank as it is.
  • Unless you want to have multiple clusters of servers within your network, each with separate user data, you should not change the value of cluster_id.
Important — MongoDB Users
  • Navigate to the HuskSync config file on each server (~/plugins/HuskSync/config.yml)
  • Set type in the database section to MONGO
  • Under credentials in the database section, enter the credentials of your MongoDB Database. You shouldn't touch the connection_pool properties.
Additional configuration for MongoDB Atlas users
  • Navigate to the HuskSync config file on each server (~/plugins/HuskSync/config.yml)
  • Set using_atlas in the mongo_settings section to true.
  • Remove &authSource=HuskSync from parameters in the mongo_settings.

(The port setting in credentials is disregarded when using Atlas.)

4. Set server names in server.yml files

  • Navigate to the server name file on each server (~/plugins/HuskSync/server.yml on Spigot, ~/config/husksync/server.yml on Fabric)
  • 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. Start every server again

  • Provided your MySQL and Redis credentials were correct, synchronization should begin as soon as you start your servers again.
  • If you need to import data from HuskSync v1.x or MySQLPlayerDataBridge, please see the guides below: