1
0
mirror of https://github.com/Suiranoil/SkinRestorer.git synced 2026-01-16 04:42:12 +00:00

check name and id for null

fixes #60 and #61
This commit is contained in:
2025-07-13 20:09:07 +03:00
parent 8af1dd8f12
commit 7fad7de710

View File

@@ -22,6 +22,9 @@ public abstract class SkullBlockEntityMixin {
@Inject(method = "fetchProfileByName", at = @At("HEAD"), @Inject(method = "fetchProfileByName", at = @At("HEAD"),
cancellable = true) cancellable = true)
private static void fetchProfileByName(String name, Services services, CallbackInfoReturnable<CompletableFuture<Optional<GameProfile>>> cir) { private static void fetchProfileByName(String name, Services services, CallbackInfoReturnable<CompletableFuture<Optional<GameProfile>>> cir) {
if (name == null)
return;
var profileOpt = services.profileCache().get(name); var profileOpt = services.profileCache().get(name);
skinrestorer$replaceSkin(profileOpt, cir); skinrestorer$replaceSkin(profileOpt, cir);
@@ -30,6 +33,9 @@ public abstract class SkullBlockEntityMixin {
@Inject(method = "fetchProfileById", at = @At("HEAD"), @Inject(method = "fetchProfileById", at = @At("HEAD"),
cancellable = true) cancellable = true)
private static void fetchProfileById(UUID id, Services services, BooleanSupplier cacheUninitialized, CallbackInfoReturnable<CompletableFuture<Optional<GameProfile>>> cir) { private static void fetchProfileById(UUID id, Services services, BooleanSupplier cacheUninitialized, CallbackInfoReturnable<CompletableFuture<Optional<GameProfile>>> cir) {
if (id == null)
return;
var profileOpt = services.profileCache().get(id); var profileOpt = services.profileCache().get(id);
skinrestorer$replaceSkin(profileOpt, cir); skinrestorer$replaceSkin(profileOpt, cir);