@@ -118,33 +118,66 @@ public GlobalPosition getPosition() {
118118 }
119119 }
120120
121+ /**
122+ * Check if the player has a valid global icon
123+ *
124+ * @return if the player has a valid global icon
125+ */
126+ public boolean hasGlobalIcon () {
127+ return this .hasCustomGlobalIcon () || this .getGlobalIconType () != GlobalIcon .NONE ;
128+ }
129+
121130 /**
122131 * Gets the player's selected {@link GlobalIcon}.
123132 *
133+ * @deprecated Use {@link #getGlobalIconType()} instead
124134 * @return The selected global icon. Defaults to {@link GlobalIcon#NONE} if invalid.
125135 */
136+ @ Deprecated
126137 @ NotNull
127138 public GlobalIcon getGlobalIcon () {
128139 return this .icon .type ;
129140 }
130141
142+ /**
143+ * Gets the player's selected {@link GlobalIcon}.
144+ *
145+ * @return The selected global icon. Defaults to {@link GlobalIcon#NONE} if invalid.
146+ */
147+ @ NotNull
148+ public GlobalIcon getGlobalIconType () {
149+ return this .icon .type ;
150+ }
151+
131152 /**
132153 * Gets the hash of the player's custom global icon, if available.
133154 *
155+ * @deprecated Use {@link #getCustomIconHash()} instead
134156 * @return The custom global icon hash, or {@code null} if none exists.
135157 */
158+ @ Deprecated
136159 @ Nullable
137160 public String getGlobalIconHash () {
138161 return this .icon .hash ;
139162 }
140163
164+ /**
165+ * Gets the hash of the player's custom global icon, if available.
166+ *
167+ * @return The custom global icon hash, or {@code null} if none exists.
168+ */
169+ @ Nullable
170+ public String getCustomIconHash () {
171+ return this .icon .hash ;
172+ }
173+
141174 /**
142175 * Checks if the player has a custom global icon.
143176 *
144177 * @return {@code true} if the player has a custom global icon; otherwise {@code false}.
145178 */
146179 public boolean hasCustomGlobalIcon () {
147- return this .getGlobalIcon () == GlobalIcon .CUSTOM && this .icon .hash != null ;
180+ return this .getGlobalIconType () == GlobalIcon .CUSTOM && this .icon .hash != null ;
148181 }
149182
150183 /**
@@ -154,7 +187,7 @@ public boolean hasCustomGlobalIcon() {
154187 */
155188 @ Nullable
156189 public String getIconUrl () {
157- GlobalIcon icon = this .getGlobalIcon ();
190+ GlobalIcon icon = this .getGlobalIconType ();
158191 if (this .hasCustomGlobalIcon ()) return this .urls .getCustomIcon (this .uuid , this .icon .hash );
159192 else if (icon == GlobalIcon .CUSTOM || icon == GlobalIcon .NONE ) {
160193 return null ;
@@ -286,8 +319,8 @@ public String toString() {
286319 ", tag=" + this .tag +
287320 ", plainTag='" + this .plainTag + '\'' +
288321 ", position=" + this .getPosition () +
289- ", icon=PlayerIcon{type=" + this .getGlobalIcon () +
290- ", hash=" + this .getGlobalIconHash () + '}' +
322+ ", icon=PlayerIcon{type=" + this .getGlobalIconType () +
323+ ", hash=" + this .getCustomIconHash () + '}' +
291324 ", referralInfo=" + this .referralInfo +
292325 ", roleIcon='" + this .roleIcon + '\'' +
293326 ", roles=" + this .roles +
0 commit comments