Skip to content

Commit f0e41ec

Browse files
authored
Merge pull request #46 from Global-Tags/development
Release `v1.2.8`
2 parents b97a2ad + 068ec54 commit f0e41ec

File tree

3 files changed

+44
-6
lines changed

3 files changed

+44
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.rappytv.globaltags</groupId>
88
<artifactId>GlobalTagsJava</artifactId>
9-
<version>1.2.7</version>
9+
<version>1.2.8</version>
1010

1111
<name>GlobalTagsJava</name>
1212
<description>A wrapper for the GlobalTagsAPI</description>

src/main/java/com/rappytv/globaltags/wrapper/enums/AuthProvider.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
*/
66
public enum AuthProvider {
77
/**
8-
* The Bearer auth provider is used to authenticate with GlobalTag's own Bearer tokens. At the moment the only way to receive one is by contacting the Database admin. See <a href="https://github.com/Global-Tags/API/blob/master/src/auth/providers/ApiKeyProvider.ts">ApiKeyProvider.ts</a>
8+
* @deprecated Use {@link #API_KEY} instead
99
*/
10+
@Deprecated
1011
BEARER("Bearer"),
12+
/**
13+
* The Bearer auth provider is used to authenticate with GlobalTag's own Bearer tokens. At the moment the only way to receive one is by contacting the Database admin. See <a href="https://github.com/Global-Tags/API/blob/master/src/auth/providers/ApiKeyProvider.ts">ApiKeyProvider.ts</a>
14+
*/
15+
API_KEY("Bearer"),
1116
/**
1217
* The Yggdrasil auth provider is used to authenticate with Minecraft session tokens. These can be obtained by the Minecraft session provider. See <a href="https://github.com/Global-Tags/API/blob/master/src/auth/providers/YggdrasilProvider.ts">YggdrasilProvider.ts</a>
1318
*/

src/main/java/com/rappytv/globaltags/wrapper/model/PlayerInfo.java

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)