From 185b4e266b8ece312c3c8556e23af2eee8fcdeed Mon Sep 17 00:00:00 2001 From: pop4959 Date: Sat, 24 Feb 2024 14:40:22 -0800 Subject: [PATCH] Fix /broadcastworld sending in all but the intended world (#5699) Fixes #5694 This issue was caused by the passed predicate being excludes rather than includes. Also addresses a separate issue where no help output was given when no arguments were specified and the command was sent by a player. --- .../earth2me/essentials/commands/Commandbroadcastworld.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandbroadcastworld.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandbroadcastworld.java index b9156cf8b..93c271dca 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandbroadcastworld.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandbroadcastworld.java @@ -19,13 +19,13 @@ public class Commandbroadcastworld extends EssentialsCommand { @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - if (args.length == 0) { + if (args.length < 2) { throw new NotEnoughArgumentsException(); } World world = user.getWorld(); String message = getFinalArg(args, 0); - if (args.length > 1 && ess.getSettings().isAllowWorldInBroadcastworld()) { + if (ess.getSettings().isAllowWorldInBroadcastworld()) { final World argWorld = ess.getWorld(args[0]); if (argWorld != null) { world = argWorld; @@ -53,7 +53,7 @@ public class Commandbroadcastworld extends EssentialsCommand { if (message.isEmpty()) { throw new NotEnoughArgumentsException(); } - ess.broadcastTl(null, u -> u.getBase().getWorld().equals(world), true, "broadcast", message, AdventureUtil.parsed(AdventureUtil.legacyToMini(name))); + ess.broadcastTl(null, u -> !u.getBase().getWorld().equals(world), true, "broadcast", message, AdventureUtil.parsed(AdventureUtil.legacyToMini(name))); } @Override