Only enable the clear/download buttons when there is something to clear/download

This commit is contained in:
Sollace 2018-08-23 00:42:54 +02:00
parent 94cdda95ea
commit ee61b56ceb
3 changed files with 9 additions and 1 deletions

View file

@ -59,6 +59,10 @@ public class LocalTexture {
return local != null;
}
public boolean hasRemoteTexture() {
return hasRemote() && remote.isTextureUploaded() && getTexture() != blank.getBlankSkin(type);
}
public boolean usingLocal() {
return !hasRemote() && hasLocal();
}

View file

@ -141,7 +141,7 @@ public class SkinUploader implements Closeable {
}
public boolean canClear() {
return !isOffline() && !hasStatus() && !downloadInProgress() && remotePlayer.isTextureSetupComplete();
return !isOffline() && !hasStatus() && !downloadInProgress() && remotePlayer.isUsingRemoteTexture();
}
public boolean hasStatus() {

View file

@ -79,6 +79,10 @@ public class EntityPlayerModel extends EntityLivingBase implements IBlankSkinSup
return skin.uploadComplete() && elytra.uploadComplete();
}
public boolean isUsingRemoteTexture() {
return skin.hasRemoteTexture() || elytra.hasRemoteTexture();
}
public void releaseTextures() {
skin.clearLocal();
elytra.clearLocal();