File tree Expand file tree Collapse file tree
common/src/main/java/de/bluecolored/bluemap/common/plugin/skins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public CompletableFuture<Void> updateSkin(final UUID playerUuid) {
7676 throw new CompletionException ("The skin provider threw an exception while loading the skin for UUID: '" + playerUuid + "'!" , e );
7777 }
7878 }, BlueMap .THREAD_POOL ).thenAcceptAsync (skin -> {
79- if (skin . isEmpty () ) {
79+ if (skin == null ) {
8080 Logger .global .logDebug ("No player-skin provided for UUID: " + playerUuid );
8181 return ;
8282 }
@@ -87,6 +87,18 @@ public CompletableFuture<Void> updateSkin(final UUID playerUuid) {
8787 return ;
8888 }
8989
90+ if (skin .isEmpty ()) {
91+ Logger .global .logDebug ("Empty player-skin provided for UUID: " + playerUuid );
92+ for (BmMap map : maps .values ()) {
93+ try {
94+ map .getStorage ().asset ("playerheads/" + playerUuid + ".png" ).delete ();
95+ } catch (IOException ex ) {
96+ Logger .global .logError ("Failed to remove player skin from storage: " + playerUuid , ex );
97+ }
98+ }
99+ return ;
100+ }
101+
90102 BufferedImage playerHead = playerMarkerIconFactory .apply (playerUuid , skin .get ());
91103
92104 for (BmMap map : maps .values ()) {
You can’t perform that action at this time.
0 commit comments