Skip to content

Commit

Permalink
chore: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
NgLoader committed Sep 22, 2024
1 parent 90529eb commit 577ec5c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public class ZipNmsManager implements NmsManager {

static {
NBT_EMPTY_ITEMSTACK.putString("id", "minecraft:air");

BiConsumer<SkullMeta, GameProfile> setProfile = (meta, profile) -> {
throw new NullPointerException("Unable to find 'setProfile' method!");
};

Class<?> craftMetaSkullClass = new ItemStack(Material.PLAYER_HEAD)
.getItemMeta()
.getClass();

Method setResolvableProfileMethod = ReflectionUtil.searchMethod(craftMetaSkullClass, void.class, ResolvableProfile.class);
if (setResolvableProfileMethod != null) {
setProfile = (meta, profile) -> {
Expand All @@ -69,7 +69,7 @@ public class ZipNmsManager implements NmsManager {
};
}
}

SET_PROFILE = setProfile;
}

Expand Down Expand Up @@ -136,7 +136,7 @@ public void setSkullProfile(SkullMeta meta, String texture) {
try {
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "");
gameProfile.getProperties().put("textures", new Property("textures", texture));

SET_PROFILE.accept(meta, gameProfile);
} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit 577ec5c

Please sign in to comment.