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>
Adds support for parsing fireworks charges (would previously cause exceptions due to illegal casts to FireworkMeta) and fixes createkit from producing invalid color values
Thanks to triagonal for reporting the exception caused by createkit.
Fixes#1283.
Adds `jail-online-time` config option to only count a player's online time to the jail cap.
This also fixes memory leak in `EssentialsTimer` which I found in the process of testing.
Closes#429.
Adds a config option to have player auto-equip armor from kits.
Also adds a performance improvement for all uses of EnumUtil#getAllMatching by switching it to an EnumSet.
Closes#347, closes#3452.
* Made currency symbol standardized in Kit
* Kits should be in a standardized format.
* Having monetary rewards in kits should not break based off of a config value oriented around currency display (suffix).
* Additionally, the dollar sign should be the standard money symbol which works on all servers and should not be tied to the server's individual currency symbol.
* Note that the server's individual currency symbol will still work but probably should not be used due its volatility.
* Reworked config currency symbol parsing in Settings
* Simplifies the number of actions needed to sanitize the input.
* Now just defaults to `$` if the currency-symbol cannot be parsed.
* Removed symbol-suffixed parsing in NumberUtil#sanitizeCurrencyString
Replace modified bStats Metrics 1.7 class with official 1.8 artifact. 1.8 adds random submit intervals and changes the way submissions are scheduled, and our custom modifications are no longer needed as we now use the plugin ID.
The countless support tickets from users of TacoSpigot (and forks of it)
have become so numerous it's not worth holding our ground on this. Taco fucked up
by going against upstream revision numbers, but as they're defunct, it's not
going to change now. We will not fix server implementations that do this in the
future, but hopefully they have all learned their lesson to use proper
versioning. The way md_5 intended.
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
Closes#2756.
Notes:
- I've kept original name for internal purposes (storing bans, etc), just in case user wants to rename it to something unbearable;
- User can message console via both names (since he can try both, duh);
- Some refactoring. Just a little.
There was a minor issue with one line of code in delhome which was causing the user's homes not to be listed since the condition was effectively reversed. This was also causing an NPE for console senders attempting to tab complete.
Fixes#3774
Uses new method of ray-tracing to target block instead of using BlockIterator which doesn't respect the player looking at a different y-level. Falls back to old BlockIterator method on server versions older than 1.13.2
Fixes#3756.
Co-authored-by: MD <1917406+md678685@users.noreply.github.com>
This PR makes HelpInput use knownCommands in the command map, rather than relying on plugin descriptions. This means that commands that have been registered programmatically (or impromptu) will be recognized and displayed in the help menu.
The ugly reflection is due to Spigot not exposing the command map getter. This has been tested on Spigot 1.8, 1.16.3 and Paper 1.16.3 with plugins that register commands directly to the command map.
Closes#3662
This PR changes the default placeholder `{0}` to username. Display name can still be used with `{5}`.
Before change:
messages.properties
`itemSoldConsole=\u00a7e{0} \u00a7asold\u00a7e {1}\u00a7a for \u00a7e{2} \u00a7a({3} items at {4} each).`
console
`[Essentials] ~test sold dirt for $64 (64 items at $1 each).`
After change:
messages.properties
`itemSoldConsole=\u00a7e{0} \u00a7asold\u00a7e {1}\u00a7a for \u00a7e{2} \u00a7a({3} items at {4} each).`
console
`[Essentials] pop4959 sold dirt for $64 (64 items at $1 each).`
messages.properties
`itemSoldConsole=\u00a7e{5} \u00a7asold\u00a7e {1}\u00a7a for \u00a7e{2} \u00a7a({3} items at {4} each).`
console
`[Essentials] ~test sold dirt for $64 (64 items at $1 each).`
Started looking into #3116 but noticed this issue and wanted to fix it first.
Also added a comment as to why the username is truncated as this took me a long time to figure out and seemed arbitrary. Probably could truncate the username later for trade signs only as other signs don't require any username to be present on the sign. However, for now I simply opted to document.
Fixes#3612, in which `/list`'s tab complete previously revealed the presence of vanished players in certain groups, and fixes#3613 in which `/time set` did not properly check whether the player had permission to change the time.
This PR updates and improves LocationUtil#isBlockDamaging. Notably, the lava check is fixed (it was not working on older versions of Minecraft), many newer materials that were missing damage checks have been added, and the code is a bit cleaner. I've tested this code on MC 1.8 and 1.16 and everything should work correctly.
Adds an `amplifier:<value>` potion meta attribute to MetaItemStack that applies a raw amplifier value, instead of translating inputs between 1 and 3 to match their vanilla names like `power:<value>` does. This matches the Mojang `/effect` command, which doesn't translate any potion effect amplifiers, and allows for creation of level IV potions (using `amplifier:3` instead of a `power` value) through EssentialsX without breaking existing usages of `power:<value>`.
More context for this commit can be found at https://github.com/EssentialsX/Essentials/pull/3592#issuecomment-678656107.
Closes#3592 and fixes#3589.
Co-authored-by: MD <1917406+md678685@users.noreply.github.com>
Fixes#3579 (async `/skull` command)
Fixes#3336 (improve codestyle of commands)
Partially addresses #3339 (`/spawn` and `/setspawn` are now hidden from tabcomplete)
Closes#3087 (`/paytoggle` is now a loop command)
Closes#1332
The spawner delay feature has been broken in Essentials for as long as anyone can remember. The reasons for this are mentioned in the issue above.
This PR fixes this by changing the command to utilize new API for setting the minimum and maximum spawn delay on spawners. This API was added in 1.12.2, so all supported versions before that (1.8.8 thru 1.12.1) require NMS to function properly. I'm aware that Essentials avoids NMS for maintainability reasons, however that should not be of much concern here since all versions 1.12.2 and later are going to be using the Bukkit API. Hence, no NMS updates will be necessary.
Also let me know if you want the NMS code refactored somewhere else. I saw the net.ess3.nms packages, but I wasn't sure where this would fit into the organisation of that.
Tested on:
1.8.8, 1.9.4, 1.10.2, 1.11.2 (NMS)
1.12.2, 1.15.2 (Bukkit API)
Aims to provide a better and less confusing error for users of GeoIP who have not configured properly (which is more common now after the license key requirement). Seems like a lot of people miss the initial error on startup, and so this may help a bit.
Closes#3561.
d9bf099c3d introduced a regression where `/tpaccept` no longer unconditionally cancels the teleportation request when it is accepted. This restores the previous request cancellation behaviour.
Fixes#3563.
Copies the list of viewers before iterating over it to fix a rare CME that is *sometimes* thrown. It's not clear *why* this broke - Spigot seems to have changed behaviour in late 1.15 or 1.16?