diff --git a/bans-core/src/main/java/space/arim/libertybans/core/alts/AltNotification.java b/bans-core/src/main/java/space/arim/libertybans/core/alts/AltNotification.java index 900834af7..11580ed69 100644 --- a/bans-core/src/main/java/space/arim/libertybans/core/alts/AltNotification.java +++ b/bans-core/src/main/java/space/arim/libertybans/core/alts/AltNotification.java @@ -55,6 +55,6 @@ public void notifyFoundAlts(UUID uuid, String name, NetworkAddress address, List } Component notification = altCheckFormatter.formatMessage( configs.getMessagesConfig().alts().autoShow().header(), name, alts); - envEnforcer.sendToThoseWithPermission("libertybans.alts.autoshow", notification); + envEnforcer.sendToThoseWithPermissionNoPrefix("libertybans.alts.autoshow", notification); } } diff --git a/bans-core/src/main/java/space/arim/libertybans/core/env/AbstractEnvEnforcer.java b/bans-core/src/main/java/space/arim/libertybans/core/env/AbstractEnvEnforcer.java index 8a627a16a..12b8cf963 100644 --- a/bans-core/src/main/java/space/arim/libertybans/core/env/AbstractEnvEnforcer.java +++ b/bans-core/src/main/java/space/arim/libertybans/core/env/AbstractEnvEnforcer.java @@ -60,10 +60,15 @@ protected CentralisedFuture completedVoid() { @Override public final CentralisedFuture sendToThoseWithPermission(String permission, ComponentLike message) { - return sendToThoseWithPermissionNoPrefix(permission, formatter.prefix(message).asComponent()); + return sendToThoseWithPermissionNoPrefix(permission, formatter.prefix(message)); } - private CentralisedFuture sendToThoseWithPermissionNoPrefix(String permission, Component message) { + @Override + public final CentralisedFuture sendToThoseWithPermissionNoPrefix(String permission, ComponentLike message) { + return sendToThoseWithPermissionNoPrefixComponent(permission, message.asComponent()); + } + + private CentralisedFuture sendToThoseWithPermissionNoPrefixComponent(String permission, Component message) { Consumer

callback; if (interlocutor.shouldFilterIpAddresses()) { Component stripped = interlocutor.stripIpAddresses(message); diff --git a/bans-core/src/main/java/space/arim/libertybans/core/env/EnvEnforcer.java b/bans-core/src/main/java/space/arim/libertybans/core/env/EnvEnforcer.java index 38c7806c8..009520541 100644 --- a/bans-core/src/main/java/space/arim/libertybans/core/env/EnvEnforcer.java +++ b/bans-core/src/main/java/space/arim/libertybans/core/env/EnvEnforcer.java @@ -51,6 +51,15 @@ public interface EnvEnforcer<@PlatformPlayer P> { */ CentralisedFuture sendToThoseWithPermission(String permission, ComponentLike message); + /** + * For all players with the specified permission, sends the message. + * + * @param permission the permission + * @param message the message + * @return a future completed when the operation is done + */ + CentralisedFuture sendToThoseWithPermissionNoPrefix(String permission, ComponentLike message); + /** * Searches for a player with the given uuid, if found, invokes the callback * diff --git a/bans-core/src/main/resources/contributors b/bans-core/src/main/resources/contributors index 4cc1baf1b..62ad967c7 100644 --- a/bans-core/src/main/resources/contributors +++ b/bans-core/src/main/resources/contributors @@ -32,6 +32,7 @@ Dejay Deactivation Folas1337 Franciscoyt94 +fuzz hawkfalcon Healthy Kaludi diff --git a/bans-env/standalone/src/main/java/space/arim/libertybans/env/standalone/StandaloneEnforcer.java b/bans-env/standalone/src/main/java/space/arim/libertybans/env/standalone/StandaloneEnforcer.java index b194fc480..8d1d3d5ea 100644 --- a/bans-env/standalone/src/main/java/space/arim/libertybans/env/standalone/StandaloneEnforcer.java +++ b/bans-env/standalone/src/main/java/space/arim/libertybans/env/standalone/StandaloneEnforcer.java @@ -50,6 +50,11 @@ public CentralisedFuture sendToThoseWithPermission(String permission, Comp return completedVoid(); } + @Override + public CentralisedFuture sendToThoseWithPermissionNoPrefix(String permission, ComponentLike message) { + return completedVoid(); + } + @Override public CentralisedFuture doForPlayerIfOnline(UUID uuid, Consumer callback) { return completedVoid();