mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 14:38:49 +00:00
implement player ignore api
This commit is contained in:
1 parent
ad2b7be13d
commit
bf9e4e8148
3 files changed
+43
No files matched your search
@@ -62,6 +62,7 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
||||
|
||||
// Punishments
|
||||
protected List<MuteEntry> muteEntries = new ArrayList<>();
|
||||
protected List<UUID> ignoredPlayers = new ArrayList<>();
|
||||
|
||||
public CarbonPlayerCommon(
|
||||
final String username,
|
||||
@@ -180,6 +181,20 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ignoring(final CarbonPlayer sender) {
|
||||
return this.ignoredPlayers.contains(sender.uuid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ignoring(final CarbonPlayer player, final boolean nowIgnoring) {
|
||||
if (nowIgnoring) {
|
||||
this.ignoredPlayers.add(player.uuid());
|
||||
} else {
|
||||
this.ignoredPlayers.remove(player.uuid());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deafened() {
|
||||
return this.deafened;
|
||||
|
||||
@@ -56,6 +56,16 @@ public abstract class WrappedCarbonPlayer implements CarbonPlayer {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ignoring(final CarbonPlayer sender) {
|
||||
return this.carbonPlayerCommon().ignoring(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ignoring(final CarbonPlayer player, final boolean nowIgnoring) {
|
||||
this.carbonPlayerCommon().ignoring(player, nowIgnoring);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(final String permission) {
|
||||
final var data = this.user().getCachedData().getPermissionData(this.user().getQueryOptions());
|
||||
|
||||
Reference in new issue
Block a user