Overhaul user cache to fix op losing issue

This commit is contained in:
Sotr
2019-04-09 14:50:03 +08:00
parent fcf97fa61e
commit 0d05c57c04
17 changed files with 120 additions and 218 deletions

View File

@@ -450,28 +450,13 @@ public class Village {
AkarinUserCache usercache = this.a.getMinecraftServer().getModernUserCache(); // Akarin
try {
// Akarin start
ProfileLookupCallback callback = new ProfileLookupCallback() {
@Override
public void onProfileLookupSucceeded(GameProfile gameprofile) {
nbttagcompound2.setString("UUID", gameprofile.getId().toString());
nbttagcompound2.setInt("S", (Integer) j.get(s));
nbttaglist1.add((NBTBase) nbttagcompound2);
}
GameProfile gameprofile = usercache.peek(s);
@Override
public void onProfileLookupFailed(GameProfile gameprofile, Exception ex) {
;
}
};
usercache.acquire(s, callback);
//if (gameprofile != null) {
// nbttagcompound2.setString("UUID", gameprofile.getId().toString());
// nbttagcompound2.setInt("S", (Integer) this.j.get(s));
// nbttaglist1.add((NBTBase) nbttagcompound2);
//}
// Akarin end
if (gameprofile != null) {
nbttagcompound2.setString("UUID", gameprofile.getId().toString());
nbttagcompound2.setInt("S", (Integer) this.j.get(s));
nbttaglist1.add((NBTBase) nbttagcompound2);
}
} catch (RuntimeException runtimeexception) {
;
}