mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 18:45:29 +01:00
Trial some changes to skin fetching to cut down on requests when persistent skins are in use
This commit is contained in:
parent
ffbedcd841
commit
47ef30639a
@ -30,6 +30,7 @@ import net.citizensnpcs.npc.profile.ProfileRequest;
|
||||
* Stores data for a single skin.
|
||||
*/
|
||||
public class Skin {
|
||||
private boolean fetching;
|
||||
private int fetchRetries = -1;
|
||||
private boolean hasFetched;
|
||||
private volatile boolean isValid = true;
|
||||
@ -56,7 +57,7 @@ public class Skin {
|
||||
CACHE.put(this.skinName, this);
|
||||
}
|
||||
|
||||
fetch();
|
||||
// fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,6 +99,9 @@ public class Skin {
|
||||
if (hasFetched) {
|
||||
return true;
|
||||
} else {
|
||||
if (!fetching) {
|
||||
fetch();
|
||||
}
|
||||
pending.put(entity, null);
|
||||
return false;
|
||||
}
|
||||
@ -136,6 +140,7 @@ public class Skin {
|
||||
}
|
||||
return;
|
||||
}
|
||||
fetching = true;
|
||||
|
||||
ProfileFetcher.fetch(this.skinName, new ProfileFetchHandler() {
|
||||
@Override
|
||||
@ -182,6 +187,7 @@ public class Skin {
|
||||
}
|
||||
return;
|
||||
}
|
||||
fetching = true;
|
||||
|
||||
ProfileFetcher.fetchForced(this.skinName, new ProfileFetchHandler() {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user