Skip to content

Commit

Permalink
use reflectionutil class
Browse files Browse the repository at this point in the history
  • Loading branch information
Olzie-12 committed Sep 19, 2024
1 parent fb91ba0 commit fb59b57
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.mojang.authlib.properties.Property;
import com.mojang.authlib.properties.PropertyMap;
import eu.decentsoftware.holograms.api.utils.Log;
import eu.decentsoftware.holograms.api.utils.reflect.ReflectionUtil;
import eu.decentsoftware.holograms.api.utils.reflect.Version;
import lombok.NonNull;
import lombok.experimental.UtilityClass;
Expand Down Expand Up @@ -50,9 +51,9 @@ public final class SkullUtils {

static {
try {
Class<?> resolvableProfileClass = Class.forName("net.minecraft.world.item.component.ResolvableProfile");
RESOLVABLE_PROFILE_CONSTRUCTOR = resolvableProfileClass.getConstructor(GameProfile.class);
} catch (ClassNotFoundException | NoSuchMethodException ignored) {
Class<?> resolvableProfileClass = ReflectionUtil.getNMClass("world.item.component.ResolvableProfile");
RESOLVABLE_PROFILE_CONSTRUCTOR = resolvableProfileClass == null ? null : resolvableProfileClass.getConstructor(GameProfile.class);
} catch ( NoSuchMethodException ignored) {
// old version, no resolvable profile class.
}
}
Expand Down

0 comments on commit fb59b57

Please sign in to comment.