Skip to content
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

Draft
wants to merge 1 commit into
base: fabric
Choose a base branch
from
Draft

Conversation

xpple
Copy link
Collaborator

@xpple xpple commented Jan 30, 2024

The clearHistory argument only clears the history in memory, the history will be restored once the game is restarted.

@xpple xpple marked this pull request as draft January 30, 2024 23:58
@xpple
Copy link
Collaborator Author

xpple commented Jan 31, 2024

Note to self: Change mixin so that the vanilla behaviour remains the same.

@Earthcomputer
Copy link
Owner

What's the difference between this and F3+D?

@xpple
Copy link
Collaborator Author

xpple commented Jan 31, 2024

See #dev-general > 💬.

Comment on lines +121 to +124
@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;
}
Copy link
Collaborator

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);
Copy link
Collaborator

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?

@xpple xpple added the enhancement New feature or request label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants