Files
CatServer/patches/net/minecraft/server/management/PlayerProfileCache.java.patch
2018-09-06 06:06:49 +08:00

30 lines
1.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/server/management/PlayerProfileCache.java
+++ ../src-work/minecraft/net/minecraft/server/management/PlayerProfileCache.java
@@ -142,7 +142,7 @@
this.usernameToProfileEntryMap.put(gameProfile.getName().toLowerCase(Locale.ROOT), playerprofilecache$profileentry);
this.uuidToProfileEntryMap.put(uuid, playerprofilecache$profileentry);
this.gameProfiles.addFirst(gameProfile);
- this.save();
+ if(!org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) this.save(); // Spigot - skip saving if disabled
}
@Nullable
@@ -176,7 +176,7 @@
}
}
- this.save();
+ if(!org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) this.save(); // Spigot - skip saving if disabled
return playerprofilecache$profileentry == null ? null : playerprofilecache$profileentry.getGameProfile();
}
@@ -246,7 +246,7 @@
public void save()
{
- String s = this.gson.toJson((Object)this.getEntriesWithLimit(1000));
+ String s = this.gson.toJson((Object)this.getEntriesWithLimit(org.spigotmc.SpigotConfig.userCacheCap)); // Spigot
BufferedWriter bufferedwriter = null;
try