mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Add extra null check to ensure color isn't null
This commit is contained in:
1 parent
628b2599e2
commit
f75d2af11a
2 files changed
+18
-12
No files matched your search
@@ -334,6 +334,10 @@ public class CarbonChatChannel extends ChatChannel {
|
||||
public TextColor getChannelColor(ChatUser user) {
|
||||
String color = getString("color");
|
||||
|
||||
if (color == null) {
|
||||
color = "white";
|
||||
}
|
||||
|
||||
if (user.isOnline()) {
|
||||
return TextColor.fromHexString(PlaceholderAPI.setPlaceholders(user.asPlayer(), color));
|
||||
}
|
||||
|
||||
+14
-12
@@ -33,24 +33,26 @@ public class BungeeMessageService implements MessageService {
|
||||
api = BungeeChannelApi.of(carbonChat);
|
||||
|
||||
api.registerForwardListener((String channel, Player player, byte[] bytes) -> {
|
||||
ByteArrayDataInput input = ByteStreams.newDataInput(bytes);
|
||||
try {
|
||||
ByteArrayDataInput input = ByteStreams.newDataInput(bytes);
|
||||
|
||||
// Separated out for ease of debugging.
|
||||
long mostServer = input.readLong();
|
||||
long leastServer = input.readLong();
|
||||
// Separated out for ease of debugging.
|
||||
long mostServer = input.readLong();
|
||||
long leastServer = input.readLong();
|
||||
|
||||
UUID messageUUID = new UUID(mostServer, leastServer);
|
||||
UUID messageUUID = new UUID(mostServer, leastServer);
|
||||
|
||||
if (messageUUID.equals(serverUUID)) {
|
||||
return;
|
||||
}
|
||||
if (messageUUID.equals(serverUUID)) {
|
||||
return;
|
||||
}
|
||||
|
||||
long mostUser = input.readLong();
|
||||
long leastUser = input.readLong();
|
||||
long mostUser = input.readLong();
|
||||
long leastUser = input.readLong();
|
||||
|
||||
UUID userUUID = new UUID(mostUser, leastUser);
|
||||
UUID userUUID = new UUID(mostUser, leastUser);
|
||||
|
||||
this.receiveMessage(userUUID, channel, input);
|
||||
this.receiveMessage(userUUID, channel, input);
|
||||
} catch (IllegalStateException ignored) {}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user