Skip to content

Commit

Permalink
Dont set a username on custom heads (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
foxfirecodes committed Sep 24, 2020
1 parent 7bbd866 commit 0a699ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/me/rayzr522/decoheads/data/Head.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ public String toString() {
}

public ItemStack getItem() {
return CustomHead.getHead(texture, uuid, name);
return CustomHead.getHead(texture, uuid);
}
}
5 changes: 2 additions & 3 deletions src/main/java/me/rayzr522/decoheads/util/CustomHead.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,16 @@ public class CustomHead {
}
}

public static ItemStack getHead(String texture, String id, String name) {
public static ItemStack getHead(String texture, String id) {
Objects.requireNonNull(texture);
Objects.requireNonNull(id);
Objects.requireNonNull(name);

ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
ItemMeta meta = item.getItemMeta();

try {

Object profile = GAME_PROFILE_CONSTRUCTOR.newInstance(UUID.fromString(id), name);
Object profile = GAME_PROFILE_CONSTRUCTOR.newInstance(UUID.fromString(id), null);
Object properties = GET_PROPERTIES.invoke(profile);
INSERT_PROPERTY.invoke(properties, "textures", PROPERTY_CONSTRUCTOR.newInstance("textures", texture));

Expand Down

0 comments on commit 0a699ae

Please sign in to comment.