mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Apply suggestions
This commit is contained in:
1 parent
a511035d0a
commit
64a93656ea
8 files changed
+15
-11
No files matched your search
@@ -298,7 +298,7 @@ public interface CarbonPlayer extends Audience, Identified {
|
||||
* @param ignoring if the player is ignoring direct messages
|
||||
* @since 2.1.0
|
||||
*/
|
||||
void ignoringDirectMessages(final boolean ignoring);
|
||||
void ignoringDirectMessages(boolean ignoring);
|
||||
|
||||
/**
|
||||
* Sends the message as the player.
|
||||
|
||||
@@ -70,7 +70,7 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
||||
// Whispers
|
||||
protected transient @Nullable UUID lastWhisperTarget = null;
|
||||
protected transient @Nullable UUID whisperReplyTarget = null;
|
||||
protected boolean ignoringdirectMessages = false;
|
||||
protected final PersistentUserProperty<Boolean> ignoringDirectMessages;
|
||||
|
||||
// Administrative
|
||||
protected final PersistentUserProperty<Boolean> spying;
|
||||
@@ -89,7 +89,8 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
||||
final @Nullable Component displayName,
|
||||
final @Nullable UUID lastWhisperTarget,
|
||||
final @Nullable UUID whisperReplyTarget,
|
||||
final boolean spying
|
||||
final boolean spying,
|
||||
final boolean ignoreDirectMessages
|
||||
) {
|
||||
this.muted = PersistentUserProperty.of(muted);
|
||||
this.deafened = PersistentUserProperty.of(deafened);
|
||||
@@ -102,6 +103,7 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
||||
this.spying = PersistentUserProperty.of(spying);
|
||||
this.ignoredPlayers = PersistentUserProperty.of(Collections.emptySet());
|
||||
this.leftChannels = PersistentUserProperty.of(Collections.emptySet());
|
||||
this.ignoringDirectMessages = PersistentUserProperty.of(ignoreDirectMessages);
|
||||
}
|
||||
|
||||
public CarbonPlayerCommon(
|
||||
@@ -117,6 +119,7 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
||||
this.leftChannels = PersistentUserProperty.of(Collections.emptySet());
|
||||
this.username = username;
|
||||
this.uuid = uuid;
|
||||
this.ignoringDirectMessages = PersistentUserProperty.of(false);
|
||||
}
|
||||
|
||||
public CarbonPlayerCommon() {
|
||||
@@ -127,6 +130,7 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
||||
this.spying = PersistentUserProperty.of(false);
|
||||
this.ignoredPlayers = PersistentUserProperty.of(Collections.emptySet());
|
||||
this.leftChannels = PersistentUserProperty.of(Collections.emptySet());
|
||||
this.ignoringDirectMessages = PersistentUserProperty.of(false);
|
||||
}
|
||||
|
||||
public boolean needsSave() {
|
||||
@@ -265,12 +269,12 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
||||
|
||||
@Override
|
||||
public boolean ignoringDirectMessages() {
|
||||
return this.ignoringdirectMessages;
|
||||
return this.ignoringDirectMessages.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ignoringDirectMessages(final boolean ignoring) {
|
||||
this.ignoringdirectMessages = ignoring;
|
||||
this.ignoringDirectMessages.set(ignoring);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,4 +7,4 @@ INSERT IGNORE INTO carbon_users SET
|
||||
lastwhispertarget = :lastwhispertarget,
|
||||
whisperreplytarget = :whisperreplytarget,
|
||||
spying = :spying,
|
||||
ignoringdirectmessages = :ignoringdirectmessages;
|
||||
ignoringdms = :ignoringdms;
|
||||
@@ -7,7 +7,7 @@ CREATE TABLE carbon_users (
|
||||
`lastwhispertarget` UUID,
|
||||
`whisperreplytarget` UUID,
|
||||
`spying` BOOLEAN,
|
||||
`ignoringdirectmessages` BOOLEAN
|
||||
`ignoringdms` BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE carbon_ignores (
|
||||
|
||||
@@ -1 +1 @@
|
||||
ALTER TABLE carbon_users ADD COLUMN ignoringdirectmessages BOOLEAN;
|
||||
ALTER TABLE carbon_users ADD COLUMN ignoringdms BOOLEAN;
|
||||
@@ -1 +1 @@
|
||||
ALTER TABLE carbon_users ADD COLUMN ignoringdirectmessages BOOLEAN;
|
||||
ALTER TABLE carbon_users ADD COLUMN ignoringdms BOOLEAN;
|
||||
@@ -7,5 +7,5 @@ SELECT
|
||||
lastwhispertarget,
|
||||
whisperreplytarget,
|
||||
spying,
|
||||
ignoringdirectmessages
|
||||
ignoringdms
|
||||
FROM carbon_users WHERE (id = :id);
|
||||
@@ -7,4 +7,4 @@ UPDATE carbon_users SET
|
||||
lastwhispertarget = :lastwhispertarget,
|
||||
whisperreplytarget = :whisperreplytarget,
|
||||
spying = :spying,
|
||||
ignoringdirectmessages = :ignoringdirectmessages;
|
||||
ignoringdms = :ignoringdms;
|
||||
Reference in new issue
Block a user