-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the cclearchat command #594
base: fabric
Are you sure you want to change the base?
Conversation
Note to self: Change mixin so that the vanilla behaviour remains the same. |
What's the difference between this and F3+D? |
See #dev-general > 💬. |
@Redirect(method = "clear", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/collection/ArrayListDeque;addAll(Ljava/util/Collection;)Z")) | ||
private boolean preventAddAll(ArrayListDeque<String> instance, Collection<String> collection) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this mixin does not affect any other behavior?
} | ||
|
||
private static int clearChat(FabricClientCommandSource source, boolean clearHistory) { | ||
source.getClient().inGameHud.getChatHud().clear(clearHistory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mentioned that F3+3 and /cclearchat false
both clear chat while leaving command history accessible while /cclearchat true
clears chat and removes all command history for the current session. The former behavior is expected because chat isn't persisted across sessions, but should /cclearchat true
also clear command history across sessions?
The
clearHistory
argument only clears the history in memory, the history will be restored once the game is restarted.