Add ability to require permission to send-on-login
This commit is contained in:
parent
0f9c3f053c
commit
5849f05a69
@ -80,6 +80,12 @@ public class ProxyConfiguration {
|
|||||||
return this.sendOnLogin;
|
return this.sendOnLogin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Comment("Require players to have the authmevelocity.send-on-login permission?")
|
||||||
|
private boolean requirePermission = false;
|
||||||
|
public boolean isRequirePermission() {
|
||||||
|
return this.requirePermission;
|
||||||
|
}
|
||||||
|
|
||||||
@Comment("""
|
@Comment("""
|
||||||
List of servers to send
|
List of servers to send
|
||||||
One of these servers will be chosen at random""")
|
One of these servers will be chosen at random""")
|
||||||
|
@ -134,6 +134,10 @@ public final class PluginMessageListener implements Listener<PluginMessageEvent>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (plugin.config().get().sendOnLogin().isRequirePermission() && !player.hasPermission("authmevelocity.send-on-login")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
eventManager.fire(new PreSendOnLoginEvent(player, loginServer, toSend.object()))
|
eventManager.fire(new PreSendOnLoginEvent(player, loginServer, toSend.object()))
|
||||||
.thenAccept(event -> {
|
.thenAccept(event -> {
|
||||||
if (!event.getResult().isAllowed()) {
|
if (!event.getResult().isAllowed()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user