mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-04-13 09:32:09 +00:00
37 lines
1.6 KiB
Diff
37 lines
1.6 KiB
Diff
From db490e23773ba2278192b54109fad731f7f26d66 Mon Sep 17 00:00:00 2001
|
|
From: drXor <mcyoungsota@gmail.com>
|
|
Date: Fri, 25 Apr 2014 18:17:30 -0400
|
|
Subject: [PATCH] Configurable UserCache cap
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/UserCache.java b/src/main/java/net/minecraft/server/players/UserCache.java
|
|
index 5ca7755d5c..dcf5e8351a 100644
|
|
--- a/src/main/java/net/minecraft/server/players/UserCache.java
|
|
+++ b/src/main/java/net/minecraft/server/players/UserCache.java
|
|
@@ -259,7 +259,7 @@ public class UserCache {
|
|
JsonArray jsonarray = new JsonArray();
|
|
DateFormat dateformat = createDateFormat();
|
|
|
|
- this.getTopMRUProfiles(1000).forEach((usercache_usercacheentry) -> {
|
|
+ this.getTopMRUProfiles(org.spigotmc.SpigotConfig.userCacheCap).forEach((usercache_usercacheentry) -> { // Spigot
|
|
jsonarray.add(writeGameProfile(usercache_usercacheentry, dateformat));
|
|
});
|
|
String s = this.gson.toJson(jsonarray);
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
index 588d4656bd..285bb7a203 100644
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
@@ -314,4 +314,10 @@ public class SpigotConfig
|
|
replaceCommands = new HashSet<String>( (List<String>) getList( "commands.replace-commands",
|
|
Arrays.asList( "setblock", "summon", "testforblock", "tellraw" ) ) );
|
|
}
|
|
+
|
|
+ public static int userCacheCap;
|
|
+ private static void userCacheCap()
|
|
+ {
|
|
+ userCacheCap = getInt( "settings.user-cache-size", 1000 );
|
|
+ }
|
|
}
|
|
--
|
|
2.42.0
|
|
|