Skip to content

Commit 2811f2e

Browse files
committed
Squashed commit of the following:
commit fde6524 Author: MD <[email protected]> Date: Wed Sep 1 18:37:46 2021 +0100 Fix error with commands ending in single colon (#4508) Co-authored-by: Josh Roy <[email protected]> commit b288696 Author: triagonal <[email protected]> Date: Thu Sep 2 03:33:43 2021 +1000 Update to bStats v2 (#4350) Co-authored-by: MD <[email protected]> Co-authored-by: Josh Roy <[email protected]> commit 19ca518 Author: Josh Roy <[email protected]> Date: Wed Sep 1 05:26:54 2021 -0700 Replace unneeded inputs with new /ess dump in issue template (#4479) Co-authored-by: MD <[email protected]> commit b86a34c Author: Josh Roy <[email protected]> Date: Wed Sep 1 04:55:37 2021 -0700 Prepare for 2.19.1 dev builds (#4505) commit d145fbc Author: MD <[email protected]> Date: Tue Aug 31 21:27:35 2021 +0100 Require forceSign property even on releases commit 3ca960e Author: Josh Roy <[email protected]> Date: Tue Aug 31 13:04:34 2021 -0400 Release 2.19.0 commit 8bbaf7d Author: MD <[email protected]> Date: Tue Aug 31 16:53:09 2021 +0100 Update Gradle to 7.2; set run-paper to 1.17.1 with toolchain (#4496) :chatting: commit 14c2ab5 Author: Josh Roy <[email protected]> Date: Tue Aug 31 08:34:10 2021 -0700 Add online mode data for /ess dump (#4497) EssentialsX/Website#60 commit 6f20a78 Author: Josh Roy <[email protected]> Date: Tue Aug 31 08:28:44 2021 -0700 Delete (& backup) invalid NPC accounts created by poor econ code (#4490) Co-authored-by: MD <[email protected]> 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 commit 4bee159 Author: Josh Roy <[email protected]> Date: Sat Aug 28 09:32:45 2021 -0700 Fix economy usernames being unsanitized in some places (#4484) Co-authored-by: MD <[email protected]> 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 commit e4c179f Author: pop4959 <[email protected]> Date: Sat Aug 28 08:46:38 2021 -0700 Allow auto equip in nbt serialized kits (#4491) Co-authored-by: Josh Roy <[email protected]> commit 4811eb1 Author: Josh Roy <[email protected]> Date: Fri Aug 27 13:50:41 2021 -0700 Fix /ess dump on 1.8.8 (#4489) Fixes #4487 pain commit 69850d8 Author: Josh Roy <[email protected]> Date: Thu Aug 26 13:12:52 2021 -0700 Fix NoClassDefFoundError on < 1.12 with Discord execute command (#4478) commit df88a89 Author: Josh Roy <[email protected]> Date: Thu Aug 26 13:09:16 2021 -0700 Add missing translation for argument pipe color (#4480) commit c746a1c Author: Josh Roy <[email protected]> Date: Tue Aug 24 03:35:53 2021 -0700 Bump Configurate (#4475) Some performance improvements, <3 zml commit ecdaed7 Author: Flask Bot <[email protected]> Date: Thu Aug 19 21:11:35 2021 +0100 New Crowdin updates (#4281) commit c062651 Author: CyberKitsune <[email protected]> Date: Thu Aug 19 13:00:06 2021 -0700 Add option for tab complete to use displaynames (#4432) Co-authored-by: MD <[email protected]> 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. commit 3692740 Author: Josh Roy <[email protected]> Date: Thu Aug 19 12:35:19 2021 -0700 Add `/ess dump` command to generate a debug dump output (#4361) Co-authored-by: MD <[email protected]> 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 commit 1179caa Author: Josh Roy <[email protected]> Date: Thu Aug 12 04:37:19 2021 -0700 Fix bot-command-relay option not ignoring itself (#4453) commit 35b1a28 Author: Josh Roy <[email protected]> Date: Tue Aug 10 07:51:33 2021 -0700 Fix improper MOTD delay check (#4454) commit 36432c6 Author: Josh Roy <[email protected]> Date: Mon Aug 9 14:30:30 2021 -0700 Fix NPE on webhooks messages with show-webhook-messages enabled (#4452) Co-authored-by: MD <[email protected]> Fixes #4451. commit 871e718 Author: Josh Roy <[email protected]> Date: Mon Aug 9 13:23:49 2021 -0700 Add online/unique placeholders to join/leave formats for discord (#4427) commit 4229359 Author: Josh Roy <[email protected]> Date: Mon Aug 9 12:56:38 2021 -0700 Add config option to disable verbose usage strings (#4396) Co-authored-by: MD <[email protected]> ```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. commit ac8a13f Author: Josh Roy <[email protected]> Date: Mon Aug 9 12:48:43 2021 -0700 Add name parameter for Discord avatar URL (#4369) Allows offline mode/Geyser users to configure their own avatar URL using a service that accepts usernames. commit d56ecaa Author: Josh Roy <[email protected]> Date: Mon Aug 9 12:39:55 2021 -0700 Allow world name fallback for LazyLocation (#4428) Co-authored-by: MD <[email protected]> commit 14fbfe3 Author: Josh Roy <[email protected]> Date: Mon Aug 9 12:22:09 2021 -0700 Allow disabling MOTD task and cancel on player logout (#4411) 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. commit 5334a3f Author: Josh Roy <[email protected]> Date: Mon Aug 9 12:14:15 2021 -0700 Move update check message out of MOTD task (#4410) Update message will now show after mail, and will not be affected by insane MOTD delays. commit 2fa9c64 Author: Josh Roy <[email protected]> Date: Mon Aug 9 11:59:36 2021 -0700 Fix disabled-commands not removing aliases (#4399) Fixes #4383, an issue where only the main command name is disabled instead of the alias specified in `config.yml`. commit c221e96 Author: Josh Roy <[email protected]> Date: Mon Aug 9 11:57:03 2021 -0700 Make discord chat format world name use world alias (#4419) commit 26c016f Author: Josh Roy <[email protected]> Date: Mon Aug 9 11:48:01 2021 -0700 Add config option to allow webhooks/bots to send commands (#4442) ```yml # Console relay settings # The console relay sends every message shown in the console to a Discord channel. console: ... # Set to true if bots/webhooks should be able to send commands through the command relay. bot-command-relay: false ``` commit b6a08ec Author: Josh Roy <[email protected]> Date: Mon Aug 9 11:44:13 2021 -0700 Fix force-disable-teleport-safety enforcing world border (#4371) commit 9179c6c Author: Josh Roy <[email protected]> Date: Mon Aug 9 11:38:04 2021 -0700 Update EssXDiscord tutorial for new developer mode location (#4409) commit 3f9aceb Author: Josh Roy <[email protected]> Date: Sat Aug 7 17:22:12 2021 -0400 Add DiscordService#sendChatMessage Allows plugins to send messages to the chat channel via API using the format from our config commit 3da8efa Author: Josh Roy <[email protected]> Date: Sat Aug 7 11:40:06 2021 -0400 Fix incorrect parameter name for allowGroupMentions
1 parent ae4d222 commit 2811f2e

File tree

84 files changed

+4024
-961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+4024
-961
lines changed

.github/ISSUE_TEMPLATE/report-a-bug.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,10 @@ body:
2222
validations:
2323
required: true
2424

25-
- type: textarea
26-
attributes:
27-
label: "`/ess version` output"
28-
description: Run `/ess version` in the console, then copy and paste the full output of the command into this box.
29-
validations:
30-
required: true
31-
- type: input
32-
attributes:
33-
label: Server startup log
34-
description: Upload your server startup log (from the start of `latest.log` up to where it says "Done!") to either https://paste.gg or https://gist.github.com, save and then paste the link in this box.
35-
placeholder: "Example: https://paste.gg/p/anonymous/109dd6a10a734a3aa430d5a351ea5210"
36-
validations:
37-
required: true
3825
- type: input
3926
attributes:
40-
label: EssentialsX config files
41-
description: Upload your EssentialsX `config.yml` (and any other relevant files like `kits.yml`) to either https://paste.gg or https://gist.github.com, save and then paste the link in this box. If you included those files in the same paste as your startup log, paste the same link here.
42-
placeholder: "Example: https://paste.gg/p/anonymous/109dd6a10a734a3aa430d5a351ea5210"
27+
label: "`/ess dump *` output"
28+
description: Run `/ess dump *` in the console, then copy and paste the link from the output of the command into this box. (If this command doesn't work, you should [update EssentialsX](https://essentialsx.net/downloads.html) and try again.)
4329
validations:
4430
required: true
4531
- type: input

Essentials/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ dependencies {
1010

1111
api 'io.papermc:paperlib:1.0.6'
1212

13-
implementation 'org.spongepowered:configurate-yaml:4.1.1'
13+
api 'org.bstats:bstats-bukkit:2.2.1'
14+
15+
implementation 'org.spongepowered:configurate-yaml:4.1.2'
1416
implementation 'org.checkerframework:checker-qual:3.14.0'
1517

1618
// Providers
@@ -28,6 +30,7 @@ shadowJar {
2830
dependencies {
2931
include (dependency('io.papermc:paperlib'))
3032
include (dependency('org.bstats:bstats-bukkit'))
33+
include (dependency('org.bstats:bstats-base'))
3134
include (dependency('org.spongepowered:configurate-yaml'))
3235
include (dependency('org.spongepowered:configurate-core'))
3336
include (dependency('org.yaml:snakeyaml'))
@@ -39,7 +42,7 @@ shadowJar {
3942
include (project(':providers:1_8Provider'))
4043
}
4144
relocate 'io.papermc.lib', 'com.earth2me.essentials.paperlib'
42-
relocate 'org.bstats.bukkit', 'com.earth2me.essentials.metrics'
45+
relocate 'org.bstats', 'com.earth2me.essentials.libs.bstats'
4346
relocate 'org.spongepowered.configurate', 'com.earth2me.essentials.libs.configurate'
4447
relocate 'org.yaml.snakeyaml', 'com.earth2me.essentials.libs.snakeyaml'
4548
relocate 'io.leangen.geantyref', 'com.earth2me.essentials.libs.geantyref'

Essentials/src/main/java/com/earth2me/essentials/AlternativeCommandsHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public final void addPlugin(final Plugin plugin) {
3333
return;
3434
}
3535
for (final Map.Entry<String, Command> entry : getPluginCommands(plugin).entrySet()) {
36-
final String commandName = entry.getKey().contains(":") ? entry.getKey().split(":")[1] : entry.getKey();
36+
final String[] commandSplit = entry.getKey().split(":", 2);
37+
final String commandName = commandSplit.length > 1 ? commandSplit[1] : entry.getKey();
3738
final Command command = entry.getValue();
3839

3940
final List<Command> pluginCommands = altcommands.computeIfAbsent(commandName.toLowerCase(Locale.ENGLISH), k -> new ArrayList<>());

Essentials/src/main/java/com/earth2me/essentials/AsyncTeleport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ protected void nowAsync(final IUser teleportee, final ITarget target, final Tele
183183
}
184184

185185
final Location targetLoc = target.getLocation();
186-
if (ess.getSettings().isTeleportSafetyEnabled() && LocationUtil.isBlockOutsideWorldBorder(targetLoc.getWorld(), targetLoc.getBlockX(), targetLoc.getBlockZ())) {
186+
if (ess.getSettings().isTeleportSafetyEnabled() && !ess.getSettings().isForceDisableTeleportSafety() && LocationUtil.isBlockOutsideWorldBorder(targetLoc.getWorld(), targetLoc.getBlockX(), targetLoc.getBlockZ())) {
187187
targetLoc.setX(LocationUtil.getXInsideWorldBorder(targetLoc.getWorld(), targetLoc.getBlockX()));
188188
targetLoc.setZ(LocationUtil.getZInsideWorldBorder(targetLoc.getWorld(), targetLoc.getBlockZ()));
189189
}

Essentials/src/main/java/com/earth2me/essentials/Essentials.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import net.ess3.api.ISettings;
5050
import net.ess3.nms.refl.providers.ReflFormattedCommandAliasProvider;
5151
import net.ess3.nms.refl.providers.ReflKnownCommandsProvider;
52+
import net.ess3.nms.refl.providers.ReflOnlineModeProvider;
5253
import net.ess3.nms.refl.providers.ReflPersistentDataProvider;
5354
import net.ess3.nms.refl.providers.ReflServerStateProvider;
5455
import net.ess3.nms.refl.providers.ReflSpawnEggProvider;
@@ -165,6 +166,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
165166
private transient MaterialTagProvider materialTagProvider;
166167
private transient SyncCommandsProvider syncCommandsProvider;
167168
private transient PersistentDataProvider persistentDataProvider;
169+
private transient ReflOnlineModeProvider onlineModeProvider;
168170
private transient Kits kits;
169171
private transient RandomTeleport randomTeleport;
170172
private transient UpdateChecker updateChecker;
@@ -406,6 +408,8 @@ public void onEnable() {
406408
persistentDataProvider = new ReflPersistentDataProvider(this);
407409
}
408410

411+
onlineModeProvider = new ReflOnlineModeProvider();
412+
409413
execTimer.mark("Init(Providers)");
410414
reload();
411415

@@ -770,12 +774,12 @@ public boolean onCommandEssentials(final CommandSender cSender, final Command co
770774
sender.sendMessage(tl("commandHelpLine1", commandLabel));
771775
sender.sendMessage(tl("commandHelpLine2", command.getDescription()));
772776
sender.sendMessage(tl("commandHelpLine3"));
773-
if (!cmd.getUsageStrings().isEmpty()) {
777+
if (getSettings().isVerboseCommandUsages() && !cmd.getUsageStrings().isEmpty()) {
774778
for (Map.Entry<String, String> usage : cmd.getUsageStrings().entrySet()) {
775779
sender.sendMessage(tl("commandHelpLineUsage", usage.getKey().replace("<command>", commandLabel), usage.getValue()));
776780
}
777781
} else {
778-
sender.sendMessage(command.getUsage());
782+
sender.sendMessage(command.getUsage().replace("<command>", commandLabel));
779783
}
780784
if (!ex.getMessage().isEmpty()) {
781785
sender.sendMessage(ex.getMessage());
@@ -1260,6 +1264,11 @@ public PersistentDataProvider getPersistentDataProvider() {
12601264
return persistentDataProvider;
12611265
}
12621266

1267+
@Override
1268+
public ReflOnlineModeProvider getOnlineModeProvider() {
1269+
return onlineModeProvider;
1270+
}
1271+
12631272
@Override
12641273
public PluginCommand getPluginCommand(final String cmd) {
12651274
return this.getCommand(cmd);

Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
import java.util.Locale;
6767
import java.util.Map.Entry;
6868
import java.util.Set;
69+
import java.util.UUID;
70+
import java.util.concurrent.ConcurrentHashMap;
6971
import java.util.logging.Level;
7072
import java.util.logging.Logger;
7173
import java.util.regex.Pattern;
@@ -75,6 +77,7 @@
7577
public class EssentialsPlayerListener implements Listener, FakeAccessor {
7678
private static final Logger LOGGER = Logger.getLogger("Essentials");
7779
private final transient IEssentials ess;
80+
private final ConcurrentHashMap<UUID, Integer> pendingMotdTasks = new ConcurrentHashMap<>();
7881

7982
public EssentialsPlayerListener(final IEssentials parent) {
8083
this.ess = parent;
@@ -216,6 +219,11 @@ public void onPlayerMove(final PlayerMoveEvent event) {
216219
public void onPlayerQuit(final PlayerQuitEvent event) {
217220
final User user = ess.getUser(event.getPlayer());
218221

222+
final Integer pendingId = pendingMotdTasks.remove(user.getUUID());
223+
if (pendingId != null) {
224+
ess.getScheduler().cancelTask(pendingId);
225+
}
226+
219227
if (hideJoinQuitMessages() || (ess.getSettings().allowSilentJoinQuit() && user.isAuthorized("essentials.silentquit"))) {
220228
event.setQuitMessage(null);
221229
} else if (ess.getSettings().isCustomQuitMessage() && event.getQuitMessage() != null) {
@@ -360,12 +368,14 @@ public void run() {
360368

361369
ess.runTaskAsynchronously(() -> ess.getServer().getPluginManager().callEvent(new AsyncUserDataLoadEvent(user, effectiveMessage)));
362370

363-
final int motdDelay = ess.getSettings().getMotdDelay() / 50;
364-
final DelayMotdTask motdTask = new DelayMotdTask(user);
365-
if (motdDelay > 0) {
366-
ess.scheduleSyncDelayedTask(motdTask, motdDelay);
367-
} else {
368-
motdTask.run();
371+
if (ess.getSettings().getMotdDelay() >= 0) {
372+
final int motdDelay = ess.getSettings().getMotdDelay() / 50;
373+
final DelayMotdTask motdTask = new DelayMotdTask(user);
374+
if (motdDelay > 0) {
375+
pendingMotdTasks.put(user.getUUID(), ess.scheduleSyncDelayedTask(motdTask, motdDelay));
376+
} else {
377+
motdTask.run();
378+
}
369379
}
370380

371381
if (!ess.getSettings().isCommandDisabled("mail") && user.isAuthorized("essentials.mail")) {
@@ -378,6 +388,14 @@ public void run() {
378388
}
379389
}
380390

391+
if (user.isAuthorized("essentials.updatecheck")) {
392+
ess.runTaskAsynchronously(() -> {
393+
for (String str : ess.getUpdateChecker().getVersionMessages(false, false)) {
394+
user.sendMessage(str);
395+
}
396+
});
397+
}
398+
381399
if (user.isAuthorized("essentials.fly.safelogin")) {
382400
user.getBase().setFallDistance(0);
383401
if (LocationUtil.shouldFly(user.getLocation())) {
@@ -419,6 +437,8 @@ class DelayMotdTask implements Runnable {
419437

420438
@Override
421439
public void run() {
440+
pendingMotdTasks.remove(user.getUUID());
441+
422442
IText tempInput = null;
423443

424444
if (!ess.getSettings().isCommandDisabled("motd")) {
@@ -440,14 +460,6 @@ public void run() {
440460
final TextPager pager = new TextPager(output, true);
441461
pager.showPage("1", null, "motd", user.getSource());
442462
}
443-
444-
if (user.isAuthorized("essentials.updatecheck")) {
445-
ess.runTaskAsynchronously(() -> {
446-
for (String str : ess.getUpdateChecker().getVersionMessages(false, false)) {
447-
user.sendMessage(str);
448-
}
449-
});
450-
}
451463
}
452464
}
453465
}

0 commit comments

Comments
 (0)