diff --git a/common/src/main/java/me/lucko/luckperms/common/actionlog/LogDispatcher.java b/common/src/main/java/me/lucko/luckperms/common/actionlog/LogDispatcher.java index 1ef9ede8..105f91c5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/actionlog/LogDispatcher.java +++ b/common/src/main/java/me/lucko/luckperms/common/actionlog/LogDispatcher.java @@ -105,7 +105,7 @@ public class LogDispatcher { public void dispatchFromRemote(ExtendedLogEntry entry) { boolean shouldCancel = !this.plugin.getConfiguration().get(ConfigKeys.BROADCAST_RECEIVED_LOG_ENTRIES) || !this.plugin.getConfiguration().get(ConfigKeys.LOG_NOTIFY); if (!this.plugin.getEventFactory().handleLogBroadcast(shouldCancel, entry, LogBroadcastEvent.Origin.REMOTE)) { - broadcast(entry, LogNotifyEvent.Origin.LOCAL_API, null); + broadcast(entry, LogNotifyEvent.Origin.REMOTE, null); } } } diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/log/LogNotify.java b/common/src/main/java/me/lucko/luckperms/common/commands/log/LogNotify.java index 90944fc2..143cbc09 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/log/LogNotify.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/log/LogNotify.java @@ -45,6 +45,8 @@ import java.util.Optional; import java.util.UUID; public class LogNotify extends SubCommand { + private static final String IGNORE_NODE = "luckperms.log.notify.ignoring"; + public LogNotify(LocaleManager locale) { super(CommandSpec.LOG_NOTIFY.localize(locale), "notify", CommandPermission.LOG_NOTIFY, Predicates.notInRange(0, 1)); } @@ -56,7 +58,7 @@ public class LogNotify extends SubCommand { } Optional ret = user.enduringData().immutable().get(ContextSet.empty()).stream() - .filter(n -> n.getPermission().equalsIgnoreCase("luckperms.log.notify.ignoring")) + .filter(n -> n.getPermission().equalsIgnoreCase(IGNORE_NODE)) .findFirst(); // if they don't have the perm, they're not ignoring @@ -72,10 +74,10 @@ public class LogNotify extends SubCommand { if (state) { // add the perm - user.setPermission(NodeFactory.make("luckperms.log.notify.ignoring")); + user.setPermission(NodeFactory.make(IGNORE_NODE)); } else { // remove the perm - user.removeIf(ContextSet.empty(), n -> n.getPermission().equalsIgnoreCase("luckperms.log.notify.ignoring")); + user.removeIf(ContextSet.empty(), n -> n.getPermission().equalsIgnoreCase(IGNORE_NODE)); } plugin.getStorage().saveUser(user).join(); diff --git a/common/src/main/java/me/lucko/luckperms/common/sender/AbstractSender.java b/common/src/main/java/me/lucko/luckperms/common/sender/AbstractSender.java index f9990af0..2d1f2b22 100644 --- a/common/src/main/java/me/lucko/luckperms/common/sender/AbstractSender.java +++ b/common/src/main/java/me/lucko/luckperms/common/sender/AbstractSender.java @@ -34,7 +34,6 @@ import me.lucko.luckperms.common.utils.TextUtils; import net.kyori.text.Component; import java.lang.ref.WeakReference; -import java.util.Optional; import java.util.UUID; /** @@ -133,11 +132,6 @@ public final class AbstractSender implements Sender { return this.reference.get() != null; } - @Override - public Optional getHandle() { - return Optional.ofNullable(this.reference.get()); - } - @Override public boolean equals(Object o) { if (o == this) return true; diff --git a/common/src/main/java/me/lucko/luckperms/common/sender/Sender.java b/common/src/main/java/me/lucko/luckperms/common/sender/Sender.java index 3cc77ce4..213874df 100644 --- a/common/src/main/java/me/lucko/luckperms/common/sender/Sender.java +++ b/common/src/main/java/me/lucko/luckperms/common/sender/Sender.java @@ -33,7 +33,6 @@ import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import net.kyori.text.Component; -import java.util.Optional; import java.util.UUID; /** @@ -156,14 +155,4 @@ public interface Sender { return true; } - /** - * Gets the handle object for this sender. (In most cases, the real - * CommandSender/CommandSource object from the platform) - * - * @return the handle - */ - default Optional getHandle() { - return Optional.empty(); - } - }