Merge pull request #126 from RealTriassic/add-sendonlogin-permission
Add ability to require permission to send-on-login
This commit is contained in:
commit
b71666be9f
@ -80,6 +80,12 @@ public class ProxyConfiguration {
|
||||
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("""
|
||||
List of servers to send
|
||||
One of these servers will be chosen at random""")
|
||||
|
@ -15,7 +15,7 @@ repositories {
|
||||
includeGroup("net.byteflux")
|
||||
}
|
||||
}
|
||||
maven("https://maven.elytrium.net/repo/")
|
||||
maven("https://mvn.exceptionflug.de/repository/exceptionflug-public/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -134,6 +134,10 @@ public final class PluginMessageListener implements Listener<PluginMessageEvent>
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.config().get().sendOnLogin().isRequirePermission() && !player.hasPermission("authmevelocity.send-on-login")) {
|
||||
return;
|
||||
}
|
||||
|
||||
eventManager.fire(new PreSendOnLoginEvent(player, loginServer, toSend.object()))
|
||||
.thenAccept(event -> {
|
||||
if (!event.getResult().isAllowed()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user