mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
Add javadoc and basic early checks to ChatUtils.areComponentsEqual()
This commit is contained in:
@@ -285,7 +285,20 @@ public final class ChatUtils {
|
||||
return component;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether two given components are equal to each other.
|
||||
*
|
||||
* @param former The left hand side component.
|
||||
* @param latter The right hand side component.
|
||||
* @return Returns whether the two given components are equal.
|
||||
*/
|
||||
public static boolean areComponentsEqual(final Component former, final Component latter) {
|
||||
if (Objects.equals(former, latter)) {
|
||||
return true;
|
||||
}
|
||||
if (former == null || latter == null) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.equals(
|
||||
MiniMessage.get().serialize(former),
|
||||
MiniMessage.get().serialize(latter))) {
|
||||
|
||||
Reference in New Issue
Block a user