mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 14:38:49 +00:00
Register permissions on Sponge
This commit is contained in:
1 file changed
+103
@@ -55,6 +55,8 @@ import org.spongepowered.api.event.Listener;
|
||||
import org.spongepowered.api.event.lifecycle.StartingEngineEvent;
|
||||
import org.spongepowered.api.event.lifecycle.StoppingEngineEvent;
|
||||
import org.spongepowered.api.scheduler.Task;
|
||||
import org.spongepowered.api.service.permission.PermissionDescription;
|
||||
import org.spongepowered.api.service.permission.PermissionService;
|
||||
import org.spongepowered.plugin.PluginContainer;
|
||||
import org.spongepowered.plugin.builtin.jvm.Plugin;
|
||||
|
||||
@@ -110,6 +112,107 @@ public final class CarbonChatSponge implements CarbonChat {
|
||||
// Load channels
|
||||
((CarbonChannelRegistry) this.channelRegistry()).loadConfigChannels();
|
||||
|
||||
// TODO: Register these in a central location, pull from that in this and plugin.yml
|
||||
Sponge.serviceProvider().provide(PermissionService.class).ifPresent(permissionService -> {
|
||||
final PermissionDescription.Builder builder = permissionService.newDescriptionBuilder(this.pluginContainer);
|
||||
|
||||
builder.id("carbon.clearchat.clear")
|
||||
.description(Component.text("Clears the chat for all players except those with carbon.chearchat.exempt."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.clearchat.exempt")
|
||||
.description(Component.text("Exempts the player from having their chat cleared when /clearchat is executed."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.debug")
|
||||
.description(Component.text("Allows the sender to quickly check what carbon think's the player's primary and non-primary groups are."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.help")
|
||||
.description(Component.text("Shows Carbon's help menu, detailing each part of Carbon's commands."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.hideidentity")
|
||||
.description(Component.text("Prevents messages from the player from being blocked clientside."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.ignore")
|
||||
.description(Component.text("Ignores the player, hiding messages they send in chat and in whispers."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.ignore.exempt")
|
||||
.description(Component.text("Prevents the player from being ignored."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.ignore.unignore")
|
||||
.description(Component.text("Removes the player from the sender's ignore list."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.itemlink")
|
||||
.description(Component.text("Shows the player's held or equipped item in chat."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.mute")
|
||||
.description(Component.text("Mutes the player, preventing them from sending messages or whispers."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.mute.exempt")
|
||||
.description(Component.text("Prevents the player from being muted."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.mute.info")
|
||||
.description(Component.text("Shows if the player is muted or now."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.mute.notify")
|
||||
.description(Component.text("Notifies the player when someone else has been mute."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.mute.unmute")
|
||||
.description(Component.text("Unmutes the player, allowing them to use chat and send whispers."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.nickname")
|
||||
.description(Component.text("The nickname command, by default shows your nickname."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.nickname.others")
|
||||
.description(Component.text("Checks/sets other player's nicknames."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.nickname.see")
|
||||
.description(Component.text("Checks your/other player's nicknames."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.nickname.self")
|
||||
.description(Component.text("Checks/sets your nickname."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.nickname.set")
|
||||
.description(Component.text("Sets your/other player's nicknames."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.reload")
|
||||
.description(Component.text("Reloads Carbon's config, channel settings, and translations."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.whisper")
|
||||
.description(Component.text("Sends private messages to other players."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.whisper.continue")
|
||||
.description(Component.text("Sends a message to the last player you whispered."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.whisper.reply")
|
||||
.description(Component.text("Sends a message to the last player who messaged you."))
|
||||
.register();
|
||||
|
||||
builder.id("carbon.whisper.vanished")
|
||||
.description(Component.text("Allows the player to send messages to vanished players."))
|
||||
.register();
|
||||
});
|
||||
|
||||
// Commands
|
||||
CloudUtils.registerCommands(this.injector);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user