Skip to content

Add Chat-Bubbles Feature#29

Open
Wueffi wants to merge 11 commits into
OpenRedstoneEngineers:masterfrom
Wueffi:master
Open

Add Chat-Bubbles Feature#29
Wueffi wants to merge 11 commits into
OpenRedstoneEngineers:masterfrom
Wueffi:master

Conversation

@Wueffi
Copy link
Copy Markdown
Member

@Wueffi Wueffi commented Apr 26, 2026

This PR adds what the title says 🧋

Copy link
Copy Markdown
Contributor

@paulikauro paulikauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! One general comment: "Chat-Bubble" -> "chat bubble". Some simplifications and a few things to think about in code comments

Comment thread chattore/src/main/kotlin/feature/BubbleCommand.kt Outdated
Comment thread chattore/src/main/kotlin/feature/BubbleCommand.kt Outdated
Comment thread chattore/src/main/kotlin/feature/BubbleCommand.kt Outdated
Comment thread chattore/src/main/kotlin/feature/BubbleCommand.kt Outdated
Comment thread chattore/src/main/kotlin/feature/BubbleCommand.kt Outdated
Comment thread chattore/src/main/kotlin/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/ChattOREConfig.kt Outdated
Comment thread chattore/src/main/kotlin/Messenger.kt Outdated
Comment thread chattore/src/main/kotlin/Messenger.kt Outdated
Comment thread chattore/src/main/kotlin/Messenger.kt Outdated
@Wueffi Wueffi requested a review from paulikauro April 27, 2026 13:50
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Copy link
Copy Markdown
Contributor

@paulikauro paulikauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! There are some ACF things that would be good to address at this point:

  • commands should take target: OnlinePlayer
  • Bubble should get its own ACF context (like mentioned previously)
  • additionally, the Bubble context should have a flag for checking bubble ownership. Then you can simply do @Flag(FLAG_BUBBLE_OWNED) bubble: Bubble whenever a command needs the sender to be an owner of a bubble (delete, kick, setPrivate). (There FLAG_BUBBLE_OWNED is just a constant string; compare to eg UserCache.COMPLETION_USERNAMES, except this one doesn't have to be public)
    Once implemented, these will make the commands shorter and nicer to read, plus there'll be less duplication :)

Comment thread chattore/src/main/kotlin/Messenger.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt
@Wueffi Wueffi requested a review from paulikauro May 3, 2026 16:04
@Wueffi
Copy link
Copy Markdown
Member Author

Wueffi commented May 3, 2026

Review requested!

Copy link
Copy Markdown
Contributor

@paulikauro paulikauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, some small details still and a few bigger suggestions

Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/feature/Bubble.kt Outdated
Comment thread chattore/src/main/kotlin/ChattOREConfig.kt Outdated
Wueffi and others added 2 commits May 4, 2026 18:28
`sender` is never Player, so the else branch was always taken.
Now every error will also get the info prefix added to it.
In the future, a sendError may be useful to add.
@Wueffi Wueffi requested a review from paulikauro May 4, 2026 16:31
@Wueffi
Copy link
Copy Markdown
Member Author

Wueffi commented May 4, 2026

I'd like to formally request a review from the great PaukkuPalikka again

?: throw ChattoreException("Target is not in a Chat-Bubble!")

if (!bubble.isInvited(sender.uniqueId) && bubble.isPrivate)
if (sender.uniqueId !in bubble.invitedPlayers && bubble.isPrivate)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really doesn't actually matter, it's more of a style thing at this point, but flipping the operands of && here will be marginally more efficient because of short-circuiting

Comment thread chattore/src/main/kotlin/Messenger.kt Outdated
luckPerms: LuckPerms,
chatBroadcastFormat: String,
formatConfig: FormatConfig,
getBubbleManager: () -> BubbleManager,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One possibly decent-ish way to break this dependency is to have a public val excludedFromGlobalChat: MutableSet<UUID> = ConcurrentHashMap.newKeySet() in Messenger, then add/remove players from that as they join/leave bubbles (if they have the setting enabled). Probably want helper methods in BubbleCommand for check setting + (add/remove) combos (and actually, remove doesn't even need to check the setting). The goal would be to replace each call to messenger.setCacheDirty() with a call to one of those new methods instead. (When popping a bubble, you can just excludedFromGlobalChat.removeAll(bubble.players) 🤔). The handler for /showglobalchat will have some extra logic unfortunately, I think. But after this, the new setting query (getAllGlobalChatEnabled) is no longer needed and the ShowGlobalChatInBubble setting can be made private.

... so at least this is a possibility, it's probably not the best solution though 🤔 Maybe worth trying. I think the final solution will be somewhat similar to this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants