From 150dbbd61ced33503982af1654367de592e34225 Mon Sep 17 00:00:00 2001 From: James Harrison Date: Thu, 10 Sep 2020 22:17:54 +0100 Subject: [PATCH] Fixed null not removing capes Removed pointless logging --- src/viewer.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/viewer.ts b/src/viewer.ts index 35cf2f2..cf3b9ad 100644 --- a/src/viewer.ts +++ b/src/viewer.ts @@ -211,15 +211,14 @@ class SkinViewer { /** * Code for MinecraftCapes */ - protected loadCustomCape(source: TextureSource | RemoteImage | null): void | Promise { + public loadCustomCape(source: TextureSource | RemoteImage | null): void | Promise { if(source === null) { this.resetCape(); } else if(isTextureSource(source)) { this.customCapeImage = source; this.loadCapeToCanvas(this.capeCanvas, source, 0); - this.capeLoaded(); } else { - return loadImage(source).then(image => this.loadCustomCape(image)); + loadImage(source).then(image => this.loadCustomCape(image)).catch(error => {}); } } @@ -230,6 +229,7 @@ class SkinViewer { if(frame != null) { frame.clearRect(0, 0, canvas.width, canvas.height), frame.drawImage(image, 0, offset, canvas.width, canvas.height, 0, 0, canvas.width, canvas.height) + this.capeLoaded(); } } @@ -256,7 +256,7 @@ class SkinViewer { this.loadEarsToCanvas(this.earCanvas, source); this.earsLoaded(); } else { - return loadImage(source).then(image => this.loadEars(image)); + loadImage(source).then(image => this.loadEars(image)).catch(error => {}); } }