Skip to content

Commit

Permalink
fix setskin trying to set a skin on a non minecraft thread
Browse files Browse the repository at this point in the history
  • Loading branch information
aabssmc committed Oct 16, 2024
1 parent 84da864 commit e1fd0c0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/lol/aabss/skuishy/other/SkinWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ public static void setSkin(Player player, Texture texture) {
}

public static void setSkin(Player player, String value, @Nullable String signature){
PlayerProfile profile = player.getPlayerProfile();
profile.removeProperties(profile.getProperties());
profile.setProperty(new ProfileProperty("textures", value, signature));
player.setPlayerProfile(profile);
Bukkit.getScheduler().runTask(Skuishy.instance, () -> {
PlayerProfile profile = player.getPlayerProfile();
profile.removeProperties(profile.getProperties());
profile.setProperty(new ProfileProperty("textures", value, signature));
player.setPlayerProfile(profile);
});
}

private static BufferedImage getHead(String name, boolean helm) throws IOException {
Expand Down

0 comments on commit e1fd0c0

Please sign in to comment.