This PR adds support for players to receive multiple teleport requests, which are queued and can be managed independently of one another.
All commands should retain their current behavior but have some new additions;
* `/tpaccept`: now allows you to specify a player or `*` to accept a specific player's or all players' teleport request(s) respectively.
- Using a wildcard will only accept all tpahere requests, as players can't teleport to multiple places simultaneously.
* `/tpdeny`: now allows you to specify a player or `*` to deny a specific player's or all players' teleport request(s) respectively.
This PR also adds a new setting for the maximum amount of pending TPA requests a user can have at once.
```yml
# The maximum amount of simultaneous tpa requests that can be pending for any given user.
# Once at this threshold, any new tpa requests will bump the oldest tpa requests out of queue.
# Defaults to 5.
tpa-max-amount: 5
```
Closes#3769Closes#1550
Co-authored-by: Mariell Hoversholm <proximyst@proximy.st>
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
Since the Configurate rewrite, we hold locations using `LazyLocation`, which is converted to a `Location` with world lookups on demand; as such we no longer need to reload configs on each world load since invalid locations will now softly fail.
Adds `essentials.seen.uuid` permission requirement to show uuids in `/seen`. People were complaining this cluttered it so whatever. Also adds said permission to the `essentials.seen.extra` permission group.
Closes#4499.
Adds a message type which will show when a player runs the /action (/me) command.
Message Type:
```yml
# Configure which Discord channels different messages will be sent to.
# You can either use the names of the channels listed above or just the id of a channel.
# If an invalid channel is used, the primary channel will be used instead.
#
# To disable a message from showing, use 'none' as the channel name.
message-types:
...
# Action messages sent when a player runs the /me or /action commands.
action: primary
```
Message Format:
```yml
# The following entries allow you to customize the formatting of messages sent by the plugin.
# Each message has a description of how it is used along with placeholders that can be used.
messages:
...
# This is the message sent to Discord when a player runs the /me or /action command.
# The following placeholders can be used here:
# - {username}: The name of the user who ran the command
# - {displayname}: The display name of the user who ran the command
# - {action}: The action (message) the user used in the command.
# ... PlaceholderAPI placeholders are also supported here too!
action: ":person_biking: {displayname} *{action}*"
```
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
my magnum opus
---
* Delete (& backup) invalid NPC accounts created by poor econ code
* Add feedback for large migrations
* Improve feedback messages
- Improve the wording of console messages
- Include details about how to resume purging userdata in case it gets interrupted
- Scale the message delay based on the number of userdata files to be processed
- Always cancel the repeating task and shut down the executor when we're done
* Update Essentials/src/main/java/com/earth2me/essentials/EssentialsUpgrade.java
* Add less ranty context to rant
At least I had caffeine before writing this
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
This PR fixes various issues with NPC accounts:
- Fixes some NPC account names not being sanitised
- Fixes wrong keys being used when manually generating a NPC account file
- Adds some debug logging to `UserMap` name lookups
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
This feature adds a new configuration option, `change-tab-complete-name`
When `change-tab-complete-name` is turned on, `getPlayers()` in `EssentialsCommand` will use `getDisplayName()` instead of `getName()`; populating the list with display names instead of player names.
Closes#4431.
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
Command usage: /essentials dump [config] [discord] [kits] [log]
Either of the optional args can be used to add the given data to the dump.
Related: EssentialsX/Website#51
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
```yml
# Whether or not Essentials should show detailed command usages.
# If set to false, Essentials will collapse all usages in to one single usage message.
verbose-command-usages: true
```
This PR also fixes a regression in legacy usage strings where the `<command>` wasn't replaced.
This PR allows setting `delay-motd` to a negative value in `config.yml` to disable the MOTD join task without disabling `/motd`, and fixes an issue where delayed MOTD tasks would run even after a player logged out (in case someone previously set an insanely high MOTD delay to "disable" the MOTD on join).
Fixes#4408.
Turns out that when you depend on a plugin, get this, the plugin will load before you. So we need to rework how we do things here.
Fixes#4075Fixes#4304
* New `/mail sendtemp <time diff> <message>` command to send mail that will self-destruct after time diff.
* New `/mail clear <number>` command to clear a specific mail item.
* `/mail read` now tracks which mails you read and won't nag you about them.
* A bunch of other flexibility since we store actual data instead of strings
This PR fixes a long-standing bug where using the `a:` or `r:` modes in `/powertool` with no commands already set on the item would result in an NPE. To prevent this, the powertool command list is now immediately initialized if it doesn't exist upon retrieval.
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
This PR makes use of Paper's item serialization to serialize items into base64 allowing for all items to be properly stored without needing to manual write in special cases for every complex item. There is a config option to disable using this new serialization and use the legacy ItemDB serializer since the new serializer removes the ability to manually edit/read kits.
Defaults to not enabled
Note: The new serializer places an @ sign in front of items serialized by the new format in order to quickly determine what is serialized by the new serializer and also to retain backward compatibility with the old serializer.
Att #3114
Att #2867
Att #1694
Att #31
Att #1283
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
Co-authored-by: Riley Park <riley.park@meino.net>
Co-authored-by: zml <zml@aoeu.xyz>
Migrates all uses of SnakeYAML and Bukkit's Configuration API to Sponge's Configurate.
Configurate enables us to the do the following stuff:
* Serialize YAML off the main thread
* (in the future) Automatically update our config
* (in the future) Manipulate comments in configs
* Be epic
This commit also *finally* strips out the 3.x storage/object mapping system in favour of Configurate's object mapper.
Adds run-paper plugin support as well as moves majority of logic to kotlin build scrips
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
This bug occurs when a player has joined before EssentialsX was installed and a player account creation is requested through Vault while they are offline.
Fixes#4195
This PR itself does nothing on its own but creates the underlying backbone I need to make a less hacky solution in #3963 lmfao.
This PR creates a provider which uses NBT on 1.8.8-1.13 to mimic the exact structure of a PersistentDataContainer on 1.14+ which will allow us make any possible upgrades (which don't die from the lack of DFU on >1.13) work as expected. Additionally, this does not use reflection on modern Minecraft versions and thus will not need to be maintained/updated on MC version updates.
In the future, we will need to find a way to store data on tile entities (signs namely) so that we are able to store UUIDs on signs for future plans, but for now ItemStacks work to fix our spawner issues.
Removed an extraneous name->uuid check
This check swallowed any warnings spit out by UserMap#trackUUID causing problems
for plugins which didn't check the success of this method and thus leading to
possible stack overflow exceptions or other unexpected behavior
Actually save accounts created with VaultEconomyProvider#createPlayerAccount
Complete oversight as I was under the impression tracking the UUID would create
the files for us.
This commit:
- Implements a new provider for VaultAPI's `Economy`
- The legacy provider built into Vault uses player names, and has not changed since Vault was invented in 1864.
- This properly supports UUIDs and works more predictably with EssentialsX.
- Replaces the Register method economy abstraction layer abstraction layer with a new `EconomyLayer` economy abstraction layer abstraction layer.
- This opens the pathway for future economy abstraction layers to be supported.
- This change also removes dubiously-licensed code from the project.
For users encountering userdata issues on this build, see this FAQ entry:
https://github.com/EssentialsX/Essentials/issues/3956#issuecomment-779254544Fixes#4110.
Closes#3344.
Closes#2401.
This PR fixes issues related to timed teleports. All timed teleports before this PR would create their own future to send back to the AsyncTeleport api causing the futures returned in the base methods never being completed.
This PR pases the future returned in AsyncTeleport methods to the timed teleport and completes it after the timed teleport has been completed.
Fixes#4065.
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
Adds an update checker to Essentials that will check for the latest version on startup, on player join (permission is `essentials.updatecheck`), or manually with `/ess version`.
On startup, the update checker will fetch build information from a resource generated at compile time and determine if the build is a dev or stable build. If it's a stable build, the update checker will only check for a new release; while a dev build will check for any new commits.
There are 6 different types of messages the update checker will return;
* Identical: The current build is the latest stable release or latest dev build. This message is only shown in the `/ess version` command.
* Behind: If the current build is stable, it's an entire stable build behind, otherwise it's one or more dev builds behind.
* Diverged: The current build was made from a branch other than `2.x` and is also one or more dev builds behind the latest commit on `2.x`.
* Diverged Latest: The current build was made from a branch other than `2.x` but is based on the latest commit from `2.x`.
* Unknown: The current build either has invalid build information or was customly built. This message is show everywhere but on player join.
* Error: There was an error while fetching the latest version information.
Update checks can be disabled using the `update-check` option in `config.yml`.
Adds `copy` and `paste` subcommands to `/editsign` to allow users to copy and paste the contents of signs without having to use the tab-completion output of `/editsign set`.
The `/editsign copy` command will also perform format-permission checks to ensure the user copying the sign has the proper permission to use said formatting.
Closes#3973.
Fixes a behavior previously possible before c6de771
I wrote the proper logic in c6de771 to handle blank currency symbols but forgot to remove the Settings check that was preventing blank currency symbols.
Fixes#3945.
Co-authored-by: Mariell <proximyst@proximyst.com>
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
This moves storage of balances from the baltop command into the UserMap. This was needed by Glare to able to get a hold of all users balances without causing jvm hell on the usermap.
To access this API as an end user;
```java
import net.essentialsx.api.v2.services.BalanceTop;
//...
BalanceTop api = Bukkit.getServer().getServicesManager().load(BalanceTop.class);
```
Closes#3100, closes#3540
This commit improves the logging of a few edge cases that can lead to loss of userdata:
- Third-party plugins forcing creation of a NPC account which could not be found on the usermap, even if the account file exists
- UserMap#trackUUID being called with a conflicting UUID but replace set to false
Adds a config option to allow to prevent socialspy from reading private messages. Useful if all you want from social spy is to read commands defined in the list.
Closes#1095.
Adds `essentials.alts` also to allow server admins to not give mods the ips of users.
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>