refactor: Move to ConfigLib, use lombok (#563)

* refactor: move to configlib, adjust config structure

* fix: huskclaims typos

* fix: don't generate `server.yml` in local mode

* fix: NPE with server name
This commit is contained in:
William authored and GitHub committed 2024-02-12 16:54:23 +00:00
1 parent c55631a30d
commit 1723aa44fc
84 files changed
+4334 -4832

No files matched your search

+112 -83
View File
@@ -19,38 +19,41 @@ This page contains the configuration structure for HuskHomes.
# ┣╸ Information: https://william278.net/project/huskhomes/
# ┣╸ Config Help: https://william278.net/docs/huskhomes/config-files/
# ┗╸ Documentation: https://william278.net/docs/huskhomes/
# Locale of the default language file to use. Docs: https://william278.net/docs/huskhomes/translations
language: en-gb
# Whether to automatically check for plugin updates on startup
check_for_updates: true
# Database settings
database:
# Type of database to use (SQLITE, H2, MYSQL or MARIADB)
# Type of database to use (SQLITE, H2, MYSQL, or MARIADB)
type: SQLITE
mysql:
credentials:
# Specify credentials here if you are using MYSQL or MARIADB as your database type
host: localhost
port: 3306
database: HuskHomes
username: root
password: pa55w0rd
parameters: ?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
connection_pool:
# MYSQL / MARIADB database Hikari connection pool properties. Don't modify this unless you know what you're doing!
size: 12
idle: 12
lifetime: 1800000
keepalive: 30000
timeout: 20000
# Specify credentials here if you are using MYSQL or MARIADB
credentials:
host: localhost
port: 3306
database: huskhomes
username: root
password: pa55w0rd
parameters: ?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
# MYSQL / MARIADB database Hikari connection pool properties
# Don't modify this unless you know what you're doing!
pool_options:
size: 12
idle: 12
lifetime: 1800000
keep_alive: 30000
timeout: 20000
# Names of tables to use on your database. Don't modify this unless you know what you're doing!
table_names:
home_data: huskhomes_homes
player_cooldowns_data: huskhomes_user_cooldowns
player_data: huskhomes_users
position_data: huskhomes_position_data
saved_position_data: huskhomes_saved_positions
teleport_data: huskhomes_teleports
warp_data: huskhomes_warps
PLAYER_DATA: huskhomes_users
PLAYER_COOLDOWNS_DATA: huskhomes_user_cooldowns
POSITION_DATA: huskhomes_position_data
SAVED_POSITION_DATA: huskhomes_saved_positions
HOME_DATA: huskhomes_homes
WARP_DATA: huskhomes_warps
TELEPORT_DATA: huskhomes_teleports
# General settings
general:
# The maximum homes a user can create. Override with the huskhomes.max_homes.<number> permission.
max_homes: 10
@@ -60,9 +63,7 @@ general:
stack_permission_limits: false
# Whether users require a permission (huskhomes.command.warp.<warp_name>) to use warps
permission_restrict_warps: false
# Whether running /sethome <name> or /setwarp <name> when a home/warp already exists should overwrite.
overwrite_existing_homes_warps: true
# How long a player has to stand still and not take damage for when teleporting (in seconds)
# How long a player has to stand still and not take damage for when teleporting (in seconds)
teleport_warmup_time: 5
# Where the teleport warmup timer should display (CHAT, ACTION_BAR, TITLE, SUBTITLE or NONE)
teleport_warmup_display: ACTION_BAR
@@ -70,87 +71,113 @@ general:
teleport_request_expiry_time: 60
# Whether /tpahere should use the location of the sender when sent. Docs: https://william278.net/docs/huskhomes/strict-tpahere/
strict_tpa_here_requests: true
# Whether home or warp names should be case insensitive (i.e. allow /home HomeOne and /home homeone)
case_insensitive_names: false
# Whether home and warp names should be restricted by a regex. Set this to false to allow full UTF-8 names (i.e. allow /home 你好).
restrict_names: true
# Regex which home and warp names must match. Names have a max length of 16 characters
name_regex: '[a-zA-Z0-9-_]*'
# Whether home/warp descriptions should be restricted. Set this to true to restrict UTF-8 usage.
restrict_descriptions: false
# Regex which home and warp descriptions must match. A hard max length of 256 characters is enforced
description_regex: '\A\p{ASCII}*\z'
# Whether /back should work to teleport the user to where they died
back_command_return_by_death: true
# Whether /back should work with other plugins that use the PlayerTeleportEvent (can cause conflicts)
back_command_save_teleport_event: false
# Whether the user should back to spawn when they die (ensure that cross_server.enabled and cross_server.global_respawning are enabled)
always_respawn_at_spawn: true
# How many items should be displayed per-page in chat menu lists
list_items_per_page: 12
# Whether teleportation should be carried out asynchronously (ensuring chunks load before teleporting)
asynchronous_teleports: true
# Whether to play sound effects
play_sound_effects: true
# Which sound effects to play for various actions
sound_effects:
teleport_request_received: entity.experience_orb.pickup
teleportation_cancelled: entity.item.break
teleportation_complete: entity.enderman.teleport
teleportation_warmup: block.note_block.banjo
# Whether to provide modern, rich TAB suggestions for commands (if available)
brigadier_tab_completion: true
# Whether the user should always be put back at the /spawn point when they die (ignores beds/respawn anchors)
always_respawn_at_spawn: false
# Whether teleportation should be carried out async (ensuring chunks load before teleporting)
teleport_async: true
# Settings for home and warp names
names:
# Whether running /sethome <name> or /setwarp <name> when one already exists should overwrite.
overwrite_existing: true
# Whether home or warp names should be case insensitive (i.e. allow /home HomeOne & /home homeone)
case_insensitive: false
# Whether home and warp names should be restricted to a regex filter.Set this to false to allow full UTF-8 names (i.e. allow /home 你好).
restrict: true
# Regex which home and warp names must match. Names have a max length of 16 characters
regex: '[a-zA-Z0-9-_]*'
# Settings for home and warp descriptions
descriptions:
# Whether home/warp descriptions should be restricted to a regex filter. Set this to true to restrict UTF-8 usage.
restrict: false
# Regex which home and warp descriptions must match. A hard max length of 256 characters is enforced
regex: \A\p{ASCII}*\z
# Settings for the /back command
back_command:
# Whether /back should work to teleport the user to where they died
return_by_death: true
# Whether /back should work with other plugins that use the PlayerTeleportEvent (can conflict)
save_on_teleport_event: false
# Settings for sound effects
sound_effects:
# Whether to play sound effects
enabled: true
# Map of sound effect actions to types
types:
TELEPORTATION_COMPLETE: entity.enderman.teleport
TELEPORTATION_WARMUP: block.note_block.banjo
TELEPORTATION_CANCELLED: entity.item.break
TELEPORT_REQUEST_RECEIVED: entity.experience_orb.pickup
# Cross-server settings
cross_server:
# Enable teleporting across your proxy network. Requires database type to be MYSQL
# Whether to enable cross-server mode for teleporting across your proxy network.
enabled: false
# The type of message broker to use for cross-server communication. Options: PLUGIN_MESSAGE, REDIS
messenger_type: PLUGIN_MESSAGE
# Specify a common ID for grouping servers running HuskHomes on your proxy. Don't modify this unless you know what you're doing!
cluster_id: ''
# The cluster ID, for if you're networking multiple separate groups of HuskHomes-enabled servers.
# Do not change unless you know what you're doing
cluster_id: main
# Type of network message broker to ues for data synchronization (PLUGIN_MESSAGE or REDIS)
broker_type: PLUGIN_MESSAGE
# Settings for if you're using REDIS as your message broker
redis:
host: localhost
port: 6379
# Password for your Redis server. Leave blank if you're not using a password.
password: ''
use_ssl: false
# Settings for if you're using Redis Sentinels.
# If you're not sure what this is, please ignore this section.
sentinel:
master_name: ''
# List of host:port pairs
nodes: []
password: ''
# Define a single global /spawn for your network via a warp. Docs: https://william278.net/docs/huskhomes/global-spawn/
global_spawn:
# Define a single global /spawn for your network via a warp. Docs: https://william278.net/docs/huskhomes/global-spawn/
# Whether to define a single global /spawn for your network via a warp.
enabled: false
# The name of the warp to use as the global spawn.
warp_name: Spawn
# Whether player respawn positions should work cross-server. Docs: https://william278.net/docs/huskhomes/global-respawning/
global_respawning: false
redis_credentials:
# Specify credentials here if you are using REDIS as your messenger_type. Docs: https://william278.net/docs/huskhomes/redis-support/
host: localhost
port: 6379
password: ''
use_ssl: false
# Random teleport (/rtp) settings.
rtp:
# Radius around the spawn point in which players cannot be random teleported to
radius: 5000
# Radius of the spawn area in which players cannot be random teleported to
spawn_radius: 500
# Radial region around the /spawn position where players CAN be randomly teleported.
# If no /spawn has been set, (0, 0) will be used instead.
region:
min: 500
max: 5000
# Mean of the normal distribution used to calculate the distance from the center of the world
distribution_mean: 0.75
# Standard deviation of the normal distribution for distributing players randomly
distribution_deviation: 2.0
distribution_standard_deviation: 2.0
# List of worlds in which /rtp is disabled. Please note that /rtp does not work well in the nether.
restricted_worlds:
- world_nether
- world_the_end
- world_nether
- world_the_end
# Action cooldown settings. Docs: https://william278.net/docs/huskhomes/cooldowns
cooldowns:
# Whether to apply a cooldown between performing certain actions
enabled: true
# Set a cooldown between performing actions (in seconds). Docs: https://william278.net/docs/huskhomes/cooldowns/
# Map of cooldown times to actions
cooldown_times:
random_teleport: 600
RANDOM_TELEPORT: 600
# Economy settings. Docs: https://william278.net/docs/huskhomes/economy-hook
economy:
# Enable economy plugin integration (requires Vault)
enabled: false
# Enable economy plugin integration (requires Vault and a compatible Economy plugin)
enabled: true
# Map of economy actions to costs.
economy_costs:
ADDITIONAL_HOME_SLOT: 100.0
MAKE_HOME_PUBLIC: 50.0
RANDOM_TELEPORT: 25.0
# Specify how many homes players can set for free, before they need to pay for more slots
free_home_slots: 5
# Charge money for perform certain actions. Docs: https://william278.net/docs/huskhomes/economy-hook/
costs:
additional_home_slot: 100.0
make_home_public: 50.0
random_teleport: 25.0
# Web map hook settings. Docs: https://william278.net/docs/huskhomes/map-hooks
map_hook:
# Display public homes/warps on your Dynmap, BlueMap or Pl3xMap. Docs: https://william278.net/docs/huskhomes/map-hooks
# Display public homes/warps on your Dynmap, BlueMap or Pl3xMap
enabled: true
# Show public homes on the web map
show_public_homes: true
@@ -170,6 +197,7 @@ You should generate this file in-game with the `/setspawn` command.
# ┃ Server /spawn location cache ┃
# ┃ Edit in-game using /setspawn ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
x: 0.0
y: 64.0
z: 0.0
@@ -186,12 +214,13 @@ world_uuid: 00000000-0000-0000-0000-000000000000
This file is only present if your server uses cross-server mode to run HuskHomes on a proxy network.
```yaml
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ HuskHomes Server ID config ┃
# ┃ HuskHomes - Server ID ┃
# ┃ 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
```