mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 14:38:49 +00:00
fix: Set whisper targets to persist (#622)
This commit is contained in:
1 parent
b3ba0dcfd6
commit
cc6837b6b9
1 file changed
+14
-8
@@ -75,8 +75,8 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
|||||||
protected final PersistentUserProperty<Component> displayName;
|
protected final PersistentUserProperty<Component> displayName;
|
||||||
|
|
||||||
// Whispers
|
// Whispers
|
||||||
protected transient @Nullable UUID lastWhisperTarget = null;
|
protected final PersistentUserProperty<UUID> lastWhisperTarget;
|
||||||
protected transient @Nullable UUID whisperReplyTarget = null;
|
protected final PersistentUserProperty<UUID> whisperReplyTarget;
|
||||||
protected final PersistentUserProperty<Boolean> ignoringDirectMessages;
|
protected final PersistentUserProperty<Boolean> ignoringDirectMessages;
|
||||||
|
|
||||||
// Administrative
|
// Administrative
|
||||||
@@ -112,8 +112,8 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
|||||||
this.username = username;
|
this.username = username;
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
this.displayName = PersistentUserProperty.of(displayName);
|
this.displayName = PersistentUserProperty.of(displayName);
|
||||||
this.lastWhisperTarget = lastWhisperTarget;
|
this.lastWhisperTarget = PersistentUserProperty.of(lastWhisperTarget);
|
||||||
this.whisperReplyTarget = whisperReplyTarget;
|
this.whisperReplyTarget = PersistentUserProperty.of(whisperReplyTarget);
|
||||||
this.spying = PersistentUserProperty.of(spying);
|
this.spying = PersistentUserProperty.of(spying);
|
||||||
this.ignoredPlayers = PersistentUserProperty.of(Collections.emptySet());
|
this.ignoredPlayers = PersistentUserProperty.of(Collections.emptySet());
|
||||||
this.leftChannels = PersistentUserProperty.of(Collections.emptySet());
|
this.leftChannels = PersistentUserProperty.of(Collections.emptySet());
|
||||||
@@ -131,6 +131,8 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
|||||||
this.deafened = PersistentUserProperty.of(false);
|
this.deafened = PersistentUserProperty.of(false);
|
||||||
this.selectedChannel = PersistentUserProperty.empty();
|
this.selectedChannel = PersistentUserProperty.empty();
|
||||||
this.displayName = PersistentUserProperty.empty();
|
this.displayName = PersistentUserProperty.empty();
|
||||||
|
this.lastWhisperTarget = PersistentUserProperty.empty();
|
||||||
|
this.whisperReplyTarget = PersistentUserProperty.empty();
|
||||||
this.spying = PersistentUserProperty.of(false);
|
this.spying = PersistentUserProperty.of(false);
|
||||||
this.ignoredPlayers = PersistentUserProperty.of(Collections.emptySet());
|
this.ignoredPlayers = PersistentUserProperty.of(Collections.emptySet());
|
||||||
this.leftChannels = PersistentUserProperty.of(Collections.emptySet());
|
this.leftChannels = PersistentUserProperty.of(Collections.emptySet());
|
||||||
@@ -147,6 +149,8 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
|||||||
this.deafened = PersistentUserProperty.of(false);
|
this.deafened = PersistentUserProperty.of(false);
|
||||||
this.selectedChannel = PersistentUserProperty.empty();
|
this.selectedChannel = PersistentUserProperty.empty();
|
||||||
this.displayName = PersistentUserProperty.empty();
|
this.displayName = PersistentUserProperty.empty();
|
||||||
|
this.lastWhisperTarget = PersistentUserProperty.empty();
|
||||||
|
this.whisperReplyTarget = PersistentUserProperty.empty();
|
||||||
this.spying = PersistentUserProperty.of(false);
|
this.spying = PersistentUserProperty.of(false);
|
||||||
this.applyOptionalChatFilters = PersistentUserProperty.of(false);
|
this.applyOptionalChatFilters = PersistentUserProperty.of(false);
|
||||||
this.ignoredPlayers = PersistentUserProperty.of(Collections.emptySet());
|
this.ignoredPlayers = PersistentUserProperty.of(Collections.emptySet());
|
||||||
@@ -166,6 +170,8 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
|||||||
this.deafened,
|
this.deafened,
|
||||||
this.selectedChannel,
|
this.selectedChannel,
|
||||||
this.displayName,
|
this.displayName,
|
||||||
|
this.lastWhisperTarget,
|
||||||
|
this.whisperReplyTarget,
|
||||||
this.spying,
|
this.spying,
|
||||||
this.applyOptionalChatFilters,
|
this.applyOptionalChatFilters,
|
||||||
this.ignoredPlayers,
|
this.ignoredPlayers,
|
||||||
@@ -334,22 +340,22 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable UUID whisperReplyTarget() {
|
public @Nullable UUID whisperReplyTarget() {
|
||||||
return this.whisperReplyTarget;
|
return this.whisperReplyTarget.orNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void whisperReplyTarget(final @Nullable UUID whisperReplyTarget) {
|
public void whisperReplyTarget(final @Nullable UUID whisperReplyTarget) {
|
||||||
this.whisperReplyTarget = whisperReplyTarget;
|
this.whisperReplyTarget.set(whisperReplyTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable UUID lastWhisperTarget() {
|
public @Nullable UUID lastWhisperTarget() {
|
||||||
return this.lastWhisperTarget;
|
return this.lastWhisperTarget.orNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void lastWhisperTarget(final @Nullable UUID lastWhisperTarget) {
|
public void lastWhisperTarget(final @Nullable UUID lastWhisperTarget) {
|
||||||
this.lastWhisperTarget = lastWhisperTarget;
|
this.lastWhisperTarget.set(lastWhisperTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in new issue
Block a user