Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Sounds: add permissions for each sound
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFaser committed Dec 22, 2023
1 parent 1310144 commit cbb9d2b
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/net/flectone/chat/model/sound/FSound.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class FSound {
@Getter
private final Player sender;
private Player recipient;
@Getter
private final String name;
private Location location;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.flectone.chat.model.sound.FSound;
import net.flectone.chat.module.FModule;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;

public class SoundsModule extends FModule {
Expand All @@ -19,6 +20,7 @@ public void init() {
public void play(@NotNull FSound sound) {
if (!isEnabledFor(sound.getSender())) return;
if (hasNoPermission(sound.getSender())) return;
if (hasNoPermission(sound.getSender(), sound.getName())) return;
sound.play();
}
}
114 changes: 114 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,120 @@ permissions:
default: true
flectonechat.sounds:
default: true
flectonechat.sounds.mention:
default: true
flectonechat.sounds.auto-message:
default: true
flectonechat.sounds.player.afk-timeout-true:
default: true
flectonechat.sounds.player.afk-timeout-false:
default: true
flectonechat.sounds.player.right-click:
default: true
flectonechat.sounds.player-message.anvil:
default: true
flectonechat.sounds.player-message.book:
default: true
flectonechat.sounds.player-message.sign:
default: true
flectonechat.sounds.player-message.chat.local:
default: true
flectonechat.sounds.player-message.chat.global:
default: true
flectonechat.sounds.extra.item-sign:
default: true
flectonechat.sounds.extra.item-sign.unsign:
default: true
flectonechat.sounds.extra.knocking.door:
default: true
flectonechat.sounds.extra.knocking.glass:
default: true
flectonechat.sounds.extra.mark:
default: true
flectonechat.sounds.extra.spit:
default: true
flectonechat.sounds.server-message.advancement:
default: true
flectonechat.sounds.server-message.death:
default: true
flectonechat.sounds.server-message.join:
default: true
flectonechat.sounds.server-message.quit:
default: true
flectonechat.sounds.commands.spit:
default: true
flectonechat.sounds.commands.kick:
default: true
flectonechat.sounds.commands.warn:
default: true
flectonechat.sounds.commands.unwarn:
default: true
flectonechat.sounds.commands.warnlist:
default: true
flectonechat.sounds.commands.spy:
default: true
flectonechat.sounds.commands.poll:
default: true
flectonechat.sounds.commands.broadcast:
default: true
flectonechat.sounds.commands.unban:
default: true
flectonechat.sounds.commands.tempban:
default: true
flectonechat.sounds.commands.clearchat:
default: true
flectonechat.sounds.commands.chatsettings:
default: true
flectonechat.sounds.commands.chatcolor:
default: true
flectonechat.sounds.commands.flectonechat:
default: true
flectonechat.sounds.commands.geolocate:
default: true
flectonechat.sounds.commands.ignore:
default: true
flectonechat.sounds.commands.ignorelist:
default: true
flectonechat.sounds.commands.mail:
default: true
flectonechat.sounds.commands.helper:
default: true
flectonechat.sounds.commands.mark:
default: true
flectonechat.sounds.commands.me:
default: true
flectonechat.sounds.commands.tell:
default: true
flectonechat.sounds.commands.ping:
default: true
flectonechat.sounds.commands.reply:
default: true
flectonechat.sounds.commands.clearmail:
default: true
flectonechat.sounds.commands.stream:
default: true
flectonechat.sounds.commands.translateto:
default: true
flectonechat.sounds.commands.try:
default: true
flectonechat.sounds.commands.dice:
default: true
flectonechat.sounds.commands.afk:
default: true
flectonechat.sounds.commands.mute:
default: true
flectonechat.sounds.commands.unmute:
default: true
flectonechat.sounds.commands.maintenance:
default: true
flectonechat.sounds.commands.ball:
default: true
flectonechat.sounds.commands.tictactoe:
default: true
flectonechat.sounds.commands.banlist:
default: true
flectonechat.sounds.commands.mutelist:
default: true
flectonechat.server.status.player-count.bypass:
default: op
flectonechat.commands.afk:
Expand Down

0 comments on commit cbb9d2b

Please sign in to comment.