Merge pull request #115 from Silent-Client/TEST2

(fix) 3d skins with custom skins
This commit is contained in:
kirillsaint 2024-05-10 14:24:21 +06:00 committed by GitHub
commit f78efb63e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 0 deletions

View File

@ -92,6 +92,26 @@ public abstract class AbstractClientPlayerMixin implements AbstractClientPlayerE
}
}
@Inject(method = "hasSkin", at = @At("HEAD"), cancellable = true)
public void mixinHasSkin(CallbackInfoReturnable<Boolean> cir) {
if(Minecraft.getMinecraft().currentScreen instanceof AdminRender) {
cir.setReturnValue(true);
cir.cancel();
}
if(Client.getInstance().getSettingsManager().getSettingByClass(CosmeticsMod.class, "Custom Skins").getValBoolean() && this.silent$getAccount() != null && this.silent$getAccount().getCustomSkin()) {
if(!CustomSkin.skins.containsKey(silent$nameClear.toLowerCase())) {
Client.logger.info(String.format("Custom Skin not found in cache! Putting Custom Skin to cache. (%s)", silent$nameClear));
CustomSkin.skins.put(silent$nameClear.toLowerCase(), new CustomSkin());
}
CustomSkin customSkin = CustomSkin.skins.get(silent$nameClear.toLowerCase());
if(customSkin.getLocation() != null) {
cir.setReturnValue(true);
cir.cancel();
}
}
}
@Inject(method = "getLocationSkin()Lnet/minecraft/util/ResourceLocation;", at = @At("HEAD"), cancellable = true)
public void mixinSkinLocation(CallbackInfoReturnable<ResourceLocation> cir) {
if(Minecraft.getMinecraft().currentScreen instanceof AdminRender) {