Skip to content

Commit 1e78cec

Browse files
authored
Add player head texture argument (#87)
1 parent b5c7f6d commit 1e78cec

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/eu/pb4/placeholders/impl/textparser/BuiltinTags.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package eu.pb4.placeholders.impl.textparser;
22

33

4+
import com.google.common.collect.ImmutableMultimap;
5+
import com.mojang.authlib.GameProfile;
6+
import com.mojang.authlib.properties.Property;
7+
import com.mojang.authlib.properties.PropertyMap;
48
import com.mojang.datafixers.util.Either;
59
import eu.pb4.placeholders.api.arguments.StringArgs;
610
import eu.pb4.placeholders.api.arguments.SimpleArguments;
@@ -216,6 +220,13 @@ public static void register() {
216220

217221
var next = data.getNext("name", "");
218222
var maybeUuid = data.get("uuid");
223+
var texture = data.get("texture");
224+
225+
if (texture != null) {
226+
PropertyMap map = new PropertyMap(ImmutableMultimap.of("textures", new Property("textures", texture, null)));
227+
return new ObjectNode(new PlayerTextObjectContents(ProfileComponent.ofStatic(new GameProfile(Util.NIL_UUID, "", map)), hat));
228+
}
229+
219230
UUID uuid = null;
220231
if (maybeUuid == null) {
221232
try {

0 commit comments

Comments
 (0)