mirror of
https://github.com/barkeser2002/Tenet.git
synced 2026-09-25 06:39:56 +03:00
38 lines
1.6 KiB
Diff
38 lines
1.6 KiB
Diff
From e1e292f440d42cd14b0c186fe0e402895a094618 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 1a9e89e874..2071d44626 100644
|
|
--- a/src/main/java/net/minecraft/server/players/UserCache.java
|
|
+++ b/src/main/java/net/minecraft/server/players/UserCache.java
|
|
@@ -261,7 +261,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 ba66d92906..6c68dc749c 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.43.2
|
|
|