Spigot: programmatically add Geyser permissions and fix reloading

This commit is contained in:
Camotoy 2022-05-06 15:32:43 -04:00
parent 05e98c3a10
commit f38c1fbc0f
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
8 changed files with 67 additions and 35 deletions

View file

@ -86,4 +86,13 @@ public abstract class GeyserCommand {
public boolean isBedrockOnly() {
return false;
}
/**
* Used for permission defaults on server implementations.
*
* @return if this command is designated to be used only by server operators.
*/
public boolean isSuggestedOpOnly() {
return false;
}
}

View file

@ -145,4 +145,9 @@ public class DumpCommand extends GeyserCommand {
public List<String> getSubCommands() {
return Arrays.asList("offline", "full", "logs");
}
@Override
public boolean isSuggestedOpOnly() {
return true;
}
}

View file

@ -51,4 +51,9 @@ public class ListCommand extends GeyserCommand {
sender.sendMessage(message);
}
@Override
public boolean isSuggestedOpOnly() {
return true;
}
}

View file

@ -54,4 +54,9 @@ public class ReloadCommand extends GeyserCommand {
geyser.getSessionManager().disconnectAll("geyser.commands.reload.kick");
geyser.reload();
}
@Override
public boolean isSuggestedOpOnly() {
return true;
}
}

View file

@ -54,4 +54,9 @@ public class StopCommand extends GeyserCommand {
geyser.getBootstrap().onDisable();
}
@Override
public boolean isSuggestedOpOnly() {
return true;
}
}

View file

@ -100,4 +100,9 @@ public class VersionCommand extends GeyserCommand {
}
}
}
@Override
public boolean isSuggestedOpOnly() {
return true;
}
}