You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-19 15:06:19 +00:00
fix(chat): relay unknown chat bubble ids instead of resetting to default
getBubble() fell back to NORMAL (bubble 0) for any id not in the registered BUBBLES map, so custom client-side chat bubbles (e.g. ids 253+) rendered as the default bubble for everyone. Now unknown positive ids (<=1000) pass through as a transient bubble carrying that id, so the server relays it and clients render their own .bubble-<id> style. No need to enumerate each one.
This commit is contained in:
@@ -134,7 +134,18 @@ public class RoomChatMessageBubbles {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static RoomChatMessageBubbles getBubble(int id) {
|
public static RoomChatMessageBubbles getBubble(int id) {
|
||||||
return BUBBLES.getOrDefault(id, NORMAL);
|
RoomChatMessageBubbles bubble = BUBBLES.get(id);
|
||||||
|
if (bubble != null) return bubble;
|
||||||
|
|
||||||
|
// Custom chat bubbles (client-side only, e.g. ids 253+) are not registered
|
||||||
|
// above. Instead of falling back to NORMAL (which made them render as the
|
||||||
|
// default bubble), pass the id through so the server relays it as-is and
|
||||||
|
// the client renders its own .bubble-<id> style. Capped to avoid abuse.
|
||||||
|
if (id > 0 && id <= 1000) {
|
||||||
|
return new RoomChatMessageBubbles(id, "CUSTOM_" + id, "", true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerBubble(RoomChatMessageBubbles bubble) {
|
private static void registerBubble(RoomChatMessageBubbles bubble) {
|
||||||
|
|||||||
Reference in New Issue
Block a user